Geant4  10.02.p03
G4SchedulerMessenger Class Reference

#include <G4SchedulerMessenger.hh>

Inheritance diagram for G4SchedulerMessenger:
Collaboration diagram for G4SchedulerMessenger:

Public Member Functions

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

Private Attributes

G4SchedulerfScheduler
 
G4UIdirectoryfITDirectory
 
G4UIcmdWithADoubleAndUnitfEndTime
 
G4UIcmdWithADoubleAndUnitfTimeTolerance
 
G4UIcmdWithAnIntegerfVerboseCmd
 
G4UIcmdWithAnIntegerfMaxStepNumber
 
G4UIcmdWithoutParameterfInitCmd
 
G4UIcmdWithoutParameterfProcessCmd
 
G4UIcmdWithAnIntegerfMaxNULLTimeSteps
 
G4UIcmdWithoutParameterfWhyDoYouStop
 
G4UIcmdWithABoolfUseDefaultTimeSteps
 

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 66 of file G4SchedulerMessenger.hh.

Constructor & Destructor Documentation

◆ G4SchedulerMessenger()

G4SchedulerMessenger::G4SchedulerMessenger ( G4Scheduler runMgr)

Definition at line 47 of file G4SchedulerMessenger.cc.

47  :
48  fScheduler(stepMgr)
49 {
50  fITDirectory = new G4UIdirectory("/scheduler/");
51  fITDirectory->SetGuidance("Control commands for the time scheduler "
52  "(dna chemistry applications).");
53 
54  // Set end time
55  fEndTime = new G4UIcmdWithADoubleAndUnit("/scheduler/endTime", this);
56  fEndTime->SetGuidance("Set time at which the simulation must stop.");
58  fEndTime->SetUnitCategory("Time");
59  fEndTime->SetDefaultUnit("picosecond");
61 
62  // Set time tolerance
63  fTimeTolerance = new G4UIcmdWithADoubleAndUnit("/scheduler/timeTolerance",
64  this);
65  fTimeTolerance->SetGuidance("This command aims at resolving issues related to"
66  " floating points. If two time events are separated by less than the "
67  "selected tolerance, they are assumed to belong to the same time step.");
70  fTimeTolerance->SetDefaultUnit("picosecond");
72 
73  // Initialize
74  fInitCmd = new G4UIcmdWithoutParameter("/scheduler/initialize", this);
75  fInitCmd->SetGuidance("Initialize G4Scheduler. This is done "
76  "for standalone application only (no physics).");
78 
79  // Set Max Null time Step
80  fMaxNULLTimeSteps = new G4UIcmdWithAnInteger("/scheduler/maxNullTimeSteps",
81  this);
82  fMaxNULLTimeSteps->SetGuidance("Set maximum allowed zero time steps. After this "
83  "threshold, the simulation is stopped.");
84  fMaxNULLTimeSteps->SetParameterName("numberOfNullTimeSteps", true);
86  fMaxNULLTimeSteps->SetRange("numberOfNullTimeSteps >=0 ");
87 
88  fMaxStepNumber = new G4UIcmdWithAnInteger("/scheduler/maxStepNumber", this);
89  fMaxStepNumber->SetGuidance("Set the maximum number of time steps. After this "
90  "threshold, the simulation is stopped.");
91  fMaxStepNumber->SetParameterName("maximumNumberOfSteps", true);
93 
94  // Beam On
95  fProcessCmd = new G4UIcmdWithoutParameter("/scheduler/process", this);
96  fProcessCmd->SetGuidance("Process stacked tracks in G4Scheduler. This is done "
97  "for standalone application only (no physics).");
99 
100  // Verbose
101  fVerboseCmd = new G4UIcmdWithAnInteger("/scheduler/verbose", this);
102  fVerboseCmd->SetGuidance("Set the Verbose level of G4Scheduler.");
103  fVerboseCmd->SetGuidance(" 0 : Silent (default)");
104  fVerboseCmd->SetGuidance(" 1 : Display reactions");
105  fVerboseCmd->SetGuidance(" 2 ");
106  fVerboseCmd->SetParameterName("level", true);
108  // fVerboseCmd->SetRange("level >=0 && level <=4");
109 
110  fWhyDoYouStop = new G4UIcmdWithoutParameter("/scheduler/whyDoYouStop",this);
111  fWhyDoYouStop->SetGuidance("Will print information on why the scheduler is "
112  "stopping the process");
113 
114  fUseDefaultTimeSteps = new G4UIcmdWithABool("/scheduler/useDefaultTimeSteps",
115  this);
116  fUseDefaultTimeSteps->SetGuidance("Let the G4 processes decided for the next "
117  "time step interval. This command would be interesting if no reaction has "
118  "been set and if one will want to track down Brownian objects. "
119  "NB: This command gets in conflicts with the declaration of time steps.");
120 }
G4UIcmdWithoutParameter * fWhyDoYouStop
G4UIcmdWithADoubleAndUnit * fEndTime
G4UIdirectory * fITDirectory
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetUnitCategory(const char *unitCategory)
G4UIcmdWithAnInteger * fMaxStepNumber
G4UIcmdWithADoubleAndUnit * fTimeTolerance
G4UIcmdWithAnInteger * fMaxNULLTimeSteps
G4UIcmdWithoutParameter * fInitCmd
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
G4UIcmdWithABool * fUseDefaultTimeSteps
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
void SetDefaultUnit(const char *defUnit)
void SetDefaultValue(G4int defVal)
G4UIcmdWithAnInteger * fVerboseCmd
G4UIcmdWithoutParameter * fProcessCmd
Here is the call graph for this function:

