6#include "GaudiKernel/EventContext.h"
40 return StatusCode::SUCCESS;
56 tPL(
"truthParticleLink");
85 if (tPL.isAvailable(*el) && tPL(*el).isValid()) {
86 tPdgID(*el) = (*tPL(*el))->pdgId();
93 firstEgMotherTT(*el) = 0;
94 firstEgMotherTO(*el) = 0;
96 firstEgMotherPdgID(*el) = 0;
103 firstEgMotherTT(*el) =
res.first;
104 firstEgMotherTO(*el) =
res.second;
105 firstEgMotherPdgID(*el) = firstElTruth->
pdgId();
107 firstElTruth, *truthContainer, ctx);
108 firstEgMotherTPL(*el) = link;
113 lastEgMotherTT(*el) = 0;
114 lastEgMotherTO(*el) = 0;
116 lastEgMotherPdgID(*el) = 0;
122 lastEgMotherTT(*el) =
res.first;
123 lastEgMotherTO(*el) =
res.second;
124 lastEgMotherPdgID(*el) = lastElTruth->
pdgId();
126 lastElTruth, *truthContainer, ctx);
127 lastEgMotherTPL(*el) = link;
130 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
std::pair< std::vector< unsigned int >, bool > res
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_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
ToolHandle< IMCTruthClassifier > m_mcTruthClassifier
MCTruthClassifier.
virtual StatusCode initialize() override final
ElementLink implementation for ROOT usage.
SG::Accessor< T, ALLOC > Accessor
Handle class for adding a decoration to an object.
int pdgId() const
PDG ID code.
::StatusCode StatusCode
StatusCode definition for legacy code.
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".