9 #include "tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorMC.h"
10 #include <mdst/dataobjects/MCParticle.h>
16 if (measurements.empty())
return 0;
26 std::map<MCRecoTrackIndex, NMatches> matches;
28 for (
SpacePoint const* spacePoint : measurements) {
33 matches[recoTrack.getArrayIndex()]++;
40 matches[recoTrack.getArrayIndex()] += 2;
47 MatchInfo bestMatch = *std::max_element(matches.begin(), matches.end(),
54 double qualityIndicator = 0;
56 if (nClusters ==
m_mcRecoTracks[match.first]->getNumberOfSVDHits()) {
57 qualityIndicator = 1 - (1. / nClusters);
60 if (nClusters == match.second) {
61 qualityIndicator = 1 - (1. / nClusters);
64 int nRecoTrackClusters =
m_mcRecoTracks[match.first]->getNumberOfSVDHits();
65 qualityIndicator = std::pow(match.second, 3) / (nRecoTrackClusters * nClusters * nClusters);
67 return qualityIndicator;
A Class to store the Monte Carlo particle information.
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
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...
std::string m_svdClustersName
SVD clusters StoreArray name.
bool m_strictQualityIndicator
If true only SPTCs containing SVDClusters corresponding to a single MCRecoTrack get a QI !...
MatchInfo m_match
stores the current match for optional return values
StoreArray< RecoTrack > m_mcRecoTracks
the storeArray for RecoTracks as member
std::pair< MCRecoTrackIndex, NMatches > MatchInfo
typedef for MatchInfo
double calculateQualityIndicator(unsigned int nClusters, MatchInfo &match)
Calculate MC qualityIndicator based on MatchInfo of best matched MCRecoTrack.
bool m_mva_target
If true the SPTCs containing all the SVDCluster of the corresponding MCRecoTrack and no other SVDClus...
std::string m_pxdClustersName
PXD clusters StoreArray name.
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 ...
virtual double estimateQuality(std::vector< SpacePoint const * > const &measurements) final
Performing MC based quality estimation.
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_mcRecoTracksStoreArrayName
MCRecoTracks StoreArray name.
This is the Reconstruction Event-Data Model Track.
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
Abstract base class for different kinds of events.
Container for complete fit/estimation results.
double qualityIndicator
return value of the quality estimator
boost::optional< double > pt
transverse momentum estimate from the QE
boost::optional< B2Vector3D > p
momentum vector estimate from the QE