ATLAS Offline Software
ParticleLevelChargeDecoratorAlg.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 
8 
9 namespace CP {
10 
12 
14 
15  return StatusCode::SUCCESS;
16 }
17 
19 
21 
22  // decorators
23  static const SG::AuxElement::Decorator<float> dec_charge("charge");
24 
25  for (const auto* particle : *particles) {
26 
27  // decorate the charge so we can save it later
28  dec_charge(*particle) = particle->charge();
29  }
30  return StatusCode::SUCCESS;
31 }
32 
33 } // namespace CP
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
ParticleLevelChargeDecoratorAlg.h
CP::ParticleLevelChargeDecoratorAlg::m_particlesKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
Definition: ParticleLevelChargeDecoratorAlg.h:27
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
CP::ParticleLevelChargeDecoratorAlg::execute
virtual StatusCode execute() final
Definition: ParticleLevelChargeDecoratorAlg.cxx:18
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CP::ParticleLevelChargeDecoratorAlg::initialize
virtual StatusCode initialize() final
Definition: ParticleLevelChargeDecoratorAlg.cxx:11
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
LArG4FSStartPointFilter.particles
list particles
Definition: LArG4FSStartPointFilter.py:84