SLIC  6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
RunAction.cc
Go to the documentation of this file.
1 // SLIC
2 #include "EventSourceManager.hh"
3 #include "LcioManager.hh"
4 #include "TrackManager.hh"
5 
6 // LCDD
7 #include "lcdd/core/GeometryManager.hh"
8 
9 // Geant4
10 #include "RunAction.hh"
11 #include "G4Run.hh"
12 
13 namespace slic {
14 
16  Module("RunAction", false) {
17 }
18 
20 }
21 
22 void RunAction::BeginOfRunAction(const G4Run *aRun) {
23 
24  // Start the run clock.
25  startRunTimer();
26 
27  // Print the run start message.
28 #ifdef SLIC_LOG
29  //printBeginOfRunMessage( aRun );
30 #endif
31 
32  // Execute LcioManager's beginRun action.
33  LcioManager::instance()->beginRun(aRun);
34 
35  // Execute EventSourceManager's beginRun action
36  EventSourceManager::instance()->beginRun(aRun);
37 
38  // Execute GeometryManager's beginRun action.
39  GeometryManager::instance()->beginRun(aRun);
40 
42 }
43 
44 void RunAction::EndOfRunAction(const G4Run *run) {
45 
46  // LcioManager's action
47  LcioManager::instance()->endRun(run);
48 
49  // event source mgr
50  EventSourceManager::instance()->endRun(run);
51 
52  m_pluginManager->endRun(run);
53 
54  // stop run clock
55  stopRunTimer();
56 
57  // end message
58 #ifdef SLIC_LOG
59  //printEndOfRunMessage( run );
60 #endif
61 }
62 
64  // start run timer
65  m_runTimer.Start();
66 #ifdef SLIC_LOG
67  log() << LOG::okay << "Started Run Timer." << LOG::done;
68 #endif
69 }
70 
72  // stop run timer
73  m_runTimer.Stop();
74 
75 #ifdef SLIC_LOG
76  log() << LOG::okay << "Run Timer: " << m_runTimer << LOG::done;
77 #endif
78 }
79 
80 /*
81 void RunAction::printBeginOfRunMessage(const G4Run* aRun) {
82  log() << LOG::okay << ">>>> BeginRun <" << aRun->GetRunID() << ">" << LOG::done;
83 }
84 
85 void RunAction::printEndOfRunMessage(const G4Run* aRun) {
86  log() << LOG::okay << ">>>> EndRun <" << aRun->GetRunID() << ">" << LOG::done;
87 }*/
88 }
static LcioManager * instance()
Base class for slic code modules that provides common functionality, such as logging to an output str...
Definition: Module.hh:25
LogStream & log()
Definition: Module.hh:99
void endRun(const G4Run *aRun)
void beginRun(const G4Run *aRun)
Definition: PluginManager.cc:9
void stopRunTimer()
Definition: RunAction.cc:71
void startRunTimer()
Definition: RunAction.cc:63
void EndOfRunAction(const G4Run *aRun)
Definition: RunAction.cc:44
void BeginOfRunAction(const G4Run *aRun)
Definition: RunAction.cc:22
G4Timer m_runTimer
Definition: RunAction.hh:72
@ okay
Definition: LogStream.hh:33
@ done
Definition: LogStream.hh:26