61 : params(opticalParameters)
64 G4bool toBeBroadcasted =
false;
65 fDir =
new G4UIdirectory(
"/process/optical/defaults/",toBeBroadcasted);
66 fDir->
SetGuidance(
"DEPRECATED Commands related to the optical physics simulation engine.");
67 fDir2 =
new G4UIdirectory(
"/process/optical/",toBeBroadcasted);
68 fDir2->
SetGuidance(
"Commands related to the optical physics simulation engine.");
70 CreateDirectory(
"/process/optical/defaults/cerenkov/",
"DEPRECATED Cerenkov process commands");
71 CreateDirectory(
"/process/optical/defaults/scintillation/",
"DEPRECATED Scintillation process commands");
72 CreateDirectory(
"/process/optical/defaults/wls/",
"DEPRECATED Wave length shifting process commands");
73 CreateDirectory(
"/process/optical/defaults/boundary/",
"DEPRECATED Boundary scattering commands");
75 CreateDirectory(
"/process/optical/cerenkov/",
"Cerenkov process commands");
76 CreateDirectory(
"/process/optical/scintillation/",
"Scintillation process commands");
77 CreateDirectory(
"/process/optical/wls/",
"Wave length shifting process commands");
78 CreateDirectory(
"/process/optical/wls2/",
"Second Wave length shifting process commands");
79 CreateDirectory(
"/process/optical/boundary/",
"Boundary scattering commands");
80 CreateDirectory(
"/process/optical/mie/",
"Mie scattering process commands");
81 CreateDirectory(
"/process/optical/absorption/",
"absorption process commands");
82 CreateDirectory(
"/process/optical/rayleigh/",
"Rayleigh scattering commands");
85 fActivateProcessCmd=
new G4UIcommand(
"/process/optical/processActivation",
this);
86 fActivateProcessCmd->
SetGuidance(
"Activate/deactivate the specified optical process");
103 fTrackSecondariesFirstCmd =
new G4UIcommand(
"/process/optical/setTrackSecondariesFirst",
this);
104 fTrackSecondariesFirstCmd->
SetGuidance(
"Activate/deactivate tracking of secondaries before finishing their parent track");
105 fTrackSecondariesFirstCmd->
SetGuidance(
"DEPRECATED: Use /process/optical/cerenkov/setTrackSecondariesFirst and");
106 fTrackSecondariesFirstCmd->
SetGuidance(
"/process/optical/scintillation/setTrackSecondariesFirst and instead.");
116 fVerboseCmd->
SetGuidance(
"Set default verbose level for optical processes");
122 fDumpCmd =
new G4UIcommand(
"/process/optical/printParameters",
this);
123 fDumpCmd->
SetGuidance(
"Print all optical parameters.");
126 fCerenkovMaxPhotons1Cmd =
new G4UIcmdWithAnInteger(
"/process/optical/defaults/cerenkov/setMaxPhotons",
this);
127 fCerenkovMaxPhotons1Cmd->
SetGuidance(
"Set maximum number of photons per step");
128 fCerenkovMaxPhotons1Cmd->
SetGuidance(
"DEPRECATED: use /process/optical/cerenkov/setMaxPhotons instead.");
130 fCerenkovMaxPhotons1Cmd->
SetRange(
"CerenkovMaxPhotons>=0");
133 fCerenkovMaxPhotonsCmd =
new G4UIcmdWithAnInteger(
"/process/optical/cerenkov/setMaxPhotons",
this);
134 fCerenkovMaxPhotonsCmd->
SetGuidance(
"Set maximum number of photons per step");
136 fCerenkovMaxPhotonsCmd->
SetRange(
"CerenkovMaxPhotons>=0");
139 fCerenkovMaxBetaChange1Cmd =
new G4UIcmdWithADouble(
"/process/optical/defaults/cerenkov/setMaxBetaChange",
this);
140 fCerenkovMaxBetaChange1Cmd->
SetGuidance(
"Set maximum change of beta of parent particle per step");
141 fCerenkovMaxBetaChange1Cmd->
SetGuidance(
"DEPRECATED: use /process/optical/cerenkov/setMaxBetaChange instead.");
142 fCerenkovMaxBetaChange1Cmd->
SetParameterName(
"CerenkovMaxBetaChange",
false);
143 fCerenkovMaxBetaChange1Cmd->
SetRange(
"CerenkovMaxBetaChange>=0");
146 fCerenkovMaxBetaChangeCmd =
new G4UIcmdWithADouble(
"/process/optical/cerenkov/setMaxBetaChange",
this);
147 fCerenkovMaxBetaChangeCmd->
SetGuidance(
"Set maximum change of beta of parent particle per step");
148 fCerenkovMaxBetaChangeCmd->
SetParameterName(
"CerenkovMaxBetaChange",
false);
149 fCerenkovMaxBetaChangeCmd->
SetRange(
"CerenkovMaxBetaChange>=0");
152 fCerenkovStackPhotons1Cmd =
new G4UIcmdWithABool(
"/process/optical/defaults/cerenkov/setStackPhotons",
this);
153 fCerenkovStackPhotons1Cmd->
SetGuidance(
"Set whether or not to stack secondary Cerenkov photons");
154 fCerenkovStackPhotons1Cmd->
SetGuidance(
"DEPRECATED: use /process/optical/cerenkov/setStackPhotons instead.");
159 fCerenkovStackPhotonsCmd =
new G4UIcmdWithABool(
"/process/optical/cerenkov/setStackPhotons",
this);
160 fCerenkovStackPhotonsCmd->
SetGuidance(
"Set whether or not to stack secondary Cerenkov photons");
163 fCerenkovTrackSecondariesFirstCmd =
new G4UIcmdWithABool(
"/process/optical/cerenkov/setTrackSecondariesFirst",
this);
164 fCerenkovTrackSecondariesFirstCmd->
SetGuidance(
"Whether to track secondary Cerenkov photons before the primary.");
168 fCerenkovVerboseLevelCmd->
SetGuidance(
"Verbose level for Cerenkov process.");
170 fCerenkovVerboseLevelCmd->
SetRange(
"verbose >= 0 && verbose <= 2");
175 fScintYieldFactor1Cmd =
new G4UIcmdWithADouble(
"/process/optical/defaults/scintillation/setYieldFactor",
this);
176 fScintYieldFactor1Cmd->
SetGuidance(
"Set scintillation yield factor");
177 fScintYieldFactor1Cmd->
SetGuidance(
"DEPRECATED: use /process/optical/scintillation/setYieldFactorinstead.");
179 fScintYieldFactor1Cmd->
SetRange(
"ScintillationYieldFactor>=0");
182 fScintYieldFactorCmd =
new G4UIcmdWithADouble(
"/process/optical/scintillation/setYieldFactor",
this);
183 fScintYieldFactorCmd->
SetGuidance(
"Set scintillation yield factor");
185 fScintYieldFactorCmd->
SetRange(
"ScintillationYieldFactor>=0");
188 fScintExcitationRatioCmd =
new G4UIcmdWithADouble(
"/process/optical/scintillation/setExcitationRatio",
this);
189 fScintExcitationRatioCmd->
SetGuidance(
"Set scintillation excitation ratio");
191 fScintExcitationRatioCmd->
SetRange(
"ExcitationRatio >= 0 && ExcitationRatio <=1");
194 fScintByParticleType1Cmd =
new G4UIcmdWithABool(
"/process/optical/defaults/scintillation/setByParticleType",
this);
195 fScintByParticleType1Cmd->
SetGuidance(
"Activate/Inactivate scintillation process by particle type");
196 fScintByParticleType1Cmd->
SetGuidance(
"DEPRECATED: use /process/optical/scintillation/setByParticleType instead.");
197 fScintByParticleType1Cmd->
SetParameterName(
"ScintillationByParticleTypeActivation",
false);
200 fScintByParticleTypeCmd =
new G4UIcmdWithABool(
"/process/optical/scintillation/setByParticleType",
this);
201 fScintByParticleTypeCmd->
SetGuidance(
"Activate/Inactivate scintillation process by particle type");
202 fScintByParticleTypeCmd->
SetParameterName(
"ScintillationByParticleTypeActivation",
false);
205 fScintEnhancedTimeConstantsCmd =
new G4UIcmdWithABool(
"/process/optical/scintillation/setEnhancedTimeConstants",
this);
206 fScintEnhancedTimeConstantsCmd->
SetGuidance(
"Activate/Inactivate enhanced time constants for scintillation.");
207 fScintEnhancedTimeConstantsCmd->
SetGuidance(
"This will be the default in the next major release.");
210 fScintTrackInfo1Cmd =
new G4UIcmdWithABool(
"/process/optical/defaults/scintillation/setTrackInfo",
this);
211 fScintTrackInfo1Cmd->
SetGuidance(
"Activate/Inactivate scintillation TrackInformation");
212 fScintTrackInfo1Cmd->
SetGuidance(
"DEPRECATED: use /process/optical/scintillation/setTrackInfo instead.");
216 fScintTrackInfoCmd =
new G4UIcmdWithABool(
"/process/optical/scintillation/setTrackInfo",
this);
217 fScintTrackInfoCmd->
SetGuidance(
"Activate/Inactivate scintillation TrackInformation");
221 fScintFiniteRiseTime1Cmd =
new G4UIcmdWithABool(
"/process/optical/defaults/scintillation/setFiniteRiseTime",
this);
222 fScintFiniteRiseTime1Cmd->
SetGuidance(
"Set option of a finite rise-time for G4Scintillation");
223 fScintFiniteRiseTime1Cmd->
SetGuidance(
"If set, the G4Scintillation process expects the user to have set the");
224 fScintFiniteRiseTime1Cmd->
SetGuidance(
"constant material property FAST/SLOWSCINTILLATIONRISETIME");
225 fScintFiniteRiseTime1Cmd->
SetGuidance(
"DEPRECATED: use /process/optical/scintillation/setFiniteRiseTime instead.");
229 fScintFiniteRiseTimeCmd =
new G4UIcmdWithABool(
"/process/optical/scintillation/setFiniteRiseTime",
this);
230 fScintFiniteRiseTimeCmd->
SetGuidance(
"Set option of a finite rise-time for G4Scintillation");
231 fScintFiniteRiseTimeCmd->
SetGuidance(
"If set, the G4Scintillation process expects the user to have set the");
232 fScintFiniteRiseTimeCmd->
SetGuidance(
"constant material property FAST/SLOWSCINTILLATIONRISETIME");
236 fScintStackPhotons1Cmd =
new G4UIcmdWithABool(
"/process/optical/defaults/scintillation/setStackPhotons",
this);
237 fScintStackPhotons1Cmd->
SetGuidance(
"Set whether or not to stack secondary Scintillation photons");
238 fScintStackPhotons1Cmd->
SetGuidance(
"DEPRECATED: use /process/optical/scintillation/setStackPhotons instead.");
239 fScintStackPhotons1Cmd->
SetParameterName(
"ScintillationStackPhotons",
true);
243 fScintStackPhotonsCmd =
new G4UIcmdWithABool(
"/process/optical/scintillation/setStackPhotons",
this);
244 fScintStackPhotonsCmd->
SetGuidance(
"Set whether or not to stack secondary Scintillation photons");
249 fScintTrackSecondariesFirstCmd =
new G4UIcmdWithABool(
"/process/optical/scintillation/setTrackSecondariesFirst",
this);
250 fScintTrackSecondariesFirstCmd->
SetGuidance(
"Whether to track scintillation secondaries before primary.");
253 fScintVerboseLevelCmd =
new G4UIcmdWithAnInteger(
"/process/optical/scintillation/verbose",
this);
254 fScintVerboseLevelCmd->
SetGuidance(
"Verbose level for scintillation process.");
256 fScintVerboseLevelCmd->
SetRange(
"verbose >= 0 && verbose <= 2");
260 fWLSTimeProfile1Cmd =
new G4UIcmdWithAString(
"/process/optical/defaults/wls/setTimeProfile",
this);
261 fWLSTimeProfile1Cmd->
SetGuidance(
"Set the WLS time profile (delta or exponential)");
262 fWLSTimeProfile1Cmd->
SetGuidance(
"DEPRECATED: use /process/optical/wls/setTimeProfile instead.");
267 fWLSTimeProfileCmd =
new G4UIcmdWithAString(
"/process/optical/wls/setTimeProfile",
this);
268 fWLSTimeProfileCmd->
SetGuidance(
"Set the WLS time profile (delta or exponential)");
274 fWLSVerboseLevelCmd->
SetGuidance(
"Verbose level for WLS process.");
276 fWLSVerboseLevelCmd->
SetRange(
"verbose >= 0 && verbose <= 2");
281 fWLS2TimeProfileCmd =
new G4UIcmdWithAString(
"/process/optical/wls2/setTimeProfile",
this);
282 fWLS2TimeProfileCmd->
SetGuidance(
"Set the WLS2 time profile (delta or exponential)");
288 fWLS2VerboseLevelCmd->
SetGuidance(
"Verbose level for WLS2 process.");
290 fWLS2VerboseLevelCmd->
SetRange(
"verbose >= 0 && verbose <= 2");
295 fBoundaryInvokeSD1Cmd =
new G4UIcmdWithABool(
"/process/optical/defaults/boundary/setInvokeSD",
this);
296 fBoundaryInvokeSD1Cmd->
SetGuidance(
"Set option for calling InvokeSD in G4OpBoundaryProcess");
297 fBoundaryInvokeSD1Cmd->
SetGuidance(
"DEPRECATED: use /process/optical/boundary/setInvokeSD instead.");
301 fBoundaryInvokeSDCmd =
new G4UIcmdWithABool(
"/process/optical/boundary/setInvokeSD",
this);
302 fBoundaryInvokeSDCmd->
SetGuidance(
"Set option for calling InvokeSD in G4OpBoundaryProcess");
307 fBoundaryVerboseLevelCmd->
SetGuidance(
"Verbose level for boundary process.");
309 fBoundaryVerboseLevelCmd->
SetRange(
"verbose >= 0 && verbose <= 2");
314 fBoundaryInvokeSD1Cmd =
new G4UIcmdWithABool(
"/process/optical/defaults/boundary/setInvokeSD",
this);
315 fAbsorptionVerboseLevelCmd =
new G4UIcmdWithAnInteger(
"/process/optical/absorption/verbose",
this);
316 fAbsorptionVerboseLevelCmd->
SetGuidance(
"Verbose level for absorption process.");
318 fAbsorptionVerboseLevelCmd->
SetRange(
"verbose >= 0 && verbose <= 2");
323 fBoundaryInvokeSD1Cmd =
new G4UIcmdWithABool(
"/process/optical/defaults/boundary/setInvokeSD",
this);
325 fRayleighVerboseLevelCmd->
SetGuidance(
"Verbose level for Rayleigh process.");
327 fRayleighVerboseLevelCmd->
SetRange(
"verbose >= 0 && verbose <= 2");
333 fMieVerboseLevelCmd->
SetGuidance(
"Verbose level for Mie process.");
335 fMieVerboseLevelCmd->
SetRange(
"verbose >= 0 && verbose <= 2");
344 delete fActivateProcessCmd;
347 delete fCerenkovMaxPhotonsCmd;
348 delete fCerenkovMaxPhotons1Cmd;
349 delete fCerenkovMaxBetaChangeCmd;
350 delete fCerenkovMaxBetaChange1Cmd;
351 delete fCerenkovStackPhotonsCmd;
352 delete fCerenkovStackPhotons1Cmd;
353 delete fCerenkovTrackSecondariesFirstCmd;
354 delete fCerenkovVerboseLevelCmd;
355 delete fScintYieldFactorCmd;
356 delete fScintYieldFactor1Cmd;
357 delete fScintByParticleTypeCmd;
358 delete fScintByParticleType1Cmd;
359 delete fScintEnhancedTimeConstantsCmd;
360 delete fScintTrackInfoCmd;
361 delete fScintTrackInfo1Cmd;
362 delete fScintStackPhotonsCmd;
363 delete fScintStackPhotons1Cmd;
364 delete fScintExcitationRatioCmd;
365 delete fScintVerboseLevelCmd;
366 delete fScintFiniteRiseTimeCmd;
367 delete fScintFiniteRiseTime1Cmd;
368 delete fScintTrackSecondariesFirstCmd;
369 delete fWLSTimeProfileCmd;
370 delete fWLSTimeProfile1Cmd;
371 delete fWLSVerboseLevelCmd;
372 delete fWLS2TimeProfileCmd;
373 delete fWLS2VerboseLevelCmd;
374 delete fAbsorptionVerboseLevelCmd;
375 delete fRayleighVerboseLevelCmd;
376 delete fMieVerboseLevelCmd;
377 delete fBoundaryVerboseLevelCmd;
378 delete fTrackSecondariesFirstCmd;
379 delete fBoundaryInvokeSDCmd;
380 delete fBoundaryInvokeSD1Cmd;
387 G4bool physicsModified =
true;
390 if (command == fActivateProcessCmd) {
391 std::istringstream is(newValue.
data());
398 else if (command == fTrackSecondariesFirstCmd) {
399 std::istringstream is(newValue.
data());
408 msg <<
"Process name not allowed: "<<pn<<
" (UI: "<<newValue<<
")";
409 G4Exception(
"G4OpticalParametersMessenger::SetNewValue(...)",
"Optical001",
413 else if (command == fVerboseCmd) {
416 else if (command == fDumpCmd) {
419 else if (command == fCerenkovMaxPhotons1Cmd) {
424 else if (command == fCerenkovMaxPhotonsCmd) {
429 else if (command == fCerenkovMaxBetaChange1Cmd) {
434 else if (command == fCerenkovMaxBetaChangeCmd) {
438 else if (command == fCerenkovStackPhotons1Cmd) {
443 else if (command == fCerenkovStackPhotonsCmd) {
447 else if (command == fCerenkovTrackSecondariesFirstCmd) {
451 else if (command == fCerenkovVerboseLevelCmd) {
455 else if (command == fScintYieldFactor1Cmd) {
460 else if (command == fScintYieldFactorCmd) {
464 else if (command == fScintByParticleType1Cmd) {
469 else if (command == fScintByParticleTypeCmd) {
473 else if (command == fScintEnhancedTimeConstantsCmd) {
477 else if (command == fScintTrackInfo1Cmd) {
482 else if (command == fScintTrackInfoCmd) {
486 else if (command == fScintFiniteRiseTime1Cmd) {
491 else if (command == fScintFiniteRiseTimeCmd) {
495 else if (command == fScintStackPhotons1Cmd) {
500 else if (command == fScintStackPhotonsCmd) {
504 else if (command == fScintExcitationRatioCmd) {
508 else if (command == fScintTrackSecondariesFirstCmd) {
512 else if (command == fScintVerboseLevelCmd) {
516 else if (command == fWLSTimeProfile1Cmd) {
520 else if (command == fWLSTimeProfileCmd) {
523 else if (command == fWLSVerboseLevelCmd) {
526 else if (command == fWLS2TimeProfileCmd) {
529 else if (command == fWLS2VerboseLevelCmd) {
532 else if (command == fAbsorptionVerboseLevelCmd) {
535 else if (command == fRayleighVerboseLevelCmd) {
538 else if (command == fMieVerboseLevelCmd) {
541 else if (command == fBoundaryVerboseLevelCmd) {
544 else if (command == fBoundaryInvokeSD1Cmd) {
548 else if (command == fBoundaryInvokeSDCmd) {
551 if (physicsModified) {
556void G4OpticalParametersMessenger::Deprecated()
559 ed <<
" This command has been deprecated and will be removed in the next" <<
G4endl
560 <<
"major release. Use the same command without /defaults/ instead.";
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
@ kNoProcess
Number of processes, no selected process.
G4String G4OpticalProcessName(G4int)
Return the name for a given optical process index.
G4GLOB_DLL std::ostream G4cout
virtual ~G4OpticalParametersMessenger()
virtual void SetNewValue(G4UIcommand *, G4String)
G4OpticalParametersMessenger(G4OpticalParameters *)
void SetScintByParticleType(G4bool)
void SetCerenkovMaxBetaChange(G4double)
void SetRayleighVerboseLevel(G4int)
void SetCerenkovMaxPhotonsPerStep(G4int)
void SetBoundaryInvokeSD(G4bool)
void SetBoundaryVerboseLevel(G4int)
void SetWLS2VerboseLevel(G4int)
void SetScintTrackSecondariesFirst(G4bool)
void SetScintEnhancedTimeConstants(G4bool)
void SetScintVerboseLevel(G4int)
void SetScintStackPhotons(G4bool)
void SetVerboseLevel(G4int)
void SetWLS2TimeProfile(const G4String &)
G4int GetCerenkovMaxPhotonsPerStep() const
void SetAbsorptionVerboseLevel(G4int)
void SetCerenkovStackPhotons(G4bool)
void SetCerenkovTrackSecondariesFirst(G4bool)
void SetScintFiniteRiseTime(G4bool)
void SetMieVerboseLevel(G4int)
void SetScintTrackInfo(G4bool)
void SetWLSTimeProfile(const G4String &)
void SetCerenkovVerboseLevel(G4int)
void SetScintExcitationRatio(G4double)
void SetScintYieldFactor(G4double)
void SetWLSVerboseLevel(G4int)
void SetProcessActivation(const G4String &, G4bool)
const char * data() const
static G4bool GetNewBoolValue(const char *paramString)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4bool defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4double GetNewDoubleValue(const char *paramString)
void SetCandidates(const char *candidateList)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void SetDefaultValue(G4int defVal)
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
static G4bool ConvertToBool(const char *st)
void SetRange(const char *rs)
void AvailableForStates(G4ApplicationState s1)
G4int ApplyCommand(const char *aCommand)
static G4UImanager * GetUIpointer()
void CreateDirectory(const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
void SetDefaultValue(const char *theDefaultValue)
void SetGuidance(const char *theGuidance)
void SetParameterCandidates(const char *theString)