Belle II Software  release-08-01-10
SPTCSelectorXBestPerFamily Class Reference

Algorithm to collect the x best TrackCandidates per family based on a VXD Quality estimator method output. More...

#include <SPTCSelectorXBestPerFamily.h>

Collaboration diagram for SPTCSelectorXBestPerFamily:

Public Member Functions

 SPTCSelectorXBestPerFamily (unsigned short xBest=5, const std::string &estimationMethod=std::string("tripletFit"))
 Constructor for the selection of the x best candidates for each family based on the quality index. More...
 
 ~SPTCSelectorXBestPerFamily ()=default
 Destructor.
 
void prepareSelector (unsigned short nFamilies)
 Preparation of Best Candidate Selector by resetting the vectors. More...
 
void testNewSPTC (SpacePointTrackCand &sptc)
 Test new SPTC if it is better than the least best of the current x best SPTCs of its respective family. More...
 
std::vector< SpacePointTrackCandreturnSelection () const
 Return vector containing the best SPTCs; maximal m_xBest per family. More...
 
void setMagneticFieldForQE (double bFieldZ)
 Setting magnetic field for the quality estimator. More...
 

Private Attributes

std::unique_ptr< QualityEstimatorBasem_estimator
 Pointer to the Quality Estimator used to evaluate the SPTCs to find the best.
 
std::vector< std::multiset< SpacePointTrackCand > > m_bestPaths
 Vector containing one vector of the best SPTCs per family.
 
std::vector< short > m_familyToIndex
 Map of family number to respective index for m_bestPaths.
 
unsigned short m_currentIndex = 0
 Counter for current index used for m_familyToIndex. More...
 
unsigned short m_xBest
 Number of allowed best SPTCs per family.
 

Detailed Description

Algorithm to collect the x best TrackCandidates per family based on a VXD Quality estimator method output.

Definition at line 29 of file SPTCSelectorXBestPerFamily.h.

Constructor & Destructor Documentation

◆ SPTCSelectorXBestPerFamily()

SPTCSelectorXBestPerFamily ( unsigned short  xBest = 5,
const std::string &  estimationMethod = std::string("tripletFit") 
)
inline

Constructor for the selection of the x best candidates for each family based on the quality index.

Parameters
xBestMaximal number of best candidates to be stored per family.
estimationMethodQuality estimator to be used.

Definition at line 38 of file SPTCSelectorXBestPerFamily.h.

38  :
39  m_xBest(xBest)
40  {
41  if (estimationMethod == "tripletFit") {
42  m_estimator = std::make_unique<QualityEstimatorTripletFit>();
43  } else if (estimationMethod == "circleFit") {
44  m_estimator = std::make_unique<QualityEstimatorCircleFit>();
45  } else if (estimationMethod == "helixFit") {
46  m_estimator = std::make_unique<QualityEstimatorRiemannHelixFit>();
47  } else if (estimationMethod == "random") {
48  m_estimator = std::make_unique<QualityEstimatorRandom>();
49  }
50  B2ASSERT("QualityEstimator could not be initialized with method: " << estimationMethod, m_estimator);
51  };
unsigned short m_xBest
Number of allowed best SPTCs per family.
std::unique_ptr< QualityEstimatorBase > m_estimator
Pointer to the Quality Estimator used to evaluate the SPTCs to find the best.

Member Function Documentation

◆ prepareSelector()

void prepareSelector ( unsigned short  nFamilies)
inline

Preparation of Best Candidate Selector by resetting the vectors.

To be executed at the beginning of a new event after the families are defined to reset the respective vectors and set them up under consideration of the number of families in the event.

Parameters
nFamiliesNumber of families in the event.

Definition at line 61 of file SPTCSelectorXBestPerFamily.h.

◆ returnSelection()

std::vector<SpacePointTrackCand> returnSelection ( ) const
inline

Return vector containing the best SPTCs; maximal m_xBest per family.

Returns
One vector containing the best SPTC candidates for the whole event.

Definition at line 103 of file SPTCSelectorXBestPerFamily.h.

◆ setMagneticFieldForQE()

void setMagneticFieldForQE ( double  bFieldZ)
inline

Setting magnetic field for the quality estimator.

Parameters
bFieldZMagnetic Field value to be used for the Quality Estimation.

Definition at line 119 of file SPTCSelectorXBestPerFamily.h.

◆ testNewSPTC()

void testNewSPTC ( SpacePointTrackCand sptc)
inline

Test new SPTC if it is better than the least best of the current x best SPTCs of its respective family.

If so, the least best is thrown out, and the new is added to the sorted x best SPTC multiset of the family. If the maximal number of best SPTCs is not reached for the family, yet, the SPTC is just added at the right place.

Parameters
sptcSpacePointTrackCandidate to be evaluated for adding.

Definition at line 76 of file SPTCSelectorXBestPerFamily.h.

Member Data Documentation

◆ m_currentIndex

unsigned short m_currentIndex = 0
private

Counter for current index used for m_familyToIndex.

The counter is increased each time a family is seen for the first time and thus a new entry for this family is added to m_familyToIndex.

Definition at line 137 of file SPTCSelectorXBestPerFamily.h.


The documentation for this class was generated from the following file: