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

#include <Doxymodules_field.h>

Inheritance diagram for F04RunActionMessenger:
G4UImessenger

Public Member Functions

 F04RunActionMessenger (F04RunAction *)
 
 ~F04RunActionMessenger () override
 
void SetNewValue (G4UIcommand *, G4String) override
 

Private Attributes

F04RunActionfRunAction = nullptr
 
G4UIdirectoryfRndmDir = nullptr
 
G4UIcmdWithAnIntegerfRndmSaveCmd = nullptr
 
G4UIcmdWithAStringfRndmReadCmd = nullptr
 
G4UIcmdWithABoolfSetAutoSeedCmd = nullptr
 

Detailed Description

Definition at line 115 of file Doxymodules_field.h.

Constructor & Destructor Documentation

◆ F04RunActionMessenger()

F04RunActionMessenger::F04RunActionMessenger ( F04RunAction runAction)

Definition at line 44 of file F04RunActionMessenger.cc.

45 : fRunAction (runAction)
46{
47 fRndmDir = new G4UIdirectory("/rndm/");
48 fRndmDir->SetGuidance("Rndm status control.");
49
50 fRndmSaveCmd = new G4UIcmdWithAnInteger("/rndm/save",this);
52 SetGuidance("set frequency to save rndm status on external files.");
53 fRndmSaveCmd->SetGuidance("freq = 0 not saved");
54 fRndmSaveCmd->SetGuidance("freq > 0 saved on: beginOfRun.rndm");
55 fRndmSaveCmd->SetGuidance("freq = 1 saved on: endOfRun.rndm");
56 fRndmSaveCmd->SetGuidance("freq = 2 saved on: endOfEvent.rndm");
57 fRndmSaveCmd->SetParameterName("frequency",false);
58 fRndmSaveCmd->SetRange("frequency>=0 && frequency<=2");
59 fRndmSaveCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
60
61 fRndmReadCmd = new G4UIcmdWithAString("/rndm/read",this);
62 fRndmReadCmd->SetGuidance("get rndm status from an external file.");
63 fRndmReadCmd->SetParameterName("fileName",true);
64 fRndmReadCmd->SetDefaultValue ("beginOfRun.rndm");
65 fRndmReadCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
66
67 fSetAutoSeedCmd = new G4UIcmdWithABool("/rndm/autoSeed",this);
68 fSetAutoSeedCmd->SetGuidance("Switch on/off time-based random seeds");
69 fSetAutoSeedCmd->SetGuidance(" true: run seeds determined by system time");
70 fSetAutoSeedCmd->SetGuidance("false: use command 'random/resetEngineFrom'");
71 fSetAutoSeedCmd->SetGuidance("Default = false");
72 fSetAutoSeedCmd->SetParameterName("autoSeed", false);
73 fSetAutoSeedCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
74}
G4UIcmdWithABool * fSetAutoSeedCmd
G4UIcmdWithAnInteger * fRndmSaveCmd
G4UIcmdWithAString * fRndmReadCmd

◆ ~F04RunActionMessenger()

F04RunActionMessenger::~F04RunActionMessenger ( )
override

Definition at line 78 of file F04RunActionMessenger.cc.

79{
80 delete fRndmDir; delete fRndmSaveCmd;
81 delete fRndmReadCmd; delete fSetAutoSeedCmd;
82}

Member Function Documentation

◆ SetNewValue()

void F04RunActionMessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
override

Definition at line 86 of file F04RunActionMessenger.cc.

87{
88 if (command == fRndmSaveCmd)
89 fRunAction->SetRndmFreq(fRndmSaveCmd->GetNewIntValue(newValue));
90
91 if (command == fRndmReadCmd)
92 { G4cout << "\n---> rndm status restored from file: " << newValue << G4endl;
93 G4Random::restoreEngineStatus(newValue);
94 G4Random::showEngineStatus();
95 }
96
97 if(command == fSetAutoSeedCmd)
98 fRunAction->SetAutoSeed(fSetAutoSeedCmd->GetNewBoolValue(newValue));
99}
void SetRndmFreq(G4int val)
void SetAutoSeed(const G4bool val)

Member Data Documentation

◆ fRunAction

F04RunAction* F04RunActionMessenger::fRunAction = nullptr
private

Definition at line 56 of file F04RunActionMessenger.hh.

◆ fRndmDir

G4UIdirectory* F04RunActionMessenger::fRndmDir = nullptr
private

Definition at line 58 of file F04RunActionMessenger.hh.

◆ fRndmSaveCmd

G4UIcmdWithAnInteger* F04RunActionMessenger::fRndmSaveCmd = nullptr
private

Definition at line 59 of file F04RunActionMessenger.hh.

◆ fRndmReadCmd

G4UIcmdWithAString* F04RunActionMessenger::fRndmReadCmd = nullptr
private

Definition at line 60 of file F04RunActionMessenger.hh.

◆ fSetAutoSeedCmd

G4UIcmdWithABool* F04RunActionMessenger::fSetAutoSeedCmd = nullptr
private

Definition at line 61 of file F04RunActionMessenger.hh.


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

Applications | User Support | Publications | Collaboration