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;
38 " The default names for the clusters are used");
42 for (
SpacePoint const* spacePoint : measurements) {
47 matches[recoTrack.getArrayIndex()]++;
54 matches[recoTrack.getArrayIndex()] += 2;
61 MatchInfo bestMatch = *std::max_element(matches.begin(), matches.end(),
68 double qualityIndicator = 0;
70 if (nClusters ==
m_mcRecoTracks[match.first]->getNumberOfSVDHits()) {
71 qualityIndicator = 1 - (1. / nClusters);
74 if (nClusters == match.second) {
75 qualityIndicator = 1 - (1. / nClusters);
78 int nRecoTrackClusters =
m_mcRecoTracks[match.first]->getNumberOfSVDHits();
79 qualityIndicator = std::pow(match.second, 3) / (nRecoTrackClusters * nClusters * nClusters);
81 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_clusterNamesNeedSetting
if true cluster names need to be set, either by calling setClustersNames or read from MCRecoTracks at...
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.
int getEntries() const
Get the number of objects in the array.
B2Vector3< double > B2Vector3D
typedef for common usage with double
Abstract base class for different kinds of events.
Container for complete fit/estimation results.
std::optional< double > pt
transverse momentum estimate from the QE
double qualityIndicator
return value of the quality estimator
std::optional< B2Vector3D > p
momentum vector estimate from the QE