ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
TauAnalysisAlgorithms
Root
DiTauTruthMatchingAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
8
9
//
10
// includes
11
//
12
13
#include <
TauAnalysisAlgorithms/DiTauTruthMatchingAlg.h
>
14
15
//
16
// method implementations
17
//
18
19
namespace
CP
20
{
21
22
StatusCode DiTauTruthMatchingAlg ::
23
initialize ()
24
{
25
ANA_CHECK
(
m_matchingTool
.retrieve());
26
ANA_CHECK
(
m_tauHandle
.initialize (
m_systematicsList
));
27
ANA_CHECK
(
m_preselection
.initialize (
m_systematicsList
,
m_tauHandle
,
SG::AllowEmpty
));
28
ANA_CHECK
(
m_systematicsList
.initialize());
29
return
StatusCode::SUCCESS;
30
}
31
32
33
34
StatusCode DiTauTruthMatchingAlg ::
35
execute (
const
EventContext& ctx)
36
{
37
for
(
const
auto
& sys :
m_systematicsList
.systematicsVector())
38
{
39
const
xAOD::DiTauJetContainer
*
taus
=
nullptr
;
40
ANA_CHECK
(
m_tauHandle
.retrieve (
taus
, sys, ctx));
41
// all decorations done within the DiTauTruthMatchingTool and to be saved in output
42
static
const
SG::Decorator<float>
accTruthVisLeadPt(
"TruthVisLeadPt"
);
43
static
const
SG::Decorator<float>
accTruthVisLeadEta(
"TruthVisLeadEta"
);
44
static
const
SG::Decorator<float>
accTruthVisLeadPhi(
"TruthVisLeadPhi"
);
45
static
const
SG::Decorator<float>
accTruthVisLeadM(
"TruthVisLeadM"
);
46
static
const
SG::Decorator<int>
accTruthLeadPdgID(
"TruthLeadPdgID"
);
47
static
const
SG::Decorator<float>
accTruthVisSubleadPt(
"TruthVisSubleadPt"
);
48
static
const
SG::Decorator<float>
accTruthVisSubleadEta(
"TruthVisSubleadEta"
);
49
static
const
SG::Decorator<float>
accTruthVisSubleadPhi(
"TruthVisSubleadPhi"
);
50
static
const
SG::Decorator<float>
accTruthVisSubleadM(
"TruthVisSubleadM"
);
51
static
const
SG::Decorator<int>
accTruthSubleadPdgID(
"TruthSubleadPdgID"
);
52
static
const
SG::Decorator<float>
accTruthVisDeltaR(
"TruthVisDeltaR"
);
53
static
const
SG::Decorator<float>
accTruthVisMass(
"TruthVisMass"
);
54
static
const
SG::Decorator<char>
accIsTruthMatched(
"IsTruthMatched"
);
55
static
const
SG::Decorator<char>
accIsTruthHadronic(
"IsTruthHadronic"
);
56
57
for
(
const
xAOD::DiTauJet
*tau : *
taus
)
58
{
59
if
(
m_preselection
.getBool (*tau, sys))
60
{
61
m_matchingTool
->getTruth (*tau);
62
}
else
{
63
// for failed selection, use the same default value as for failed match
64
accTruthVisLeadPt(*tau) = -1234;
65
accTruthVisLeadEta(*tau) = -1234;
66
accTruthVisLeadPhi(*tau) = -1234;
67
accTruthVisLeadM(*tau) = -1234;
68
accTruthLeadPdgID(*tau) = -1234;
69
accTruthVisSubleadPt(*tau) = -1234;
70
accTruthVisSubleadEta(*tau) = -1234;
71
accTruthVisSubleadPhi(*tau) = -1234;
72
accTruthVisSubleadM(*tau) = -1234;
73
accTruthSubleadPdgID(*tau) = -1234;
74
accTruthVisDeltaR(*tau) = -1234;
75
accTruthVisMass(*tau) = -1234;
76
accIsTruthMatched(*tau) =
char
(
false
);
77
accIsTruthHadronic(*tau) =
char
(
false
);
78
}
79
}
80
}
81
return
StatusCode::SUCCESS;
82
}
83
}
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
DiTauTruthMatchingAlg.h
taus
static Double_t taus
Definition
LArPhysWaveHECTool.cxx:37
CP::DiTauTruthMatchingAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition
DiTauTruthMatchingAlg.h:39
CP::DiTauTruthMatchingAlg::m_tauHandle
SysReadHandle< xAOD::DiTauJetContainer > m_tauHandle
the tau collection we run on
Definition
DiTauTruthMatchingAlg.h:43
CP::DiTauTruthMatchingAlg::m_preselection
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Definition
DiTauTruthMatchingAlg.h:48
CP::DiTauTruthMatchingAlg::m_matchingTool
ToolHandle< TauAnalysisTools::IDiTauTruthMatchingTool > m_matchingTool
the matching tool
Definition
DiTauTruthMatchingAlg.h:35
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:27
SG::Decorator
SG::Decorator< T, ALLOC > Decorator
Helper class to provide type-safe access to aux data, specialized for JaggedVecElt.
Definition
AuxElement.h:576
xAOD::char
char
Definition
TrigDecision_v1.cxx:38
xAOD::DiTauJetContainer
DiTauJetContainer_v1 DiTauJetContainer
Definition of the current DiTauJet container version.
Definition
DiTauJetContainer.h:17
xAOD::DiTauJet
DiTauJet_v1 DiTauJet
Definition of the current version.
Definition
DiTauJet.h:17
Generated on
for ATLAS Offline Software by
1.17.0