Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PurgMagRunAction Class Reference

#include <PurgMagRunAction.hh>

Inheritance diagram for PurgMagRunAction:
Collaboration diagram for PurgMagRunAction:

Public Member Functions

 PurgMagRunAction ()
 
 ~PurgMagRunAction ()
 
void BeginOfRunAction (const G4Run *)
 
void EndOfRunAction (const G4Run *)
 
void SetRndmFreq (G4int val)
 
G4int GetRndmFreq ()
 
- Public Member Functions inherited from G4UserRunAction
 G4UserRunAction ()
 
virtual ~G4UserRunAction ()
 
virtual G4RunGenerateRun ()
 
virtual void SetMaster (G4bool val=true)
 
G4bool IsMaster () const
 

Additional Inherited Members

- Protected Attributes inherited from G4UserRunAction
G4bool isMaster
 

Detailed Description

Definition at line 49 of file PurgMagRunAction.hh.

Constructor & Destructor Documentation

PurgMagRunAction::PurgMagRunAction ( )

Definition at line 48 of file PurgMagRunAction.cc.

49 {
50  saveRndm = 1;
51 }
PurgMagRunAction::~PurgMagRunAction ( )

Definition at line 55 of file PurgMagRunAction.cc.

56 {}

Member Function Documentation

void PurgMagRunAction::BeginOfRunAction ( const G4Run aRun)
virtual

Reimplemented from G4UserRunAction.

Definition at line 60 of file PurgMagRunAction.cc.

61 {
62  //Analysis must be handled by master and workers
64  analysis->book();
65 
66 
67  if (IsMaster())
68  G4cout << "---> Run " << aRun->GetRunID() << " (master) start."
69  << G4endl;
70  else
71  G4cout << "---> Run " << aRun->GetRunID() << " (worker) start."
72  << G4endl;
73 
74 
75  // save Rndm status
76  if (saveRndm > 0 && IsMaster())
77  {
78  G4Random::showEngineStatus();
79  G4Random::saveEngineStatus("beginOfRun.rndm");
80  }
81 
82 }
G4GLOB_DLL std::ostream G4cout
G4bool IsMaster() const
G4int GetRunID() const
Definition: G4Run.hh:76
Uncomment #include to switch to ROOT or XML output file.
#define G4endl
Definition: G4ios.hh:61
static PurgMagAnalysisManager * getInstance()

Here is the call graph for this function:

void PurgMagRunAction::EndOfRunAction ( const G4Run aRun)
virtual

Reimplemented from G4UserRunAction.

Definition at line 87 of file PurgMagRunAction.cc.

88 {
89 
91  analysis->finish();
92 
93  if (IsMaster())
94  G4cout << "Total number of event = " << aRun->GetNumberOfEvent() << G4endl;
95  else
96  G4cout << "Partial number of event in this worker = "
97  << aRun->GetNumberOfEvent() << G4endl;
98 
99 
100  if (IsMaster())
101  {
102  // save Rndm status
103  if (saveRndm == 1)
104  {
105  G4Random::showEngineStatus();
106  G4Random::saveEngineStatus("endOfRun.rndm");
107  }
108  }
109 }
G4GLOB_DLL std::ostream G4cout
G4int GetNumberOfEvent() const
Definition: G4Run.hh:79
G4bool IsMaster() const
Uncomment #include to switch to ROOT or XML output file.
#define G4endl
Definition: G4ios.hh:61
static PurgMagAnalysisManager * getInstance()

Here is the call graph for this function:

G4int PurgMagRunAction::GetRndmFreq ( )
inline

Definition at line 60 of file PurgMagRunAction.hh.

60 {return saveRndm;}
void PurgMagRunAction::SetRndmFreq ( G4int  val)
inline

Definition at line 59 of file PurgMagRunAction.hh.

59 {saveRndm = val;}

The documentation for this class was generated from the following files: