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

#include <F02RunMessenger.hh>

Inheritance diagram for F02RunMessenger:
G4UImessenger

Public Member Functions

 F02RunMessenger (F02RunAction *)
 
virtual ~F02RunMessenger ()
 
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
 

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
 

Detailed Description

Definition at line 48 of file F02RunMessenger.hh.

Constructor & Destructor Documentation

F02RunMessenger::F02RunMessenger ( F02RunAction action)

Definition at line 45 of file F02RunMessenger.cc.

References G4UIcommand::AvailableForStates(), G4State_Idle, G4State_PreInit, G4UIcmdWithAString::SetDefaultValue(), G4UIcommand::SetGuidance(), G4UIcmdWithAString::SetParameterName(), G4UIcmdWithAnInteger::SetParameterName(), and G4UIcommand::SetRange().

46  : G4UImessenger(),
47  fRunAction(action),
48  fRndmDir(0),
49  fRndmSaveCmd(0),
50  fRndmReadCmd(0)
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 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
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:225
void SetDefaultValue(const char *defVal)
F02RunMessenger::~F02RunMessenger ( )
virtual

Definition at line 75 of file F02RunMessenger.cc.

76 {
77  delete fRndmSaveCmd;
78  delete fRndmReadCmd;
79  delete fRndmDir;
80 }

Member Function Documentation

void F02RunMessenger::SetNewValue ( G4UIcommand command,
G4String  newValues 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 84 of file F02RunMessenger.cc.

References G4cout, G4endl, G4UIcmdWithAnInteger::GetNewIntValue(), and F02RunAction::SetRndmFreq().

85 {
86  if (command == fRndmSaveCmd)
87  fRunAction->SetRndmFreq(fRndmSaveCmd->GetNewIntValue(newValues));
88 
89  if (command == fRndmReadCmd)
90  {G4cout << "\n---> rndm status restored from file: " << newValues << G4endl;
91  G4Random::restoreEngineStatus(newValues);
92  G4Random::showEngineStatus();
93  }
94 }
static G4int GetNewIntValue(const char *paramString)
void SetRndmFreq(G4int val)
Definition: F02RunAction.hh:56
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

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