48{
49
51 SG::ReadHandle<xAOD::TruthParticleContainer> truthContainer{
m_truthContainer,
52 ctx };
53
54
56 ElementLink<xAOD::TruthParticleContainer>>
58
59
60 SG::WriteDecorHandle<xAOD::ElectronContainer, int> tPdgID(
m_truthPdgId, ctx);
61
62 SG::WriteDecorHandle<xAOD::ElectronContainer, int> firstEgMotherTT(
64 SG::WriteDecorHandle<xAOD::ElectronContainer, int> firstEgMotherTO(
66 SG::WriteDecorHandle<xAOD::ElectronContainer, unsigned int> firstEgMotherTC(
68 SG::WriteDecorHandle<xAOD::ElectronContainer, int> firstEgMotherPdgID(
71 ElementLink<xAOD::TruthParticleContainer>>
73
74
75 SG::WriteDecorHandle<xAOD::ElectronContainer, int> lastEgMotherTT(
77 SG::WriteDecorHandle<xAOD::ElectronContainer, int> lastEgMotherTO(
79 SG::WriteDecorHandle<xAOD::ElectronContainer, unsigned int> lastEgMotherTC(
81 SG::WriteDecorHandle<xAOD::ElectronContainer, int> lastEgMotherPdgID(
84 ElementLink<xAOD::TruthParticleContainer>>
86
87
89 tPdgID(*el) = 0;
90 if (tPL.isPresent() && tPL(*el).isValid()) {
91 tPdgID(*el) = (*tPL(*el))->
pdgId();
92 }
93
94
95
96
97
98 firstEgMotherTT(*el) = 0;
99 firstEgMotherTO(*el) = 0;
100 firstEgMotherTC(*el) = 0;
101 firstEgMotherTPL(*el) = ElementLink<xAOD::TruthParticleContainer>();
102 firstEgMotherPdgID(*el) = 0;
105
106 if (firstElTruth) {
108 firstEgMotherTT(*el) =
res.first;
109 firstEgMotherTO(*el) =
res.second;
111 firstEgMotherPdgID(*el) = firstElTruth->
pdgId();
112 ElementLink<xAOD::TruthParticleContainer>
link(
113 firstElTruth, *truthContainer, ctx);
114 firstEgMotherTPL(*el) =
link;
115 }
116
117
118
119 lastEgMotherTT(*el) = 0;
120 lastEgMotherTO(*el) = 0;
121 lastEgMotherTC(*el) = 0;
122 lastEgMotherTPL(*el) = ElementLink<xAOD::TruthParticleContainer>();
123 lastEgMotherPdgID(*el) = 0;
126
127 if (lastElTruth) {
129 lastEgMotherTT(*el) =
res.first;
130 lastEgMotherTO(*el) =
res.second;
132 lastEgMotherPdgID(*el) = lastElTruth->
pdgId();
133 ElementLink<xAOD::TruthParticleContainer>
link(
134 lastElTruth, *truthContainer, ctx);
135 lastEgMotherTPL(*el) =
link;
136 }
137 }
138 return StatusCode::SUCCESS;
139}
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
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.
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_firstEgMotherTruthClassification
int pdgId() const
PDG ID code.
std::tuple< unsigned int, T > defOrigOfParticle(T thePart)
pointer & link(pointer p) const
Return a reference to the link for an element.
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".