Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
F04RunAction Class Reference

#include <Doxymodules_field.h>

Inheritance diagram for F04RunAction:
G4UserRunAction

Public Member Functions

 F04RunAction ()
 
 ~F04RunAction () override
 
void BeginOfRunAction (const G4Run *) override
 
void EndOfRunAction (const G4Run *) override
 
void SetRndmFreq (G4int val)
 
G4int GetRndmFreq ()
 
void SetAutoSeed (const G4bool val)
 

Private Attributes

F04RunActionMessengerfRunMessenger = nullptr
 
G4int fSaveRndm = 0
 
G4bool fAutoSeed = false
 

Detailed Description

Definition at line 114 of file Doxymodules_field.h.

Constructor & Destructor Documentation

◆ F04RunAction()

F04RunAction::F04RunAction ( )

Definition at line 43 of file F04RunAction.cc.

44{
46}
F04RunActionMessenger * fRunMessenger

◆ ~F04RunAction()

F04RunAction::~F04RunAction ( )
override

Definition at line 50 of file F04RunAction.cc.

51{
52 delete fRunMessenger;
53}

Member Function Documentation

◆ BeginOfRunAction()

void F04RunAction::BeginOfRunAction ( const G4Run aRun)
override

Definition at line 58 of file F04RunAction.cc.

59{
60 G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
61
62 G4RunManager::GetRunManager()->SetRandomNumberStore(true);
63 G4RunManager::GetRunManager()->SetRandomNumberStoreDir("random/");
64
65 if (fAutoSeed) {
66 // automatic (time-based) random seeds for each run
67 G4cout << "*******************" << G4endl;
68 G4cout << "*** AUTOSEED ON ***" << G4endl;
69 G4cout << "*******************" << G4endl;
70 long seeds[2];
71 time_t systime = time(nullptr);
72 seeds[0] = (long) systime;
73 seeds[1] = (long) (systime*G4UniformRand());
74 G4Random::setTheSeeds(seeds);
75 G4Random::showEngineStatus();
76 } else {
77 G4Random::showEngineStatus();
78 }
79
80 if (fSaveRndm > 0)
81 {
82 std::ostringstream os;
83 os<<"beginOfRun_"<<G4Threading::G4GetThreadId()<<".rndm";
84 G4Random::saveEngineStatus(os.str().c_str());
85 }
86}

◆ EndOfRunAction()

void F04RunAction::EndOfRunAction ( const G4Run )
override

Definition at line 90 of file F04RunAction.cc.

91{
92 if (fSaveRndm == 1) {
93 G4Random::showEngineStatus();
94 std::ostringstream os;
95 os<<"endOfRun_"<<G4Threading::G4GetThreadId()<<".rndm";
96 G4Random::saveEngineStatus(os.str().c_str());
97 }
98}

◆ SetRndmFreq()

void F04RunAction::SetRndmFreq ( G4int  val)
inline

Definition at line 53 of file F04RunAction.hh.

53{fSaveRndm = val;}

◆ GetRndmFreq()

G4int F04RunAction::GetRndmFreq ( )
inline

Definition at line 54 of file F04RunAction.hh.

54{return fSaveRndm;}

◆ SetAutoSeed()

void F04RunAction::SetAutoSeed ( const G4bool  val)
inline

Definition at line 56 of file F04RunAction.hh.

56{fAutoSeed = val;}

Member Data Documentation

◆ fRunMessenger

F04RunActionMessenger* F04RunAction::fRunMessenger = nullptr
private

Definition at line 60 of file F04RunAction.hh.

◆ fSaveRndm

G4int F04RunAction::fSaveRndm = 0
private

Definition at line 62 of file F04RunAction.hh.

◆ fAutoSeed

G4bool F04RunAction::fAutoSeed = false
private

Definition at line 63 of file F04RunAction.hh.


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

Applications | User Support | Publications | Collaboration