ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkTools
TrkTruthCreatorTools
src
TruthMatchTanimoto.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrkTruthCreatorTools/TruthMatchTanimoto.h
"
6
#include "
TrkTruthData/DetailedTrackTruth.h
"
7
#include "
TrkTruthData/SubDetHitStatistics.h
"
8
9
namespace
Trk
{
10
11
//================================================================
12
TruthMatchTanimoto::TruthMatchTanimoto
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent)
13
:
CommonTruthMatchWeights
(
type
,name,parent)
14
{
15
declareInterface<IDetailedTrackTruthSimilarity>(
this
);
16
}
17
18
//================================================================
19
double
TruthMatchTanimoto::trackTruthSimilarity
(
const
DetailedTrackTruth
& dt)
const
20
{
21
double
prd_truth=0;
22
double
prd_track=0;
23
double
prd_common=0;
24
for
(
unsigned
i=0; i<
SubDetHitStatistics::NUM_SUBDETECTORS
; i++) {
25
prd_common +=
m_subDetWeights
[i] * dt.statsCommon()[
SubDetHitStatistics::SubDetType
(i)];
26
prd_track +=
m_subDetWeights
[i] * dt.statsTrack()[
SubDetHitStatistics::SubDetType
(i)];
27
prd_truth +=
m_subDetWeights
[i] * dt.statsTruth()[
SubDetHitStatistics::SubDetType
(i)];
28
}
29
30
double
denom = prd_track + prd_truth - prd_common;
31
32
return
(denom>0)? prd_common/denom : 0.;
33
}
34
35
//================================================================
36
37
}
// namespace Trk
DetailedTrackTruth.h
SubDetHitStatistics.h
A struture to keep per-subdetector numbers of hits for truth matching.
TruthMatchTanimoto.h
DetailedTrackTruth
Definition
DetailedTrackTruth.h:16
SubDetHitStatistics::SubDetType
SubDetType
Definition
SubDetHitStatistics.h:74
SubDetHitStatistics::NUM_SUBDETECTORS
@ NUM_SUBDETECTORS
Definition
SubDetHitStatistics.h:74
Trk::CommonTruthMatchWeights::CommonTruthMatchWeights
CommonTruthMatchWeights(const std::string &type, const std::string &name, const IInterface *parent)
Definition
CommonTruthMatchWeights.cxx:11
Trk::CommonTruthMatchWeights::m_subDetWeights
std::vector< double > m_subDetWeights
Definition
CommonTruthMatchWeights.h:29
Trk::TruthMatchTanimoto::TruthMatchTanimoto
TruthMatchTanimoto(const std::string &type, const std::string &name, const IInterface *parent)
Definition
TruthMatchTanimoto.cxx:12
Trk::TruthMatchTanimoto::trackTruthSimilarity
virtual double trackTruthSimilarity(const DetailedTrackTruth &dtt) const override final
Tanimoto distance between sets A and B is.
Definition
TruthMatchTanimoto.cxx:19
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
type
Generated on
for ATLAS Offline Software by
1.17.0