 |
Belle II Software
release-05-01-25
|
11 #include "tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorMC.h"
12 #include <mdst/dataobjects/MCParticle.h>
18 if (measurements.empty())
return 0;
28 std::map<MCRecoTrackIndex, NMatches> matches;
30 for (
SpacePoint const* spacePoint : measurements) {
35 matches[recoTrack.getArrayIndex()]++;
42 matches[recoTrack.getArrayIndex()] += 2;
49 MatchInfo bestMatch = *std::max_element(matches.begin(), matches.end(),
56 double qualityIndicator = 0;
58 if (nClusters ==
m_mcRecoTracks[match.first]->getNumberOfSVDHits()) {
59 qualityIndicator = 1 - (1. / nClusters);
62 if (nClusters == match.second) {
63 qualityIndicator = 1 - (1. / nClusters);
66 int nRecoTrackClusters =
m_mcRecoTracks[match.first]->getNumberOfSVDHits();
67 qualityIndicator = std::pow(match.second, 3) / (nRecoTrackClusters * nClusters * nClusters);
69 return qualityIndicator;
std::pair< MCRecoTrackIndex, NMatches > MatchInfo
typedef for MatchInfo
boost::optional< B2Vector3< double > > p
momentum vector estimate from the QE
Container for complete fit/estimation results.
virtual QualityEstimationResults estimateQualityAndProperties(std::vector< SpacePoint const * > const &measurements) override final
additionally return momentum_truth if it is a perfect match to a single MCRecoTrack
std::string m_pxdClustersName
PXD clusters StoreArray name.
double qualityIndicator
return value of the quality estimator
std::string m_svdClustersName
SVD clusters StoreArray name.
boost::optional< double > pt
transverse momentum estimate from the QE
MatchInfo getBestMatchToMCClusters(std::vector< SpacePoint const * > const &measurements)
Get MCRecoTrack index of best matching tracks and number of matched MC clusters which can be matched ...
std::string m_mcRecoTracksStoreArrayName
MCRecoTracks StoreArray name.
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
bool m_mva_target
If true the SPTCs containing all the SVDCluster of the corresponding MCRecoTrack and no other SVDClus...
This is the Reconstruction Event-Data Model Track.
virtual double estimateQuality(std::vector< SpacePoint const * > const &measurements) final
Performing MC based quality estimation.
Abstract base class for different kinds of events.
double calculateQualityIndicator(unsigned int nClusters, MatchInfo &match)
Calculate MC qualityIndicator based on MatchInfo of best matched MCRecoTrack.
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
bool m_strictQualityIndicator
If true only SPTCs containing SVDClusters corresponding to a single MCRecoTrack get a QI !...
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
A Class to store the Monte Carlo particle information.
MatchInfo m_match
stores the current match for optional return values
virtual QualityEstimationResults estimateQualityAndProperties(std::vector< SpacePoint const * > const &measurements)
Quality estimation providing additional quantities Calculates quality indicator in range [0,...
QualityEstimationResults m_results
Result of the quality estimation This is stored as a member variable, because some values may be calc...
StoreArray< RecoTrack > m_mcRecoTracks
the storeArray for RecoTracks as member