SLIC  6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
EventSource.hh
Go to the documentation of this file.
1 #ifndef SLIC_EVENTSOURCE_HH_
2 #define SLIC_EVENTSOURCE_HH_ 1
3 
4 // SLIC
5 #include "Module.hh"
6 
7 // Geant4
8 #include "G4VPrimaryGenerator.hh"
9 
10 class G4Event;
11 class G4Run;
12 
13 namespace slic {
14 
19 class EventSource: public Module {
20 
21  protected:
22 
26  EventSource(const std::string& name);
27 
28  public:
29 
33  virtual ~EventSource();
34 
35  public:
36 
41  virtual void generate(G4Event* event) = 0;
42 
46  virtual void printCurrentEvent() = 0;
47 
51  virtual void reset();
52 
57  virtual unsigned int skipEvents(unsigned int n);
58 
63  virtual void beginEvent(const G4Event* event);
64 
69  virtual void endEvent(const G4Event* event);
70 
75  virtual void beginRun(const G4Run* run);
76 
81  virtual void endRun(const G4Run* run);
82 
83  private:
84 
85  std::string m_name;
87 
88 };
89 }
90 
91 #endif
The virtual base class for a physics event source such as a StdHep file.
Definition: EventSource.hh:19
virtual void endRun(const G4Run *run)
Definition: EventSource.cc:37
virtual void generate(G4Event *event)=0
EventSource(const std::string &name)
Definition: EventSource.cc:12
virtual unsigned int skipEvents(unsigned int n)
Definition: EventSource.cc:20
virtual void beginRun(const G4Run *run)
Definition: EventSource.cc:33
virtual ~EventSource()
Definition: EventSource.cc:9
virtual void printCurrentEvent()=0
virtual void beginEvent(const G4Event *event)
Definition: EventSource.cc:25
virtual void reset()
Definition: EventSource.cc:16
virtual void endEvent(const G4Event *event)
Definition: EventSource.cc:29
std::string m_name
Definition: EventSource.hh:85
Base class for slic code modules that provides common functionality, such as logging to an output str...
Definition: Module.hh:25
@ name
Definition: LogStream.hh:26