Geant4  10.02.p03
UIhelpers Namespace Reference

Functions

template<class T >
void buildCommands (T *proc, const char *dir, const char *guidance)
 
void buildCommands (G4OpWLS *op)
 
void buildCommands (G4Scintillation *ScintillationProcess)
 
void buildCommands (G4Cerenkov *CerenkovProcess)
 

Function Documentation

◆ buildCommands() [1/4]

template<class T >
void UIhelpers::buildCommands ( T *  proc,
const char *  dir,
const char *  guidance 
)

Definition at line 153 of file G4OpticalPhysics.cc.

154  {
155  //Generic function to add a "verbose" command for a process
156  G4GenericMessenger* mess = new G4GenericMessenger(proc,dir,guidance);
158  G4GenericMessenger::Command& wlscmd4 = mess->DeclareMethod("verbose",&T::SetVerboseLevel,
159  "Set the verbose level");
160  wlscmd4.SetParameterName("ver",true);
161  wlscmd4.SetDefaultValue("1");
162  wlscmd4.SetStates(G4State_Idle);
163  }
This class is generic messenger.
Command & DeclareMethod(const G4String &name, const G4AnyMethod &fun, const G4String &doc="")
TDirectory * dir
Command & SetDefaultValue(const G4String &)
void Register(T *inst)
Definition: G4AutoDelete.hh:65
Command & SetStates(G4ApplicationState s0)
Command & SetParameterName(const G4String &, G4bool, G4bool=false)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildCommands() [2/4]

void UIhelpers::buildCommands ( G4OpWLS op)

Definition at line 165 of file G4OpticalPhysics.cc.

166  {
167  //Build UI commands for WLS
168  G4GenericMessenger* mess = new G4GenericMessenger(op,DIR_CMDS"/wls/",GUIDANCE" for WLS process.");
170  //Here, more correctly DeclareProperty should be used, but to do that, I would need public/friend
171  //access of G4GenericMessenger to private members of G4Scintillation. Thus I use the approach
172  //of DeclareMethod, that has a draw back: range checking does not work
173  G4GenericMessenger::Command& wlscmd1 = mess->DeclareMethod("setTimeProfile",&G4OpWLS::UseTimeProfile,
174  "Set the WLS time profile (delta or exponential)");
175  wlscmd1.SetParameterName("profile",false);
176  wlscmd1.SetCandidates("delta exponential");
177  wlscmd1.SetStates(G4State_Idle);
178  buildCommands(op,DIR_CMDS"/wls/",GUIDANCE" for WLS process.");
179  }
This class is generic messenger.
Command & DeclareMethod(const G4String &name, const G4AnyMethod &fun, const G4String &doc="")
#define DIR_CMDS
void UseTimeProfile(const G4String name)
Definition: G4OpWLS.cc:417
void Register(T *inst)
Definition: G4AutoDelete.hh:65
void buildCommands(G4Cerenkov *CerenkovProcess)
Command & SetStates(G4ApplicationState s0)
Command & SetCandidates(const G4String &)
Command & SetParameterName(const G4String &, G4bool, G4bool=false)
#define GUIDANCE
Here is the call graph for this function:

◆ buildCommands() [3/4]

void UIhelpers::buildCommands ( G4Scintillation ScintillationProcess)

Definition at line 181 of file G4OpticalPhysics.cc.

