ATLAS Offline Software
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
TruthParticleLevelAnalysisAlgorithms
Root
ParticleLevelPtEtaPhiDecoratorAlg.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/ParticleLevelPtEtaPhiDecoratorAlg.h
"
8
9
namespace
CP
{
10
11
StatusCode
ParticleLevelPtEtaPhiDecoratorAlg::initialize
() {
12
13
ANA_CHECK
(
m_particlesKey
.initialize());
14
15
return
StatusCode::SUCCESS;
16
}
17
18
StatusCode
ParticleLevelPtEtaPhiDecoratorAlg::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_pt(
"pt"
);
24
static
const
SG::Decorator<float>
dec_eta(
"eta"
);
25
static
const
SG::Decorator<float>
dec_phi(
"phi"
);
26
27
for
(
const
auto
* particle : *particles) {
28
29
// decorate pT/eta/phi of the truth particle
30
// (Energy is already decorated at DAOD-level!)
31
dec_pt(*particle) = particle->pt();
32
dec_eta(*particle) = particle->eta();
33
dec_phi(*particle) = particle->phi();
34
}
35
return
StatusCode::SUCCESS;
36
}
37
38
}
// namespace CP
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
ParticleLevelPtEtaPhiDecoratorAlg.h
CP::ParticleLevelPtEtaPhiDecoratorAlg::m_particlesKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
Definition
ParticleLevelPtEtaPhiDecoratorAlg.h:27
CP::ParticleLevelPtEtaPhiDecoratorAlg::execute
virtual StatusCode execute(const EventContext &ctx) const final
Definition
ParticleLevelPtEtaPhiDecoratorAlg.cxx:18
CP::ParticleLevelPtEtaPhiDecoratorAlg::initialize
virtual StatusCode initialize() final
Definition
ParticleLevelPtEtaPhiDecoratorAlg.cxx:11
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