ATLAS Offline Software
PhysicsAnalysis
TauID
TauAnalysisTools
TauAnalysisTools
TauTruthMatchingTool.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef TAUANALYSISTOOLS_TAUTRUTHMATCHINGTOOL_H
6
#define TAUANALYSISTOOLS_TAUTRUTHMATCHINGTOOL_H
7
8
/*
9
author: Dirk Duschinger
10
mail: dirk.duschinger@cern.ch
11
documentation in: ../README.rst
12
*/
13
14
// Local include(s):
15
#include "
TauAnalysisTools/ITauTruthMatchingTool.h
"
16
#include "
TauAnalysisTools/BuildTruthTaus.h
"
17
#include "
CxxUtils/CachedValue.h
"
18
19
namespace
TauAnalysisTools
20
{
21
22
class
TauTruthMatchingTool
23
:
public
virtual
TauAnalysisTools::BuildTruthTaus
24
,
public
virtual
TauAnalysisTools::ITauTruthMatchingTool
25
{
27
ASG_TOOL_CLASS2
(
TauTruthMatchingTool
,
28
TauAnalysisTools::IBuildTruthTaus
,
29
TauAnalysisTools::ITauTruthMatchingTool
)
30
31
public
:
// Interface functions
32
33
TauTruthMatchingTool
(
const
std::string&
name
);
34
35
virtual
~
TauTruthMatchingTool
() =
default
;
36
37
// initialize the tool
38
virtual
StatusCode
initialize
()
override
final
;
39
40
virtual
std::unique_ptr<ITruthTausEvent>
getEvent
()
const
override
final
;
41
42
// get pointer to the truth matched particle, if no truth particle was found a null pointer is returned
43
virtual
const
xAOD::TruthParticle
*
getTruth
(
const
xAOD::TauJet
& xTau)
override
final
;
44
virtual
const
xAOD::TruthParticle
*
getTruth
(
const
xAOD::TauJet
& xTau,
45
ITruthTausEvent
& truthTausEVent)
const
override
final
;
46
virtual
std::vector<const xAOD::TruthParticle*>
getTruth
(
const
std::vector<const xAOD::TauJet*>& vTaus)
override
final
;
47
48
public
:
// Wrapper functions
49
50
// wrapper function to get truth tau visible TLorentzvector
51
virtual
TLorentzVector
getTruthTauP4Vis
(
const
xAOD::TauJet
& xTau)
override
final
;
52
virtual
TLorentzVector
getTruthTauP4Vis
(
const
xAOD::TruthParticle
& xTruthTau)
const
override
final
;
53
54
// wrapper function to get truth tau invisible TLorentzvector
55
virtual
TLorentzVector
getTruthTauP4Invis
(
const
xAOD::TauJet
& xTau)
override
final
;
56
virtual
TLorentzVector
getTruthTauP4Invis
(
const
xAOD::TruthParticle
& xTruthTau)
const
override
final
;
57
58
// get type of truth match particle (hadronic tau, leptonic tau, electron, muon, jet)
59
virtual
TauAnalysisTools::TruthMatchedParticleType
getTruthParticleType
(
const
xAOD::TauJet
& xTau)
override
final
;
60
61
// wrapper function to count number of decay particles of given pdg id
62
virtual
int
getNTauDecayParticles
(
const
xAOD::TauJet
& xTau,
int
iPdgId,
bool
bCompareAbsoluteValues =
false
)
override
final
;
63
virtual
int
getNTauDecayParticles
(
const
xAOD::TruthParticle
& xTruthTau,
int
iPdgId,
bool
bCompareAbsoluteValues =
false
)
const
override
final
;
64
65
// wrapper function to obtain truth verion of xAOD::TauJetParameters::DecayMode
66
virtual
xAOD::TauJetParameters::DecayMode
getDecayMode
(
const
xAOD::TauJet
& xTau)
override
final
;
67
virtual
xAOD::TauJetParameters::DecayMode
getDecayMode
(
const
xAOD::TruthParticle
& xTruthTau)
const
override
final
;
68
69
private
:
// private helper functions
70
71
StatusCode
findTruthTau
(
const
xAOD::TauJet
& xTau,
72
TruthTausEvent& truthTausEvent)
const
;
73
StatusCode
checkTruthMatch
(
const
xAOD::TauJet
& xTau,
const
xAOD::TruthParticleContainer
& xTauContainer,
const
TruthTausEvent& truthTausEvent)
const
;
74
75
private
:
// steering variables
76
77
double
m_dMaxDeltaR
;
78
79
CxxUtils::CachedValue<bool>
m_bIsTruthMatchedAvailable
;
80
CxxUtils::CachedValue<bool>
m_bIsTruthParticleLinkAvailable
;
81
82
private
:
// private helper variables
83
84
SG::AuxElement::ConstAccessor<double>
m_accPtVis
;
85
SG::AuxElement::ConstAccessor<double>
m_accEtaVis
;
86
SG::AuxElement::ConstAccessor<double>
m_accPhiVis
;
87
SG::AuxElement::ConstAccessor<double>
m_accMVis
;
88
89
};
// class TauTruthMatchingTool
90
91
}
92
#endif // TAUANALYSISTOOLS_TAUTRUTHMATCHINGTOOL_H
TauAnalysisTools
Definition:
TruthCollectionMakerTau.h:16
TauAnalysisTools::TauTruthMatchingTool::getTruthTauP4Vis
virtual TLorentzVector getTruthTauP4Vis(const xAOD::TauJet &xTau) override final
Definition:
TauTruthMatchingTool.cxx:121
TauAnalysisTools::TauTruthMatchingTool::getTruthTauP4Invis
virtual TLorentzVector getTruthTauP4Invis(const xAOD::TauJet &xTau) override final
Definition:
TauTruthMatchingTool.cxx:155
TauAnalysisTools::TauTruthMatchingTool::m_accEtaVis
SG::AuxElement::ConstAccessor< double > m_accEtaVis
Definition:
TauTruthMatchingTool.h:85
TauAnalysisTools::IBuildTruthTaus::ITruthTausEvent
Declare the interface that the class provides.
Definition:
IBuildTruthTaus.h:35
ASG_TOOL_CLASS2
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Definition:
AsgToolMacros.h:77
TauAnalysisTools::TauTruthMatchingTool::checkTruthMatch
StatusCode checkTruthMatch(const xAOD::TauJet &xTau, const xAOD::TruthParticleContainer &xTauContainer, const TruthTausEvent &truthTausEvent) const
Definition:
TauTruthMatchingTool.cxx:329
TauAnalysisTools::TauTruthMatchingTool::getEvent
virtual std::unique_ptr< ITruthTausEvent > getEvent() const override final
Definition:
TauTruthMatchingTool.cxx:49
TauAnalysisTools::TauTruthMatchingTool::getTruthParticleType
virtual TauAnalysisTools::TruthMatchedParticleType getTruthParticleType(const xAOD::TauJet &xTau) override final
Definition:
TauTruthMatchingTool.cxx:197
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition:
ConstAccessor.h:55
xAOD::TauJetParameters::DecayMode
DecayMode
Definition:
TauDefs.h:385
TauAnalysisTools::BuildTruthTaus
Definition:
BuildTruthTaus.h:34
ITauTruthMatchingTool.h
TauAnalysisTools::TauTruthMatchingTool::m_bIsTruthParticleLinkAvailable
CxxUtils::CachedValue< bool > m_bIsTruthParticleLinkAvailable
Definition:
TauTruthMatchingTool.h:80
TauAnalysisTools::TauTruthMatchingTool::m_accMVis
SG::AuxElement::ConstAccessor< double > m_accMVis
Definition:
TauTruthMatchingTool.h:87
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TauAnalysisTools::TauTruthMatchingTool::m_dMaxDeltaR
double m_dMaxDeltaR
Definition:
TauTruthMatchingTool.h:77
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition:
TruthParticle_v1.h:37
xAOD::TauJet_v3
Class describing a tau jet.
Definition:
TauJet_v3.h:41
CxxUtils::CachedValue< bool >
TauAnalysisTools::ITauTruthMatchingTool
Definition:
ITauTruthMatchingTool.h:33
TauAnalysisTools::TauTruthMatchingTool::findTruthTau
StatusCode findTruthTau(const xAOD::TauJet &xTau, TruthTausEvent &truthTausEvent) const
Definition:
TauTruthMatchingTool.cxx:299
TauAnalysisTools::TauTruthMatchingTool
Definition:
TauTruthMatchingTool.h:25
DataVector
Derived DataVector<T>.
Definition:
DataVector.h:581
BuildTruthTaus.h
CachedValue.h
Cached value with atomic update.
TauAnalysisTools::TruthMatchedParticleType
TruthMatchedParticleType
Definition:
PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:95
name
std::string name
Definition:
Control/AthContainers/Root/debug.cxx:221
TauAnalysisTools::IBuildTruthTaus
Definition:
IBuildTruthTaus.h:28
TauAnalysisTools::TauTruthMatchingTool::getDecayMode
virtual xAOD::TauJetParameters::DecayMode getDecayMode(const xAOD::TauJet &xTau) override final
Definition:
TauTruthMatchingTool.cxx:244
TauAnalysisTools::TauTruthMatchingTool::m_accPhiVis
SG::AuxElement::ConstAccessor< double > m_accPhiVis
Definition:
TauTruthMatchingTool.h:86
TauAnalysisTools::TauTruthMatchingTool::initialize
virtual StatusCode initialize() override final
Definition:
TauTruthMatchingTool.cxx:33
TauAnalysisTools::TauTruthMatchingTool::getTruth
virtual const xAOD::TruthParticle * getTruth(const xAOD::TauJet &xTau) override final
Definition:
TauTruthMatchingTool.cxx:59
TauAnalysisTools::TauTruthMatchingTool::m_bIsTruthMatchedAvailable
CxxUtils::CachedValue< bool > m_bIsTruthMatchedAvailable
Definition:
TauTruthMatchingTool.h:79
TauAnalysisTools::TauTruthMatchingTool::getNTauDecayParticles
virtual int getNTauDecayParticles(const xAOD::TauJet &xTau, int iPdgId, bool bCompareAbsoluteValues=false) override final
Definition:
TauTruthMatchingTool.cxx:203
TauAnalysisTools::TauTruthMatchingTool::m_accPtVis
SG::AuxElement::ConstAccessor< double > m_accPtVis
Definition:
TauTruthMatchingTool.h:84
Generated on Thu Nov 7 2024 21:27:08 for ATLAS Offline Software by
1.8.18