◆ ~G4SchedulerMessenger()

G4SchedulerMessenger::~G4SchedulerMessenger ( )

Definition at line 122 of file G4SchedulerMessenger.cc.

123 {
124  delete fTimeTolerance;
125  delete fITDirectory;
126  delete fInitCmd;
127  delete fEndTime;
128  delete fMaxNULLTimeSteps;
129  delete fMaxStepNumber;
130  delete fProcessCmd;
131  delete fVerboseCmd;
132  delete fWhyDoYouStop;
133  delete fUseDefaultTimeSteps;
134 }
G4UIcmdWithoutParameter * fWhyDoYouStop
G4UIcmdWithADoubleAndUnit * fEndTime
G4UIdirectory * fITDirectory
G4UIcmdWithAnInteger * fMaxStepNumber
G4UIcmdWithADoubleAndUnit * fTimeTolerance
G4UIcmdWithAnInteger * fMaxNULLTimeSteps
G4UIcmdWithoutParameter * fInitCmd
G4UIcmdWithABool * fUseDefaultTimeSteps
G4UIcmdWithAnInteger * fVerboseCmd
G4UIcmdWithoutParameter * fProcessCmd

Member Function Documentation

◆ GetCurrentValue()

G4String G4SchedulerMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 179 of file G4SchedulerMessenger.cc.

180 {
181  G4String cv;
182 
183  if (command == fVerboseCmd)
184  {
186  }
187  else if (command == fEndTime)
188  {
190  }
191  else if (command == fTimeTolerance)
192  {
194  }
195  else if (command == fInitCmd)
196  {
198  }
199  else if (command == fMaxNULLTimeSteps)
200  {
203  }
204  else if (command == fMaxStepNumber)
205  {
207  }
208  else if (command == fUseDefaultTimeSteps)
209  {
211  }
212 
213  return cv;
214 }
G4UIcmdWithADoubleAndUnit * fEndTime
int GetMaxZeroTimeAllowed() const
Definition: G4Scheduler.hh:388
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:371
G4UIcmdWithAnInteger * fMaxStepNumber
G4int GetMaxNbSteps() const
Definition: G4Scheduler.hh:331
G4UIcmdWithADoubleAndUnit * fTimeTolerance
G4UIcmdWithAnInteger * fMaxNULLTimeSteps
G4UIcmdWithoutParameter * fInitCmd
G4bool AreDefaultTimeStepsUsed()
Definition: G4Scheduler.hh:443
G4double GetEndTime() const
Definition: G4Scheduler.hh:341
G4UIcmdWithABool * fUseDefaultTimeSteps
int GetVerbose() const
Definition: G4Scheduler.hh:377
bool IsInitialized()
Definition: G4Scheduler.hh:288
double GetTimeTolerance() const
Definition: G4Scheduler.hh:398
G4UIcmdWithAnInteger * fVerboseCmd
Here is the call graph for this function:

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 136 of file G4SchedulerMessenger.cc.

