25 m_particle(0), m_extBarcode(barCode,
eventIndex) {}
28 m_particle(rhs.m_particle),
29 m_extBarcode(rhs.m_extBarcode) {}
31 const HepMC::GenEvent* pevt);
39 operator const HepMC::GenParticle* ()
const {
return cptr(); }
45 int barcode()
const {
return m_extBarcode.barcode(); }
50 const HepMC::GenParticle*
cptr()
const;
53 class ExtendedBarCode {
55 ExtendedBarCode() : m_extBC(0) {}
57 assert(barcode < 0x1FFFFF);
58 assert(eventIndex < 0x7FF);
59 m_extBC = barcode + (eventIndex << 21);
61 ExtendedBarCode(
const ExtendedBarCode& rhs) :
62 m_extBC(rhs.m_extBC) {}
64 int barcode()
const {
return m_extBC & 0x1FFFFF; }
65 index_type eventIndex()
const {
return m_extBC >> 21; }
71 mutable HepMC::GenParticle* m_particle;
72 ExtendedBarCode m_extBarcode;
a link optimized in size for a GenParticle in a McEventCollection
index_type eventIndex() const
HepMcParticleLink(index_type barCode, index_type eventIndex=0)
const HepMC::GenParticle & operator*() const
const HepMC::GenParticle * operator->() const
HepMcParticleLink(const HepMcParticleLink &rhs)
HepMcParticleLink(const HepMC::GenParticle *part, const HepMC::GenEvent *pevt)
const HepMC::GenParticle * cptr() const