ATLAS Offline Software
Loading...
Searching...
No Matches
SystObjectUnioniserAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
4 SystObjectUnioniserAlg:
5 This alg takes a set of systematic variation containers which have
6 been filtered, then using the links set by SystObjectLinkerAlg
7 constructs new containers holding the objects that are in any
8 of the filtered variation containers.
9
10 This is templated to support recording the union containers as
11 the concrete type, not least because xAOD::IParticleContainer has
12 no CollectionProxy to support writing with AsgxAODNTupleMakerAlg.
13
14*/
15
17
18
19// Always protect against multiple includes!
20#ifndef CP_SYSTUNIONISERALG
21#define CP_SYSTUNIONISERALG
22
23#include <vector>
24#include <unordered_map>
25#include <utility>
26#include <memory>
27
34#ifdef XAOD_STANDALONE
36#endif
37
41#include <xAODJet/Jet.h>
43#include <xAODEgamma/Electron.h>
45#include <xAODEgamma/Photon.h>
47#include <xAODMuon/Muon.h>
49#include <xAODTau/TauJet.h>
51#include <xAODTau/DiTauJet.h>
53
54class EventContext;
55
56namespace CP
57{
59
60 // We need separate template parameters for the object type
61 // and container, as DataVector<xAOD::Blah_v1> does not have
62 // a classID, where BlahContainer does.
63 template<class T, class C>
65 {
67public:
69
72 StatusCode initialize() override;
74 StatusCode execute(const EventContext& ctx) const override;
76
77private:
78
79 // Members for configurable properties
80
83
86 m_inputHandle{ this, "input", "", "Container to read" };
87
90 m_outputHandle{this, "output", "", "Collection holding all objects passing any systematic"};
91
93 Gaudi::Property<std::string> m_syst_decor_pattern
94 { this, "systVarLink_template", "systVarLink_%SYS%", "Pattern to be substituted with systematics names"};
95
97 std::unordered_map<size_t,SG::ConstAccessor<iplink_t> >
99 };
100
101 // Define the following classes concretely for source code configuration.
108
109 // Trivial subclassing for more convenient python configuration
110 // Otherwise genConf creates a horribly mangled templated name
111 // even if typedef'ed
113 {
114 public:
115 SystJetUnioniserAlg(const std::string &name,ISvcLocator *pSvcLocator)
116 : SystObjectUnioniserAlg<xAOD::Jet,xAOD::JetContainer>(name, pSvcLocator) {};
117 };
118
120 {
121 public:
122 SystElectronUnioniserAlg(const std::string &name,ISvcLocator *pSvcLocator)
124 };
125
127 {
128 public:
129 SystPhotonUnioniserAlg(const std::string &name,ISvcLocator *pSvcLocator)
131 };
132
134 {
135 public:
136 SystMuonUnioniserAlg(const std::string &name,ISvcLocator *pSvcLocator)
138 };
139
141 {
142 public:
143 SystTauUnioniserAlg(const std::string &name,ISvcLocator *pSvcLocator)
145 };
146
148 {
149 public:
150 SystDiTauUnioniserAlg(const std::string &name,ISvcLocator *pSvcLocator)
152 };
153
154}
155
157
158#endif
DataVector adapter that acts like it holds const pointers.
An STL vector of pointers that by default owns its pointed-to elements.
a class managing the property to configure the list of systematics to process
a data handle for reading systematics varied input data
a data handle for writing systematics varied input data
SystDiTauUnioniserAlg(const std::string &name, ISvcLocator *pSvcLocator)
SystElectronUnioniserAlg(const std::string &name, ISvcLocator *pSvcLocator)
SystJetUnioniserAlg(const std::string &name, ISvcLocator *pSvcLocator)
SystMuonUnioniserAlg(const std::string &name, ISvcLocator *pSvcLocator)
CP::SysListHandle m_systematicsList
We use default finalize() – this is for cleanup, and we don't do any.
StatusCode initialize() override
Initialisation method, for setting up tools and other persistent configs.
StatusCode execute(const EventContext &ctx) const override
Execute method, for actions to be taken in the event loop.
CP::SysWriteHandle< ConstDataVector< C > > m_outputHandle
Setup syst-aware output container handles, templated to generate appropriate type.
Gaudi::Property< std::string > m_syst_decor_pattern
The systematics link decoration name template.
CP::SysReadHandle< C > m_inputHandle
Setup syst-aware input container handles.
std::unordered_map< size_t, SG::ConstAccessor< iplink_t > > m_syst_link_acc
Build a map of syst hash to ConstAccessors to read the systematics links.
SystPhotonUnioniserAlg(const std::string &name, ISvcLocator *pSvcLocator)
SystTauUnioniserAlg(const std::string &name, ISvcLocator *pSvcLocator)
the base class for EventLoop reentrant algorithms
AnaReentrantAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Select isolated Photons, Electrons and Muons.
ElementLink< xAOD::IParticleContainer > iplink_t
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Jet_v1 Jet
Definition of the current "jet version".
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
DiTauJetContainer_v1 DiTauJetContainer
Definition of the current DiTauJet container version.
TauJet_v3 TauJet
Definition of the current "tau version".
Photon_v1 Photon
Definition of the current "egamma version".
DiTauJet_v1 DiTauJet
Definition of the current version.
Definition DiTauJet.h:17
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".
Electron_v1 Electron
Definition of the current "egamma version".