13#include <tracking/spacePointCreation/SpacePointTrackCand.h>
14#include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorBase.h>
15#include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorTripletFit.h>
16#include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorCircleFit.h>
17#include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorRiemannHelixFit.h>
18#include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorRandom.h>
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>();
50 B2ASSERT(
"QualityEstimator could not be initialized with method: " << estimationMethod,
m_estimator);
82 m_bestPaths.emplace_back(std::multiset<SpacePointTrackCand> { sptc });
90 if (currentSet.size() ==
m_xBest) {
91 std::multiset<SpacePointTrackCand>::iterator iter = currentSet.begin();
95 currentSet.erase(iter);
97 currentSet.emplace_hint(currentSet.cbegin(), sptc);
105 std::vector<SpacePointTrackCand> jointBestPaths;
107 [](
int a,
auto b) { return a + b.size(); }));
110 jointBestPaths.insert(jointBestPaths.end(), set.begin(), set.end());
113 return jointBestPaths;
Algorithm to collect the x best TrackCandidates per family based on a VXD Quality estimator method ou...
std::vector< short > m_familyToIndex
Map of family number to respective index for m_bestPaths.
unsigned short m_xBest
Number of allowed best SPTCs per family.
~SPTCSelectorXBestPerFamily()=default
Destructor.
unsigned short m_currentIndex
Counter for current index used for m_familyToIndex.
void prepareSelector(unsigned short nFamilies)
Preparation of Best Candidate Selector by resetting the vectors.
std::vector< SpacePointTrackCand > returnSelection() const
Return vector containing the best SPTCs; maximal m_xBest per family.
std::unique_ptr< QualityEstimatorBase > m_estimator
Pointer to the Quality Estimator used to evaluate the SPTCs to find the best.
void setMagneticFieldForQE(double bFieldZ)
Setting magnetic field for the quality estimator.
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.
void testNewSPTC(SpacePointTrackCand &sptc)
Test new SPTC if it is better than the least best of the current x best SPTCs of its respective famil...
std::vector< std::multiset< SpacePointTrackCand > > m_bestPaths
Vector containing one vector of the best SPTCs per family.
Storage for (VXD) SpacePoint-based track candidates.
short getFamily() const
return family identifier
double getQualityIndicator() const
returns the current status of the estimated quality of this track candidate.
const std::vector< const Belle2::SpacePoint * > getSortedHits() const
get hits (space points) sorted by their respective sorting parameter
void setQualityIndicator(const double newIndicator)
sets the new status of the estimated quality of this track candidate.
Abstract base class for different kinds of events.