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 
7 #include <iostream>
8 #include <fstream>
9 
11  : m_runManager(rm),
12  m_stopFile(p.getParameter<std::string>("StopFile")) {}
13 
14 void RunAction::BeginOfRunAction(const G4Run * aRun)
15 {
16  if (std::ifstream(m_stopFile.c_str()))
17  {
18  std::cout << "BeginOfRunAction: termination signal received" << std::endl;
19  //RunManager::instance()->abortRun(true);
20  m_runManager->abortRun(true);
21  }
22  BeginOfRun r(aRun);
24 }
25 
26 void RunAction::EndOfRunAction(const G4Run * aRun)
27 {
28  if (std::ifstream(m_stopFile.c_str()))
29  {
30  std::cout << "EndOfRunAction: termination signal received" << std::endl;
31  //RunManager::instance()->abortRun(true);
32  m_runManager->abortRun(true);
33  }
34  EndOfRun r(aRun);
35  m_endOfRunSignal(&r);
36 }
37 
RunAction(const edm::ParameterSet &ps, RunManager *)
Definition: RunAction.cc:10
void abortRun(bool softAbort=false)
Definition: RunManager.cc:470
SimActivityRegistry::EndOfRunSignal m_endOfRunSignal
Definition: RunAction.h:23
std::string m_stopFile
Definition: RunAction.h:26
string rm
Definition: submit.py:76
void EndOfRunAction(const G4Run *aRun)
Definition: RunAction.cc:26
void BeginOfRunAction(const G4Run *aRun)
Definition: RunAction.cc:14
RunManager * m_runManager
Definition: RunAction.h:25
SimActivityRegistry::BeginOfRunSignal m_beginOfRunSignal
Definition: RunAction.h:22
tuple cout
Definition: gather_cfg.py:121