ATLAS Offline Software
Public Member Functions | Private Types | Private Attributes | List of all members
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 58 of file ParticleJetLabelCommon.h.

Member Typedef Documentation

◆ IPLV

Definition at line 65 of file ParticleJetLabelCommon.h.

Constructor & Destructor Documentation

◆ IParticleLinker()

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

Definition at line 142 of file ParticleJetLabelCommon.cxx.

144  :
145  m_dec(linkname)
146  {
147  }

Member Function Documentation

◆ decorate()

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

Definition at line 148 of file ParticleJetLabelCommon.cxx.

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

Member Data Documentation

◆ m_dec

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

Definition at line 66 of file ParticleJetLabelCommon.h.


The documentation for this class was generated from the following files:
ParticleJetTools::IParticleLinker::m_dec
SG::AuxElement::Decorator< IPLV > m_dec
Definition: ParticleJetLabelCommon.h:66
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
DMTest::links
links
Definition: CLinks_v1.cxx:22
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
ParticleJetTools::IParticleLinker::IPLV
std::vector< ElementLink< xAOD::IParticleContainer > > IPLV
Definition: ParticleJetLabelCommon.h:65