SLIC  6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
LcioEventSource.cc
Go to the documentation of this file.
1 #include "LcioEventSource.hh"
2 
3 // SLIC
4 #include "MCParticleManager.hh"
5 
6 // LCIO
7 #include "UTIL/LCTOOLS.h"
8 
9 namespace slic {
10 
11 LcioEventSource::LcioEventSource(const std::string& fname) :
12  EventSourceWithInputFile("LcioEventSource", fname), m_eventGenerator(0) {
13 }
14 
16  delete m_eventGenerator;
17 }
18 
19 // open the current file
22  m_fileIsOpen = true;
23 }
24 
25 // close the current file
27  delete m_eventGenerator;
28  m_eventGenerator = 0;
29  m_fileIsOpen = false;
30 }
31 
32 // read the next event
35  if (m_eventGenerator->getCurrentEvent() == 0) {
36  m_eof = true;
37  }
38 }
39 
41  if (MCParticleManager::instance()->getMCParticleCollection() != NULL)
42  UTIL::LCTOOLS::printMCParticles(MCParticleManager::instance()->getMCParticleCollection());
43 }
44 
45 void LcioEventSource::generate(G4Event* anEvent) {
47 }
48 
49 void LcioEventSource::beginRun(const G4Run* aRun) {
50  // do superclass action
52 }
53 
54 void LcioEventSource::beginEvent(const G4Event* anEvent) {
56 }
57 
58 }
static MCParticleManager * instance()
An EventSource with an associated input file, such as StdHep or LCIO event files.
void beginEvent(const G4Event *event)
void generate(G4Event *anEvent)
void beginEvent(const G4Event *anEvent)
LcioEventSource(const std::string &fname="")
void beginRun(const G4Run *aRun)
MCParticleGenerator * m_eventGenerator
Converts from MCParticle collection into a G4Event.
void generateEvent(G4Event *event)