48 fITDirectory = std::make_unique<G4UIdirectory>(
"/scheduler/");
49 fITDirectory->SetGuidance(
"Control commands for the time scheduler "
50 "(dna chemistry applications).");
53 fEndTime = std::make_unique<G4UIcmdWithADoubleAndUnit>(
"/scheduler/endTime",
this);
54 fEndTime->SetGuidance(
"Set time at which the simulation must stop.");
56 fEndTime->SetUnitCategory(
"Time");
57 fEndTime->SetDefaultUnit(
"picosecond");
58 fEndTime->SetDefaultValue(1);
61 fTimeTolerance = std::make_unique<G4UIcmdWithADoubleAndUnit>(
"/scheduler/timeTolerance",
this);
62 fTimeTolerance->SetGuidance(
63 "This command aims at resolving issues related to"
64 " floating points. If two time events are separated by less than the "
65 "selected tolerance, they are assumed to belong to the same time step.");
67 fTimeTolerance->SetUnitCategory(
"Time");
68 fTimeTolerance->SetDefaultUnit(
"picosecond");
69 fTimeTolerance->SetDefaultValue(1);
72 fInitCmd = std::make_unique<G4UIcmdWithoutParameter>(
"/scheduler/initialize",
this);
73 fInitCmd->SetGuidance(
"Initialize G4Scheduler. This is done "
74 "for standalone application only (no physics).");
78 fMaxNULLTimeSteps = std::make_unique<G4UIcmdWithAnInteger>(
"/scheduler/maxNullTimeSteps",
this);
79 fMaxNULLTimeSteps->SetGuidance(
80 "Set maximum allowed zero time steps. After this "
81 "threshold, the simulation is stopped.");
82 fMaxNULLTimeSteps->SetParameterName(
"numberOfNullTimeSteps",
true);
83 fMaxNULLTimeSteps->SetDefaultValue(10000);
84 fMaxNULLTimeSteps->SetRange(
"numberOfNullTimeSteps >=0 ");
86 fMaxStepNumber = std::make_unique<G4UIcmdWithAnInteger>(
"/scheduler/maxStepNumber",
this);
87 fMaxStepNumber->SetGuidance(
88 "Set the maximum number of time steps. After this "
89 "threshold, the simulation is stopped.");
90 fMaxStepNumber->SetParameterName(
"maximumNumberOfSteps",
true);
91 fMaxStepNumber->SetDefaultValue(-1);
94 fProcessCmd = std::make_unique<G4UIcmdWithoutParameter>(
"/scheduler/process",
this);
95 fProcessCmd->SetGuidance(
96 "Process stacked tracks in G4Scheduler. This is done "
97 "for standalone application only (no physics).");
101 fVerboseCmd = std::make_unique<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);
107 fVerboseCmd->SetDefaultValue(1);
109 fWhyDoYouStop = std::make_unique<G4UIcmdWithoutParameter>(
"/scheduler/whyDoYouStop",
this);
110 fWhyDoYouStop->SetGuidance(
"Will print information on why the scheduler is "
111 "stopping the process");
113 fUseDefaultTimeSteps = std::make_unique<G4UIcmdWithABool>(
"/scheduler/useDefaultTimeSteps",
this);
114 fUseDefaultTimeSteps->SetGuidance(
115 "Let the G4 processes decided for the next "
116 "time step interval. This command would be interesting if no reaction has "
117 "been set and if one will want to track down Brownian objects. "
118 "NB: This command gets in conflicts with the declaration of time steps.");
120 fResetScavenger = std::make_unique<G4UIcmdWithABool>(
"/scheduler/ResetScavengerForEachBeamOn",
this);
121 fResetScavenger->SetGuidance(
122 "Reset Scavenger information apres each BeamOn.");
123 fResetScavenger->SetDefaultValue(
true);
131 if(command == fProcessCmd.get())
135 else if(command == fEndTime.get())
137 fScheduler->
SetEndTime(fEndTime->GetNewDoubleValue(newValue));
139 else if(command == fTimeTolerance.get())
143 else if(command == fVerboseCmd.get())
145 fScheduler->
SetVerbose(fVerboseCmd->GetNewIntValue(newValue));
147 else if(command == fInitCmd.get())
151 else if(command == fMaxNULLTimeSteps.get())
154 fMaxNULLTimeSteps->GetNewIntValue(newValue));
156 else if(command == fMaxStepNumber.get())
158 fScheduler->
SetMaxNbSteps(fMaxStepNumber->GetNewIntValue(newValue));
160 else if(command == fWhyDoYouStop.get())
164 else if(command == fUseDefaultTimeSteps.get())
167 fUseDefaultTimeSteps->GetNewBoolValue(newValue));
169 else if(command == fResetScavenger.get())
171 fScheduler->
ResetScavenger(fResetScavenger->GetNewBoolValue(newValue));
179 if(command == fVerboseCmd.get())
181 cv = fVerboseCmd->ConvertToString(fScheduler->
GetVerbose());
183 else if(command == fEndTime.get())
185 cv = fEndTime->ConvertToString(fScheduler->
GetEndTime());
187 else if(command == fTimeTolerance.get())
191 else if(command == fInitCmd.get())
195 else if(command == fMaxNULLTimeSteps.get())
200 else if(command == fMaxStepNumber.get())
202 cv = fMaxStepNumber->ConvertToString(fScheduler->
GetMaxNbSteps());
204 else if(command == fUseDefaultTimeSteps.get())
206 cv = fUseDefaultTimeSteps->ConvertToString(
void SetNewValue(G4UIcommand *command, G4String newValues)
G4String GetCurrentValue(G4UIcommand *command)
G4SchedulerMessenger(G4Scheduler *runMgr)
G4int GetMaxZeroTimeAllowed() const
void SetMaxNbSteps(G4int)
G4int GetMaxNbSteps() const
G4double GetEndTime() const
G4bool AreDefaultTimeStepsUsed()
void SetMaxZeroTimeAllowed(G4int)
void SetEndTime(const G4double)
G4double GetTimeTolerance() const
void SetTimeTolerance(G4double)
void ResetScavenger(bool)
void UseDefaultTimeSteps(G4bool)