Geant4  10.02.p03
WLSRunActionMessenger Class Reference

#include <WLSRunActionMessenger.hh>

Inheritance diagram for WLSRunActionMessenger:
Collaboration diagram for WLSRunActionMessenger:

Public Member Functions

 WLSRunActionMessenger (WLSRunAction *)
 
virtual ~WLSRunActionMessenger ()
 
virtual void SetNewValue (G4UIcommand *, G4String)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Private Attributes

WLSRunActionfRunAction
 
G4UIdirectoryfRndmDir
 
G4UIcmdWithAnIntegerfRndmSaveCmd
 
G4UIcmdWithAStringfRndmReadCmd
 
G4UIcmdWithABoolfSetAutoSeedCmd
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Definition at line 51 of file WLSRunActionMessenger.hh.

Constructor & Destructor Documentation

◆ WLSRunActionMessenger()

WLSRunActionMessenger::WLSRunActionMessenger ( WLSRunAction runaction)

Definition at line 49 of file WLSRunActionMessenger.cc.

50  : fRunAction (runaction)
51 {
52  fRndmDir = new G4UIdirectory("/rndm/");
53  fRndmDir->SetGuidance("Rndm status control.");
54 
55  fRndmSaveCmd = new G4UIcmdWithAnInteger("/rndm/save",this);
56  fRndmSaveCmd->
57  SetGuidance("set frequency to save rndm status on external files.");
58  fRndmSaveCmd->SetGuidance("freq = 0 not saved");
59  fRndmSaveCmd->SetGuidance("freq > 0 saved on: beginOfRun.rndm");
60  fRndmSaveCmd->SetGuidance("freq = 1 saved on: endOfRun.rndm");
61  fRndmSaveCmd->SetGuidance("freq = 2 saved on: endOfEvent.rndm");
62  fRndmSaveCmd->SetParameterName("frequency",false);
63  fRndmSaveCmd->SetRange("frequency>=0 && frequency<=2");
65 
66  fRndmReadCmd = new G4UIcmdWithAString("/rndm/read",this);
67  fRndmReadCmd->SetGuidance("get rndm status from an external file.");
68  fRndmReadCmd->SetParameterName("fileName",true);
69  fRndmReadCmd->SetDefaultValue ("beginOfRun.rndm");
71 
72  fSetAutoSeedCmd = new G4UIcmdWithABool("/rndm/autoSeed",this);
73  fSetAutoSeedCmd->SetGuidance("Switch on/off time-based random seeds");
74  fSetAutoSeedCmd->SetGuidance(" true: run seeds determined by system time");
75  fSetAutoSeedCmd->SetGuidance("false: use command 'random/resetEngineFrom'");
76  fSetAutoSeedCmd->SetGuidance("Default = false");
77  fSetAutoSeedCmd->SetParameterName("autoSeed", false);
79 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithAString * fRndmReadCmd
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
void SetDefaultValue(const char *defVal)
G4UIcmdWithABool * fSetAutoSeedCmd
G4UIcmdWithAnInteger * fRndmSaveCmd
Here is the call graph for this function:

◆ ~WLSRunActionMessenger()

WLSRunActionMessenger::~WLSRunActionMessenger ( )
virtual

Definition at line 83 of file WLSRunActionMessenger.cc.

84 {
85  delete fRndmDir; delete fRndmSaveCmd;
86  delete fRndmReadCmd; delete fSetAutoSeedCmd;
87 }
G4UIcmdWithAString * fRndmReadCmd
G4UIcmdWithABool * fSetAutoSeedCmd
G4UIcmdWithAnInteger * fRndmSaveCmd

Member Function Documentation

◆ SetNewValue()

void WLSRunActionMessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 91 of file WLSRunActionMessenger.cc.

92 {
93  if (command == fRndmSaveCmd)
95 
96  if (command == fRndmReadCmd)
97  { G4cout << "\n---> rndm status restored from file: " << newValue << G4endl;
98  G4Random::restoreEngineStatus(newValue);
99  G4Random::showEngineStatus();
100  }
101 
102  if(command == fSetAutoSeedCmd)
104 }
void SetAutoSeed(const G4bool val)
Definition: WLSRunAction.hh:61
static G4int GetNewIntValue(const char *paramString)
void SetRndmFreq(G4int val)
Definition: WLSRunAction.hh:58
static G4bool GetNewBoolValue(const char *paramString)
G4GLOB_DLL std::ostream G4cout
G4UIcmdWithAString * fRndmReadCmd
G4UIcmdWithABool * fSetAutoSeedCmd
#define G4endl
Definition: G4ios.hh:61
G4UIcmdWithAnInteger * fRndmSaveCmd
Here is the call graph for this function:

Member Data Documentation

◆ fRndmDir

G4UIdirectory* WLSRunActionMessenger::fRndmDir
private

Definition at line 64 of file WLSRunActionMessenger.hh.

◆ fRndmReadCmd

G4UIcmdWithAString* WLSRunActionMessenger::fRndmReadCmd
private

Definition at line 66 of file WLSRunActionMessenger.hh.

◆ fRndmSaveCmd

G4UIcmdWithAnInteger* WLSRunActionMessenger::fRndmSaveCmd
private

Definition at line 65 of file WLSRunActionMessenger.hh.

◆ fRunAction

WLSRunAction* WLSRunActionMessenger::fRunAction
private

Definition at line 62 of file WLSRunActionMessenger.hh.

◆ fSetAutoSeedCmd

G4UIcmdWithABool* WLSRunActionMessenger::fSetAutoSeedCmd
private

Definition at line 67 of file WLSRunActionMessenger.hh.


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