CGEM BOSS
6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
HepMcParticleLink.cxx
Go to the documentation of this file.
1
#include "
GeneratorObject/HepMcParticleLink.h
"
2
#include "
GeneratorObject/McEventCollection.h
"
3
#include "StoreGate/StoreGate.h"
4
#include "CLHEP/HepMC/GenParticle.h"
5
#include "CLHEP/HepMC/GenEvent.h"
6
#include <cassert>
7
8
HepMcParticleLink::HepMcParticleLink
(
const
HepMC::GenParticle* part,
9
index_type
eventIndex) :
10
m_particle(const_cast<
HepMC
::GenParticle*>(part)),
11
m_extBarcode((0 != part) ? part->barcode() : 0, eventIndex) {
12
assert(part);
13
}
14
15
const
HepMC::GenParticle*
HepMcParticleLink::cptr
()
const
{
16
if
(!m_particle) {
17
const
McEventCollection
* pEvtColl;
18
if
((StoreGate::instance().retrieve(pEvtColl)).isSuccess()) {
//FIXME SLOW
19
m_particle = pEvtColl->at(
eventIndex
())->barcode_to_particle(
barcode
());
20
}
21
}
22
return
m_particle;
23
}
HepMcParticleLink.h
McEventCollection.h
HepMcParticleLink::eventIndex
index_type eventIndex() const
Definition
HepMcParticleLink.h:46
HepMcParticleLink::index_type
unsigned int index_type
Definition
HepMcParticleLink.h:19
HepMcParticleLink::HepMcParticleLink
HepMcParticleLink()
Definition
HepMcParticleLink.h:23
HepMcParticleLink::barcode
int barcode() const
Definition
HepMcParticleLink.h:45
HepMcParticleLink::cptr
const HepMC::GenParticle * cptr() const
Definition
HepMcParticleLink.cxx:15
McEventCollection
Definition
McEventCollection.h:26
HepMC
Definition
GenIMCselector.h:12
6.6.5.h
Generator
GeneratorObject
GeneratorObject-00-01-05
src
HepMcParticleLink.cxx
Generated by
1.12.0