SLIC  6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
EventSourceWithInputFile.hh
Go to the documentation of this file.
1 #ifndef SLIC_EVENTSOURCEWITHINPUTFILE_HH_
2 #define SLIC_EVENTSOURCEWITHINPUTFILE_HH_ 1
3 
4 // SLIC
5 #include "EventSource.hh"
6 #include "FileUtil.hh"
7 #include "Module.hh"
8 
9 namespace slic {
10 
16 
17  protected:
18 
24  EventSourceWithInputFile(const std::string& name, const std::string& filename = "") :
25  EventSource(name), m_filename(filename), m_eof(false), m_fileIsOpen(false), m_fileIsNew(false), m_fileIsSet(false) {
26  }
27 
28  public:
29 
34  }
35 
36  public:
37 
42  void setFilename(const std::string& filename);
43 
48  const std::string& getFilename();
49 
53  void reset();
54 
59  unsigned int skipEvents(unsigned int nevents);
60 
64  bool isEOF();
65 
70  void beginEvent(const G4Event* event);
71 
76  void beginRun(const G4Run* run);
77 
81  virtual void open() = 0;
82 
86  virtual void close() = 0;
87 
91  virtual void readNextEvent() = 0;
92 
96  virtual void printCurrentEvent() = 0;
97 
98  protected:
99 
101  std::string m_filename;
102 
103  // state vars
104  bool m_eof;
108 };
109 }
110 
111 #endif
An EventSource with an associated input file, such as StdHep or LCIO event files.
EventSourceWithInputFile(const std::string &name, const std::string &filename="")
void setFilename(const std::string &filename)
virtual void printCurrentEvent()=0
void beginEvent(const G4Event *event)
virtual void readNextEvent()=0
unsigned int skipEvents(unsigned int nevents)
The virtual base class for a physics event source such as a StdHep file.
Definition: EventSource.hh:19
@ name
Definition: LogStream.hh:26