CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Attributes
RunAction Class Reference

#include <RunAction.h>

Inheritance diagram for RunAction:

Public Member Functions

void BeginOfRunAction (const G4Run *aRun)
 
void EndOfRunAction (const G4Run *aRun)
 
 RunAction (const edm::ParameterSet &ps, SimRunInterface *)
 

Public Attributes

SimActivityRegistry::BeginOfRunSignal m_beginOfRunSignal
 
SimActivityRegistry::EndOfRunSignal m_endOfRunSignal
 

Private Attributes

SimRunInterfacem_runInterface
 
std::string m_stopFile
 
G4Timer * m_timer
 

Detailed Description

Definition at line 16 of file RunAction.h.

Constructor & Destructor Documentation

RunAction::RunAction ( const edm::ParameterSet ps,
SimRunInterface rm 
)

Definition at line 16 of file RunAction.cc.

17  : m_runInterface(rm),
18  m_stopFile(p.getParameter<std::string>("StopFile")), m_timer(0)
19 {}
G4Timer * m_timer
Definition: RunAction.h:29
std::string m_stopFile
Definition: RunAction.h:28
SimRunInterface * m_runInterface
Definition: RunAction.h:27

Member Function Documentation

void RunAction::BeginOfRunAction ( const G4Run *  aRun)

Definition at line 21 of file RunAction.cc.

References SimRunInterface::abortRun(), m_beginOfRunSignal, m_runInterface, m_stopFile, and alignCSCRings::r.

Referenced by RunManagerMT::initG4(), and RunManager::initializeRun().

22 {
23  if (std::ifstream(m_stopFile.c_str()))
24  {
25  edm::LogWarning("SimG4CoreApplication")
26  << "RunAction::BeginOfRunAction: termination signal received";
27  m_runInterface->abortRun(true);
28  }
29  BeginOfRun r(aRun);
31  /*
32  if (isMaster) {
33  m_timer = new G4Timer();
34  m_timer->Start();
35  }
36  */
37 }
void abortRun(bool softAbort)
std::string m_stopFile
Definition: RunAction.h:28
SimActivityRegistry::BeginOfRunSignal m_beginOfRunSignal
Definition: RunAction.h:23
SimRunInterface * m_runInterface
Definition: RunAction.h:27
void RunAction::EndOfRunAction ( const G4Run *  aRun)

Definition at line 39 of file RunAction.cc.

References SimRunInterface::abortRun(), m_endOfRunSignal, m_runInterface, m_stopFile, m_timer, and alignCSCRings::r.

Referenced by RunManager::terminateRun(), and RunManagerMT::terminateRun().

40 {
41  if (isMaster) {
42  edm::LogInfo("SimG4CoreApplication")
43  << "RunAction: total number of events " << aRun->GetNumberOfEvent();
44  if(m_timer) {
45  m_timer->Stop();
46  edm::LogInfo("SimG4CoreApplication")
47  << "RunAction: Master thread time " << *m_timer;
48  // std::cout << "\n" << "Master thread time: " << *m_timer << std::endl;
49  delete m_timer;
50  }
51  }
52  if (std::ifstream(m_stopFile.c_str()))
53  {
54  edm::LogWarning("SimG4CoreApplication")
55  << "RunAction::EndOfRunAction: termination signal received";
56  m_runInterface->abortRun(true);
57  }
58  EndOfRun r(aRun);
60 }
G4Timer * m_timer
Definition: RunAction.h:29
SimActivityRegistry::EndOfRunSignal m_endOfRunSignal
Definition: RunAction.h:24
void abortRun(bool softAbort)
std::string m_stopFile
Definition: RunAction.h:28
SimRunInterface * m_runInterface
Definition: RunAction.h:27

Member Data Documentation

SimActivityRegistry::BeginOfRunSignal RunAction::m_beginOfRunSignal
SimActivityRegistry::EndOfRunSignal RunAction::m_endOfRunSignal
SimRunInterface* RunAction::m_runInterface
private

Definition at line 27 of file RunAction.h.

Referenced by BeginOfRunAction(), and EndOfRunAction().

std::string RunAction::m_stopFile
private

Definition at line 28 of file RunAction.h.

Referenced by BeginOfRunAction(), and EndOfRunAction().

G4Timer* RunAction::m_timer
private

Definition at line 29 of file RunAction.h.

Referenced by EndOfRunAction().