ATLAS Offline Software
TruthMatchRatio.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
9 namespace Trk {
10 
11 //================================================================
12 TruthMatchRatio::TruthMatchRatio(const std::string& type, const std::string& name, const IInterface* parent)
14 {
15  declareInterface<IDetailedTrackTruthSimilarity>(this);
16 }
17 
18 //================================================================
20 {
21  double prd_track=0;
22  double prd_common=0;
23  for(unsigned i=0; i<SubDetHitStatistics::NUM_SUBDETECTORS; i++) {
24  prd_common += m_subDetWeights[i] * dt.statsCommon()[SubDetHitStatistics::SubDetType(i)];
25  prd_track += m_subDetWeights[i] * dt.statsTrack()[SubDetHitStatistics::SubDetType(i)];
26  }
27  return (prd_track>0)? prd_common/prd_track : 0.;
28 }
29 
30 //================================================================
31 
32 } // namespace Trk
SubDetHitStatistics::SubDetType
SubDetType
Definition: SubDetHitStatistics.h:74
SubDetHitStatistics::NUM_SUBDETECTORS
@ NUM_SUBDETECTORS
Definition: SubDetHitStatistics.h:74
Trk::CommonTruthMatchWeights
Definition: CommonTruthMatchWeights.h:21
Trk::TruthMatchRatio::TruthMatchRatio
TruthMatchRatio(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TruthMatchRatio.cxx:12
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloNoise_fillDB.dt
dt
Definition: CaloNoise_fillDB.py:58
Trk::TruthMatchRatio::trackTruthSimilarity
virtual double trackTruthSimilarity(const DetailedTrackTruth &dtt) const override
The match quality returned by this tool is a (weighted) ratio of the number of hits common to the tra...
Definition: TruthMatchRatio.cxx:19
test_pyathena.parent
parent
Definition: test_pyathena.py:15
DetailedTrackTruth.h
TruthMatchRatio.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
DetailedTrackTruth
Definition: DetailedTrackTruth.h:16
SubDetHitStatistics.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Trk::CommonTruthMatchWeights::m_subDetWeights
std::vector< double > m_subDetWeights
Definition: CommonTruthMatchWeights.h:29