ATLAS Offline Software
Loading...
Searching...
No Matches
ParticleLevelPtEtaPhiDecoratorAlg.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_decPtKey.initialize());
18 ANA_CHECK(m_decEtaKey.initialize());
19 ANA_CHECK(m_decPhiKey.initialize());
20
21 return StatusCode::SUCCESS;
22}
23
24StatusCode ParticleLevelPtEtaPhiDecoratorAlg::execute(const EventContext &ctx) const {
25
27
28 // decorators
32
33 for (const auto* particle : *particles) {
34
35 // decorate pT/eta/phi of the truth particle
36 // (Energy is already decorated at DAOD-level!)
37 dec_pt(*particle) = particle->pt();
38 dec_eta(*particle) = particle->eta();
39 dec_phi(*particle) = particle->phi();
40 }
41 return StatusCode::SUCCESS;
42}
43
44} // 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::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_decPhiKey
virtual StatusCode execute(const EventContext &ctx) const final
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_decPtKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_decEtaKey
Handle class for adding a decoration to an object.
Select isolated Photons, Electrons and Muons.