ATLAS Offline Software
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
TruthParticleLevelAnalysisAlgorithms
Root
ParticleLevelChargeDecoratorAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
#include "
TruthParticleLevelAnalysisAlgorithms/ParticleLevelChargeDecoratorAlg.h
"
8
9
namespace
CP
{
10
11
StatusCode
ParticleLevelChargeDecoratorAlg::initialize
() {
12
13
ANA_CHECK
(
m_particlesKey
.initialize());
14
15
return
StatusCode::SUCCESS;
16
}
17
18
StatusCode
ParticleLevelChargeDecoratorAlg::execute
(
const
EventContext &ctx)
const
{
19
20
SG::ReadHandle<xAOD::TruthParticleContainer>
particles(
m_particlesKey
, ctx);
21
22
// decorators
23
static
const
SG::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
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
ParticleLevelChargeDecoratorAlg.h
CP::ParticleLevelChargeDecoratorAlg::initialize
virtual StatusCode initialize() final
Definition
ParticleLevelChargeDecoratorAlg.cxx:11
CP::ParticleLevelChargeDecoratorAlg::m_particlesKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
Definition
ParticleLevelChargeDecoratorAlg.h:27
CP::ParticleLevelChargeDecoratorAlg::execute
virtual StatusCode execute(const EventContext &ctx) const final
Definition
ParticleLevelChargeDecoratorAlg.cxx:18
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition
Decorator.h:59
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
Generated on
for ATLAS Offline Software by
1.14.0