ATLAS Offline Software
Loading...
Searching...
No Matches
IsolationBuilder.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5*/
6
7// IsolationBuilder.h
8// Header file for class IsolationBuilder
10#ifndef ISOLATIONALGS_ISOLATIONBUILDER_H
11#define ISOLATIONALGS_ISOLATIONBUILDER_H 1
12
13// STL includes
14#include <set>
15#include <string>
16#include <utility>
17#include <vector>
18
19// FrameWork includes
22#include "GaudiKernel/ToolHandle.h"
27
31
36
41
43
45{
46
48 // Public methods:
50public:
51 // Copy constructor:
52
54 IsolationBuilder(const std::string& name, ISvcLocator* pSvcLocator);
55
58
59 // Athena algorithm's Hooks
60 virtual StatusCode initialize() override final;
61 virtual StatusCode execute(const EventContext& ctx) const override final;
62 virtual StatusCode finalize() override final;
63
65 // Private data:
70
73 this,
74 "ElectronCollectionContainerName",
75 "Electrons"
76 };
77
78 Gaudi::Property<std::string> m_FwdElectronContainerName{
79 this,
80 "FwdElectronCollectionContainerName",
81 "ForwardElectrons"
82 };
83
84 Gaudi::Property<std::string> m_PhotonContainerName{
85 this,
86 "PhotonCollectionContainerName",
87 "Photons"
88 };
89
90 Gaudi::Property<std::string> m_MuonContainerName{
91 this,
92 "MuonCollectionContainerName",
93 "Muons"
94 };
95
97 ToolHandle<xAOD::ICaloCellIsolationTool> m_cellIsolationTool{
98 this,
99 "CaloCellIsolationTool",
100 "",
101 "Handle of the calo cell IsolationTool"
102 };
103
106 this,
107 "CellCollectionName",
108 "AllCalo",
109 "Name of container which contain calo cells"
110 };
111
113 ToolHandle<xAOD::ICaloTopoClusterIsolationTool> m_topoIsolationTool{
114 this,
115 "CaloTopoIsolationTool",
116 "",
117 "Handle of the calo topo IsolationTool"
118 };
119
121 ToolHandle<xAOD::INeutralEFlowIsolationTool> m_pflowIsolationTool{
122 this,
123 "PFlowIsolationTool",
124 "",
125 "Handle of the pflow IsolationTool"
126 };
127
129 ToolHandle<xAOD::ITrackIsolationTool> m_trackIsolationTool{
130 this,
131 "TrackIsolationTool",
132 "",
133 "Handle of the track IsolationTool"
134 };
135
137 Gaudi::Property<bool> m_isTrigger{ this, "IsTrigger", false };
138
139 // FIXME: need to add the electron bremAssoc stuff
140 Gaudi::Property<bool> m_useBremAssoc{ this,
141 "useBremAssoc",
142 true,
143 "use track to track assoc after brem" };
144
145 Gaudi::Property<bool> m_allTrackRemoval{ this, "AllTrackRemoval", true };
146
147 Gaudi::Property<bool> m_storepileupCorrection{ this, "storepileupCorrection", false };
148
150 Gaudi::Property<std::vector<std::vector<int>>> m_elisoInts{
151 this,
152 "ElIsoTypes",
153 {},
154 "The isolation types to do for electrons: vector of vector of enum type "
155 "Iso::IsolationType"
156 };
157
158 Gaudi::Property<std::vector<std::vector<int>>> m_elcorInts{
159 this,
160 "ElCorTypes",
161 {},
162 "The correction types to do for electron iso: vector of vector of enum "
163 "type Iso::IsolationCalo/TrackCorrection"
164 };
165
166 Gaudi::Property<std::vector<std::vector<int>>> m_elcorIntsExtra{
167 this,
168 "ElCorTypesExtra",
169 {},
170 "The extra correction types to store but not apply for electrons"
171 };
172
175 Gaudi::Property<std::vector<std::vector<int>>> m_phisoInts{
176 this,
177 "PhIsoTypes",
178 {},
179 "The isolation types to do for photons: vector of vector of enum type "
180 "Iso::IsolationType"
181 };
182
183 Gaudi::Property<std::vector<std::vector<int>>> m_phcorInts{
184 this,
185 "PhCorTypes",
186 {},
187 "The correction types to do for photons iso: vector of vector of enum type "
188 "Iso::IsolationCalo/TrackCorrection"
189 };
190
191 Gaudi::Property<std::vector<std::vector<int>>> m_phcorIntsExtra{
192 this,
193 "PhCorTypesExtra",
194 {},
195 "The extra correction types to store but not apply for photons"
196 };
197
198 Gaudi::Property<std::vector<std::vector<int>>> m_muisoInts{
199 this,
200 "MuIsoTypes",
201 {},
202 "The isolation types to do for Muons : vector of vector of enum type "
203 "Iso::IsolationType"
204 };
205
206 Gaudi::Property<std::vector<std::vector<int>>> m_mucorInts{
207 this,
208 "MuCorTypes",
209 {},
210 "The correction types to do for Muon iso: vector of vector of enum type "
211 "Iso::IsolationCalo/TrackCorrection"
212 };
213
214 Gaudi::Property<std::vector<std::vector<int>>> m_mucorIntsExtra{
215 this,
216 "MuCorTypesExtra",
217 {},
218 "The extra correction types to store but not apply for muons"
219 };
220
221 Gaudi::Property<std::vector<std::vector<int>>> m_feisoInts{
222 this,
223 "FeIsoTypes",
224 {},
225 "The isolation types to do for forward electron: vector of vector of enum "
226 "type Iso::IsolationType"
227 };
228
229 Gaudi::Property<std::vector<std::vector<int>>> m_fecorInts{
230 this,
231 "FeCorTypes",
232 {},
233 "The correction types to do for forward electron iso: vector of vector of "
234 "enum type Iso::IsolationCalo/TrackCorrection"
235 };
236
237 Gaudi::Property<std::vector<std::vector<int>>> m_fecorIntsExtra{
238 this,
239 "FeCorTypesExtra",
240 {},
241 "The extra correction types to store but not apply for forward electrons"
242 };
243
245 {
247 CaloIsoHelpKey(IDataHandleHolder* owningAlg);
248
251 void declare(IDataHandleHolder* owningAlg);
252
255
260
265
267 std::vector<xAOD::Iso::IsolationType> isoTypes;
268
271 // xAOD::CaloCorrection CorrListExtra; // should ideally pass this, but not
272 // possible yet
274 };
275
276 std::vector<std::pair<xAOD::Iso::IsolationFlavour, CaloIsoHelpKey>>
278 std::vector<std::pair<xAOD::Iso::IsolationFlavour, CaloIsoHelpKey>>
280 std::vector<std::pair<xAOD::Iso::IsolationFlavour, CaloIsoHelpKey>>
282 std::vector<std::pair<xAOD::Iso::IsolationFlavour, CaloIsoHelpKey>>
284
286 {
288 TrackIsoHelpKey(IDataHandleHolder* owningAlg);
289
292 void declare(IDataHandleHolder* owningAlg);
293
297
302
304 std::vector<xAOD::Iso::IsolationType> isoTypes;
305
308 // xAOD::TrackCorrection CorrListExtra; // should ideally pass this, but not
309 // possible yet
311 };
312
313 std::vector<std::pair<xAOD::Iso::IsolationFlavour, TrackIsoHelpKey>>
315 std::vector<std::pair<xAOD::Iso::IsolationFlavour, TrackIsoHelpKey>>
317 std::vector<std::pair<xAOD::Iso::IsolationFlavour, TrackIsoHelpKey>>
319
321 {
322
324
325 std::vector<SG::WriteDecorHandle<xAOD::IParticleContainer, float>> isoDeco;
330 std::vector<SG::WriteDecorHandle<xAOD::IParticleContainer, float>>>
333 };
334
336 {
337
339
340 std::vector<SG::WriteDecorHandle<xAOD::IParticleContainer, float>> isoDeco;
341 std::vector<SG::WriteDecorHandle<xAOD::IParticleContainer, float>> isoDecoV;
346 };
347
348 // for the time being, only mu vs eg, no separation in eg
349 Gaudi::Property<std::string> m_customConfigEl{
350 this,
351 "CustomConfigurationNameEl",
352 "",
353 "use a custom configuration for electron"
354 };
355
356 Gaudi::Property<std::string> m_customConfigPh{
357 this,
358 "CustomConfigurationNamePh",
359 "",
360 "use a custom configuration for photon"
361 };
362
363 Gaudi::Property<std::string> m_customConfigFwd{
364 this,
365 "CustomConfigurationNameFwd",
366 "",
367 "use a custom configuration for forward electron"
368 };
369
370 Gaudi::Property<std::string> m_customConfigMu{
371 this,
372 "CustomConfigurationNameMu",
373 "",
374 "use a custom configuration for muon"
375 };
376
378
381 StatusCode initializeIso(
382 std::set<xAOD::Iso::IsolationFlavour>& runIsoType, // out
383 std::vector<std::pair<xAOD::Iso::IsolationFlavour, CaloIsoHelpKey>>*
384 caloIsoMap, // out
385 std::vector<std::pair<xAOD::Iso::IsolationFlavour, TrackIsoHelpKey>>*
386 trackIsoMap, // out
387 const std::string& containerName,
388 const std::vector<std::vector<int>>& isoInts,
389 const std::vector<std::vector<int>>& corInts,
390 const std::vector<std::vector<int>>& corIntsExtra,
391 const std::string& customConfig);
392
394 StatusCode addCaloIsoCorrections(size_t flavor,
396 CaloIsoHelpKey& cisoH, // in-out
397 const std::vector<std::vector<int>>& corInts,
398 bool corrsAreExtra,
399 const std::string& prefix,
400 const std::string& customConfig);
401
403 StatusCode addTrackIsoCorrections(
404 size_t flavor,
406 TrackIsoHelpKey& tisoH, // in-out
407 const std::vector<std::vector<int>>& corInts,
408 bool corrsAreExtra,
409 const std::string& prefix,
410 const std::string& customConfig);
411
412 StatusCode executeCaloIso(
413 const std::vector<std::pair<xAOD::Iso::IsolationFlavour, CaloIsoHelpKey>>&
414 caloIsoMap,
415 const CaloCellContainer* cellColl) const;
416
417 StatusCode executeTrackIso(
418 const std::vector<std::pair<xAOD::Iso::IsolationFlavour, TrackIsoHelpKey>>&
419 trackIsoMap) const;
420
421 void declareIso(
422 std::vector<std::pair<xAOD::Iso::IsolationFlavour, CaloIsoHelpKey>>&
423 caloIso);
424 void declareIso(
425 std::vector<std::pair<xAOD::Iso::IsolationFlavour, TrackIsoHelpKey>>&
426 trackIso);
427};
428
429#endif //> !ISOLATIONALGS_ISOLATIONBUILDER_H
Base class for elements of a container that can have aux data.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Handle class for adding a decoration to an object.
An algorithm that can be simultaneously executed in multiple threads.
Container class for CaloCell.
void declareIso(std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > &caloIso)
Gaudi::Property< std::string > m_ElectronContainerName
Containers (Is it best to make them as strings? Used by multiple handles)
StatusCode addTrackIsoCorrections(size_t flavor, xAOD::Iso::IsolationFlavour isoFlav, TrackIsoHelpKey &tisoH, const std::vector< std::vector< int > > &corInts, bool corrsAreExtra, const std::string &prefix, const std::string &customConfig)
called by initializeIso
virtual StatusCode initialize() override final
Gaudi::Property< std::string > m_customConfigFwd
IsolationBuilder()
Default constructor:
virtual ~IsolationBuilder()
Destructor:
Gaudi::Property< std::vector< std::vector< int > > > m_elcorIntsExtra
std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > m_elTrackIso
Gaudi::Property< std::string > m_customConfigPh
Gaudi::Property< std::vector< std::vector< int > > > m_phisoInts
Isolation types (for the alg.
ToolHandle< xAOD::INeutralEFlowIsolationTool > m_pflowIsolationTool
Tool for neutral pflow isolation calculation.
Gaudi::Property< std::string > m_customConfigMu
IsolationBuilder(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > m_muCaloIso
ToolHandle< xAOD::ICaloTopoClusterIsolationTool > m_topoIsolationTool
Tool for topo isolation calculation.
Gaudi::Property< std::vector< std::vector< int > > > m_fecorIntsExtra
Gaudi::Property< bool > m_useBremAssoc
std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > m_phTrackIso
std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > m_feCaloIso
Gaudi::Property< std::vector< std::vector< int > > > m_mucorIntsExtra
Gaudi::Property< std::vector< std::vector< int > > > m_muisoInts
Gaudi::Property< std::vector< std::vector< int > > > m_elisoInts
Isolation types.
std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > m_elCaloIso
StatusCode executeTrackIso(const std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > &trackIsoMap) const
Gaudi::Property< std::vector< std::vector< int > > > m_fecorInts
virtual StatusCode execute(const EventContext &ctx) const override final
StatusCode addCaloIsoCorrections(size_t flavor, xAOD::Iso::IsolationFlavour isoFlav, CaloIsoHelpKey &cisoH, const std::vector< std::vector< int > > &corInts, bool corrsAreExtra, const std::string &prefix, const std::string &customConfig)
called by initializeIso
Gaudi::Property< std::vector< std::vector< int > > > m_mucorInts
Gaudi::Property< std::vector< std::vector< int > > > m_phcorIntsExtra
Gaudi::Property< bool > m_isTrigger
is the alg run at trigger level
Gaudi::Property< std::string > m_FwdElectronContainerName
Gaudi::Property< bool > m_storepileupCorrection
std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > m_muTrackIso
StatusCode initializeIso(std::set< xAOD::Iso::IsolationFlavour > &runIsoType, std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > *caloIsoMap, std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > *trackIsoMap, const std::string &containerName, const std::vector< std::vector< int > > &isoInts, const std::vector< std::vector< int > > &corInts, const std::vector< std::vector< int > > &corIntsExtra, const std::string &customConfig)
called by algorithm initialize per object (electron, photon, forward electron, muon)
ToolHandle< xAOD::ICaloCellIsolationTool > m_cellIsolationTool
Tool for cell isolation calculation.
StatusCode executeCaloIso(const std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > &caloIsoMap, const CaloCellContainer *cellColl) const
Gaudi::Property< std::string > m_MuonContainerName
ToolHandle< xAOD::ITrackIsolationTool > m_trackIsolationTool
Tool for neutral pflow isolation calculation.
Gaudi::Property< std::vector< std::vector< int > > > m_feisoInts
Gaudi::Property< std::string > m_customConfigEl
std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > m_phCaloIso
Gaudi::Property< std::vector< std::vector< int > > > m_elcorInts
SG::ReadHandleKey< CaloCellContainer > m_cellsKey
Cell container.
Gaudi::Property< bool > m_allTrackRemoval
static bool isCoreCor(xAOD::Iso::IsolationCaloCorrection corr)
virtual StatusCode finalize() override final
Gaudi::Property< std::vector< std::vector< int > > > m_phcorInts
Gaudi::Property< std::string > m_PhotonContainerName
Support class for PropertyMgr.
Definition Property.h:23
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Handle class for adding a decoration to an object.
=============================================================================
DecorHandleKeyArray< WriteDecorHandle< T, S >, WriteDecorHandleKey< T >, Gaudi::DataHandle::Writer > WriteDecorHandleKeyArray
STL namespace.
IsolationFlavour
Enumeration for different ways of calculating isolation in xAOD files.
IsolationCaloCorrection
Enumeration for different ways of correcting isolation in xAOD files.
std::map< xAOD::Iso::IsolationCaloCorrection, SG::WriteDecorHandle< xAOD::IParticleContainer, float > > coreCorDeco
std::map< xAOD::Iso::IsolationCaloCorrection, std::vector< SG::WriteDecorHandle< xAOD::IParticleContainer, float > > > noncoreCorDeco
SG::WriteDecorHandle< xAOD::IParticleContainer, uint32_t > corrBitsetDeco
std::vector< SG::WriteDecorHandle< xAOD::IParticleContainer, float > > isoDeco
CaloIsoHelpHandles(const CaloIsoHelpKey &keys)
void declare(IDataHandleHolder *owningAlg)
only to be called after placed in the final location, to propagate dependencies
xAOD::CaloCorrection CorrList
to keep track of the corrections
SG::WriteDecorHandleKeyArray< xAOD::IParticleContainer > isoDeco
The actual isolations.
std::map< xAOD::Iso::IsolationCaloCorrection, SG::WriteDecorHandleKey< xAOD::IParticleContainer > > coreCorDeco
The corrections (one per flavor)
std::vector< xAOD::Iso::IsolationType > isoTypes
the types of isolations to calculate
CaloIsoHelpKey(IDataHandleHolder *owningAlg)
constructor
SG::WriteDecorHandleKey< xAOD::IParticleContainer > corrBitsetDeco
std::map< xAOD::Iso::IsolationCaloCorrection, SG::WriteDecorHandleKeyArray< xAOD::IParticleContainer > > noncoreCorDeco
The corrections (one per flavor/type combination)
std::vector< SG::WriteDecorHandle< xAOD::IParticleContainer, float > > isoDecoV
std::map< xAOD::Iso::IsolationTrackCorrection, SG::WriteDecorHandle< xAOD::IParticleContainer, float > > coreCorDeco
TrackIsoHelpHandles(const TrackIsoHelpKey &keys)
SG::WriteDecorHandle< xAOD::IParticleContainer, uint32_t > corrBitsetDeco
std::vector< SG::WriteDecorHandle< xAOD::IParticleContainer, float > > isoDeco
std::vector< xAOD::Iso::IsolationType > isoTypes
the types of isolations to calculate
void declare(IDataHandleHolder *owningAlg)
only to be called after placed in the final location, to propagate dependencies
SG::WriteDecorHandleKeyArray< xAOD::IParticleContainer > isoDecoV
SG::WriteDecorHandleKeyArray< xAOD::IParticleContainer > isoDeco
The actual isolations.
std::map< xAOD::Iso::IsolationTrackCorrection, SG::WriteDecorHandleKey< xAOD::IParticleContainer > > coreCorDeco
The corrections.
TrackIsoHelpKey(IDataHandleHolder *owningAlg)
constructor
SG::WriteDecorHandleKey< xAOD::IParticleContainer > corrBitsetDeco
xAOD::TrackCorrection CorrList
to keep track of the corrections
#define private