#include <HepMcParticleLink.h>
Public Types | ||||
typedef unsigned int | index_type | |||
Public Member Functions | ||||
bool | isValid () const | |||
const HepMC::GenParticle * | cptr () const | |||
structors | ||||
HepMcParticleLink () | ||||
HepMcParticleLink (index_type barCode, index_type eventIndex=0) | ||||
HepMcParticleLink (const HepMC::GenParticle *p, index_type eventIndex=0) | ||||
HepMcParticleLink (const HepMcParticleLink &rhs) | ||||
HepMcParticleLink (const HepMC::GenParticle *part, const HepMC::GenEvent *pevt) | ||||
pointer interface | ||||
const HepMC::GenParticle & | operator * () const | |||
| ||||
const HepMC::GenParticle * | operator-> () const | |||
operator const HepMC::GenParticle * () const | ||||
bool | operator! () const | |||
indexing accessors (e.g. for writing) | ||||
int | barcode () const | |||
index_type | eventIndex () const | |||
Private Attributes | ||||
HepMC::GenParticle * | m_particle | |||
ExtendedBarCode | m_extBarcode | |||
Classes | ||||
class | ExtendedBarCode |
Definition at line 17 of file HepMcParticleLink.h.
typedef unsigned int HepMcParticleLink::index_type |
Definition at line 19 of file HepMcParticleLink.h.
HepMcParticleLink::HepMcParticleLink | ( | ) | [inline] |
HepMcParticleLink::HepMcParticleLink | ( | index_type | barCode, | |
index_type | eventIndex = 0 | |||
) | [inline] |
Definition at line 24 of file HepMcParticleLink.h.
00024 : 00025 m_particle(0), m_extBarcode(barCode, eventIndex) {} HepMcParticleLink(const HepMC::GenParticle* p, index_type eventIndex = 0);
HepMcParticleLink::HepMcParticleLink | ( | const HepMC::GenParticle * | p, | |
index_type | eventIndex = 0 | |||
) |
Definition at line 8 of file HepMcParticleLink.cxx.
00009 : 00010 m_particle(const_cast<HepMC::GenParticle*>(part)), 00011 m_extBarcode((0 != part) ? part->barcode() : 0, eventIndex) { 00012 assert(part); 00013 }
HepMcParticleLink::HepMcParticleLink | ( | const HepMcParticleLink & | rhs | ) | [inline] |
Definition at line 27 of file HepMcParticleLink.h.
00027 : 00028 m_particle(rhs.m_particle), 00029 m_extBarcode(rhs.m_extBarcode) {}
HepMcParticleLink::HepMcParticleLink | ( | const HepMC::GenParticle * | part, | |
const HepMC::GenEvent * | pevt | |||
) |
int HepMcParticleLink::barcode | ( | ) | const [inline] |
Definition at line 45 of file HepMcParticleLink.h.
Referenced by cptr().
00045 { return m_extBarcode.barcode(); }
const HepMC::GenParticle * HepMcParticleLink::cptr | ( | ) | const |
Definition at line 15 of file HepMcParticleLink.cxx.
References barcode(), eventIndex(), and m_particle.
Referenced by operator *(), operator const HepMC::GenParticle *(), and operator->().
00015 { 00016 if (!m_particle) { 00017 const McEventCollection* pEvtColl; 00018 if ((StoreGate::instance().retrieve(pEvtColl)).isSuccess()) { //FIXME SLOW 00019 m_particle = pEvtColl->at(eventIndex())->barcode_to_particle(barcode()); 00020 } 00021 } 00022 return m_particle; 00023 }
index_type HepMcParticleLink::eventIndex | ( | ) | const [inline] |
Definition at line 46 of file HepMcParticleLink.h.
Referenced by cptr().
00046 { return m_extBarcode.eventIndex(); }
bool HepMcParticleLink::isValid | ( | ) | const [inline] |
const HepMC::GenParticle& HepMcParticleLink::operator * | ( | void | ) | const [inline] |
std::runtime_error | when the element is not found |
Definition at line 37 of file HepMcParticleLink.h.
References cptr().
00037 { return *cptr(); }//FIXME
HepMcParticleLink::operator const HepMC::GenParticle * | ( | ) | const [inline] |
bool HepMcParticleLink::operator! | ( | ) | const [inline] |
const HepMC::GenParticle* HepMcParticleLink::operator-> | ( | ) | const [inline] |
Definition at line 72 of file HepMcParticleLink.h.
HepMC::GenParticle* HepMcParticleLink::m_particle [mutable, private] |