CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RunAction.cc
Go to the documentation of this file.
3 
6 
8 
9 #include <iostream>
10 #include <fstream>
11 
13  : m_runInterface(rm),
14  m_stopFile(p.getParameter<std::string>("StopFile")) {}
15 
16 void RunAction::BeginOfRunAction(const G4Run * aRun)
17 {
18  if (std::ifstream(m_stopFile.c_str()))
19  {
20  edm::LogWarning("SimG4CoreApplication")
21  << "BeginOfRunAction: termination signal received";
22  m_runInterface->abortRun(true);
23  }
24  BeginOfRun r(aRun);
26 }
27 
28 void RunAction::EndOfRunAction(const G4Run * aRun)
29 {
30  if (std::ifstream(m_stopFile.c_str()))
31  {
32  edm::LogWarning("SimG4CoreApplication")
33  << "EndOfRunAction: termination signal received";
34  m_runInterface->abortRun(true);
35  }
36  EndOfRun r(aRun);
37  m_endOfRunSignal(&r);
38 }
39 
SimActivityRegistry::EndOfRunSignal m_endOfRunSignal
Definition: RunAction.h:23
void abortRun(bool softAbort)
std::string m_stopFile
Definition: RunAction.h:26
RunAction(const edm::ParameterSet &ps, SimRunInterface *)
Definition: RunAction.cc:12
string rm
Definition: submit.py:76
void EndOfRunAction(const G4Run *aRun)
Definition: RunAction.cc:28
void BeginOfRunAction(const G4Run *aRun)
Definition: RunAction.cc:16
SimActivityRegistry::BeginOfRunSignal m_beginOfRunSignal
Definition: RunAction.h:22
SimRunInterface * m_runInterface
Definition: RunAction.h:25