56 : params(opticalParameters)
59 G4bool toBeBroadcasted =
false;
60 fDir =
new G4UIdirectory(
"/process/optical/", toBeBroadcasted);
62 "Commands related to the optical physics simulation engine.");
65 new G4UIdirectory(
"/process/optical/cerenkov/", toBeBroadcasted);
66 fCerenkovDir->SetGuidance(
"Cerenkov process commands");
68 new G4UIdirectory(
"/process/optical/scintillation/", toBeBroadcasted);
69 fScintDir->SetGuidance(
"Scintillation process commands");
70 fWlsDir =
new G4UIdirectory(
"/process/optical/wls/", toBeBroadcasted);
71 fWlsDir->SetGuidance(
"Wave length shifting process commands");
72 fWls2Dir =
new G4UIdirectory(
"/process/optical/wls2/", toBeBroadcasted);
73 fWls2Dir->SetGuidance(
"Second Wave length shifting process commands");
75 new G4UIdirectory(
"/process/optical/boundary/", toBeBroadcasted);
76 fBoundaryDir->SetGuidance(
"Boundary scattering commands");
77 fMieDir =
new G4UIdirectory(
"/process/optical/mie/", toBeBroadcasted);
78 fMieDir->SetGuidance(
"Mie scattering process commands");
79 fAbsDir =
new G4UIdirectory(
"/process/optical/absorption/", toBeBroadcasted);
80 fAbsDir->SetGuidance(
"absorption process commands");
81 fRaylDir =
new G4UIdirectory(
"/process/optical/rayleigh/", toBeBroadcasted);
82 fRaylDir->SetGuidance(
"Rayleigh scattering commands");
86 new G4UIcommand(
"/process/optical/processActivation",
this);
87 fActivateProcessCmd->SetGuidance(
88 "Activate/deactivate the specified optical process");
96 par->SetParameterCandidates(candidates);
97 par->SetGuidance(
"the process name");
98 fActivateProcessCmd->SetParameter(par);
100 par->SetDefaultValue(
true);
101 par->SetGuidance(
"activation flag");
102 fActivateProcessCmd->SetParameter(par);
106 fVerboseCmd->SetGuidance(
"Set default verbose level for optical processes");
107 fVerboseCmd->SetParameterName(
"ver",
true);
108 fVerboseCmd->SetDefaultValue(1);
109 fVerboseCmd->SetRange(
"ver>=0");
112 fDumpCmd =
new G4UIcommand(
"/process/optical/printParameters",
this);
113 fDumpCmd->SetGuidance(
"Print all optical parameters.");
114 fDumpCmd->SetToBeBroadcasted(
false);
116 fXRayCmd =
new G4UIcommand(
"/process/optical/XRayModel",
this);
117 fXRayCmd->SetGuidance(
"Add XRay model per G4LogicalVolume.");
118 fXRayCmd->SetGuidance(
" lvName : G4LogicalVolume name");
119 fXRayCmd->SetGuidance(
" xrayType : X-Ray model type");
121 fXRayCmd->SetToBeBroadcasted(
false);
123 fXRayCmd->SetParameter(lvName);
125 fXRayCmd->SetParameter(xrayT);
128 fCerenkovMaxPhotonsCmd =
130 fCerenkovMaxPhotonsCmd->SetGuidance(
"Set maximum number of photons per step");
131 fCerenkovMaxPhotonsCmd->SetParameterName(
"CerenkovMaxPhotons",
false);
132 fCerenkovMaxPhotonsCmd->SetRange(
"CerenkovMaxPhotons>=0");
135 fCerenkovMaxBetaChangeCmd =
137 fCerenkovMaxBetaChangeCmd->SetGuidance(
138 "Set maximum change of beta of parent particle per step (in percent)");
139 fCerenkovMaxBetaChangeCmd->SetParameterName(
"CerenkovMaxBetaChange",
false);
140 fCerenkovMaxBetaChangeCmd->SetRange(
"CerenkovMaxBetaChange>=0");
143 fCerenkovStackPhotonsCmd =
145 fCerenkovStackPhotonsCmd->SetGuidance(
146 "Set whether or not to stack secondary Cerenkov photons");
149 fCerenkovOffloadPhotonsCmd =
151 fCerenkovOffloadPhotonsCmd->SetGuidance(
152 "Set whether or not to offload secondary Cerenkov photons");
153 fCerenkovOffloadPhotonsCmd->SetParameterName(
"CerenkovOffloadPhotons",
false);
154 fCerenkovOffloadPhotonsCmd->SetDefaultValue(
false);
158 "/process/optical/cerenkov/setTrackSecondariesFirst",
this);
159 fCerenkovTrackSecondariesFirstCmd->SetGuidance(
160 "Whether to track secondary Cerenkov photons before the primary.");
164 fCerenkovVerboseLevelCmd =
166 fCerenkovVerboseLevelCmd->SetGuidance(
"Verbose level for Cerenkov process.");
167 fCerenkovVerboseLevelCmd->SetParameterName(
"verbose",
true);
168 fCerenkovVerboseLevelCmd->SetRange(
"verbose >= 0 && verbose <= 2");
169 fCerenkovVerboseLevelCmd->SetDefaultValue(2);
174 "/process/optical/scintillation/setByParticleType",
this);
175 fScintByParticleTypeCmd->SetGuidance(
176 "Activate/Inactivate scintillation process by particle type");
177 fScintByParticleTypeCmd->SetParameterName(
178 "ScintillationByParticleTypeActivation",
false);
183 fScintTrackInfoCmd->SetGuidance(
184 "Activate/Inactivate scintillation TrackInformation");
185 fScintTrackInfoCmd->SetParameterName(
"ScintillationTrackInfo",
false);
189 "/process/optical/scintillation/setFiniteRiseTime",
this);
190 fScintFiniteRiseTimeCmd->SetGuidance(
191 "Set option of a finite rise-time for G4Scintillation");
192 fScintFiniteRiseTimeCmd->SetGuidance(
193 "If set, the G4Scintillation process expects the user to have set the");
194 fScintFiniteRiseTimeCmd->SetGuidance(
195 "constant material property SCINTILLATIONRISETIME{1,2,3}");
196 fScintFiniteRiseTimeCmd->SetParameterName(
"FiniteRiseTime",
false);
200 "/process/optical/scintillation/setStackPhotons",
this);
201 fScintStackPhotonsCmd->SetGuidance(
202 "Set whether or not to stack secondary Scintillation photons");
203 fScintStackPhotonsCmd->SetParameterName(
"ScintillationStackPhotons",
true);
204 fScintStackPhotonsCmd->SetDefaultValue(
true);
208 "/process/optical/scintillation/setOffloadPhotons",
this);
209 fScintOffloadPhotonsCmd->SetGuidance(
210 "Set whether or not to offload secondary scintillation photons");
211 fScintOffloadPhotonsCmd->SetParameterName(
"ScintillationOffloadPhotons",
false);
212 fScintOffloadPhotonsCmd->SetDefaultValue(
false);
216 "/process/optical/scintillation/setTrackSecondariesFirst",
this);
217 fScintTrackSecondariesFirstCmd->SetGuidance(
218 "Whether to track scintillation secondaries before primary.");
222 fScintVerboseLevelCmd =
224 fScintVerboseLevelCmd->SetGuidance(
225 "Verbose level for scintillation process.");
226 fScintVerboseLevelCmd->SetParameterName(
"verbose",
true);
227 fScintVerboseLevelCmd->SetRange(
"verbose >= 0 && verbose <= 2");
233 fWLSTimeProfileCmd->SetGuidance(
234 "Set the WLS time profile (delta or exponential)");
235 fWLSTimeProfileCmd->SetParameterName(
"WLSTimeProfile",
false);
236 fWLSTimeProfileCmd->SetCandidates(
"delta exponential");
239 fWLSVerboseLevelCmd =
241 fWLSVerboseLevelCmd->SetGuidance(
"Verbose level for WLS process.");
242 fWLSVerboseLevelCmd->SetParameterName(
"verbose",
true);
243 fWLSVerboseLevelCmd->SetRange(
"verbose >= 0 && verbose <= 2");
244 fWLSVerboseLevelCmd->SetDefaultValue(1);
248 fWLS2TimeProfileCmd =
250 fWLS2TimeProfileCmd->SetGuidance(
251 "Set the WLS2 time profile (delta or exponential)");
252 fWLS2TimeProfileCmd->SetParameterName(
"WLS2TimeProfile",
false);
253 fWLS2TimeProfileCmd->SetCandidates(
"delta exponential");
256 fWLS2VerboseLevelCmd =
258 fWLS2VerboseLevelCmd->SetGuidance(
"Verbose level for WLS2 process.");
259 fWLS2VerboseLevelCmd->SetParameterName(
"verbose",
true);
260 fWLS2VerboseLevelCmd->SetRange(
"verbose >= 0 && verbose <= 2");
261 fWLS2VerboseLevelCmd->SetDefaultValue(1);
265 fBoundaryInvokeSDCmd =
267 fBoundaryInvokeSDCmd->SetGuidance(
268 "Set option for calling InvokeSD in G4OpBoundaryProcess");
269 fBoundaryInvokeSDCmd->SetParameterName(
"InvokeSD",
false);
272 fBoundaryVerboseLevelCmd =
274 fBoundaryVerboseLevelCmd->SetGuidance(
"Verbose level for boundary process.");
275 fBoundaryVerboseLevelCmd->SetParameterName(
"verbose",
true);
276 fBoundaryVerboseLevelCmd->SetRange(
"verbose >= 0 && verbose <= 2");
277 fBoundaryVerboseLevelCmd->SetDefaultValue(1);
281 fAbsorptionVerboseLevelCmd =
283 fAbsorptionVerboseLevelCmd->SetGuidance(
284 "Verbose level for absorption process.");
285 fAbsorptionVerboseLevelCmd->SetParameterName(
"verbose",
true);
286 fAbsorptionVerboseLevelCmd->SetRange(
"verbose >= 0 && verbose <= 2");
287 fAbsorptionVerboseLevelCmd->SetDefaultValue(1);
291 fRayleighVerboseLevelCmd =
293 fRayleighVerboseLevelCmd->SetGuidance(
"Verbose level for Rayleigh process.");
294 fRayleighVerboseLevelCmd->SetParameterName(
"verbose",
true);
295 fRayleighVerboseLevelCmd->SetRange(
"verbose >= 0 && verbose <= 2");
296 fRayleighVerboseLevelCmd->SetDefaultValue(1);
300 fMieVerboseLevelCmd =
302 fMieVerboseLevelCmd->SetGuidance(
"Verbose level for Mie process.");
303 fMieVerboseLevelCmd->SetParameterName(
"verbose",
true);
304 fMieVerboseLevelCmd->SetRange(
"verbose >= 0 && verbose <= 2");
305 fMieVerboseLevelCmd->SetDefaultValue(1);
349 G4bool physicsModified =
true;
352 if(command == fActivateProcessCmd)
354 std::istringstream is(newValue.data());
359 params->SetProcessActivation(pn, value);
361 else if(command == fXRayCmd)
363 std::istringstream is(newValue.data());
368 if (sss ==
"CerenkovDefault")
372 else if (sss ==
"ScintillationDefault")
378 G4cout <<
"G4OpticalParametersMessenger::SetNewValue: "
379 <<
" fail for /process/optical/XRayModel \n"
380 <<
" type " << sss <<
" is unknown, no model assigned."
384 params->SetActiveVolume(lv, type);
386 else if(command == fVerboseCmd)
388 params->SetVerboseLevel(fVerboseCmd->GetNewIntValue(newValue));
390 else if(command == fDumpCmd)
394 else if(command == fCerenkovMaxPhotonsCmd)
396 params->SetCerenkovMaxPhotonsPerStep(
397 fCerenkovMaxPhotonsCmd->GetNewIntValue(newValue));
398 G4cout <<
"Cerenkov max photons: " << params->GetCerenkovMaxPhotonsPerStep()
401 else if(command == fCerenkovMaxBetaChangeCmd)
403 params->SetCerenkovMaxBetaChange(
404 fCerenkovMaxBetaChangeCmd->GetNewDoubleValue(newValue));
406 else if(command == fCerenkovStackPhotonsCmd)
408 params->SetCerenkovStackPhotons(
409 fCerenkovStackPhotonsCmd->GetNewBoolValue(newValue));
411 else if(command == fCerenkovOffloadPhotonsCmd)
413 params->SetCerenkovOffloadPhotons(
414 fCerenkovOffloadPhotonsCmd->GetNewBoolValue(newValue));
416 else if(command == fCerenkovTrackSecondariesFirstCmd)
418 params->SetCerenkovTrackSecondariesFirst(
419 fCerenkovTrackSecondariesFirstCmd->GetNewBoolValue(newValue));
421 else if(command == fCerenkovVerboseLevelCmd)
423 params->SetCerenkovVerboseLevel(
424 fCerenkovVerboseLevelCmd->GetNewIntValue(newValue));
426 else if(command == fScintByParticleTypeCmd)
428 params->SetScintByParticleType(
429 fScintByParticleTypeCmd->GetNewBoolValue(newValue));
431 else if(command == fScintTrackInfoCmd)
433 params->SetScintTrackInfo(fScintTrackInfoCmd->GetNewBoolValue(newValue));
435 else if(command == fScintFiniteRiseTimeCmd)
437 params->SetScintFiniteRiseTime(
438 fScintFiniteRiseTimeCmd->GetNewBoolValue(newValue));
440 else if(command == fScintStackPhotonsCmd)
442 params->SetScintStackPhotons(
443 fScintStackPhotonsCmd->GetNewBoolValue(newValue));
445 else if(command == fScintOffloadPhotonsCmd)
447 params->SetScintOffloadPhotons(
448 fScintOffloadPhotonsCmd->GetNewBoolValue(newValue));
450 else if(command == fScintTrackSecondariesFirstCmd)
452 params->SetScintTrackSecondariesFirst(
453 fScintTrackSecondariesFirstCmd->GetNewBoolValue(newValue));
455 else if(command == fScintVerboseLevelCmd)
457 params->SetScintVerboseLevel(
458 fScintVerboseLevelCmd->GetNewIntValue(newValue));
460 else if(command == fWLSTimeProfileCmd)
462 params->SetWLSTimeProfile(newValue);
464 else if(command == fWLSVerboseLevelCmd)
466 params->SetWLSVerboseLevel(fWLSVerboseLevelCmd->GetNewIntValue(newValue));
468 else if(command == fWLS2TimeProfileCmd)
470 params->SetWLS2TimeProfile(newValue);
472 else if(command == fWLS2VerboseLevelCmd)
474 params->SetWLS2VerboseLevel(fWLS2VerboseLevelCmd->GetNewIntValue(newValue));
476 else if(command == fAbsorptionVerboseLevelCmd)
478 params->SetAbsorptionVerboseLevel(
479 fAbsorptionVerboseLevelCmd->GetNewIntValue(newValue));
481 else if(command == fRayleighVerboseLevelCmd)
483 params->SetRayleighVerboseLevel(
484 fRayleighVerboseLevelCmd->GetNewIntValue(newValue));
486 else if(command == fMieVerboseLevelCmd)
488 params->SetMieVerboseLevel(fMieVerboseLevelCmd->GetNewIntValue(newValue));
490 else if(command == fBoundaryVerboseLevelCmd)
492 params->SetBoundaryVerboseLevel(
493 fBoundaryVerboseLevelCmd->GetNewIntValue(newValue));
495 else if(command == fBoundaryInvokeSDCmd)
497 params->SetBoundaryInvokeSD(
498 fBoundaryInvokeSDCmd->GetNewBoolValue(newValue));