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-2026 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_truthVisLeadPtDecor
.initialize (
m_systematicsList
,
m_tauHandle
));
29
ANA_CHECK
(
m_truthVisLeadEtaDecor
.initialize (
m_systematicsList
,
m_tauHandle
));
30
ANA_CHECK
(
m_truthVisLeadPhiDecor
.initialize (
m_systematicsList
,
m_tauHandle
));
31
ANA_CHECK
(
m_truthVisLeadMDecor
.initialize (
m_systematicsList
,
m_tauHandle
));
32
ANA_CHECK
(
m_truthLeadPdgIDDecor
.initialize (
m_systematicsList
,
m_tauHandle
));
33
ANA_CHECK
(
m_truthVisSubleadPtDecor
.initialize (
m_systematicsList
,
m_tauHandle
));
34
ANA_CHECK
(
m_truthVisSubleadEtaDecor
.initialize (
m_systematicsList
,
m_tauHandle
));
35
ANA_CHECK
(
m_truthVisSubleadPhiDecor
.initialize (
m_systematicsList
,
m_tauHandle
));
36
ANA_CHECK
(
m_truthVisSubleadMDecor
.initialize (
m_systematicsList
,
m_tauHandle
));
37
ANA_CHECK
(
m_truthSubleadPdgIDDecor
.initialize (
m_systematicsList
,
m_tauHandle
));
38
ANA_CHECK
(
m_truthVisDeltaRDecor
.initialize (
m_systematicsList
,
m_tauHandle
));
39
ANA_CHECK
(
m_truthVisMassDecor
.initialize (
m_systematicsList
,
m_tauHandle
));
40
ANA_CHECK
(
m_isTruthMatchedDecor
.initialize (
m_systematicsList
,
m_tauHandle
));
41
ANA_CHECK
(
m_isTruthHadronicDecor
.initialize (
m_systematicsList
,
m_tauHandle
));
42
ANA_CHECK
(
m_systematicsList
.initialize());
43
return
StatusCode::SUCCESS;
44
}
45
46
47
48
StatusCode DiTauTruthMatchingAlg ::
49
execute (
const
EventContext& ctx)
50
{
51
for
(
const
auto
& sys :
m_systematicsList
.systematicsVector())
52
{
53
const
xAOD::DiTauJetContainer
*
taus
=
nullptr
;
54
ANA_CHECK
(
m_tauHandle
.retrieve (
taus
, sys, ctx));
55
// all decorations done within the DiTauTruthMatchingTool and to be saved in output
56
for
(
const
xAOD::DiTauJet
*tau : *
taus
)
57
{
58
if
(
m_preselection
.getBool (*tau, sys))
59
{
60
m_matchingTool
->getTruth (*tau);
61
}
else
{
62
// for failed selection, use the same default value as for failed match
63
m_truthVisLeadPtDecor
.set (*tau, -1234, sys);
64
m_truthVisLeadEtaDecor
.set (*tau, -1234, sys);
65
m_truthVisLeadPhiDecor
.set (*tau, -1234, sys);
66
m_truthVisLeadMDecor
.set (*tau, -1234, sys);
67
m_truthLeadPdgIDDecor
.set (*tau, -1234, sys);
68
m_truthVisSubleadPtDecor
.set (*tau, -1234, sys);
69
m_truthVisSubleadEtaDecor
.set (*tau, -1234, sys);
70
m_truthVisSubleadPhiDecor
.set (*tau, -1234, sys);
71
m_truthVisSubleadMDecor
.set (*tau, -1234, sys);
72
m_truthSubleadPdgIDDecor
.set (*tau, -1234, sys);
73
m_truthVisDeltaRDecor
.set (*tau, -1234, sys);
74
m_truthVisMassDecor
.set (*tau, -1234, sys);
75
m_isTruthMatchedDecor
.set (*tau,
char
(
false
), sys);
76
m_isTruthHadronicDecor
.set (*tau,
char
(
false
), sys);
77
}
78
}
79
}
80
return
StatusCode::SUCCESS;
81
}
82
}
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:325
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:40
CP::DiTauTruthMatchingAlg::m_truthVisMassDecor
SysWriteDecorHandle< float > m_truthVisMassDecor
Definition
DiTauTruthMatchingAlg.h:66
CP::DiTauTruthMatchingAlg::m_isTruthHadronicDecor
SysWriteDecorHandle< char > m_isTruthHadronicDecor
Definition
DiTauTruthMatchingAlg.h:68
CP::DiTauTruthMatchingAlg::m_truthVisLeadEtaDecor
SysWriteDecorHandle< float > m_truthVisLeadEtaDecor
Definition
DiTauTruthMatchingAlg.h:56
CP::DiTauTruthMatchingAlg::m_isTruthMatchedDecor
SysWriteDecorHandle< char > m_isTruthMatchedDecor
Definition
DiTauTruthMatchingAlg.h:67
CP::DiTauTruthMatchingAlg::m_truthVisLeadMDecor
SysWriteDecorHandle< float > m_truthVisLeadMDecor
Definition
DiTauTruthMatchingAlg.h:58
CP::DiTauTruthMatchingAlg::m_tauHandle
SysReadHandle< xAOD::DiTauJetContainer > m_tauHandle
the tau collection we run on
Definition
DiTauTruthMatchingAlg.h:44
CP::DiTauTruthMatchingAlg::m_truthVisDeltaRDecor
SysWriteDecorHandle< float > m_truthVisDeltaRDecor
Definition
DiTauTruthMatchingAlg.h:65
CP::DiTauTruthMatchingAlg::m_truthVisLeadPtDecor
SysWriteDecorHandle< float > m_truthVisLeadPtDecor
output decorations, written by the matching tool (or by us for ditaus failing the preselection)
Definition
DiTauTruthMatchingAlg.h:55
CP::DiTauTruthMatchingAlg::m_truthLeadPdgIDDecor
SysWriteDecorHandle< int > m_truthLeadPdgIDDecor
Definition
DiTauTruthMatchingAlg.h:59
CP::DiTauTruthMatchingAlg::m_truthVisSubleadPtDecor
SysWriteDecorHandle< float > m_truthVisSubleadPtDecor
Definition
DiTauTruthMatchingAlg.h:60
CP::DiTauTruthMatchingAlg::m_truthVisSubleadPhiDecor
SysWriteDecorHandle< float > m_truthVisSubleadPhiDecor
Definition
DiTauTruthMatchingAlg.h:62
CP::DiTauTruthMatchingAlg::m_preselection
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Definition
DiTauTruthMatchingAlg.h:49
CP::DiTauTruthMatchingAlg::m_truthVisLeadPhiDecor
SysWriteDecorHandle< float > m_truthVisLeadPhiDecor
Definition
DiTauTruthMatchingAlg.h:57
CP::DiTauTruthMatchingAlg::m_truthVisSubleadMDecor
SysWriteDecorHandle< float > m_truthVisSubleadMDecor
Definition
DiTauTruthMatchingAlg.h:63
CP::DiTauTruthMatchingAlg::m_matchingTool
ToolHandle< TauAnalysisTools::IDiTauTruthMatchingTool > m_matchingTool
the matching tool
Definition
DiTauTruthMatchingAlg.h:36
CP::DiTauTruthMatchingAlg::m_truthVisSubleadEtaDecor
SysWriteDecorHandle< float > m_truthVisSubleadEtaDecor
Definition
DiTauTruthMatchingAlg.h:61
CP::DiTauTruthMatchingAlg::m_truthSubleadPdgIDDecor
SysWriteDecorHandle< int > m_truthSubleadPdgIDDecor
Definition
DiTauTruthMatchingAlg.h:64
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:29
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