ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
TauID
TauAnalysisTools
TauAnalysisTools
TauTruthMatchingTool.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 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
#include "
AsgTools/PropertyWrapper.h
"
19
#include <vector>
20
#include <string>
21
22
namespace
ADD_CMODE(TauAnalysisTools)
23
{
24
25
class
TauTruthMatchingTool
26
:
public
virtual
BuildTruthTaus
27
,
public
virtual
ITauTruthMatchingTool
28
{
30
ASG_TOOL_CLASS2
( TauTruthMatchingTool,
31
IBuildTruthTaus,
32
ITauTruthMatchingTool )
33
34
public
:
// Interface functions
35
36
TauTruthMatchingTool(
const
std::string& name );
37
38
virtual
~TauTruthMatchingTool() =
default
;
39
40
// initialize the tool
41
virtual
StatusCode
initialize
()
override
final
;
42
43
virtual
std::unique_ptr<ITruthTausEvent> getEvent()
const
override
final
;
44
45
// get pointer to the truth matched particle, if no truth particle was found a null pointer is returned
46
virtual
const
xAOD::TruthParticle
* getTruth(
const
xAOD::TauJet
& xTau)
override
final
;
47
virtual
const
xAOD::TruthParticle
* getTruth(
const
xAOD::TauJet
& xTau,
48
ITruthTausEvent& truthTausEVent)
const
override
final
;
49
virtual
std::vector<const xAOD::TruthParticle*> getTruth(
const
std::vector<const xAOD::TauJet*>& vTaus)
override
final
;
50
51
public
:
// Wrapper functions
52
53
// wrapper function to get truth tau visible TLorentzvector
54
virtual
TLorentzVector getTruthTauP4Vis(
const
xAOD::TauJet
& xTau)
override
final
;
55
virtual
TLorentzVector getTruthTauP4Vis(
const
xAOD::TruthParticle
& xTruthTau)
const
override
final
;
56
57
// wrapper function to get truth tau invisible TLorentzvector
58
virtual
TLorentzVector getTruthTauP4Invis(
const
xAOD::TauJet
& xTau)
override
final
;
59
virtual
TLorentzVector getTruthTauP4Invis(
const
xAOD::TruthParticle
& xTruthTau)
const
override
final
;
60
61
// function to check if a reconstructed electron or muon is matched to a true tau
62
bool
matchTruthLeptonicTauDecay(
const
xAOD::IParticle
* p,
const
xAOD::TruthParticleContainer
* truth_taus);
63
64
// get type of truth match particle (hadronic tau, leptonic tau, electron, muon, jet)
65
virtual
TauAnalysisTools::TruthMatchedParticleType
getTruthParticleType(
const
xAOD::TauJet
& xTau)
override
final
;
66
67
// wrapper function to count number of decay particles of given pdg id
68
virtual
int
getNTauDecayParticles(
const
xAOD::TauJet
& xTau,
int
iPdgId,
bool
bCompareAbsoluteValues =
false
)
override
final
;
69
virtual
int
getNTauDecayParticles(
const
xAOD::TruthParticle
& xTruthTau,
int
iPdgId,
bool
bCompareAbsoluteValues =
false
)
const
override
final
;
70
71
// wrapper function to obtain truth verion of xAOD::TauJetParameters::DecayMode
72
virtual
xAOD::TauJetParameters::DecayMode
getDecayMode(
const
xAOD::TauJet
& xTau)
override
final
;
73
virtual
xAOD::TauJetParameters::DecayMode
getDecayMode(
const
xAOD::TruthParticle
& xTruthTau)
const
override
final
;
74
80
virtual
StatusCode lockDecorations (
const
xAOD::TauJetContainer
&
taus
)
const
override
final
;
81
82
private
:
// private helper functions
83
84
StatusCode findTruthTau(
const
xAOD::TauJet
& xTau,
85
TruthTausEvent& truthTausEvent)
const
;
86
StatusCode checkTruthMatch (
const
xAOD::TauJet
& xTau,
const
xAOD::TruthParticleContainer
& xTauContainer,
const
TruthTausEvent& truthTausEvent)
const
;
87
88
private
:
// steering variables
89
90
Gaudi::Property<double> m_dMaxDeltaR{
this
,
"MaxDeltaR"
, 0.2};
91
92
CxxUtils::CachedValue<bool>
m_bIsTruthMatchedAvailable;
93
CxxUtils::CachedValue<bool>
m_bIsTruthParticleLinkAvailable;
94
95
private
:
// private helper variables
96
97
SG::ConstAccessor<double>
m_accPtVis;
98
SG::ConstAccessor<double>
m_accEtaVis;
99
SG::ConstAccessor<double>
m_accPhiVis;
100
SG::ConstAccessor<double>
m_accMVis;
101
102
};
// class TauTruthMatchingTool
103
104
}
105
#endif
// TAUANALYSISTOOLS_TAUTRUTHMATCHINGTOOL_H
ASG_TOOL_CLASS2
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Definition
AsgToolMacros.h:77
BuildTruthTaus.h
CachedValue.h
Cached value with atomic update.
ITauTruthMatchingTool.h
taus
static Double_t taus
Definition
LArPhysWaveHECTool.cxx:37
PropertyWrapper.h
CxxUtils::CachedValue
Cached value with atomic update.
Definition
CachedValue.h:55
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition
ConstAccessor.h:55
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
TauAnalysisTools::TruthMatchedParticleType
TruthMatchedParticleType
Definition
PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h:107
xAOD::TauJetParameters::DecayMode
DecayMode
Definition
TauDefs.h:385
xAOD::TauJet
TauJet_v3 TauJet
Definition of the current "tau version".
Definition
TauJet.h:17
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition
Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
xAOD::TauJetContainer
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".
Definition
TauJetContainer.h:17
xAOD::TruthParticleContainer
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.
Definition
Event/xAOD/xAODTruth/xAODTruth/TruthParticleContainer.h:17
initialize
void initialize()
Definition
run_EoverP.cxx:894
Generated on
for ATLAS Offline Software by
1.17.0