SLIC  6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
StdHepEventSource.cc
Go to the documentation of this file.
1 #include "StdHepEventSource.hh"
2 
3 // SLIC
4 #include "LcioManager.hh"
5 #include "MCParticleManager.hh"
6 
7 // LCIO
8 #include "UTIL/LCTOOLS.h"
9 
10 namespace slic {
11 StdHepEventSource::StdHepEventSource(const std::string& fname) :
12  EventSourceWithInputFile("StdHepEventSource", fname), m_eventGenerator(0) {
13 }
14 
15 void StdHepEventSource::generate(G4Event* anEvent) {
16  //std::cout << "StdHepEventSource::generate" << std::endl;
17 
19 }
20 
21 // open the current file
23 
24  /* Initialize the event generator using the current file name. */
26 
27  m_fileIsOpen = true;
28 }
29 
30 // close the current file
32  delete m_eventGenerator;
33  m_fileIsOpen = false;
34 }
35 
36 // read the next event
38 
41  m_eof = true;
42  }
43 }
44 
46  if (MCParticleManager::instance()->getMCParticleCollection() != NULL)
47  UTIL::LCTOOLS::printMCParticles(MCParticleManager::instance()->getMCParticleCollection());
48 }
49 
50 void StdHepEventSource::beginRun(const G4Run* aRun) {
51 
52  // do superclass setup
54 }
55 
56 void StdHepEventSource::beginEvent(const G4Event* anEvent) {
57 
58  //std::cout << "StdHepEventSource::beginEvent" << std::endl;
59 
60  // read an event
62 }
63 
64 }
static MCParticleManager * instance()
An EventSource with an associated input file, such as StdHep or LCIO event files.
void beginEvent(const G4Event *event)
StdHepEventSource(const std::string &fname)
void generate(G4Event *anEvent)
void beginEvent(const G4Event *anEvent)
StdHepGenerator * m_eventGenerator
void beginRun(const G4Run *aRun)
Converts from StdHep input to a G4Event.
LCCollectionVec * getCurrentParticleCollection()
void generateEvent(G4Event *event)