ATLAS Offline Software
Loading...
Searching...
No Matches
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
13
14//
15// method implementations
16//
17
18namespace CP
19{
20
21 StatusCode OverlapRemovalAlg ::
22 initialize ()
23 {
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());
45 ANA_CHECK (m_systematicsList.initialize());
46 return StatusCode::SUCCESS;
47 }
48
49
50
51 StatusCode OverlapRemovalAlg ::
52 execute ()
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};
60 {
61 ANA_CHECK (m_electronsHandle.getCopy (electrons, sys));
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));
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));
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));
84 decorationsMap.emplace(taus, &m_tausSelectionHandle);
85 }
86 const xAOD::PhotonContainer *photons {nullptr};
88 {
89 ANA_CHECK (m_photonsHandle.getCopy (photons, sys));
91 decorationsMap.emplace(photons, &m_photonsSelectionHandle);
92 }
93 const xAOD::JetContainer *fatJets {nullptr};
95 {
96 ANA_CHECK (m_fatJetsHandle.getCopy (fatJets, sys));
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
static Double_t taus
SysWriteSelectionHandle m_tausSelectionHandle
SysCopyHandle< const xAOD::MuonContainer > m_muonsHandle
ToolHandle< ORUtils::IOverlapRemovalTool > m_overlapTool
The OR toolbox.
SysWriteSelectionHandle m_jetsSelectionHandle
SysCopyHandle< const xAOD::PhotonContainer > m_photonsHandle
Gaudi::Property< std::string > m_overlapRemovalDecoration
the tool output decoration for the overlap removal status
SysCopyHandle< const xAOD::JetContainer > m_fatJetsHandle
SysCopyHandle< const xAOD::ElectronContainer > m_electronsHandle
SysCopyHandle< const xAOD::JetContainer > m_jetsHandle
SysCopyHandle< const xAOD::TauJetContainer > m_tausHandle
SysWriteSelectionHandle m_photonsSelectionHandle
std::unique_ptr< const SG::Accessor< char > > m_overlapRemovalAccessor
the accessor for m_overlapRemovalDecoration
SysWriteSelectionHandle m_electronsSelectionHandle
the decoration for the overlap removal status
SysWriteSelectionHandle m_fatJetsSelectionHandle
SysListHandle m_systematicsList
the systematics list we run
SysWriteSelectionHandle m_muonsSelectionHandle
STL class.
Class providing the definition of the 4-vector interface.
Select isolated Photons, Electrons and Muons.
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".