|
ATLAS Offline Software
|
Go to the documentation of this file.
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;
179 const std::size_t etIsolationsIdx,
270 ? (*m_etIsolations)->etIsolations(
barcode)
298 const std::size_t genEvtIdx,
301 if ( 0 != mcColl && mcColl->
size() > genEvtIdx ) {
314 const std::size_t etIsolationsIdx,
328 #endif // not __REFLEX__
335 #endif //> MCPARTICLEEVENT_TRUTHPARTICLECONTAINER_H
SG_BASE(TruthParticleContainer, DataVector< TruthParticle >)
void setEtIsolations(const ElementLink< TruthEtIsolationsContainer > &etIsolations)
Setup the persistent pointer toward the TruthEtIsolations.
Map_t m_particles
Dictionary to ease the extraction of a TruthParticle (contained by this collection) from the HepMC::G...
ElementLink< McEventCollection > m_genEvent
Persistent pointer to the HepMC::GenEvent we are proxying.
bool toIndexedElement(BaseConstReference data, index_type elemID, IProxyDict *sg=0)
Set the link to an element given by index and pointer to container.
ElementLink< TruthEtIsolationsContainer > m_etIsolations
Persistent pointer to the TruthEtIsolations container, holding Et isolations for TruthParticle or Hep...
McAod::EtIsolations EtIsol_t
An array of doubles of fixed size to modelize the Et isolations for different values of isolation rad...
std::size_t genEventIdx() const
Retrieve the index (within a McEventCollection) of the HepMC::GenEvent this TruthParticleContainer is...
DATAVECTOR_BASE(TruthParticle, IParticle)
ConeSize
Enum for Cone size indexes (for isolation)
TruthParticleContainer()
Default constructor:
void line(std::ostream &os, const GenEvent &e)
std::ostream & dump(std::ostream &out=std::cout) const
Dump the content of the TruthParticleContainer.
bool isValid() const
Test to see if the link can be dereferenced.
const ID_type & dataID() const
Get the key that we reference, as a string.
const ElementLink< TruthEtIsolationsContainer > & etIsolationsLink() const
return the link to truth Et isolations.
OwnershipPolicy
describes the possible element ownership policies (see e.g. DataVector)
const HepMC::GenEvent * genEvent() const
Retrieve the HepMC::GenEvent this TruthParticleContainer is proxying.
double etIsol(const int barcode, const TruthParticleParameters::ConeSize coneIdx) const
Return the Et isolation for a given particle and a given cone size.
void setGenEvent(const ElementLink< McEventCollection > &genEvent)
Setup the persistent pointer toward the HepMC::GenEvent this TruthParticleContainer is proxying.
static const std::size_t NoIdx
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
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
std::unordered_map< long, const TruthParticle * > Map_t
barcode to TruthParticle dictionary
~TruthParticleContainer()
Destructor:
An STL vector of pointers that by default owns its pointed-to elements.
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...
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
const TruthEtIsolations::EtIsol_t * etIsolations(const int barcode) const
return the container of Truth Et isolations for a given TruthParticle (or a HepMC::GenParticle)
index_type index() const
Get the index of the element inside of its container.
const ElementLink< McEventCollection > & genEventLink() const
Retrieve the HepMC::GenEvent this TruthParticleContainer is proxying, as a link.
TruthParticle::evtIndex_t evtIndex_t
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...
size_type size() const noexcept
Returns the number of elements in the collection.
macros to associate a CLID to a type
bool hasEtIsol() const
tell if this TruthParticleContainer has been registered with a TruthEtIsolations container