31 {
32
33 std::vector<const xAOD::TruthParticleContainer*> targets{};
35
36 SG::WriteDecorHandle<xAOD::IParticleContainer, ElementLink<xAOD::TruthParticleContainer> >
38
39 for (
const SG::ReadHandleKey<xAOD::TruthParticleContainer>& key :
m_targetKeys) {
40 SG::ReadHandle<xAOD::TruthParticleContainer> readHandle{
key, ctx};
43 return StatusCode::FAILURE;
44 }
45 targets.emplace_back(readHandle.
cptr());
46 }
47
48
49 SG::ReadHandle<xAOD::IParticleContainer> inputCont{
m_recoKey, ctx};
52 return StatusCode::FAILURE;
53 }
54 for ( const xAOD::IParticle* input : *inputCont) {
56 output_decorator(*input) = ElementLink<xAOD::TruthParticleContainer>{};
59
60 if (index >=0) output_decorator(*input) = ElementLink<xAOD::TruthParticleContainer>(*target, index);
61
62 }
63 }
64
65 return StatusCode::SUCCESS;
66}
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any)
TruthParticle_v1 TruthParticle
Typedef to implementation.
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.