ATLAS Offline Software
Loading...
Searching...
No Matches
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
14
15//
16// method implementations
17//
18
19namespace CP
20{
21
22 StatusCode DiTauTruthMatchingAlg ::
23 initialize ()
24 {
25 ANA_CHECK (m_matchingTool.retrieve());
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}
#define ANA_CHECK(EXP)
check whether the given expression was successful
static Double_t taus
SysListHandle m_systematicsList
the systematics list we run
SysWriteDecorHandle< float > m_truthVisMassDecor
SysWriteDecorHandle< char > m_isTruthHadronicDecor
SysWriteDecorHandle< float > m_truthVisLeadEtaDecor
SysWriteDecorHandle< char > m_isTruthMatchedDecor
SysWriteDecorHandle< float > m_truthVisLeadMDecor
SysReadHandle< xAOD::DiTauJetContainer > m_tauHandle
the tau collection we run on
SysWriteDecorHandle< float > m_truthVisDeltaRDecor
SysWriteDecorHandle< float > m_truthVisLeadPtDecor
output decorations, written by the matching tool (or by us for ditaus failing the preselection)
SysWriteDecorHandle< int > m_truthLeadPdgIDDecor
SysWriteDecorHandle< float > m_truthVisSubleadPtDecor
SysWriteDecorHandle< float > m_truthVisSubleadPhiDecor
SysReadSelectionHandle m_preselection
the preselection we apply to our input
SysWriteDecorHandle< float > m_truthVisLeadPhiDecor
SysWriteDecorHandle< float > m_truthVisSubleadMDecor
ToolHandle< TauAnalysisTools::IDiTauTruthMatchingTool > m_matchingTool
the matching tool
SysWriteDecorHandle< float > m_truthVisSubleadEtaDecor
SysWriteDecorHandle< int > m_truthSubleadPdgIDDecor
Select isolated Photons, Electrons and Muons.
DiTauJetContainer_v1 DiTauJetContainer
Definition of the current DiTauJet container version.
DiTauJet_v1 DiTauJet
Definition of the current version.
Definition DiTauJet.h:17