ATLAS Offline Software
egammaTruthAssociationAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "StoreGate/ReadHandle.h"
14 
16 
17 #include <memory>
18 
19 namespace {
23 xAOD::TruthParticle* getEgammaTruthParticle(
24  const xAOD::TruthParticle* truth,
25  xAOD::TruthParticleContainer& egammaTruthContainer) {
26  if (!truth) {
27  return nullptr;
28  }
29  // Find the original truth particle for electrons from conversions
30  for (unsigned int i = 0;
31  i < 100 && truth && HepMC::is_simulation_particle(truth); ++i) {
32  if (truth->prodVtx() && truth->prodVtx()->nIncomingParticles()) {
33  truth = truth->prodVtx()->incomingParticle(0);
34  } else {
35  break;
36  }
37  }
38 
39  // In case truth became null in the above loop
40  if (!truth) {
41  return nullptr;
42  }
43  for (auto egammaTruth : egammaTruthContainer) {
44  if (HepMC::uniqueID(truth) == HepMC::uniqueID(*egammaTruth)) {
45  return egammaTruth;
46  }
47  }
48  return nullptr;
49 }
50 } // namespace
51 
56 
58  ISvcLocator* pSvcLocator)
59  : AthReentrantAlgorithm(name, pSvcLocator)
60 {}
61 
64 {
65 
66  ATH_MSG_DEBUG("Initializing " << name() << "...");
67 
68  // initialize the data handles
70  ATH_CHECK(
73 
74  // Now the standard decoration handles
75  if (m_matchElectrons) {
77  } else {
78  m_electronDecKeys.clear();
79  }
80 
81  if (m_matchPhotons) {
83  } else {
84  m_photonDecKeys.clear();
85  }
86 
87  if (m_matchClusters) {
89  } else {
90  m_clusterDecKeys.clear();
91  }
92 
95  } else {
96  m_fwdElectronDecKeys.clear();
97  }
98 
99  CHECK(m_mcTruthClassifier.retrieve());
100  ATH_MSG_DEBUG("Retrieved tool " << m_mcTruthClassifier);
101  ATH_MSG_DEBUG("Initialization successful");
102  return StatusCode::SUCCESS;
103 }
104 
107 {
108  return StatusCode::SUCCESS;
109 }
110 
112 egammaTruthAssociationAlg::execute(const EventContext& ctx) const
113 {
114 
116 
118 
119  egammaTruthContainer = SG::WriteHandle<xAOD::TruthParticleContainer>(
121  ATH_CHECK(egammaTruthContainer.record(
122  std::make_unique<xAOD::TruthParticleContainer>(),
123  std::make_unique<xAOD::TruthParticleAuxContainer>()));
124 
125  // Add a copy of electrons and photons to the truth egamma container
128 
129  // only for serial running. Can remove check later
130  if (!truthEvtContainer.isValid() || truthEvtContainer->empty()) {
131  ATH_MSG_WARNING("Could not retrieve "
132  << m_truthEventContainerKey.key()
133  << " or container empty, returning");
134  return StatusCode::SUCCESS;
135  }
136 
137  for (const auto& truthParticleLink :
138  truthEvtContainer->front()->truthParticleLinks()) {
139  if (!truthParticleLink.isValid())
140  continue;
141  const xAOD::TruthParticle* truthParticle = *truthParticleLink;
142  if (!isPromptEgammaParticle(ctx, truthParticle))
143  continue;
145  *egammaTruthContainer,
146  truthParticle,
147  truthParticleLink.getDataPtr());
148  }
149  }
150  // Decorate containers with truth info, including links to truth particles
151  // Decorate the truth particles with links to the reco ones
152 
153  // note that in multithreading this must be valid; can't just fail with
154  // success.
157 
158  // accessors
159  static const SG::AuxElement::Accessor<ClusterLink_t> accClusLink(
160  "recoClusterLink");
161  static const SG::AuxElement::Accessor<ElectronLink_t> accElLink(
162  "recoElectronLink");
163  static const SG::AuxElement::Accessor<PhotonLink_t> accPhLink(
164  "recoPhotonLink");
165 
166  if (m_matchElectrons) {
167  ATH_MSG_DEBUG("About to match electrons");
168  ATH_CHECK(match(ctx,
169  *truthParticles,
171  accElLink,
172  egammaTruthContainer.ptr()));
173  }
174 
175  if (m_matchPhotons) {
176  ATH_MSG_DEBUG("About to match photons");
177  ATH_CHECK(match(ctx,
178  *truthParticles,
180  accPhLink,
181  egammaTruthContainer.ptr()));
182  }
183 
184  if (m_matchClusters) {
185  ATH_MSG_DEBUG("About to match clusters");
186  ATH_CHECK(match(ctx,
187  *truthParticles,
189  accClusLink,
190  egammaTruthContainer.ptr()));
191  }
192 
194  ATH_MSG_DEBUG("About to match fwd electrons");
195  ATH_CHECK(match(ctx,
196  *truthParticles,
198  accElLink,
199  egammaTruthContainer.ptr()));
200  }
201 
202  return StatusCode::SUCCESS;
203 }
204 
205 bool
207  const EventContext& ctx,
208  const xAOD::TruthParticle* truth) const
209 {
210 
211  if ((truth->pdgId() != 22 && abs(truth->pdgId()) != 11) ||
212  MC::isDecayed(truth) || truth->status() == 3 ||
213  HepMC::is_simulation_particle(truth) || truth->pt() < m_minPt) {
214  return false;
215  }
216  MCTruthPartClassifier::Info mcinfo(ctx);
217  auto type = m_mcTruthClassifier->particleTruthClassifier(truth, &mcinfo);
218 
219  // Isolated electron or photon
220  if (type.first == MCTruthPartClassifier::IsoElectron ||
222  return true;
223  }
224 
225  // FSR photon
228  truth->pt() > m_minPtFSR) {
229  return true;
230  }
231 
232  return false;
233 }
234 
235 void
237  const EventContext& ctx,
238  xAOD::TruthParticleContainer& egammaTruthContainer,
239  const xAOD::TruthParticle* truth,
240  const xAOD::TruthParticleContainer* oldContainer) const
241 {
242  auto *truthParticle = egammaTruthContainer.push_back(std::make_unique<xAOD::TruthParticle>());
243  truthParticle->setPdgId(truth->pdgId());
244  truthParticle->setBarcode(HepMC::barcode(truth)); // FIXME barcode-based
245  truthParticle->setStatus(truth->status());
246  truthParticle->setPx(truth->px());
247  truthParticle->setPy(truth->py());
248  truthParticle->setPz(truth->pz());
249  truthParticle->setE(truth->e());
250  truthParticle->setM(truth->m());
251  truthParticle->setProdVtxLink(truth->prodVtxLink());
252  truthParticle->setDecayVtxLink(truth->decayVtxLink());
253 
254  static const SG::AuxElement::Accessor<ClusterLink_t> accClusLink(
255  "recoClusterLink");
256  static const SG::AuxElement::Accessor<ElectronLink_t> accElLink(
257  "recoElectronLink");
258  static const SG::AuxElement::Accessor<PhotonLink_t> accPhLink(
259  "recoPhotonLink");
260  static const SG::AuxElement::Accessor<TruthLink_t> accTruthLink(
261  "truthParticleLink");
262  static const SG::AuxElement::Accessor<int> accType("truthType");
263  static const SG::AuxElement::Accessor<int> accOrigin("truthOrigin");
264 
265  if (m_matchClusters) {
266  accClusLink(*truthParticle) = ClusterLink_t();
267  }
268  accElLink(*truthParticle) = ElectronLink_t();
269  accPhLink(*truthParticle) = PhotonLink_t();
270  accTruthLink(*truthParticle) = TruthLink_t(truth, *oldContainer, ctx);
271  accTruthLink(*truthParticle).toPersistent();
272  // MCTruthClassifier info
273  MCTruthPartClassifier::Info mcinfo(ctx);
274  auto info = m_mcTruthClassifier->particleTruthClassifier(truth, &mcinfo);
275  accType(*truthParticle) = static_cast<int>(info.first);
276  accOrigin(*truthParticle) = static_cast<int>(info.second);
277 }
278 
280 template<class T>
284  const std::string& name)
285 {
286  if (!keys.empty()) {
287  ATH_MSG_FATAL("The WriteDecorHandle should not be configured directly.");
288  return StatusCode::FAILURE;
289  }
290 
291  keys.emplace_back(name + ".truthParticleLink");
292  keys.emplace_back(name + ".truthType");
293  keys.emplace_back(name + ".truthOrigin");
294  ATH_CHECK(keys.initialize());
295  return StatusCode::SUCCESS;
296 }
297 
298 // constructor
299 template<class T>
301  const SG::WriteDecorHandleKeyArray<T>& hkeys,
302  const EventContext& ctx)
303  : el(hkeys.at(0), ctx)
304  , type(hkeys.at(1), ctx)
305  , origin(hkeys.at(2), ctx)
306 {}
307 
308 template<class T>
311  const EventContext& ctx,
312  const T* particle) const
313 {
315  MCTruthPartClassifier::Info mcinfo(ctx);
316  auto ret = m_mcTruthClassifier->particleTruthClassifier(particle, &mcinfo);
317  info.genPart = mcinfo.genPart;
318  info.first = ret.first;
319  info.second = ret.second;
320  return info;
321 }
322 
325 template<>
327 egammaTruthAssociationAlg::particleTruthClassifier<xAOD::Electron>(
328  const EventContext& ctx,
329  const xAOD::Electron* electron) const
330 {
331  MCTruthInfo_t info{};
332  MCTruthPartClassifier::Info mcinfo(ctx);
333  auto ret = m_mcTruthClassifier->particleTruthClassifier(electron, &mcinfo);
334  if (ret.first == MCTruthPartClassifier::Unknown &&
336  electron->caloCluster()) {
337  ATH_MSG_DEBUG("Trying cluster-based truth classification for electron");
338  ret = m_mcTruthClassifier->particleTruthClassifier(electron->caloCluster(),
339  &mcinfo);
340  }
341  info.genPart = mcinfo.genPart;
342  info.first = ret.first;
343  info.second = ret.second;
344  return info;
345 }
346 
347 template<class T, class L>
350  const EventContext& ctx,
351  const xAOD::TruthParticleContainer& truthParticles,
352  const SG::WriteDecorHandleKeyArray<T>& hkeys,
353  const SG::AuxElement::Accessor<L>& linkAccess,
354  xAOD::TruthParticleContainer* egammaTruthContainer) const
355 {
356 
357  writeDecorHandles<T> decoHandles(hkeys, ctx);
358 
359 
360  for (auto particle : *decoHandles.readHandle()) {
361 
364 
365  const xAOD::TruthParticle* truthParticle = info.genPart;
366  if (truthParticle) {
368  truthParticle, truthParticles, ctx);
370  "Decorating object with link to truth, index = " << link.index());
371  decoHandles.el(*particle) = link;
372  } else {
374  }
375  decoHandles.el(*particle).toPersistent();
376  ATH_MSG_DEBUG("truthType = " << info.first
377  << " truthOrigin = " << info.second);
378  decoHandles.type(*particle) = static_cast<int>(info.first);
379  decoHandles.origin(*particle) = static_cast<int>(info.second);
380 
381  // Decorate the corresponding truth particle with the link to the reco
383  if (!egammaTruthContainer) {
384  ATH_MSG_ERROR("The egammaTruthContainer needs to be valid");
385  return StatusCode::FAILURE;
386  }
387  const xAOD::TruthParticle* truth =
389  if (truth) {
390  xAOD::TruthParticle* truthEgamma =
391  getEgammaTruthParticle(truth, *egammaTruthContainer);
392  if (truthEgamma) {
393  // we found a truthEgamma object we should annotate if this is the
394  // best link
395  bool annotateLink = true; // by default we annotate
396  const auto link = linkAccess(*truthEgamma); // what already exists
397  if (link.isValid()) {
398  auto oldPart = *link;
399  if (oldPart && truthEgamma->e() > 0 &&
400  std::abs(oldPart->e() / truthEgamma->e() - 1) <
401  std::abs(particle->e() / truthEgamma->e() - 1)) {
402  ATH_MSG_DEBUG(truthEgamma
403  << ": "
404  << " already set to a better matched particle: "
405  << particle);
406  annotateLink = false;
407  }
408  }
409 
410  if (annotateLink) {
411  L link(particle, *decoHandles.readHandle(), ctx);
412  linkAccess(*truthEgamma) = link;
413  linkAccess(*truthEgamma).toPersistent();
414  }
415  }
416  }
417  }
418  }
419  return StatusCode::SUCCESS;
420 }
grepfile.info
info
Definition: grepfile.py:38
IsoPhoton
@ IsoPhoton
Definition: TruthClasses.h:23
egammaTruthAssociationAlg.h
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
egammaTruthAssociationAlg::particleTruthClassifier
MCTruthInfo_t particleTruthClassifier(const EventContext &ctx, const T *) const
return the result of MCTruthClassifier::particleTruthClassifier or do a second pass for electrons bas...
Definition: egammaTruthAssociationAlg.cxx:310
ElectronLink_t
ElementLink< xAOD::ElectronContainer > ElectronLink_t
Definition: egammaTruthAssociationAlg.cxx:54
egammaTruthAssociationAlg::m_egammaTruthParticleContainerKey
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_egammaTruthParticleContainerKey
Name of the output egamma truth container.
Definition: egammaTruthAssociationAlg.h:236
xAOD::TruthParticle_v1::pz
float pz() const
The z component of the particle's momentum.
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
NonIsoPhoton
@ NonIsoPhoton
Definition: TruthClasses.h:24
egammaTruthAssociationAlg::getNewTruthParticle
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 ...
Definition: egammaTruthAssociationAlg.cxx:236
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
PhotonLink_t
ElementLink< xAOD::PhotonContainer > PhotonLink_t
Definition: egammaTruthAssociationAlg.cxx:55
egammaTruthAssociationAlg::m_matchClusters
Gaudi::Property< bool > m_matchClusters
Match clusters?
Definition: egammaTruthAssociationAlg.h:145
xAOD::TruthParticle_v1::px
float px() const
The x component of the particle's momentum.
egammaTruthAssociationAlg::match
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...
Definition: egammaTruthAssociationAlg.cxx:349
egammaTruthAssociationAlg::m_minPtFSR
Gaudi::Property< float > m_minPtFSR
Minimum Pt for FSR to enter egamma truth particle container.
Definition: egammaTruthAssociationAlg.h:252
egammaTruthAssociationAlg::m_matchPhotons
Gaudi::Property< bool > m_matchPhotons
Match photons?
Definition: egammaTruthAssociationAlg.h:133
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
xAOD::TruthParticle_v1::py
float py() const
The y component of the particle's momentum.
egammaTruthAssociationAlg::writeDecorHandles::writeDecorHandles
writeDecorHandles(const SG::WriteDecorHandleKeyArray< T > &keys, const EventContext &ctx)
Definition: egammaTruthAssociationAlg.cxx:300
egammaTruthAssociationAlg::MCTruthInfo_t
Definition: egammaTruthAssociationAlg.h:61
egammaTruthAssociationAlg::m_electronDecKeys
SG::WriteDecorHandleKeyArray< xAOD::ElectronContainer > m_electronDecKeys
The electron container decor handle key array.
Definition: egammaTruthAssociationAlg.h:168
egammaTruthAssociationAlg::m_truthEventContainerKey
SG::ReadHandleKey< xAOD::TruthEventContainer > m_truthEventContainerKey
Name of the truth event container.
Definition: egammaTruthAssociationAlg.h:219
xAODTruthHelpers.h
egammaTruthAssociationAlg::m_matchElectrons
Gaudi::Property< bool > m_matchElectrons
Match electrons?
Definition: egammaTruthAssociationAlg.h:127
egammaTruthAssociationAlg::writeDecorHandles::type
SG::WriteDecorHandle< T, int > type
Definition: egammaTruthAssociationAlg.h:81
egammaTruthAssociationAlg::m_fwdElectronDecKeys
SG::WriteDecorHandleKeyArray< xAOD::ElectronContainer > m_fwdElectronDecKeys
The fwd electron container decor handle key array.
Definition: egammaTruthAssociationAlg.h:185
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
FSRPhot
@ FSRPhot
Definition: TruthClasses.h:96
egammaTruthAssociationAlg::m_fwdElectronDecName
Gaudi::Property< std::string > m_fwdElectronDecName
The fwd electron name property used to initialize the WriteDecorHandleKeyArray.
Definition: egammaTruthAssociationAlg.h:194
egammaTruthAssociationAlg::m_clusterDecName
Gaudi::Property< std::string > m_clusterDecName
The egamma cluster name property used to initialize the WriteDecorHandleKeyArray.
Definition: egammaTruthAssociationAlg.h:160
egammaTruthAssociationAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
execute on container
Definition: egammaTruthAssociationAlg.cxx:112
egammaTruthAssociationAlg::initialize
virtual StatusCode initialize() override final
initialize method
Definition: egammaTruthAssociationAlg.cxx:63
WriteHandle.h
Handle class for recording to StoreGate.
EgammaxAODHelpers.h
egammaTruthAssociationAlg::m_truthParticleContainerKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerKey
Name of the truth particle container.
Definition: egammaTruthAssociationAlg.h:227
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::TruthParticle_v1::e
virtual double e() const override final
The total energy of the particle.
xAOD::TruthParticle_v1::prodVtxLink
const ElementLink< TruthVertexContainer > & prodVtxLink() const
The production vertex link of this particle.
ElectronContainer.h
HepMC::is_simulation_particle
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
Definition: MagicNumbers.h:299
lumiFormat.i
int i
Definition: lumiFormat.py:92
ret
T ret(T t)
Definition: rootspy.cxx:260
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
WriteDecorHandle.h
Handle class for adding a decoration to an object.
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:113
DataVector::front
const T * front() const
Access the first element in the collection as an rvalue.
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
egammaTruthAssociationAlg::writeDecorHandles::origin
SG::WriteDecorHandle< T, int > origin
Definition: egammaTruthAssociationAlg.h:82
ClusterLink_t
ElementLink< xAOD::CaloClusterContainer > ClusterLink_t
Definition: egammaTruthAssociationAlg.cxx:53
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
xAOD::TruthVertex_v1::incomingParticle
const TruthParticle_v1 * incomingParticle(size_t index) const
Get one of the incoming particles.
Definition: TruthVertex_v1.cxx:71
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
egammaTruthAssociationAlg::m_mcTruthClassifier
ToolHandle< IMCTruthClassifier > m_mcTruthClassifier
MCTruthClassifier.
Definition: egammaTruthAssociationAlg.h:260
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
egammaTruthAssociationAlg::egammaTruthAssociationAlg
egammaTruthAssociationAlg(const std::string &name, ISvcLocator *pSvcLocator)
constructor
Definition: egammaTruthAssociationAlg.cxx:57
xAOD::EgammaHelpers::isFwdElectron
bool isFwdElectron(const xAOD::Egamma *eg)
is the object a Fwd electron
Definition: EgammaxAODHelpers.cxx:18
xAOD::TruthParticle_v1::decayVtxLink
const ElementLink< TruthVertexContainer > & decayVtxLink() const
The decay vertex link of this particle.
egammaTruthAssociationAlg::writeDecorHandles
helper class to contain write decoration handles
Definition: egammaTruthAssociationAlg.h:76
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
egammaTruthAssociationAlg::m_doEgammaTruthContainer
Gaudi::Property< bool > m_doEgammaTruthContainer
Create egamma truth container?
Definition: egammaTruthAssociationAlg.h:119
egammaTruthAssociationAlg::m_electronDecName
Gaudi::Property< std::string > m_electronDecName
The electron container name property used to initialize the WriteDecorHandleKeyArray.
Definition: egammaTruthAssociationAlg.h:177
egammaTruthAssociationAlg::initializeDecorKeys
StatusCode initializeDecorKeys(SG::WriteDecorHandleKeyArray< T > &keys, const std::string &name)
A function that initializes the decor handles, but also checks the naming convention.
Definition: egammaTruthAssociationAlg.cxx:282
xAOD::TruthParticle_v1::prodVtx
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Definition: TruthParticle_v1.cxx:80
egammaTruthAssociationAlg::m_matchForwardElectrons
Gaudi::Property< bool > m_matchForwardElectrons
Match fwd electrons?
Definition: egammaTruthAssociationAlg.h:139
egammaTruthAssociationAlg::writeDecorHandles::el
SG::WriteDecorHandle< T, ElementLink< xAOD::TruthParticleContainer > > el
Definition: egammaTruthAssociationAlg.h:80
egammaTruthAssociationAlg::m_minPt
Gaudi::Property< float > m_minPt
Minimum Pt to enter egamma truth particle container.
Definition: egammaTruthAssociationAlg.h:244
MCTruthPartClassifier::Info::genPart
const xAOD::TruthParticle * genPart
Definition: IMCTruthClassifier.h:57
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
xAOD::TruthHelpers::getTruthParticle
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any)
Definition: xAODTruthHelpers.cxx:25
egammaTruthAssociationAlg::m_photonDecKeys
SG::WriteDecorHandleKeyArray< xAOD::PhotonContainer > m_photonDecKeys
The photon container decor handle key array.
Definition: egammaTruthAssociationAlg.h:202
egammaTruthAssociationAlg::finalize
virtual StatusCode finalize() override final
finalize method
Definition: egammaTruthAssociationAlg.cxx:106
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
egammaTruthAssociationAlg::m_clusterDecKeys
SG::WriteDecorHandleKeyArray< xAOD::CaloClusterContainer > m_clusterDecKeys
The egamma cluster decor handle key array.
Definition: egammaTruthAssociationAlg.h:151
egammaTruthAssociationAlg::isPromptEgammaParticle
bool isPromptEgammaParticle(const EventContext &ctx, const xAOD::TruthParticle *truth) const
Return true if the truth particle is a prompt electron or photon.
Definition: egammaTruthAssociationAlg.cxx:206
xAOD::Electron_v1
Definition: Electron_v1.h:34
egammaTruthAssociationAlg::writeDecorHandles::readHandle
SG::ReadHandle< T > & readHandle()
Definition: egammaTruthAssociationAlg.h:85
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
xAOD::TruthParticle_v1::status
int status() const
Status code.
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAOD::TruthVertex_v1::nIncomingParticles
size_t nIncomingParticles() const
Get the number of incoming particles.
Definition: TruthVertex_v1.cxx:49
MC::isDecayed
bool isDecayed(const T &p)
Definition: HepMCHelpers.h:29
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
CaloClusterContainer.h
xAOD::TruthParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TruthParticle_v1.cxx:166
TruthLink_t
ElementLink< xAOD::TruthParticleContainer > TruthLink_t
Definition: egammaTruthAssociationAlg.cxx:52
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
ReadHandle.h
Handle class for reading from StoreGate.
egammaTruthAssociationAlg::m_photonDecName
Gaudi::Property< std::string > m_photonDecName
The photon container name property used to initialize the WriteDecorHandleKeyArray.
Definition: egammaTruthAssociationAlg.h:211
xAOD::TruthParticle_v1::pdgId
int pdgId() const
PDG ID code.
MCTruthPartClassifier::Info
Definition: IMCTruthClassifier.h:49
PhotonContainer.h
xAOD::TruthParticle_v1::m
virtual double m() const override final
The mass of the particle.
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
HepMCHelpers.h
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35