61 if(
nullptr == theInstance) {
64 if(
nullptr == theInstance) {
67 theInstance = &manager;
85G4OpticalParameters::G4OpticalParameters()
100void G4OpticalParameters::Initialise()
104 cerenkovStackPhotons =
true;
105 cerenkovTrackSecondariesFirst =
true;
106 cerenkovVerboseLevel = 0;
107 cerenkovMaxPhotons = 100;
108 cerenkovMaxBetaChange = 10.;
110 scintByParticleType =
false;
111 scintTrackInfo =
false;
112 scintStackPhotons =
true;
113 scintEnhancedTimeConstants =
false;
114 scintFiniteRiseTime =
false;
115 scintTrackSecondariesFirst =
true;
116 scintYieldFactor = 1.;
117 scintExcitationRatio = 1.;
118 scintVerboseLevel = 0;
120 wlsTimeProfileName =
"delta";
123 wls2TimeProfileName =
"delta";
124 wls2VerboseLevel = 0;
126 absorptionVerboseLevel = 0;
128 rayleighVerboseLevel = 0;
132 boundaryInvokeSD =
false;
133 boundaryVerboseLevel = 0;
135 processActivation[
"OpRayleigh"] =
true;
136 processActivation[
"OpBoundary"] =
true;
137 processActivation[
"OpMieHG"] =
true;
138 processActivation[
"OpAbsorption"] =
true;
139 processActivation[
"OpWLS"] =
true;
140 processActivation[
"OpWLS2"] =
true;
141 processActivation[
"Cerenkov"] =
true;
142 processActivation[
"Scintillation"] =
true;
148 if(IsLocked()) {
return; }
173 if(IsLocked()) {
return; }
174 if (processActivation[process] == val)
return;
177 if (processActivation.find(process) != processActivation.end()) {
178 processActivation[process] = val;
182 ed <<
"Process name " << process <<
" out of bounds.";
183 G4Exception(
"G4OpticalParameters::SetProcessActivation()",
"Optical013",
189{
return processActivation.find(process)->second; }
201 if(IsLocked()) {
return; }
202 if (index ==
kCerenkov) processActivation[
"Cerenkov"] = val;
203 else if (index ==
kScintillation) processActivation[
"Scintillation"] = val;
204 else if (index ==
kAbsorption) processActivation[
"OpAbsorption"] = val;
205 else if (index ==
kRayleigh) processActivation[
"OpRayleigh"] = val;
206 else if (index ==
kMieHG) processActivation[
"OpMieHG"] = val;
207 else if (index ==
kWLS) processActivation[
"OpWLS"] = val;
208 else if (index ==
kWLS2) processActivation[
"OpWLS2"] = val;
211 ed <<
"Process index " << index <<
" out of bounds.";
215 ed2 <<
"Method Configure(G4OpticalProcessIndex, G4bool) is deprecated "
216 <<
"and will be removed in a future Geant4 version. Please use "
217 <<
"SetProcessActivation(G4String, G4bool) instead.";
224 if (index ==
kCerenkov)
return processActivation[
"Cerenkov"];
225 else if (index ==
kScintillation)
return processActivation[
"Scintillation"];
226 else if (index ==
kAbsorption)
return processActivation[
"OpAbsorption"];
227 else if (index ==
kRayleigh)
return processActivation[
"OpRayleigh"];
228 else if (index ==
kMieHG)
return processActivation[
"OpMieHG"];
229 else if (index ==
kWLS)
return processActivation[
"OpWLS"];
230 else if (index ==
kWLS2)
return processActivation[
"OpWLS2"];
233 ed <<
"Process index " << index <<
" out of bounds.";
237 ed2 <<
"Method GetConfiguration(G4OpticalProcessIndex) is deprecated "
238 <<
"and will be removed in a future Geant4 version. Please use "
239 <<
"GetProcessActivation(G4String) instead.";
249 if(IsLocked()) {
return; }
250 if (index ==
kCerenkov) cerenkovTrackSecondariesFirst = val;
251 else if (index ==
kScintillation) scintTrackSecondariesFirst = val;
254 ed <<
"Process index " << index <<
" out of bounds.";
255 G4Exception(
"G4OpticalParameters::SetTrackSecondariesFirst()",
259 ed2 <<
"Method SetTrackSecondariesFirst(G4OpticalProcessIndex, G4bool) is "
260 <<
"deprecated and will be removed in a future Geant4 version. Please use "
261 <<
"SetCerenkovTrackSecondariesFirst(G4bool) and "
262 <<
"SetScintTrackSecondariesFirst(G4bool) instead.";
271 if (index ==
kCerenkov)
return cerenkovTrackSecondariesFirst;
272 else if (index ==
kScintillation)
return scintTrackSecondariesFirst;
275 ed <<
"Process index " << index <<
" out of bounds.";
276 G4Exception(
"G4OpticalParameters::GetTrackSecondariesFirst()",
280 ed2 <<
"Method GetTrackSecondariesFirst(G4OpticalProcessIndex) is "
281 <<
"deprecated and will be removed in a future Geant4 version. Please use "
282 <<
"GetCerenkovTrackSecondariesFirst() and "
283 <<
"GetScintTrackSecondariesFirst() instead.";
290 if(IsLocked()) {
return; }
291 cerenkovStackPhotons = val;
296 return cerenkovStackPhotons;
301 if(IsLocked()) {
return; }
302 cerenkovVerboseLevel = val;
307 return cerenkovVerboseLevel;
312 if(IsLocked()) {
return; }
313 cerenkovMaxPhotons = val;
318 return cerenkovMaxPhotons;
323 if(IsLocked()) {
return; }
324 cerenkovMaxBetaChange = val;
329 return cerenkovMaxBetaChange;
334 if(IsLocked()) {
return; }
335 cerenkovTrackSecondariesFirst = val;
340 return cerenkovTrackSecondariesFirst;
345 if(IsLocked()) {
return; }
346 scintYieldFactor = val;
351 return scintYieldFactor;
356 if(IsLocked()) {
return; }
357 scintExcitationRatio = val;
362 return scintExcitationRatio;
367 if(IsLocked()) {
return; }
368 scintByParticleType = val;
373 return scintByParticleType;
378 if(IsLocked()) {
return; }
379 scintTrackInfo = val;
384 return scintTrackInfo;
389 if(IsLocked()) {
return; }
390 scintTrackSecondariesFirst = val;
395 return scintTrackSecondariesFirst;
400 if(IsLocked()) {
return; }
401 scintFiniteRiseTime = val;
406 return scintFiniteRiseTime;
411 if(IsLocked()) {
return; }
412 scintStackPhotons = val;
417 return scintStackPhotons;
422 if(IsLocked()) {
return; }
423 scintVerboseLevel = val;
428 return scintVerboseLevel;
433 if(IsLocked()) {
return; }
434 scintEnhancedTimeConstants = val;
439 return scintEnhancedTimeConstants;
444 if(IsLocked()) {
return; }
445 wlsTimeProfileName = val;
450 return wlsTimeProfileName;
455 if(IsLocked()) {
return; }
456 wlsVerboseLevel = val;
461 return wlsVerboseLevel;
466 if(IsLocked()) {
return; }
467 wls2TimeProfileName = val;
472 return wls2TimeProfileName;
477 if(IsLocked()) {
return; }
478 wls2VerboseLevel = val;
483 return wls2VerboseLevel;
488 if(IsLocked()) {
return;}
489 boundaryVerboseLevel = val;
494 return boundaryVerboseLevel;
499 if(IsLocked()) {
return;}
500 boundaryInvokeSD = val;
505 return boundaryInvokeSD;
510 if(IsLocked()) {
return;}
511 absorptionVerboseLevel = val;
516 return absorptionVerboseLevel;
521 if(IsLocked()) {
return;}
522 rayleighVerboseLevel = val;
527 return rayleighVerboseLevel;
532 if(IsLocked()) {
return;}
533 mieVerboseLevel = val;
538 return mieVerboseLevel;
548 G4int prec = os.precision(5);
549 os <<
"=======================================================================" <<
"\n";
550 os <<
"====== Optical Physics Parameters ========" <<
"\n";
551 os <<
"=======================================================================" <<
"\n";
554 os <<
" Cerenkov maximum photons per step: " << cerenkovMaxPhotons <<
"\n";
555 os <<
" Cerenkov maximum beta change per step: " << cerenkovMaxBetaChange <<
" %\n";
556 os <<
" Cerenkov stack photons: " << cerenkovStackPhotons <<
"\n";
557 os <<
" Cerenkov track secondaries first: " << cerenkovTrackSecondariesFirst <<
"\n";
559 os <<
" Scintillation yield factor: " << scintYieldFactor <<
"\n";
560 os <<
" Scintillation excitation ratio: " << scintExcitationRatio <<
"\n";
561 os <<
" Scintillation finite rise time: " << scintFiniteRiseTime <<
"\n";
562 os <<
" Scintillation by particle type: " << scintByParticleType <<
"\n";
563 os <<
" Scintillation record track info: " << scintTrackInfo <<
"\n";
564 os <<
" Scintillation stack photons: " << scintStackPhotons <<
"\n";
565 os <<
" Scintillation use enhanced time constants: " << scintEnhancedTimeConstants <<
"\n";
566 os <<
" Scintillation track secondaries first: " << scintTrackSecondariesFirst <<
"\n";
568 os <<
" WLS time profile name: " << wlsTimeProfileName <<
"\n";
570 os <<
" WLS2 time profile name: " << wls2TimeProfileName <<
"\n";
572 os <<
" Boundary invoke sensitive detector: " << boundaryInvokeSD <<
"\n";
576 os <<
"=======================================================================" <<
"\n";
582#ifdef G4MULTITHREADED
586#ifdef G4MULTITHREADED
597G4bool G4OpticalParameters::IsLocked()
const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
std::ostream & operator<<(std::ostream &os, const G4OpticalParameters &par)
@ kWLS
Wave Length Shifting process index.
@ kScintillation
Scintillation process index.
@ kWLS2
Second Wave Length Shifting process index.
@ kRayleigh
Rayleigh scattering process index.
@ kAbsorption
Absorption process index.
@ kCerenkov
Cerenkov process index.
@ kMieHG
Mie scattering process index.
#define G4MUTEX_INITIALIZER
#define G4MUTEXLOCK(mutex)
#define G4MUTEXUNLOCK(mutex)
G4GLOB_DLL std::ostream G4cout
G4bool GetBoundaryInvokeSD() const
void SetScintByParticleType(G4bool)
void SetCerenkovMaxBetaChange(G4double)
void SetRayleighVerboseLevel(G4int)
void SetCerenkovMaxPhotonsPerStep(G4int)
void SetBoundaryInvokeSD(G4bool)
void Configure(G4OpticalProcessIndex, G4bool)
void SetBoundaryVerboseLevel(G4int)
G4int GetCerenkovVerboseLevel() const
void SetWLS2VerboseLevel(G4int)
void SetScintTrackSecondariesFirst(G4bool)
void SetScintEnhancedTimeConstants(G4bool)
G4int GetScintVerboseLevel() const
void StreamInfo(std::ostream &os) const
void SetTrackSecondariesFirst(G4OpticalProcessIndex, G4bool)
G4int GetAbsorptionVerboseLevel() const
void SetScintVerboseLevel(G4int)
void SetScintStackPhotons(G4bool)
G4bool GetScintStackPhotons() const
G4int GetBoundaryVerboseLevel() const
G4int GetRayleighVerboseLevel() const
G4int GetWLS2VerboseLevel() const
G4String GetWLS2TimeProfile() const
G4bool GetTrackSecondariesFirst(G4OpticalProcessIndex)
G4int GetMieVerboseLevel() const
void SetVerboseLevel(G4int)
void SetWLS2TimeProfile(const G4String &)
G4int GetCerenkovMaxPhotonsPerStep() const
static G4OpticalParameters * Instance()
G4double GetCerenkovMaxBetaChange() const
G4double GetScintExcitationRatio() const
G4bool GetConfiguration(G4OpticalProcessIndex)
G4int GetVerboseLevel() const
void SetAbsorptionVerboseLevel(G4int)
G4bool GetProcessActivation(const G4String &) const
void SetCerenkovStackPhotons(G4bool)
void SetCerenkovTrackSecondariesFirst(G4bool)
void SetScintFiniteRiseTime(G4bool)
G4String GetWLSTimeProfile() const
G4bool GetScintEnhancedTimeConstants() const
G4bool GetScintByParticleType() const
void SetMieVerboseLevel(G4int)
void SetScintTrackInfo(G4bool)
void SetWLSTimeProfile(const G4String &)
G4bool GetScintFiniteRiseTime() const
void SetCerenkovVerboseLevel(G4int)
G4double GetScintYieldFactor() const
G4bool GetScintTrackInfo() const
void SetScintExcitationRatio(G4double)
G4bool GetCerenkovTrackSecondariesFirst() const
void SetScintYieldFactor(G4double)
void SetWLSVerboseLevel(G4int)
G4int GetWLSVerboseLevel() const
void SetProcessActivation(const G4String &, G4bool)
G4bool GetScintTrackSecondariesFirst() const
G4bool GetCerenkovStackPhotons() const
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()