138 {
139  if (command == fProcessCmd)
140  {
141  fScheduler->Process();
142  }
143  else if (command == fEndTime)
144  {
146  }
147  else if (command == fTimeTolerance)
148  {
150  fTimeTolerance->GetNewDoubleValue(newValue));
151  }
152  else if (command == fVerboseCmd)
153  {
155  }
156  else if (command == fInitCmd)
157  {
159  }
160  else if (command == fMaxNULLTimeSteps)
161  {
163  fMaxNULLTimeSteps->GetNewIntValue(newValue));
164  }
165  else if (command == fMaxStepNumber)
166  {
168  }
169  else if (command == fWhyDoYouStop)
170  {
172  }
173  else if (command == fUseDefaultTimeSteps)
174  {
176  }
177 }
void Process()
Definition: G4Scheduler.cc:377
G4UIcmdWithoutParameter * fWhyDoYouStop
G4UIcmdWithADoubleAndUnit * fEndTime
static G4int GetNewIntValue(const char *paramString)
void SetEndTime(const double)
Definition: G4Scheduler.hh:298
void SetTimeTolerance(double)
Definition: G4Scheduler.hh:393
static G4double GetNewDoubleValue(const char *paramString)
G4UIcmdWithAnInteger * fMaxStepNumber
static G4bool GetNewBoolValue(const char *paramString)
G4UIcmdWithADoubleAndUnit * fTimeTolerance
G4UIcmdWithAnInteger * fMaxNULLTimeSteps
G4UIcmdWithoutParameter * fInitCmd
void SetVerbose(int)
Definition: G4Scheduler.hh:372
G4UIcmdWithABool * fUseDefaultTimeSteps
void SetMaxNbSteps(G4int)
Definition: G4Scheduler.hh:326
void SetMaxZeroTimeAllowed(int)
Definition: G4Scheduler.hh:383
G4UIcmdWithAnInteger * fVerboseCmd
void UseDefaultTimeSteps(G4bool)
Definition: G4Scheduler.hh:438
void Initialize()
Definition: G4Scheduler.cc:282
G4UIcmdWithoutParameter * fProcessCmd
void WhyDoYouStop()
Definition: G4Scheduler.hh:433
Here is the call graph for this function:

Member Data Documentation

◆ fEndTime

G4UIcmdWithADoubleAndUnit* G4SchedulerMessenger::fEndTime
private

Definition at line 82 of file G4SchedulerMessenger.hh.

◆ fInitCmd

G4UIcmdWithoutParameter* G4SchedulerMessenger::fInitCmd
private

Definition at line 86 of file G4SchedulerMessenger.hh.

◆ fITDirectory

G4UIdirectory* G4SchedulerMessenger::fITDirectory
private

Definition at line 80 of file G4SchedulerMessenger.hh.

◆ fMaxNULLTimeSteps

G4UIcmdWithAnInteger* G4SchedulerMessenger::fMaxNULLTimeSteps
private

Definition at line 88 of file G4SchedulerMessenger.hh.

◆ fMaxStepNumber

G4UIcmdWithAnInteger* G4SchedulerMessenger::fMaxStepNumber
private

Definition at line 85 of file G4SchedulerMessenger.hh.

◆ fProcessCmd

G4UIcmdWithoutParameter* G4SchedulerMessenger::fProcessCmd
private

Definition at line 87 of file G4SchedulerMessenger.hh.

◆ fScheduler

G4Scheduler* G4SchedulerMessenger::fScheduler
private

Definition at line 77 of file G4SchedulerMessenger.hh.

◆ fTimeTolerance

G4UIcmdWithADoubleAndUnit* G4SchedulerMessenger::fTimeTolerance
private

Definition at line 83 of file G4SchedulerMessenger.hh.

◆ fUseDefaultTimeSteps

G4UIcmdWithABool* G4SchedulerMessenger::fUseDefaultTimeSteps
private

Definition at line 90 of file G4SchedulerMessenger.hh.

◆ fVerboseCmd

G4UIcmdWithAnInteger* G4SchedulerMessenger::fVerboseCmd
private

Definition at line 84 of file G4SchedulerMessenger.hh.

◆ fWhyDoYouStop

G4UIcmdWithoutParameter* G4SchedulerMessenger::fWhyDoYouStop
private

Definition at line 89 of file G4SchedulerMessenger.hh.


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