11#ifndef MCPARTICLEEVENT_TRUTHPARTICLECONTAINER_H
12#define MCPARTICLEEVENT_TRUTHPARTICLECONTAINER_H
16#include <unordered_map>
19#include "AthLinks/ElementLink.h"
51 static const std::size_t
NoIdx =
static_cast<std::size_t
>(-1);
59 typedef std::unordered_map<long,const TruthParticle*>
Map_t;
94 std::ostream&
dump( std::ostream& out = std::cout )
const;
99 const HepMC::GenEvent*
genEvent()
const;
137 bool hasEtIsol(
const int barcode )
const;
153 double etIsol(
const int barcode,
179 const std::size_t etIsolationsIdx,
232 return m_genEvent.isValid() ? (*m_genEvent) : 0;
263 return hasEtIsol() && (*m_etIsolations)->hasEtIsol( barcode );
270 ? (*m_etIsolations)->etIsolations(barcode)
285 ? (*m_etIsolations)->etIsol(barcode, idx)
298 const std::size_t genEvtIdx,
301 if ( 0 != mcColl && mcColl->
size() > genEvtIdx ) {
302 m_genEvent.toIndexedElement( *mcColl, genEvtIdx, sg );
314 const std::size_t etIsolationsIdx,
#define SG_BASE(D, B)
Declare that class D derives from class B.
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
An STL vector of pointers that by default owns its pointed-to elements.
#define DATAVECTOR_BASE(T, BASE)
Declare base class info to DataVector.
DataVector(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES)
size_type size() const noexcept
Returns the number of elements in the collection.
ElementLink implementation for ROOT usage.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
McAod::EtIsolations EtIsol_t
An array of doubles of fixed size to modelize the Et isolations for different values of isolation rad...
ElementLink< TruthEtIsolationsContainer > m_etIsolations
Persistent pointer to the TruthEtIsolations container, holding Et isolations for TruthParticle or Hep...
ElementLink< McEventCollection > m_genEvent
Persistent pointer to the HepMC::GenEvent we are proxying.
const ElementLink< McEventCollection > & genEventLink() const
Retrieve the HepMC::GenEvent this TruthParticleContainer is proxying, as a link.
double etIsol(const int barcode, const TruthParticleParameters::ConeSize coneIdx) const
Return the Et isolation for a given particle and a given cone size.
std::ostream & dump(std::ostream &out=std::cout) const
Dump the content of the TruthParticleContainer.
const TruthEtIsolations::EtIsol_t * etIsolations(const int barcode) const
return the container of Truth Et isolations for a given TruthParticle (or a HepMC::GenParticle)
Map_t m_particles
Dictionary to ease the extraction of a TruthParticle (contained by this collection) from the HepMC::G...
std::size_t genEventIdx() const
Retrieve the index (within a McEventCollection) of the HepMC::GenEvent this TruthParticleContainer is...
std::unordered_map< long, const TruthParticle * > Map_t
barcode to TruthParticle dictionary
friend class TruthParticleCnvTool
const TruthParticle * truthParticle(const int barcode, std::size_t genEventIdx=0) const
return a const pointer to an TruthParticle given the barcode of the HepMC::GenParticle it is wrapping
~TruthParticleContainer()
Destructor:
std::size_t truthParticleIdx(const int barcode, std::size_t genEventIdx=0) const
return the index to an TruthParticle given the barcode of the HepMC::GenParticle it is wrapping retur...
void setGenEvent(const ElementLink< McEventCollection > &genEvent)
Setup the persistent pointer toward the HepMC::GenEvent this TruthParticleContainer is proxying.
static const std::size_t NoIdx
TruthParticleContainer()
Default constructor:
const HepMC::GenEvent * genEvent() const
Retrieve the HepMC::GenEvent this TruthParticleContainer is proxying.
TruthParticle::evtIndex_t evtIndex_t
void setEtIsolations(const ElementLink< TruthEtIsolationsContainer > &etIsolations)
Setup the persistent pointer toward the TruthEtIsolations.
const ElementLink< TruthEtIsolationsContainer > & etIsolationsLink() const
return the link to truth Et isolations.
bool hasEtIsol() const
tell if this TruthParticleContainer has been registered with a TruthEtIsolations container
void setParticles(const Map_t &parts)
Setup the dictionary of barcodes-to-TruthParticle.
const std::string & genEventName() const
Retrieve the name (StoreGate location) of the HepMC::GenEvent this TruthParticleContainer is proxying...
(HepMC) Monte Carlo particle.
void line(std::ostream &os, const GenEvent &e)
ConeSize
Enum for Cone size indexes (for isolation)