10 #define CLUSTERIZEND_H
29 std::vector<std::string> var_labels = {
"omega",
"phi",
"theta"};
50 unsigned short init_ClSize = 0;
51 unsigned short default_value = 0;
52 cell_index cell(
m_dim, default_value);
53 std::vector<cell_index> C(init_ClSize, cell);
56 void setParams(
unsigned short dim)
69 m_C.push_back(next_entry);
72 void add_hit(
unsigned short hit,
unsigned short weight,
unsigned short orient)
101 std::vector<cell_index>
m_C;
129 void setPlaneShape(std::vector<ushort> planeShape)
131 m_dimsize = planeShape.size();
132 m_planeShape = planeShape;
133 m_valmax = std::vector<ushort>(m_planeShape);
134 for (ushort idim = 0; idim < m_dimsize; idim++) {
137 m_valmax.push_back(1);
144 m_houghVals = &houghmap_plain;
145 m_houghVisit = c3array(m_c3shape);
152 bool has_before(cell_index entry, ushort dim);
154 cell_index before(cell_index entry, ushort dim);
156 bool has_after(cell_index entry, ushort dim);
158 cell_index after(cell_index entry, ushort dim);
160 void blockcheck(std::vector<cell_index>* neighbors, cell_index elem, ushort dim);
162 std::vector<cell_index> regionQuery(cell_index entry);
164 std::vector<SimpleCluster> dbscan();
166 void expandCluster(std::vector<cell_index>& N,
SimpleCluster& C);
172 std::string printVector(std::vector<T> vecX)
174 std::stringstream result;
176 for (T& elem : vecX) { result << elem <<
" ";}
184 std::string printCells(std::vector<T> vecX)
186 std::stringstream result;
187 for (T& elem : vecX) { result <<
" {" << printVector(elem) <<
"}";}
193 std::vector<ushort> m_planeShape;
194 std::vector<ushort> m_valmax;
196 boost::array<c3index, 3> m_c3shape = {{ 40, 384, 9 }};
197 c3array* m_houghVals{0};
198 c3array m_houghVisit = c3array(m_c3shape);
bool has_before(cell_index entry, ushort dim)
Clustering logic.
void setNewPlane(c3array &houghmap_plain)
Next event initialization: set a new hough space for clustering and track finding.
clusterer_params m_params
Clusterizend.
std::vector< cell_index > getCandidates()
void add_hit(unsigned short hit, unsigned short weight, unsigned short orient)
Relate a hit to the cluster.
std::vector< unsigned short > m_hitWeights
Cluster related hits weights.
unsigned short m_dim
Dimension of the track space (3 for omega, phi, theta)
unsigned short m_orientSum
Sum of related hit orientations (== number of related axials)
std::vector< cell_index > m_C
SimpleCluster.
std::vector< unsigned short > get_weights()
Get weight contribution of each related hit to the cluster.
unsigned long get_naxial()
Get number related axial hits.
std::vector< unsigned short > get_hits()
Get ids of related hits (indices of the TS StoreArray)
std::vector< cell_index > getEntries()
Get member cells in the cluster.
std::vector< unsigned short > m_hits
Cluster related hits ids.
void append(cell_index next_entry)
Add a track-space cell to the cluster.
unsigned long get_nstereo()
Get number related stereo hits.
Abstract base class for different kinds of events.
unsigned short minweight
minimum weight for a cluster cell
bool diagonal
Consider diagonal adjacent cells as neighbors.
unsigned short minpts
minimum number of neighbours for a cluster core cell
std::vector< bool > var_cyclic
Ordering of track parameters and position of cyclic variable (phi)