ATLAS Offline Software
PhysicsAnalysis
Algorithms
TruthParticleLevelAnalysisAlgorithms
Root
ParticleLevelPtEtaPhiDecoratorAlg.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
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
() {
19
20
SG::ReadHandle<xAOD::TruthParticleContainer>
particles
(
m_particlesKey
);
21
22
// decorators
23
static
const
SG::AuxElement::Decorator<float>
dec_pt(
"pt"
);
24
static
const
SG::AuxElement::Decorator<float>
dec_eta(
"eta"
);
25
static
const
SG::AuxElement::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
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition:
ParticleHypothesis.h:76
ParticleLevelPtEtaPhiDecoratorAlg.h
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::ParticleLevelPtEtaPhiDecoratorAlg::initialize
virtual StatusCode initialize() final
Definition:
ParticleLevelPtEtaPhiDecoratorAlg.cxx:11
CP
Select isolated Photons, Electrons and Muons.
Definition:
Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
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
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
CP::ParticleLevelPtEtaPhiDecoratorAlg::execute
virtual StatusCode execute() final
Definition:
ParticleLevelPtEtaPhiDecoratorAlg.cxx:18
CP::ParticleLevelPtEtaPhiDecoratorAlg::m_particlesKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
Definition:
ParticleLevelPtEtaPhiDecoratorAlg.h:27
Generated on Sun Dec 22 2024 21:16:03 for ATLAS Offline Software by
1.8.18