Belle II Software development
QualityEstimatorMC.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorBase.h>
12#include <framework/datastore/StoreArray.h>
13#include <tracking/dataobjects/RecoTrack.h>
14#include <tracking/spacePointCreation/SpacePoint.h>
15
16namespace Belle2 {
23 public:
24 // some typedefs to increase readability
25 typedef int MCRecoTrackIndex;
26 typedef unsigned int NMatches;
27 typedef std::pair<MCRecoTrackIndex, NMatches> MatchInfo;
35 QualityEstimatorMC(const std::string& mcRecoTracksStoreArrayName = "MCRecoTracks",
36 bool strictQualityIndicator = true, bool mva_target = false):
37 QualityEstimatorBase(), m_strictQualityIndicator(strictQualityIndicator), m_mva_target(mva_target),
38 m_mcRecoTracksStoreArrayName(mcRecoTracksStoreArrayName)
39 {
41 };
42
47 virtual double estimateQuality(std::vector<SpacePoint const*> const& measurements) final;
48
50 virtual QualityEstimationResults estimateQualityAndProperties(std::vector<SpacePoint const*> const& measurements) override final;
51
56 void setClustersNames(const std::string& svdClustersName, const std::string& pxdClustersName)
57 {
58 m_svdClustersName = svdClustersName;
59 m_pxdClustersName = pxdClustersName;
61 };
62
68
69 protected:
75 MatchInfo getBestMatchToMCClusters(std::vector<SpacePoint const*> const& measurements);
76
82 double calculateQualityIndicator(unsigned int nClusters, MatchInfo& match);
83
84 // parameters
89
95
96 // module members
98 std::string m_svdClustersName = "";
99 std::string m_pxdClustersName = "";
101 true;
105
108 };
110}
BaseClass for QualityEstimators.
Class implementing the algorithm used for the MC based quality estimation.
unsigned int NMatches
typedef for counter of number of matches
int MCRecoTrackIndex
typedef for MCRecoTrackIndex
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.
void forceUpdateClusterNames()
Setter to force the class to update its cluster names.
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 ...
void setClustersNames(const std::string &svdClustersName, const std::string &pxdClustersName)
Setter for StoreArray names of SVD and PXD clusters, if those are not set by the user it will be trie...
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
QualityEstimatorMC(const std::string &mcRecoTracksStoreArrayName="MCRecoTracks", bool strictQualityIndicator=true, bool mva_target=false)
Constructor.
std::string m_mcRecoTracksStoreArrayName
MCRecoTracks StoreArray name.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Abstract base class for different kinds of events.
Container for complete fit/estimation results.