ATLAS Offline Software
Loading...
Searching...
No Matches
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
8
9namespace CP {
10
12
13 ANA_CHECK(m_particlesKey.initialize());
14
15 return StatusCode::SUCCESS;
16}
17
18StatusCode ParticleLevelPtEtaPhiDecoratorAlg::execute(const EventContext &ctx) const {
19
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
#define ANA_CHECK(EXP)
check whether the given expression was successful
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
virtual StatusCode execute(const EventContext &ctx) const final
Helper class to provide type-safe access to aux data.
Definition Decorator.h:59
Select isolated Photons, Electrons and Muons.