ATLAS Offline Software
Loading...
Searching...
No Matches
ParticleLevelChargeDecoratorAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
8
11
12namespace CP {
13
15
16 ANA_CHECK(m_particlesKey.initialize());
17 ANA_CHECK(m_decChargeKey.initialize());
18
19 return StatusCode::SUCCESS;
20}
21
22StatusCode ParticleLevelChargeDecoratorAlg::execute(const EventContext &ctx) const {
23
25
26 // decorators
28
29 for (const auto* particle : *particles) {
30
31 // decorate the charge so we can save it later
32 dec_charge(*particle) = particle->charge();
33 }
34 return StatusCode::SUCCESS;
35}
36
37} // namespace CP
Handle class for reading from StoreGate.
Handle class for adding a decoration to an object.
#define ANA_CHECK(EXP)
check whether the given expression was successful
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_decChargeKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
virtual StatusCode execute(const EventContext &ctx) const final
Handle class for adding a decoration to an object.
Select isolated Photons, Electrons and Muons.