Belle II Software development
|
Class to represent the CDC NDFinder. More...
#include <NDFinder.h>
Classes | |
struct | ndparameters |
Struct of ndFinder parameters. More... | |
Public Member Functions | |
NDFinder () | |
Default constructor. | |
virtual | ~NDFinder () |
Default destructor. | |
void | init (unsigned short minWeight, unsigned char minPts, bool diagonal, unsigned char minSuperAxial, unsigned char minSuperStereo, float thresh, unsigned char minCells, bool dbscanning, unsigned short minTotalWeight, unsigned short minPeakWeight, unsigned char iterations, unsigned char omegaTrim, unsigned char phiTrim, unsigned char thetaTrim, bool verbose, std::string &axialFile, std::string &stereoFile) |
initialization | |
void | initBins () |
Initialize the binnings and reserve the arrays. | |
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. | |
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. | |
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. | |
void | initHitModAxSt (c2array &hitMod) |
Initialize hit modulo mappings. | |
void | reset () |
NDFinder reset data structure to process next event. | |
void | printParams () |
Debug: print configured parameters. | |
void | addHit (unsigned short hitId, unsigned short hitSLId, unsigned short hitPrioPos, long hitPrioTime) |
fill hit info of the event | |
void | findTracks () |
main function for track finding | |
std::vector< NDFinderTrack > * | getFinderTracks () |
retreive the results | |
void | printArray3D (c3array &hitsToTracks, ndbinning bins, ushort, ushort, ushort, ushort) |
Debug Tool: Print part of the houghmap. | |
Public Attributes | |
std::vector< std::vector< float > > | m_acceptRanges |
std::vector< float > | m_slotSizes |
Protected Member Functions | |
void | getCM () |
NDFinder internal functions for track finding. | |
void | addLookup (unsigned short ihit) |
Add a single axial or stereo hit to the houghmap. | |
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< std::vector< unsigned short > > | getHitsVsClusters (std::vector< SimpleCluster > &clusters) |
Create hits to clusters confusion matrix. | |
cell_index | getMax (const std::vector< cell_index > &) |
Peak cell in cluster. | |
ushort | hitContrib (cell_index peak, ushort ihit) |
Determine weight contribution of a single hit to a single cell. | |
std::vector< SimpleCluster > | allHitsToClusters (std::vector< std::vector< unsigned short > > &hitsVsClusters, std::vector< SimpleCluster > &clusters) |
Relate all hits in a cluster to the cluster Remove small clusters with less than minsuper related hits. | |
std::vector< cellweight > | getHighWeight (std::vector< cell_index > entries, float cutoff) |
Candidate cells as seed for the clustering. | |
std::vector< double > | getWeightedMean (std::vector< cellweight >) |
Calculate the weighted center of a cluster. | |
std::vector< double > | getBinToVal (std::vector< double >) |
Scale the weighted center to track parameter values. | |
double | cdcTrackRadius (double pt) |
Transverse momentum to radius. | |
float | transformVar (float estVal, int idx) |
Calculate physical units. | |
std::vector< double > | transform (std::vector< double > estimate) |
Private Attributes | |
boost::array< c5index, 5 > | m_pc5shapeax |
NDFinder. | |
boost::array< c5index, 5 > | m_pc5shapest |
boost::array< c3index, 3 > | m_pc3shape |
boost::array< c2index, 2 > | m_pc2shapeHitMod |
boost::array< c5index, 5 > | m_pc5shapeCompAx |
boost::array< c5index, 5 > | m_pc5shapeCompSt |
boost::array< c5index, 5 > | m_pc5shapeExpAx |
boost::array< c5index, 5 > | m_pc5shapeExpSt |
c5array * | m_parrayAxial = nullptr |
Array pointers to the hit patterns. | |
c5array * | m_parrayStereo = nullptr |
c3array * | m_phoughPlane = nullptr |
c2array * | m_parrayHitMod = nullptr |
c5array * | m_pcompAxial = nullptr |
c5array * | m_pcompStereo = nullptr |
c5array * | m_parrayAxialExp = nullptr |
c5array * | m_parrayStereoExp = nullptr |
std::vector< int > | m_nWires |
Number of first priority wires in each super layer (TS per SL) | |
std::vector< NDFinderTrack > | m_NDFinderTracks |
Result: vector of the found tracks. | |
std::vector< unsigned short > | m_hitIds |
TS-Ids of the hits in the current event elements: [0,2335] for 2336 TS in total. | |
std::vector< unsigned short > | m_hitSLIds |
SL-Ids of the hits in the current event elements: super layer number in [0,1,...,8]. | |
std::vector< unsigned short > | m_prioPos |
Priority positon within the TS in the current event elements basf2: [0,3] first, left, right, no hit elements stored: 3 - basf2prio. | |
std::vector< long > | m_prioTime |
Drift time of the priority wire. | |
std::vector< unsigned short > | m_hitOrients |
Orients TS-Ids of the hits in the current event elements: [0,2335] for 2336 TS in total. | |
std::vector< short > | m_vecDstart |
Phi-start of 7/32 hit representation in full track parameter space. | |
unsigned short | m_nHits {0} |
Counter for the number of hits in the current event. | |
ndparameters | m_params |
Configuration parameters of the 3DFinder. | |
ndbinning | m_axBins |
Binnings in different hit pattern arrays. | |
ndbinning | m_stBins |
ndbinning | m_fullBins |
ndbinning | m_compAxBins |
ndbinning | m_compStBins |
ndbinning | m_expAxBins |
ndbinning | m_expStBins |
clustererParams | m_clustererParams |
Configuration of the clustering module. | |
std::vector< ushort > | m_planeShape |
unsigned short | m_nPhiFull {0} |
Default bins. | |
unsigned short | m_nPhiOne {0} |
unsigned short | m_nPhiComp {0} |
unsigned short | m_nPhiExp {0} |
unsigned short | m_nPhiUse {0} |
unsigned short | m_nOmega {0} |
unsigned short | m_nTheta {0} |
unsigned short | m_nSL {0} |
unsigned short | m_nTS {0} |
unsigned short | m_nAx {0} |
unsigned short | m_nSt {0} |
unsigned short | m_nPrio {0} |
Belle2::Clusterizend | m_clusterer |
Clustering module. | |
Belle2::Clusterizend | m_clusterer2 |
bool | m_verbose {false} |
Print Hough planes and verbose output. | |
Class to represent the CDC NDFinder.
Definition at line 107 of file NDFinder.h.
|
inline |
|
inlinevirtual |
Default destructor.
Definition at line 166 of file NDFinder.h.
|
protected |
In place array addition to houghmap Comp: A = A + B.
Definition at line 368 of file NDFinder.cc.
|
inline |
fill hit info of the event
Definition at line 249 of file NDFinder.h.
|
protected |
Add a single axial or stereo hit to the houghmap.
orient: {1 : axial, 0 : stereo}
Determines the phi window of the hit in the full houghmap (Dstart, Dend). Uses: m_arrayHitMod Fills: m_vecDstart, m_hitOrients
Definition at line 337 of file NDFinder.cc.
|
protected |
Relate all hits in a cluster to the cluster Remove small clusters with less than minsuper related hits.
Definition at line 429 of file NDFinder.cc.
|
inlineprotected |
Transverse momentum to radius.
Definition at line 316 of file NDFinder.h.
void findTracks | ( | ) |
main function for track finding
Build the Houghplane by summing up all single hit contributions
Definition at line 394 of file NDFinder.cc.
|
protected |
Scale the weighted center to track parameter values.
Definition at line 608 of file NDFinder.cc.
|
protected |
NDFinder internal functions for track finding.
Core track finding logic in the constructed houghmap
Definition at line 494 of file NDFinder.cc.
|
inline |
retreive the results
Definition at line 264 of file NDFinder.h.
|
protected |
Candidate cells as seed for the clustering.
Selects all cells with weight > minWeight
Definition at line 655 of file NDFinder.cc.
|
protected |
Create hits to clusters confusion matrix.
Definition at line 408 of file NDFinder.cc.
|
protected |
Peak cell in cluster.
Definition at line 639 of file NDFinder.cc.
|
protected |
Calculate the weighted center of a cluster.
Definition at line 619 of file NDFinder.cc.
|
protected |
Determine weight contribution of a single hit to a single cell.
Used to create the hitsVsClusters confusion matrix.
Definition at line 672 of file NDFinder.cc.
void init | ( | unsigned short | minWeight, |
unsigned char | minPts, | ||
bool | diagonal, | ||
unsigned char | minSuperAxial, | ||
unsigned char | minSuperStereo, | ||
float | thresh, | ||
unsigned char | minCells, | ||
bool | dbscanning, | ||
unsigned short | minTotalWeight, | ||
unsigned short | minPeakWeight, | ||
unsigned char | iterations, | ||
unsigned char | omegaTrim, | ||
unsigned char | phiTrim, | ||
unsigned char | thetaTrim, | ||
bool | verbose, | ||
std::string & | axialFile, | ||
std::string & | stereoFile | ||
) |
initialization
Set parameters
minWeight | minimum weight of cluster member cells |
minPts | minimum neighboring cells with minWeight for core cells |
diagonal | consider diagonal neighbor cells in the clustering |
minSuperAxial | minimum number of axial super layers per cluster |
minSuperStereo | minimum number of stereo super layers per cluster |
thresh | selection of cells for weighted mean track estimation |
minCells | minumum number of cells per cluster |
dbscanning | when true: dbscan, when false: fixed three dim volume |
minTotalWeight | minimum total weight of all cells in the 3d volume |
minPeakWeight | minimum peak cell weight |
iterations | number of cluster searches in each Hough space |
omegaTrim | number deleted cells in each omega direction from the maximum |
phiTrim | number deleted cells in each phi direction from the maximum |
thetaTrim | number deleted cells in each theta direction from the maximum |
verbose | print Hough planes and verbose output |
axialFile | axial hit data |
stereoFile | stereo hit data |
Load the axial and stereo track to hit relations from file.
Unpack zero suppresed track to hit relations.
Definition at line 24 of file NDFinder.cc.
void initBins | ( | ) |
Initialize the binnings and reserve the arrays.
Create the arrays of the track to hit relations for axial and stereo hits.
Since the CDC wire pattern is repeated 32 times, the hit ids are stored for 1/32 of the CDC only. The total number of 2336 TS corresponds to (41 axial + 32 stereo) * 32.
The number of track bins (full phi) is: (omega, phi, theta) = (40, 384, 9)
compressed phi: phi_start, phi_width, phi_0, ..., phi_12
use phi bins: 84 = 7 * (384/32)
expanded phi: 132 = 11 * (384/32)
Acceptance Ranges
Definition at line 78 of file NDFinder.cc.
void initHitModAxSt | ( | c2array & | hitMod | ) |
Initialize hit modulo mappings.
Definition at line 198 of file NDFinder.cc.
void loadArray | ( | const std::string & | filename, |
ndbinning | bins, | ||
c5array & | hitsToTracks | ||
) |
Load an NDFinder array of hit representations in track phase space.
Used to load axial and stereo hit arrays. Represented in a 7/32 phi sector of the CDC.
Definition at line 165 of file NDFinder.cc.
void printArray3D | ( | c3array & | hitsToTracks, |
ndbinning | bins, | ||
ushort | phiInc = 1 , |
||
ushort | omInc = 1 , |
||
ushort | divide = 4 , |
||
ushort | minWeightShow = 1 |
||
) |
Debug Tool: Print part of the houghmap.
Definition at line 289 of file NDFinder.cc.
void printParams | ( | ) |
Debug: print configured parameters.
Definition at line 703 of file NDFinder.cc.
|
inline |
NDFinder reset data structure to process next event.
Definition at line 231 of file NDFinder.h.
void restoreZeros | ( | ndbinning | zerobins, |
ndbinning | compbins, | ||
c5array & | expArray, | ||
const c5array & | compArray | ||
) |
Restore non-zero suppressed hit curves.
will make m_params.arrayAxialFile and m_params.arrayStereoFile obsolete
Definition at line 264 of file NDFinder.cc.
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.
Definition at line 252 of file NDFinder.cc.
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.
inparcels | number of 1/32 sectors in input plane |
outparcels | number of 1/32 sectors in output plane |
Definition at line 229 of file NDFinder.cc.
|
protected |
Definition at line 598 of file NDFinder.cc.
|
protected |
Calculate physical units.
Definition at line 579 of file NDFinder.cc.
std::vector<std::vector<float> > m_acceptRanges |
Definition at line 159 of file NDFinder.h.
|
private |
Binnings in different hit pattern arrays.
Definition at line 386 of file NDFinder.h.
|
private |
Clustering module.
Definition at line 414 of file NDFinder.h.
|
private |
Definition at line 415 of file NDFinder.h.
|
private |
Configuration of the clustering module.
Definition at line 395 of file NDFinder.h.
|
private |
Definition at line 389 of file NDFinder.h.
|
private |
Definition at line 390 of file NDFinder.h.
|
private |
Definition at line 391 of file NDFinder.h.
|
private |
Definition at line 392 of file NDFinder.h.
|
private |
Definition at line 388 of file NDFinder.h.
|
private |
TS-Ids of the hits in the current event elements: [0,2335] for 2336 TS in total.
Definition at line 356 of file NDFinder.h.
|
private |
Orients TS-Ids of the hits in the current event elements: [0,2335] for 2336 TS in total.
Definition at line 373 of file NDFinder.h.
|
private |
SL-Ids of the hits in the current event elements: super layer number in [0,1,...,8].
Definition at line 360 of file NDFinder.h.
|
private |
Definition at line 409 of file NDFinder.h.
|
private |
Result: vector of the found tracks.
Definition at line 352 of file NDFinder.h.
|
private |
Counter for the number of hits in the current event.
Definition at line 380 of file NDFinder.h.
|
private |
Definition at line 404 of file NDFinder.h.
|
private |
Definition at line 401 of file NDFinder.h.
|
private |
Definition at line 402 of file NDFinder.h.
|
private |
Default bins.
Definition at line 399 of file NDFinder.h.
|
private |
Definition at line 400 of file NDFinder.h.
|
private |
Definition at line 403 of file NDFinder.h.
|
private |
Definition at line 411 of file NDFinder.h.
|
private |
Definition at line 407 of file NDFinder.h.
|
private |
Definition at line 410 of file NDFinder.h.
|
private |
Definition at line 405 of file NDFinder.h.
|
private |
Definition at line 408 of file NDFinder.h.
|
private |
Number of first priority wires in each super layer (TS per SL)
Definition at line 349 of file NDFinder.h.
|
private |
Configuration parameters of the 3DFinder.
Definition at line 383 of file NDFinder.h.
|
private |
Array pointers to the hit patterns.
Definition at line 339 of file NDFinder.h.
|
private |
Definition at line 345 of file NDFinder.h.
|
private |
Definition at line 342 of file NDFinder.h.
|
private |
Definition at line 340 of file NDFinder.h.
|
private |
Definition at line 346 of file NDFinder.h.
|
private |
Definition at line 332 of file NDFinder.h.
|
private |
Definition at line 331 of file NDFinder.h.
|
private |
|
private |
Definition at line 333 of file NDFinder.h.
|
private |
Definition at line 334 of file NDFinder.h.
|
private |
Definition at line 335 of file NDFinder.h.
|
private |
Definition at line 336 of file NDFinder.h.
|
private |
Definition at line 330 of file NDFinder.h.
|
private |
Definition at line 343 of file NDFinder.h.
|
private |
Definition at line 344 of file NDFinder.h.
|
private |
Definition at line 341 of file NDFinder.h.
|
private |
Definition at line 396 of file NDFinder.h.
|
private |
Priority positon within the TS in the current event elements basf2: [0,3] first, left, right, no hit elements stored: 3 - basf2prio.
Definition at line 365 of file NDFinder.h.
|
private |
Drift time of the priority wire.
Definition at line 368 of file NDFinder.h.
std::vector<float> m_slotSizes |
Definition at line 160 of file NDFinder.h.
|
private |
Definition at line 387 of file NDFinder.h.
|
private |
Phi-start of 7/32 hit representation in full track parameter space.
Used to get the weight contribution of a hit to a cluster.
Definition at line 377 of file NDFinder.h.
|
private |
Print Hough planes and verbose output.
Definition at line 418 of file NDFinder.h.