182  {
183  //Build UI commands for scintillation
184  G4GenericMessenger* mess = new G4GenericMessenger(ScintillationProcess,DIR_CMDS"/scintillation/",GUIDANCE" for scintillation process.");
186  G4GenericMessenger::Command& sccmd1 = mess->DeclareMethod("setFiniteRiseTime",
188  "Set option of a finite rise-time for G4Scintillation - If set, the G4Scintillation process expects the user to have set the constant material property FAST/SLOWSCINTILLATIONRISETIME");
189  sccmd1.SetParameterName("time",false);
190  sccmd1.SetStates(G4State_Idle);
191 
192  G4GenericMessenger::Command& sccmd2 = mess->DeclareMethod("setYieldFactor",
194  "Set scintillation yield factor");
195  sccmd2.SetParameterName("factor",false);
196  //sccmd2.SetRange("factor>=0."); //LIMITATION: w/ DeclareMethod range checking does not work
197  sccmd2.SetStates(G4State_Idle);
198 
199  G4GenericMessenger::Command& sccmd3 = mess->DeclareMethod("setExcitationRatio",
201  "Set scintillation excitation ratio");
202  sccmd3.SetParameterName("ratio",false);
203  //sccmd3.SetRange("ratio>=0.&&ratio<=1.");//LIMITATION: w/ DeclareMethod range checking does not work
204  sccmd3.SetStates(G4State_Idle);
205  G4GenericMessenger::Command& sccmd4 = mess->DeclareMethod("setByParticleType",
207  "Activate/Inactivate scintillation process by particle type");
208  sccmd4.SetParameterName("flag", false);
209  sccmd4.SetStates(G4State_Idle);
210 
211  G4GenericMessenger::Command& sccmd5 = mess->DeclareMethod("setTrackSecondariesFirst",
213  "Set option to track secondaries before finishing their parent track");
214  sccmd5.SetParameterName("flag",false);
215  sccmd5.SetStates(G4State_Idle);
216 
217  buildCommands(ScintillationProcess,DIR_CMDS"/scintillation/",GUIDANCE" for scintillation process.");
218  }
void SetScintillationByParticleType(const G4bool)
void SetFiniteRiseTime(const G4bool state)
This class is generic messenger.
Command & DeclareMethod(const G4String &name, const G4AnyMethod &fun, const G4String &doc="")
#define DIR_CMDS
void SetScintillationYieldFactor(const G4double yieldfactor)
void Register(T *inst)
Definition: G4AutoDelete.hh:65
void buildCommands(G4Cerenkov *CerenkovProcess)
Command & SetStates(G4ApplicationState s0)
void SetScintillationExcitationRatio(const G4double ratio)
void SetTrackSecondariesFirst(const G4bool state)
Command & SetParameterName(const G4String &, G4bool, G4bool=false)
#define GUIDANCE
Here is the call graph for this function:

◆ buildCommands() [4/4]

void UIhelpers::buildCommands ( G4Cerenkov CerenkovProcess)

Definition at line 220 of file G4OpticalPhysics.cc.

221  {
222  //BUild UI commands for cerenkov
223  G4GenericMessenger* mess = new G4GenericMessenger(CerenkovProcess,DIR_CMDS"/cerenkov/",GUIDANCE" for Cerenkov process.");
225  G4GenericMessenger::Command& cecmd1 = mess->DeclareMethod("setMaxPhotons",
227  "Set maximum number of photons per step");
228  cecmd1.SetParameterName("max",false);
229  //cecmd1.SetRange("max>=0");//LIMITATION: w/ DeclareMethod range checking does not work
230  cecmd1.SetStates(G4State_Idle);
231 
232  G4GenericMessenger::Command& cecmd2 = mess->DeclareMethod("setMaxBetaChange",
234  "Set maximum change of beta of parent particle per step");
235  cecmd2.SetParameterName("max",false);
236  //cecmd2.SetRange("max>=0.");//LIMITATION: w/ DeclareMethod range checking does not work
237  cecmd2.SetStates(G4State_Idle);
238 
239  G4GenericMessenger::Command& cecmd3 = mess->DeclareMethod("setTrackSecondariesFirst",
241  "Set option to track secondaries before finishing their parent track");
242  cecmd3.SetParameterName("flag",false);
243  cecmd3.SetStates(G4State_Idle);
244 
245  buildCommands(CerenkovProcess,DIR_CMDS"/cerenkov/",GUIDANCE" for Cerenkov process.");
246  }
void SetMaxBetaChangePerStep(const G4double d)
Definition: G4Cerenkov.cc:151
void SetTrackSecondariesFirst(const G4bool state)
Definition: G4Cerenkov.cc:146
This class is generic messenger.
Command & DeclareMethod(const G4String &name, const G4AnyMethod &fun, const G4String &doc="")
#define DIR_CMDS
void Register(T *inst)
Definition: G4AutoDelete.hh:65
void SetMaxNumPhotonsPerStep(const G4int NumPhotons)
Definition: G4Cerenkov.cc:156
void buildCommands(G4Cerenkov *CerenkovProcess)
Command & SetStates(G4ApplicationState s0)
Command & SetParameterName(const G4String &, G4bool, G4bool=false)
#define GUIDANCE
Here is the call graph for this function:
Here is the caller graph for this function: