Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
WLSRunAction Class Reference

#include <WLSRunAction.hh>

Inheritance diagram for WLSRunAction:
G4UserRunAction

Public Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from G4UserRunAction
G4bool isMaster
 

Detailed Description

Definition at line 46 of file WLSRunAction.hh.

Constructor & Destructor Documentation

WLSRunAction::WLSRunAction ( )

Definition at line 47 of file WLSRunAction.cc.

48  : fSaveRndm(0), fAutoSeed(false)
49 {
50  fRunMessenger = new WLSRunActionMessenger(this);
51 }
WLSRunAction::~WLSRunAction ( )
virtual

Definition at line 55 of file WLSRunAction.cc.

56 {
57  delete fRunMessenger;
58 }

Member Function Documentation

void WLSRunAction::BeginOfRunAction ( const G4Run aRun)
virtual

Reimplemented from G4UserRunAction.

Definition at line 62 of file WLSRunAction.cc.

References G4cout, G4endl, G4UniformRand, G4Run::GetRunID(), G4RunManager::GetRunManager(), G4RunManager::SetRandomNumberStore(), and G4RunManager::SetRandomNumberStoreDir().

63 {
64  G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
65 
68 
69  if (fAutoSeed) {
70  // automatic (time-based) random seeds for each run
71  G4cout << "*******************" << G4endl;
72  G4cout << "*** AUTOSEED ON ***" << G4endl;
73  G4cout << "*******************" << G4endl;
74  long seeds[2];
75  time_t systime = time(NULL);
76  seeds[0] = (long) systime;
77  seeds[1] = (long) (systime*G4UniformRand());
78  G4Random::setTheSeeds(seeds);
79  G4Random::showEngineStatus();
80  } else {
81  G4Random::showEngineStatus();
82  }
83 
84  if (fSaveRndm > 0) G4Random::saveEngineStatus("BeginOfRun.rndm");
85 
86 }
void SetRandomNumberStore(G4bool flag)
#define G4UniformRand()
Definition: Randomize.hh:87
G4GLOB_DLL std::ostream G4cout
G4int GetRunID() const
Definition: G4Run.hh:76
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:74
#define G4endl
Definition: G4ios.hh:61
void SetRandomNumberStoreDir(const G4String &dir)
void WLSRunAction::EndOfRunAction ( const G4Run )
virtual

Reimplemented from G4UserRunAction.

Definition at line 90 of file WLSRunAction.cc.

91 {
92  if (fSaveRndm == 1)
93  {
94  G4Random::showEngineStatus();
95  G4Random::saveEngineStatus("endOfRun.rndm");
96  }
97 }
G4int WLSRunAction::GetRndmFreq ( )
inline

Definition at line 59 of file WLSRunAction.hh.

Referenced by WLSEventAction::EndOfEventAction().

59 { return fSaveRndm; }
void WLSRunAction::SetAutoSeed ( const G4bool  val)
inline

Definition at line 61 of file WLSRunAction.hh.

Referenced by WLSRunActionMessenger::SetNewValue().

61 { fAutoSeed = val; }
void WLSRunAction::SetRndmFreq ( G4int  val)
inline

Definition at line 58 of file WLSRunAction.hh.

Referenced by WLSRunActionMessenger::SetNewValue().

58 { fSaveRndm = val; }

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