EDepSimUserRunAction.hh
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////
2 // $Id: EDepSim::UserRunAction.hh,v 1.9 2011/07/19 20:55:13 mcgrew Exp $
3 //
4 
5 #ifndef EDepSim_UserRunAction_h
6 #define EDepSim_UserRunAction_h 1
7 
8 #include "globals.hh"
9 #include "G4UserRunAction.hh"
10 
11 class G4Run;
12 class G4Timer;
13 namespace EDepSim {class UserRunActionMessenger;}
14 
15 namespace EDepSim {class UserRunAction;}
16 class EDepSim::UserRunAction : public G4UserRunAction {
17 public:
18  UserRunAction();
19  virtual ~UserRunAction();
20 
21 public:
22  void BeginOfRunAction(const G4Run*);
23  void EndOfRunAction(const G4Run*);
24  const G4Timer* GetRunTimer(void) const {return fTimer;};
25 
26  /// Set the seed to a new value. This takes a long since the low-level
27  /// random generate expects a long seed.
28  void SetSeed(long);
29 
30  /// Get the seed that started the low level random generator.
31  long GetSeed(void) const;
32 
33  /// Build a seed for the generator based on the system time.
34  void SetTimeSeed();
35 
36  /// Set the DetSim Run Id to a specific value. This is the first run id
37  /// that will be used by GEANT. GEANT will automatically increment the
38  /// run id everytime it starts a new internal run. The run id should be
39  /// accessed through G4RunInfo (see G4RunManager).
40  void SetDetSimRunId(int v);
41 
42  /// Set the DetSim Subrun Id to a specific value. This has no internal
43  /// meaning and is just copied to the output event.
44  void SetDetSimSubrunId(int v);
45 
46  /// Get the subrun id value.
47  int GetDetSimSubrunId() const;
48 
49 private:
50  /// The messenger for this action
52 
53  /// The time that the run was started.
54  G4String fStartTime;
55 
56  /// The time that the run was stopped.
57  G4String fStopTime;
58 
59  /// The running time for the run.
60  G4Timer* fTimer;
61 
62  /// The cached value of the subrun id.
63  int fSubrunId;
64 };
65 #endif
int GetDetSimSubrunId() const
Get the subrun id value.
EDepSim::UserRunActionMessenger * fMessenger
The messenger for this action.
void EndOfRunAction(const G4Run *)
G4Timer * fTimer
The running time for the run.
G4String fStopTime
The time that the run was stopped.
Construct a module from components.
Definition: TG4HitSegment.h:10
void SetTimeSeed()
Build a seed for the generator based on the system time.
int fSubrunId
The cached value of the subrun id.
void BeginOfRunAction(const G4Run *)
G4String fStartTime
The time that the run was started.
long GetSeed(void) const
Get the seed that started the low level random generator.
const G4Timer * GetRunTimer(void) const