ATLAS Offline Software
Loading...
Searching...
No Matches
ParticleJetTools::IParticleLinker Class Reference

#include <ParticleJetLabelCommon.h>

Collaboration diagram for ParticleJetTools::IParticleLinker:

Public Member Functions

 IParticleLinker (const SG::ReadHandleKey< xAOD::TruthParticleContainer > &, const std::string &linkName)
void decorate (const xAOD::Jet &, const std::vector< const xAOD::TruthParticle * > &) const

Private Types

using IPLV = std::vector<ElementLink<xAOD::IParticleContainer>>

Private Attributes

SG::AuxElement::Decorator< IPLVm_dec

Detailed Description

Definition at line 62 of file ParticleJetLabelCommon.h.

Member Typedef Documentation

◆ IPLV

Constructor & Destructor Documentation

◆ IParticleLinker()

ParticleJetTools::IParticleLinker::IParticleLinker ( const SG::ReadHandleKey< xAOD::TruthParticleContainer > & ,
const std::string & linkName )

Definition at line 139 of file ParticleJetLabelCommon.cxx.

141 :
142 m_dec(linkname)
143 {
144 }
SG::AuxElement::Decorator< IPLV > m_dec

Member Function Documentation

◆ decorate()

void ParticleJetTools::IParticleLinker::decorate ( const xAOD::Jet & jet,
const std::vector< const xAOD::TruthParticle * > & ipv ) const

Definition at line 145 of file ParticleJetLabelCommon.cxx.

148 {
149 IPLV links;
150 for (const xAOD::TruthParticle* ip: ipv) {
151 // I copied this whole song and dance from setAssociatedObjects
152 // in the jet edm. It would be much easier if we could store the
153 // container hash in this object and use ElementLink(sgkey,
154 // index) but that seems to break in AnalysisBase
155 IPLV::value_type link;
156 const auto* ipc = dynamic_cast<const xAOD::IParticleContainer*>(
157 ip->container());
158 link.toIndexedElement(*ipc, ip->index());
159 links.push_back(link);
160 }
161 m_dec(jet) = std::move(links);
162 }
std::vector< ElementLink< xAOD::IParticleContainer > > IPLV
TruthParticle_v1 TruthParticle
Typedef to implementation.
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.

Member Data Documentation

◆ m_dec

SG::AuxElement::Decorator<IPLV> ParticleJetTools::IParticleLinker::m_dec
private

Definition at line 70 of file ParticleJetLabelCommon.h.


The documentation for this class was generated from the following files: