ATLAS Offline Software
Loading...
Searching...
No Matches
egammaTruthAssociationAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef EGAMMAALGS_EGAMMATRUTHASSOCIATIONALG_H
6#define EGAMMAALGS_EGAMMATRUTHASSOCIATIONALG_H
7
9#include "GaudiKernel/EventContext.h"
10#include "GaudiKernel/ToolHandle.h"
14
21
23
29
30#include <string>
31
39
41{
42
43public:
44
46 egammaTruthAssociationAlg(const std::string& name, ISvcLocator* pSvcLocator);
47
49 virtual ~egammaTruthAssociationAlg() = default;
50
52 virtual StatusCode initialize() override final;
54 virtual StatusCode finalize() override final;
55
57 virtual StatusCode execute(const EventContext& ctx) const override final;
58
66
69 template<class T>
71 const std::string& name);
72
74 template<class T>
76 {
78 const EventContext& ctx); // constructor
79
83
84 // any of the handles should function as a read handle, choice is arbitrary
86 };
87
91 template<class T, class L>
92 StatusCode match(const EventContext& ctx,
93 const xAOD::TruthParticleContainer& truthParticles,
95 const SG::AuxElement::Accessor<L>& linkAccess,
96 xAOD::TruthParticleContainer* egammaTruthContainer) const;
97
101 template<class T>
102 MCTruthInfo_t particleTruthClassifier(const EventContext& ctx,
103 const T*) const;
104
108 const EventContext& ctx,
109 xAOD::TruthParticleContainer& egammaTruthContainer,
110 const xAOD::TruthParticle* truth,
111 const xAOD::TruthParticleContainer* oldContainer) const;
112
115 bool isPromptEgammaParticle(const EventContext& ctx,
116 const xAOD::TruthParticle* truth) const;
117
119 Gaudi::Property<bool> m_doEgammaTruthContainer{
120 this,
121 "CreateEgammaTruthContainer",
122 true,
123 "Create egammaTruthContainer?"
124 };
125
127 Gaudi::Property<bool> m_matchElectrons{ this,
128 "MatchElectrons",
129 true,
130 "Match (central) electrons?" };
131
133 Gaudi::Property<bool> m_matchPhotons{ this,
134 "MatchPhotons",
135 true,
136 "Match photons?" };
137
139 Gaudi::Property<bool> m_matchForwardElectrons{ this,
140 "MatchForwardElectrons",
141 true,
142 "Match forward electrons?" };
143
145 Gaudi::Property<bool> m_matchClusters{ this,
146 "MatchClusters",
147 false,
148 "Match clusters?" };
149
152 this,
153 "DoNotSet_ClusterContainerName",
154 {},
155 "Do not set; configuration via the string property"
156 };
157
160 Gaudi::Property<std::string> m_clusterDecName{
161 this,
162 "ClusterContainerName",
163 "",
164 "Name of the egamma cluster container"
165 };
166
169 this,
170 "DoNotSet_ElectronContainerName",
171 {},
172 "Do not set; configuration via the string property"
173 };
174
177 Gaudi::Property<std::string> m_electronDecName{
178 this,
179 "ElectronContainerName",
180 "",
181 "Name of the input electron container"
182 };
183
186 this,
187 "DoNotSet_FwdElectronContainerName",
188 {},
189 "Do not set; configuration via the string property"
190 };
191
194 Gaudi::Property<std::string> m_fwdElectronDecName{
195 this,
196 "FwdElectronContainerName",
197 "",
198 "Name of the input fwd electron container"
199 };
200
203 this,
204 "DoNotSet_PhotonContainerName",
205 {},
206 "Do not set; configuration via the string property"
207 };
208
211 Gaudi::Property<std::string> m_photonDecName{
212 this,
213 "PhotonContainerName",
214 "",
215 "Name of the input photon container"
216 };
217
220 this,
221 "TruthEventContainerName",
222 "",
223 "Name of the truth event container"
224 };
225
228 this,
229 "TruthParticleContainerName",
230 "",
231 "Name of the truth particle container"
232 };
233
237 this,
238 "EgammaTruthContainerName",
239 "",
240 "Name of the output egamma truth particle container"
241 };
242
244 Gaudi::Property<float> m_minPt{
245 this,
246 "MinPtEgammaTruth",
247 10,
248 "Minimum Pt to enter egamma truth particle container"
249 };
250
252 Gaudi::Property<float> m_minPtFSR{
253 this,
254 "MinPtEgammaTruthFSR",
255 1e3,
256 "Minimum Pt for FSR to enter egamma truth particle container"
257 };
258
260 Gaudi::Property<bool> m_UPCmode{
261 this,
262 "UPCmode",
263 false,
264 "Allow electron from photon in egamma truth particle container"
265 };
266
267
269 ToolHandle<IMCTruthClassifier> m_mcTruthClassifier{
270 this,
271 "MCTruthClassifier",
272 "EMMCTruthClassifier",
273 "Handle of MCTruthClassifier"
274 };
275};
276
277#endif // EGAMMAALGS_EGAMMATRUTHASSOCIATIONALG_H
Property holding a SG store/key/clid from which a ReadHandle is made.
Handle class for reading from StoreGate.
Handle class for adding a decoration to an object.
Property holding a SG store/key/clid from which a WriteHandle is made.
An algorithm that can be simultaneously executed in multiple threads.
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
Property holding a SG store/key/clid from which a ReadHandle is made.
Handle class for adding a decoration to an object.
Property holding a SG store/key/clid from which a WriteHandle is made.
Gaudi::Property< bool > m_doEgammaTruthContainer
Create egamma truth container?
virtual ~egammaTruthAssociationAlg()=default
destructor
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerKey
Name of the truth particle container.
Gaudi::Property< std::string > m_electronDecName
The electron container name property used to initialize the WriteDecorHandleKeyArray.
Gaudi::Property< bool > m_matchElectrons
Match electrons?
SG::WriteDecorHandleKeyArray< xAOD::ElectronContainer > m_fwdElectronDecKeys
The fwd electron container decor handle key array.
SG::WriteDecorHandleKeyArray< xAOD::PhotonContainer > m_photonDecKeys
The photon container decor handle key array.
StatusCode initializeDecorKeys(SG::WriteDecorHandleKeyArray< T > &keys, const std::string &name)
A function that initializes the decor handles, but also checks the naming convention.
Gaudi::Property< bool > m_matchClusters
Match clusters?
StatusCode match(const EventContext &ctx, const xAOD::TruthParticleContainer &truthParticles, const SG::WriteDecorHandleKeyArray< T > &hkeys, const SG::AuxElement::Accessor< L > &linkAccess, xAOD::TruthParticleContainer *egammaTruthContainer) const
Loop over elements in the reco container, decorate them with truth info and decorate the truth partic...
Gaudi::Property< bool > m_matchPhotons
Match photons?
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_egammaTruthParticleContainerKey
Name of the output egamma truth container.
virtual StatusCode execute(const EventContext &ctx) const override final
execute on container
SG::WriteDecorHandleKeyArray< xAOD::ElectronContainer > m_electronDecKeys
The electron container decor handle key array.
Gaudi::Property< std::string > m_photonDecName
The photon container name property used to initialize the WriteDecorHandleKeyArray.
void getNewTruthParticle(const EventContext &ctx, xAOD::TruthParticleContainer &egammaTruthContainer, const xAOD::TruthParticle *truth, const xAOD::TruthParticleContainer *oldContainer) const
Create a copy a truth particle, add it to the new getNewTruthParticle container and decorate it with ...
Gaudi::Property< float > m_minPt
Minimum Pt to enter egamma truth particle container.
Gaudi::Property< std::string > m_fwdElectronDecName
The fwd electron name property used to initialize the WriteDecorHandleKeyArray.
bool isPromptEgammaParticle(const EventContext &ctx, const xAOD::TruthParticle *truth) const
Return true if the truth particle is a prompt electron or photon.
Gaudi::Property< bool > m_matchForwardElectrons
Match fwd electrons?
Gaudi::Property< float > m_minPtFSR
Minimum Pt for FSR to enter egamma truth particle container.
Gaudi::Property< std::string > m_clusterDecName
The egamma cluster name property used to initialize the WriteDecorHandleKeyArray.
MCTruthInfo_t particleTruthClassifier(const EventContext &ctx, const T *) const
return the result of MCTruthClassifier::particleTruthClassifier or do a second pass for electrons bas...
SG::WriteDecorHandleKeyArray< xAOD::CaloClusterContainer > m_clusterDecKeys
The egamma cluster decor handle key array.
egammaTruthAssociationAlg(const std::string &name, ISvcLocator *pSvcLocator)
constructor
Gaudi::Property< bool > m_UPCmode
Allow electron from photon in egamma truth particle container.
ToolHandle< IMCTruthClassifier > m_mcTruthClassifier
MCTruthClassifier.
virtual StatusCode finalize() override final
finalize method
virtual StatusCode initialize() override final
initialize method
SG::ReadHandleKey< xAOD::TruthEventContainer > m_truthEventContainerKey
Name of the truth event container.
DecorHandleKeyArray< WriteDecorHandle< T, S >, WriteDecorHandleKey< T >, Gaudi::DataHandle::Writer > WriteDecorHandleKeyArray
TruthParticle_v1 TruthParticle
Typedef to implementation.
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.
MCTruthPartClassifier::ParticleType first
MCTruthPartClassifier::ParticleOrigin second
writeDecorHandles(const SG::WriteDecorHandleKeyArray< T > &keys, const EventContext &ctx)
SG::WriteDecorHandle< T, ElementLink< xAOD::TruthParticleContainer > > el
#define private