13 #include "trg/cdc/NDFinderDefs.h"
14 #include "trg/cdc/Clusterizend.h"
56 std::vector<unsigned short> get_relHits()
60 std::vector<unsigned short> get_relHitsWeights()
96 std::string
axialFile =
"data/trg/cdc/ndFinderArrayAxialComp.txt.gz";
97 std::string stereoFile =
"data/trg/cdc/ndFinderArrayStereoComp.txt.gz";
120 std::vector<std::vector<float>> m_acceptRanges;
121 std::vector<float> m_slotsizes;
132 delete m_parrayStereo;
133 delete m_phoughPlane;
134 delete m_parrayHitMod;
136 delete m_pcompStereo;
137 delete m_parrayAxialExp;
138 delete m_parrayStereoExp;
157 void init(
int minweight,
int minpts,
bool diagonal,
158 int minhits,
int minhits_axial,
double thresh,
double minassign,
159 int mincells,
bool verbose, std::string& axialFile, std::string& stereoFile);
175 void squeezeOne(c5array& writeArray, c5array& readArray,
int outparcels,
int inparcels, c5index ihit, c5index iprio, c5index itheta,
180 void squeezeAll(
ndbinning writebins, c5array& writeArray, c5array& readArray,
int outparcels,
int inparcels);
194 delete m_phoughPlane;
195 m_phoughPlane =
new c3array(m_pc3shape);
202 void addHit(
unsigned short hitId,
unsigned short hitPrioPos)
204 if (hitPrioPos > 0) {
236 void addC3Comp(ushort hitr, ushort prio,
const c5array& hitsToTracks,
241 std::vector<SimpleCluster>& clusters);
244 cell_index
getMax(
const std::vector<cell_index>&);
248 ushort
hitContrib(cell_index peak, ushort ihit);
253 std::vector<std::vector<unsigned short>>& hitsVsClusters,
254 std::vector<SimpleCluster>& clusters);
258 int hitToCluster(std::vector<std::vector<unsigned short>>& hitsVsClusters,
263 std::vector<cellweight>
getHighWeight(std::vector<cell_index> entries,
float cutoff);
269 std::vector<double>
getBinToVal(std::vector<double>);
274 return pt * 1e11 / (3e8 * 1.5);
279 std::vector<double> transform(std::vector<double> estimate);
286 boost::array<c5index, 5> m_pc5shapest;
287 boost::array<c3index, 3> m_pc3shape;
288 boost::array<c2index, 2> m_pc2shapeHitMod;
289 boost::array<c5index, 5> m_pc5shapeCompAx;
290 boost::array<c5index, 5> m_pc5shapeCompSt;
291 boost::array<c5index, 5> m_pc5shapeExpAx;
292 boost::array<c5index, 5> m_pc5shapeExpSt;
296 c5array* m_parrayStereo =
nullptr;
297 c3array* m_phoughPlane =
nullptr;
298 c2array* m_parrayHitMod =
nullptr;
299 c5array* m_pcompAxial =
nullptr;
300 c5array* m_pcompStereo =
nullptr;
301 c5array* m_parrayAxialExp =
nullptr;
302 c5array* m_parrayStereoExp =
nullptr;
345 std::vector<ushort> m_planeShape;
349 unsigned short m_nPhiOne{0};
350 unsigned short m_nPhiComp{0};
351 unsigned short m_nPhiExp{0};
352 unsigned short m_nPhiUse{0};
353 unsigned short m_nOmega{0};
354 unsigned short m_nTheta{0};
356 unsigned short m_nSL{0};
357 unsigned short m_nTS{0};
358 unsigned short m_nAx{0};
359 unsigned short m_nSt{0};
360 unsigned short m_nPrio{0};
Store track parameters of found tracks.
std::vector< unsigned short > m_relHits
vector of the indices of the related hits in the list of CDC hits (StoreArray<CDCHits>)
double m_phi
2D azimuthal angle
virtual ~NDFinderTrack()
Default destructor.
std::vector< double > m_hitWeights
vector of the weights for each related hit.
double m_omega
2D track curvature
double m_cotTheta
3D polar angle
Class to represent the CDC NDFinder.
std::vector< NDFinderTrack > * getFinderTracks()
retreive the results
std::vector< cellweight > getHighWeight(std::vector< cell_index > entries, float cutoff)
Candidate cells as seed for the clustering.
ndbinning m_axbins
Binnings in different hit pattern arrays.
virtual ~NDFinder()
Default destructor.
std::vector< SimpleCluster > relateHitsToClusters(std::vector< std::vector< unsigned short >> &hitsVsClusters, std::vector< SimpleCluster > &clusters)
Use confusion matrix to related hits to clusters.
Belle2::Clusterizend m_clusterer
Clustering module.
void initBins()
Initialize the binnings and reserve the arrays.
void initHitModAxSt(c2array &hitMod)
Initialize hit modulo mappings.
c5array * m_parrayAxial
Array pointers to the hit patterns.
void getCM()
NDFinder internal functions for track finding.
void squeezeAll(ndbinning writebins, c5array &writeArray, c5array &readArray, int outparcels, int inparcels)
Loop over all hits and theta bins and squeeze all 2D (omega,phi) planes.
std::vector< unsigned short > m_prioPos
Priority positon within the TS in the current event elements basf2: [0,3] first, left,...
void loadArray(const std::string &filename, ndbinning bins, c5array &hitsToTracks)
Load an NDFinder array of hit representations in track phase space.
void restoreZeros(ndbinning zerobins, ndbinning compbins, c5array &expArray, const c5array &compArray)
Restore non-zero suppressed hit curves.
std::vector< short > m_vecDstart
Phi-start of 7/32 hit representation in full track parameter space.
std::vector< unsigned short > m_hitOrients
Orients TS-Ids of the hits in the current event elements: [0,2335] for 2336 TS in total.
ushort hitContrib(cell_index peak, ushort ihit)
Determine weight contribution of a single hit to a single cell.
void squeezeOne(c5array &writeArray, c5array &readArray, int outparcels, int inparcels, c5index ihit, c5index iprio, c5index itheta, c5elem nomega)
Squeeze phi-axis in a 2D (omega,phi) plane.
std::vector< double > getBinToVal(std::vector< double >)
Scale the weighted center to track parameter values.
unsigned short m_nHits
Counter for the number of hits in the current event.
boost::array< c5index, 5 > m_pc5shapeax
NDFinder.
void addC3Comp(ushort hitr, ushort prio, const c5array &hitsToTracks, short Dstart, ndbinning bins)
In place array addition to houghmap Comp: A = A + B.
std::vector< int > m_nWires
Number of first priority wires in each super layer (TS per SL)
double cdc_track_radius(double pt)
Transverse momentum to radius.
void printParams()
Debug: print configured parameters.
ndparameters m_params
Configuration parameters of the 3DFinder.
clusterer_params m_clusterer_params
Configuration of the clustering module.
std::vector< NDFinderTrack > m_NDFinderTracks
Result: vector of the found tracks.
void addLookup(unsigned short ihit)
Add a single axial or stereo hit to the houghmap.
std::vector< unsigned short > m_hitIds
TS-Ids of the hits in the current event elements: [0,2335] for 2336 TS in total.
int hitToCluster(std::vector< std::vector< unsigned short >> &hitsVsClusters, unsigned short hit)
Determine the best cluster for a single hit, given hitsVsClusters confusion matrix.
unsigned short m_nPhiFull
Default bins.
NDFinder()
Default constructor.
void reset()
NDFinder reset data structure to process next event.
void findTracks()
main function for track finding
std::vector< std::vector< unsigned short > > getHitsVsClusters(std::vector< SimpleCluster > &clusters)
Create hits to clusters confusion matrix.
std::vector< double > getWeightedMean(std::vector< cellweight >)
Calculate the weighted center of a cluster.
float transformVar(float estVal, int idx)
Calculate physical units.
void printArray3D(c3array &hitsToTracks, ndbinning bins, ushort, ushort, ushort, ushort)
Debug Tool: Print part of the houghmap.
cell_index getMax(const std::vector< cell_index > &)
Peak cell in cluster.
void addHit(unsigned short hitId, unsigned short hitPrioPos)
fill hit info of the event
bool m_verbose
Print Hough planes and verbose output.
void init(int minweight, int minpts, bool diagonal, int minhits, int minhits_axial, double thresh, double minassign, int mincells, bool verbose, std::string &axialFile, std::string &stereoFile)
initialization
std::vector< unsigned short > get_weights()
Get weight contribution of each related hit to the cluster.
std::vector< unsigned short > get_hits()
Get ids of related hits (indices of the TS StoreArray)
unsigned short c5elem
Store hit patterns in a 5D array (hitid, prio, omega, phi, theta)
Abstract base class for different kinds of events.
Struct of ndFinder parameters.
long unsigned int minhits
Clustering options.
long unsigned int mincells
Minimum numeber of cells in the track parameter space.
long unsigned int minhits_axial
Required number of axial hits per track.
std::string axialFile
Zero-Suppressed trained hit data.
unsigned short phigeo
CDC symmetry: repeat wire pattern 32 times in phi.
float minassign
Required relative weight contribution to assign a hit to a cluster.
float thresh
Members must have thresh x maxweight of cluster.
unsigned short parcelsExp
CDC symmetry: phi range covered by expanded hit data [0 .
unsigned short parcels
** CDC symmetry: phi range covered by hit data [0 .. phigeo] */
Default binning in a (7/32) phi-sector.