ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
AsgAnalysisAlgorithms
Root
OverlapRemovalAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
8
//
9
// includes
10
//
11
12
#include <
AsgAnalysisAlgorithms/OverlapRemovalAlg.h
>
13
14
//
15
// method implementations
16
//
17
18
namespace
CP
19
{
20
21
StatusCode OverlapRemovalAlg ::
22
initialize ()
23
{
24
if
(
m_overlapRemovalDecoration
.empty())
25
{
26
ANA_MSG_ERROR
(
"no overlap removal decoration name set"
);
27
return
StatusCode::FAILURE;
28
}
29
30
m_overlapRemovalAccessor
= std::make_unique<SG::Accessor<char> > (
m_overlapRemovalDecoration
);
31
32
ANA_CHECK
(
m_overlapTool
.retrieve());
33
ANA_CHECK
(
m_electronsHandle
.initialize (
m_systematicsList
,
SG::AllowEmpty
));
34
ANA_CHECK
(
m_electronsSelectionHandle
.initialize (
m_systematicsList
,
m_electronsHandle
,
SG::AllowEmpty
));
35
ANA_CHECK
(
m_muonsHandle
.initialize (
m_systematicsList
,
SG::AllowEmpty
));
36
ANA_CHECK
(
m_muonsSelectionHandle
.initialize (
m_systematicsList
,
m_muonsHandle
,
SG::AllowEmpty
));
37
ANA_CHECK
(
m_jetsHandle
.initialize (
m_systematicsList
,
SG::AllowEmpty
));
38
ANA_CHECK
(
m_jetsSelectionHandle
.initialize (
m_systematicsList
,
m_jetsHandle
,
SG::AllowEmpty
));
39
ANA_CHECK
(
m_tausHandle
.initialize (
m_systematicsList
,
SG::AllowEmpty
));
40
ANA_CHECK
(
m_tausSelectionHandle
.initialize (
m_systematicsList
,
m_tausHandle
,
SG::AllowEmpty
));
41
ANA_CHECK
(
m_photonsHandle
.initialize (
m_systematicsList
,
SG::AllowEmpty
));
42
ANA_CHECK
(
m_photonsSelectionHandle
.initialize (
m_systematicsList
,
m_photonsHandle
,
SG::AllowEmpty
));
43
ANA_CHECK
(
m_fatJetsHandle
.initialize (
m_systematicsList
,
SG::AllowEmpty
));
44
ANA_CHECK
(
m_fatJetsSelectionHandle
.initialize (
m_systematicsList
,
m_fatJetsHandle
,
SG::AllowEmpty
));
45
ANA_CHECK
(
m_systematicsList
.initialize());
46
return
StatusCode::SUCCESS;
47
}
48
49
50
51
StatusCode OverlapRemovalAlg ::
52
execute (
const
EventContext& ctx)
53
{
54
for
(
const
auto
& sys :
m_systematicsList
.systematicsVector())
55
{
56
std::unordered_map<const xAOD::IParticleContainer *, const SysWriteSelectionHandle *> decorationsMap;
57
58
const
xAOD::ElectronContainer
*electrons {
nullptr
};
59
if
(
m_electronsHandle
)
60
{
61
ANA_CHECK
(
m_electronsHandle
.getCopy (electrons, sys, ctx));
62
if
(
m_electronsSelectionHandle
)
63
decorationsMap.emplace(electrons, &
m_electronsSelectionHandle
);
64
}
65
const
xAOD::MuonContainer
*muons {
nullptr
};
66
if
(
m_muonsHandle
)
67
{
68
ANA_CHECK
(
m_muonsHandle
.getCopy (muons, sys, ctx));
69
if
(
m_muonsSelectionHandle
)
70
decorationsMap.emplace(muons, &
m_muonsSelectionHandle
);
71
}
72
const
xAOD::JetContainer
*jets {
nullptr
};
73
if
(
m_jetsHandle
)
74
{
75
ANA_CHECK
(
m_jetsHandle
.getCopy (jets, sys, ctx));
76
if
(
m_jetsSelectionHandle
)
77
decorationsMap.emplace(jets, &
m_jetsSelectionHandle
);
78
}
79
const
xAOD::TauJetContainer
*
taus
{
nullptr
};
80
if
(
m_tausHandle
)
81
{
82
ANA_CHECK
(
m_tausHandle
.getCopy (
taus
, sys, ctx));
83
if
(
m_tausSelectionHandle
)
84
decorationsMap.emplace(
taus
, &
m_tausSelectionHandle
);
85
}
86
const
xAOD::PhotonContainer
*photons {
nullptr
};
87
if
(
m_photonsHandle
)
88
{
89
ANA_CHECK
(
m_photonsHandle
.getCopy (photons, sys, ctx));
90
if
(
m_photonsSelectionHandle
)
91
decorationsMap.emplace(photons, &
m_photonsSelectionHandle
);
92
}
93
const
xAOD::JetContainer
*fatJets {
nullptr
};
94
if
(
m_fatJetsHandle
)
95
{
96
ANA_CHECK
(
m_fatJetsHandle
.getCopy (fatJets, sys, ctx));
97
if
(
m_fatJetsSelectionHandle
)
98
decorationsMap.emplace(fatJets, &
m_fatJetsSelectionHandle
);
99
}
100
101
ATH_CHECK
(
m_overlapTool
->removeOverlaps (electrons, muons, jets,
taus
,
102
photons, fatJets));
103
104
// Re-decorate if needed
105
for
(
const
auto
&
pair
: decorationsMap)
106
{
107
for
(
const
xAOD::IParticle
*particle : *(
pair
.first))
108
{
109
(*(
pair
.second)).setBool
110
(*particle, (*
m_overlapRemovalAccessor
) (*particle), sys);
111
}
112
}
113
}
114
115
return
StatusCode::SUCCESS;
116
}
117
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
taus
static Double_t taus
Definition
LArPhysWaveHECTool.cxx:37
OverlapRemovalAlg.h
CP::OverlapRemovalAlg::m_tausSelectionHandle
SysWriteSelectionHandle m_tausSelectionHandle
Definition
OverlapRemovalAlg.h:68
CP::OverlapRemovalAlg::m_muonsHandle
SysCopyHandle< const xAOD::MuonContainer > m_muonsHandle
Definition
OverlapRemovalAlg.h:49
CP::OverlapRemovalAlg::m_overlapTool
ToolHandle< ORUtils::IOverlapRemovalTool > m_overlapTool
The OR toolbox.
Definition
OverlapRemovalAlg.h:40
CP::OverlapRemovalAlg::m_jetsSelectionHandle
SysWriteSelectionHandle m_jetsSelectionHandle
Definition
OverlapRemovalAlg.h:66
CP::OverlapRemovalAlg::m_photonsHandle
SysCopyHandle< const xAOD::PhotonContainer > m_photonsHandle
Definition
OverlapRemovalAlg.h:55
CP::OverlapRemovalAlg::m_overlapRemovalDecoration
Gaudi::Property< std::string > m_overlapRemovalDecoration
the tool output decoration for the overlap removal status
Definition
OverlapRemovalAlg.h:77
CP::OverlapRemovalAlg::m_fatJetsHandle
SysCopyHandle< const xAOD::JetContainer > m_fatJetsHandle
Definition
OverlapRemovalAlg.h:57
CP::OverlapRemovalAlg::m_electronsHandle
SysCopyHandle< const xAOD::ElectronContainer > m_electronsHandle
Definition
OverlapRemovalAlg.h:47
CP::OverlapRemovalAlg::m_jetsHandle
SysCopyHandle< const xAOD::JetContainer > m_jetsHandle
Definition
OverlapRemovalAlg.h:51
CP::OverlapRemovalAlg::m_tausHandle
SysCopyHandle< const xAOD::TauJetContainer > m_tausHandle
Definition
OverlapRemovalAlg.h:53
CP::OverlapRemovalAlg::m_photonsSelectionHandle
SysWriteSelectionHandle m_photonsSelectionHandle
Definition
OverlapRemovalAlg.h:70
CP::OverlapRemovalAlg::m_overlapRemovalAccessor
std::unique_ptr< const SG::Accessor< char > > m_overlapRemovalAccessor
the accessor for m_overlapRemovalDecoration
Definition
OverlapRemovalAlg.h:81
CP::OverlapRemovalAlg::m_electronsSelectionHandle
SysWriteSelectionHandle m_electronsSelectionHandle
the decoration for the overlap removal status
Definition
OverlapRemovalAlg.h:62
CP::OverlapRemovalAlg::m_fatJetsSelectionHandle
SysWriteSelectionHandle m_fatJetsSelectionHandle
Definition
OverlapRemovalAlg.h:72
CP::OverlapRemovalAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition
OverlapRemovalAlg.h:44
CP::OverlapRemovalAlg::m_muonsSelectionHandle
SysWriteSelectionHandle m_muonsSelectionHandle
Definition
OverlapRemovalAlg.h:64
pair
STL class.
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:27
xAOD::PhotonContainer
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
Definition
Event/xAOD/xAODEgamma/xAODEgamma/PhotonContainer.h:17
xAOD::ElectronContainer
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
Definition
Event/xAOD/xAODEgamma/xAODEgamma/ElectronContainer.h:17
xAOD::JetContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Definition
JetContainer.h:17
xAOD::TauJetContainer
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".
Definition
TauJetContainer.h:17
xAOD::MuonContainer
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
Definition
Event/xAOD/xAODMuon/xAODMuon/MuonContainer.h:14
Generated on
for ATLAS Offline Software by
1.17.0