Belle II Software  release-05-01-25
QualityEstimatorMC.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Jonas Wagner *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorBase.h>
14 #include <framework/datastore/StoreArray.h>
15 #include <tracking/dataobjects/RecoTrack.h>
16 #include <tracking/spacePointCreation/SpacePoint.h>
17 
18 namespace Belle2 {
23  class QualityEstimatorMC : public QualityEstimatorBase {
25  public:
26  // some typedefs to increase readability
27  typedef int MCRecoTrackIndex;
28  typedef unsigned int NMatches;
29  typedef std::pair<MCRecoTrackIndex, NMatches> MatchInfo;
37  QualityEstimatorMC(const std::string& mcRecoTracksStoreArrayName = "MCRecoTracks",
38  bool strictQualityIndicator = true, bool mva_target = false):
39  QualityEstimatorBase(), m_strictQualityIndicator(strictQualityIndicator), m_mva_target(mva_target),
40  m_mcRecoTracksStoreArrayName(mcRecoTracksStoreArrayName)
41  {
43  };
44 
49  virtual double estimateQuality(std::vector<SpacePoint const*> const& measurements) final;
50 
52  virtual QualityEstimationResults estimateQualityAndProperties(std::vector<SpacePoint const*> const& measurements) override final;
53 
58  void setClustersNames(const std::string& svdClustersName, const std::string& pxdClustersName)
59  { m_svdClustersName = svdClustersName; m_pxdClustersName = pxdClustersName; };
60 
61  protected:
67  MatchInfo getBestMatchToMCClusters(std::vector<SpacePoint const*> const& measurements);
68 
74  double calculateQualityIndicator(unsigned int nClusters, MatchInfo& match);
75 
76  // parameters
81 
86  bool m_mva_target;
87 
88  // module members
89  std::string m_mcRecoTracksStoreArrayName;
90  std::string m_svdClustersName = "";
91  std::string m_pxdClustersName = "";
95 
98  };
100 }
Belle2::QualityEstimatorMC::MatchInfo
std::pair< MCRecoTrackIndex, NMatches > MatchInfo
typedef for MatchInfo
Definition: QualityEstimatorMC.h:37
Belle2::QualityEstimatorMC::QualityEstimatorMC
QualityEstimatorMC(const std::string &mcRecoTracksStoreArrayName="MCRecoTracks", bool strictQualityIndicator=true, bool mva_target=false)
Constructor.
Definition: QualityEstimatorMC.h:45
Belle2::QualityEstimationResults
Container for complete fit/estimation results.
Definition: QualityEstimatorBase.h:36
Belle2::QualityEstimatorMC::estimateQualityAndProperties
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
Definition: QualityEstimatorMC.cc:73
Belle2::QualityEstimatorMC::m_pxdClustersName
std::string m_pxdClustersName
PXD clusters StoreArray name.
Definition: QualityEstimatorMC.h:99
Belle2::QualityEstimatorMC::m_svdClustersName
std::string m_svdClustersName
SVD clusters StoreArray name.
Definition: QualityEstimatorMC.h:98
Belle2::QualityEstimatorMC::getBestMatchToMCClusters
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 ...
Definition: QualityEstimatorMC.cc:26
Belle2::QualityEstimatorMC::m_mcRecoTracksStoreArrayName
std::string m_mcRecoTracksStoreArrayName
MCRecoTracks StoreArray name.
Definition: QualityEstimatorMC.h:97
Belle2::QualityEstimatorMC::m_mva_target
bool m_mva_target
If true the SPTCs containing all the SVDCluster of the corresponding MCRecoTrack and no other SVDClus...
Definition: QualityEstimatorMC.h:94
Belle2::QualityEstimatorMC::estimateQuality
virtual double estimateQuality(std::vector< SpacePoint const * > const &measurements) final
Performing MC based quality estimation.
Definition: QualityEstimatorMC.cc:16
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::QualityEstimatorMC::calculateQualityIndicator
double calculateQualityIndicator(unsigned int nClusters, MatchInfo &match)
Calculate MC qualityIndicator based on MatchInfo of best matched MCRecoTrack.
Definition: QualityEstimatorMC.cc:54
Belle2::QualityEstimatorMC::m_strictQualityIndicator
bool m_strictQualityIndicator
If true only SPTCs containing SVDClusters corresponding to a single MCRecoTrack get a QI !...
Definition: QualityEstimatorMC.h:88
Belle2::QualityEstimatorMC::setClustersNames
void setClustersNames(const std::string &svdClustersName, const std::string &pxdClustersName)
Setter for StoreArray names of SVD and PXD clusters.
Definition: QualityEstimatorMC.h:66
Belle2::QualityEstimatorMC::NMatches
unsigned int NMatches
typedef for counter of number of matches
Definition: QualityEstimatorMC.h:36
Belle2::QualityEstimatorMC::MCRecoTrackIndex
int MCRecoTrackIndex
typedef for MCRecoTrackIndex
Definition: QualityEstimatorMC.h:35
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::QualityEstimatorBase
BaseClass for QualityEstimators.
Definition: QualityEstimatorBase.h:52
Belle2::QualityEstimatorMC::m_match
MatchInfo m_match
stores the current match for optional return values
Definition: QualityEstimatorMC.h:102
Belle2::QualityEstimatorMC::m_mcRecoTracks
StoreArray< RecoTrack > m_mcRecoTracks
the storeArray for RecoTracks as member
Definition: QualityEstimatorMC.h:105