7#include "GaudiKernel/EventContext.h"
44 return StatusCode::SUCCESS;
91 if (tPL.isPresent() && tPL(*el).isValid()) {
93 tPdgID(*el) = truthEl->
pdgId();
97 for (
size_t p = 0; p < truthEl->
nParents(); ++p) {
100 <<
"truth thinning) for truth electron with pt "
101 << truthEl->
pt() <<
" MeV");
112 firstEgMotherTT(*el) = 0;
113 firstEgMotherTO(*el) = 0;
114 firstEgMotherTC(*el) = 0;
116 firstEgMotherPdgID(*el) = 0;
122 firstEgMotherTT(*el) =
res.first;
123 firstEgMotherTO(*el) =
res.second;
125 firstEgMotherPdgID(*el) = firstElTruth->
pdgId();
127 firstElTruth, *truthContainer, ctx);
128 firstEgMotherTPL(*el) = link;
133 lastEgMotherTT(*el) = 0;
134 lastEgMotherTO(*el) = 0;
135 lastEgMotherTC(*el) = 0;
137 lastEgMotherPdgID(*el) = 0;
143 lastEgMotherTT(*el) =
res.first;
144 lastEgMotherTO(*el) =
res.second;
146 lastEgMotherPdgID(*el) = lastElTruth->
pdgId();
148 lastElTruth, *truthContainer, ctx);
149 lastEgMotherTPL(*el) = link;
152 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_WARNING(x,...)
ATLAS-specific HepMC functions.
std::pair< std::vector< unsigned int >, bool > res
Handle class for reading a decoration on an object.
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_lastEgMotherTruthOrigin
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronContainer
input electron container
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_truthPdgId
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_lastEgMotherTruthParticleLink
virtual StatusCode addBranches(const EventContext &ctx) const override final
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthContainer
Input truth particle container.
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_lastEgMotherTruthClassification
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_firstEgMotherPdgId
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_firstEgMotherTruthType
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_firstEgMotherTruthOrigin
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_firstEgMotherTruthParticleLink
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_lastEgMotherTruthType
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_lastEgMotherPdgId
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_electronTruthParticleLink
ToolHandle< IMCTruthClassifier > m_mcTruthClassifier
MCTruthClassifier.
virtual StatusCode initialize() override final
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_firstEgMotherTruthClassification
ElementLink implementation for ROOT usage.
Handle class for reading a decoration on an object.
Handle class for adding a decoration to an object.
int pdgId() const
PDG ID code.
const TruthParticle_v1 * parent(size_t i) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
size_t nParents() const
Number of parents of this particle.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::tuple< unsigned int, T > defOrigOfParticle(T thePart)
Classify a particle into a bit-word (see MCTC_bits).
bool isElectron(const T &p)
const xAOD::TruthParticle * getBkgElectronMother(const xAOD::Electron *el, const bool allTheWayBack=true)
Helper wrapper function for calling the function above extracting the truth from a reco electron.
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
TruthParticle_v1 TruthParticle
Typedef to implementation.
Electron_v1 Electron
Definition of the current "egamma version".