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 MCTruthPartClassifier::Info mcinfo(ctx);
107 if (firstElTruth) {
109 firstEgMotherTT(*el) =
res.first;
110 firstEgMotherTO(*el) =
res.second;
112 firstEgMotherPdgID(*el) = firstElTruth->
pdgId();
113 ElementLink<xAOD::TruthParticleContainer> link(
114 firstElTruth, *truthContainer, ctx);
115 firstEgMotherTPL(*el) = link;
116 }
117
118
119
120 lastEgMotherTT(*el) = 0;
121 lastEgMotherTO(*el) = 0;
122 lastEgMotherTC(*el) = 0;
123 lastEgMotherTPL(*el) = ElementLink<xAOD::TruthParticleContainer>();
124 lastEgMotherPdgID(*el) = 0;
127
128 if (lastElTruth) {
130 lastEgMotherTT(*el) =
res.first;
131 lastEgMotherTO(*el) =
res.second;
133 lastEgMotherPdgID(*el) = lastElTruth->
pdgId();
134 ElementLink<xAOD::TruthParticleContainer> link(
135 lastElTruth, *truthContainer, ctx);
136 lastEgMotherTPL(*el) = link;
137 }
138 }
139 return StatusCode::SUCCESS;
140}
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)
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".