Import Geant4 11.0.0 source tree
This commit is contained in:
committed by
Ben Morgan
parent
6399a014b6
commit
80e2389dd8
@@ -51,17 +51,19 @@
|
||||
G4OpticalParameters* G4OpticalParameters::theInstance = nullptr;
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
G4Mutex G4OpticalParameters::opticalParametersMutex = G4MUTEX_INITIALIZER;
|
||||
G4Mutex G4OpticalParameters::opticalParametersMutex = G4MUTEX_INITIALIZER;
|
||||
#endif
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
G4OpticalParameters* G4OpticalParameters::Instance()
|
||||
{
|
||||
if(nullptr == theInstance) {
|
||||
if(nullptr == theInstance)
|
||||
{
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXLOCK(&opticalParametersMutex);
|
||||
if(nullptr == theInstance) {
|
||||
if(nullptr == theInstance)
|
||||
{
|
||||
#endif
|
||||
static G4OpticalParameters manager;
|
||||
theInstance = &manager;
|
||||
@@ -75,10 +77,7 @@ G4OpticalParameters* G4OpticalParameters::Instance()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
G4OpticalParameters::~G4OpticalParameters()
|
||||
{
|
||||
delete theMessenger;
|
||||
}
|
||||
G4OpticalParameters::~G4OpticalParameters() { delete theMessenger; }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
@@ -92,7 +91,8 @@ G4OpticalParameters::G4OpticalParameters()
|
||||
|
||||
void G4OpticalParameters::SetDefaults()
|
||||
{
|
||||
if(!IsLocked()) {
|
||||
if(!IsLocked())
|
||||
{
|
||||
Initialise();
|
||||
}
|
||||
}
|
||||
@@ -114,10 +114,10 @@ void G4OpticalParameters::Initialise()
|
||||
scintTrackSecondariesFirst = true;
|
||||
scintVerboseLevel = 0;
|
||||
|
||||
wlsTimeProfileName = "delta";
|
||||
wlsTimeProfileName = "delta";
|
||||
wlsVerboseLevel = 0;
|
||||
|
||||
wls2TimeProfileName = "delta";
|
||||
wls2TimeProfileName = "delta";
|
||||
wls2VerboseLevel = 0;
|
||||
|
||||
absorptionVerboseLevel = 0;
|
||||
@@ -137,12 +137,14 @@ void G4OpticalParameters::Initialise()
|
||||
processActivation["OpWLS2"] = true;
|
||||
processActivation["Cerenkov"] = true;
|
||||
processActivation["Scintillation"] = true;
|
||||
|
||||
}
|
||||
|
||||
void G4OpticalParameters::SetVerboseLevel(G4int val)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
verboseLevel = val;
|
||||
SetCerenkovVerboseLevel(verboseLevel);
|
||||
SetScintVerboseLevel(verboseLevel);
|
||||
@@ -154,12 +156,10 @@ void G4OpticalParameters::SetVerboseLevel(G4int val)
|
||||
SetWLS2VerboseLevel(verboseLevel);
|
||||
}
|
||||
|
||||
G4int G4OpticalParameters::GetVerboseLevel() const
|
||||
{
|
||||
return verboseLevel;
|
||||
}
|
||||
G4int G4OpticalParameters::GetVerboseLevel() const { return verboseLevel; }
|
||||
|
||||
void G4OpticalParameters::SetProcessActivation(const G4String& process, G4bool val)
|
||||
void G4OpticalParameters::SetProcessActivation(const G4String& process,
|
||||
G4bool val)
|
||||
{
|
||||
// Configure the physics constructor to use/not use a selected process.
|
||||
// This method can only be called in PreInit> phase (before execution of
|
||||
@@ -167,14 +167,20 @@ void G4OpticalParameters::SetProcessActivation(const G4String& process, G4bool v
|
||||
// and so it cannot be re-activated later in Idle> phase with the command
|
||||
// /process/activate.
|
||||
|
||||
if(IsLocked()) { return; }
|
||||
if (processActivation[process] == val) return;
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(processActivation[process] == val)
|
||||
return;
|
||||
|
||||
// processActivation keys defined at initialisation
|
||||
if (processActivation.find(process) != processActivation.end()) {
|
||||
if(processActivation.find(process) != processActivation.end())
|
||||
{
|
||||
processActivation[process] = val;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Process name " << process << " out of bounds.";
|
||||
G4Exception("G4OpticalParameters::SetProcessActivation()", "Optical013",
|
||||
@@ -183,11 +189,16 @@ void G4OpticalParameters::SetProcessActivation(const G4String& process, G4bool v
|
||||
}
|
||||
|
||||
G4bool G4OpticalParameters::GetProcessActivation(const G4String& process) const
|
||||
{ return processActivation.find(process)->second; }
|
||||
{
|
||||
return processActivation.find(process)->second;
|
||||
}
|
||||
|
||||
void G4OpticalParameters::SetCerenkovStackPhotons(G4bool val)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
cerenkovStackPhotons = val;
|
||||
}
|
||||
|
||||
@@ -198,7 +209,10 @@ G4bool G4OpticalParameters::GetCerenkovStackPhotons() const
|
||||
|
||||
void G4OpticalParameters::SetCerenkovVerboseLevel(G4int val)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
cerenkovVerboseLevel = val;
|
||||
}
|
||||
|
||||
@@ -209,7 +223,10 @@ G4int G4OpticalParameters::GetCerenkovVerboseLevel() const
|
||||
|
||||
void G4OpticalParameters::SetCerenkovMaxPhotonsPerStep(G4int val)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
cerenkovMaxPhotons = val;
|
||||
}
|
||||
|
||||
@@ -220,7 +237,10 @@ G4int G4OpticalParameters::GetCerenkovMaxPhotonsPerStep() const
|
||||
|
||||
void G4OpticalParameters::SetCerenkovMaxBetaChange(G4double val)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
cerenkovMaxBetaChange = val;
|
||||
}
|
||||
|
||||
@@ -231,7 +251,10 @@ G4double G4OpticalParameters::GetCerenkovMaxBetaChange() const
|
||||
|
||||
void G4OpticalParameters::SetCerenkovTrackSecondariesFirst(G4bool val)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
cerenkovTrackSecondariesFirst = val;
|
||||
}
|
||||
|
||||
@@ -242,7 +265,10 @@ G4bool G4OpticalParameters::GetCerenkovTrackSecondariesFirst() const
|
||||
|
||||
void G4OpticalParameters::SetScintByParticleType(G4bool val)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
scintByParticleType = val;
|
||||
}
|
||||
|
||||
@@ -253,18 +279,21 @@ G4bool G4OpticalParameters::GetScintByParticleType() const
|
||||
|
||||
void G4OpticalParameters::SetScintTrackInfo(G4bool val)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
scintTrackInfo = val;
|
||||
}
|
||||
|
||||
G4bool G4OpticalParameters::GetScintTrackInfo() const
|
||||
{
|
||||
return scintTrackInfo;
|
||||
}
|
||||
G4bool G4OpticalParameters::GetScintTrackInfo() const { return scintTrackInfo; }
|
||||
|
||||
void G4OpticalParameters::SetScintTrackSecondariesFirst(G4bool val)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
scintTrackSecondariesFirst = val;
|
||||
}
|
||||
|
||||
@@ -275,7 +304,10 @@ G4bool G4OpticalParameters::GetScintTrackSecondariesFirst() const
|
||||
|
||||
void G4OpticalParameters::SetScintFiniteRiseTime(G4bool val)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
scintFiniteRiseTime = val;
|
||||
}
|
||||
|
||||
@@ -286,7 +318,10 @@ G4bool G4OpticalParameters::GetScintFiniteRiseTime() const
|
||||
|
||||
void G4OpticalParameters::SetScintStackPhotons(G4bool val)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
scintStackPhotons = val;
|
||||
}
|
||||
|
||||
@@ -297,7 +332,10 @@ G4bool G4OpticalParameters::GetScintStackPhotons() const
|
||||
|
||||
void G4OpticalParameters::SetScintVerboseLevel(G4int val)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
scintVerboseLevel = val;
|
||||
}
|
||||
|
||||
@@ -308,7 +346,10 @@ G4int G4OpticalParameters::GetScintVerboseLevel() const
|
||||
|
||||
void G4OpticalParameters::SetWLSTimeProfile(const G4String& val)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
wlsTimeProfileName = val;
|
||||
}
|
||||
|
||||
@@ -319,7 +360,10 @@ G4String G4OpticalParameters::GetWLSTimeProfile() const
|
||||
|
||||
void G4OpticalParameters::SetWLSVerboseLevel(G4int val)
|
||||
{
|
||||
if(IsLocked()) {return; }
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
wlsVerboseLevel = val;
|
||||
}
|
||||
|
||||
@@ -330,7 +374,10 @@ G4int G4OpticalParameters::GetWLSVerboseLevel() const
|
||||
|
||||
void G4OpticalParameters::SetWLS2TimeProfile(const G4String& val)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
wls2TimeProfileName = val;
|
||||
}
|
||||
|
||||
@@ -341,7 +388,10 @@ G4String G4OpticalParameters::GetWLS2TimeProfile() const
|
||||
|
||||
void G4OpticalParameters::SetWLS2VerboseLevel(G4int val)
|
||||
{
|
||||
if(IsLocked()) {return; }
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
wls2VerboseLevel = val;
|
||||
}
|
||||
|
||||
@@ -352,7 +402,10 @@ G4int G4OpticalParameters::GetWLS2VerboseLevel() const
|
||||
|
||||
void G4OpticalParameters::SetBoundaryVerboseLevel(G4int val)
|
||||
{
|
||||
if(IsLocked()) {return;}
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
boundaryVerboseLevel = val;
|
||||
}
|
||||
|
||||
@@ -363,7 +416,10 @@ G4int G4OpticalParameters::GetBoundaryVerboseLevel() const
|
||||
|
||||
void G4OpticalParameters::SetBoundaryInvokeSD(G4bool val)
|
||||
{
|
||||
if(IsLocked()) {return;}
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
boundaryInvokeSD = val;
|
||||
}
|
||||
|
||||
@@ -374,7 +430,10 @@ G4bool G4OpticalParameters::GetBoundaryInvokeSD() const
|
||||
|
||||
void G4OpticalParameters::SetAbsorptionVerboseLevel(G4int val)
|
||||
{
|
||||
if(IsLocked()) {return;}
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
absorptionVerboseLevel = val;
|
||||
}
|
||||
|
||||
@@ -385,7 +444,10 @@ G4int G4OpticalParameters::GetAbsorptionVerboseLevel() const
|
||||
|
||||
void G4OpticalParameters::SetRayleighVerboseLevel(G4int val)
|
||||
{
|
||||
if(IsLocked()) {return;}
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
rayleighVerboseLevel = val;
|
||||
}
|
||||
|
||||
@@ -396,7 +458,10 @@ G4int G4OpticalParameters::GetRayleighVerboseLevel() const
|
||||
|
||||
void G4OpticalParameters::SetMieVerboseLevel(G4int val)
|
||||
{
|
||||
if(IsLocked()) {return;}
|
||||
if(IsLocked())
|
||||
{
|
||||
return;
|
||||
}
|
||||
mieVerboseLevel = val;
|
||||
}
|
||||
|
||||
@@ -413,31 +478,56 @@ void G4OpticalParameters::PrintWarning(G4ExceptionDescription& ed) const
|
||||
void G4OpticalParameters::StreamInfo(std::ostream& os) const
|
||||
{
|
||||
G4int prec = os.precision(5);
|
||||
os << "=======================================================================" << "\n";
|
||||
os << "====== Optical Physics Parameters ========" << "\n";
|
||||
os << "=======================================================================" << "\n";
|
||||
os
|
||||
<< "======================================================================="
|
||||
<< "\n";
|
||||
os
|
||||
<< "====== Optical Physics Parameters ========"
|
||||
<< "\n";
|
||||
os
|
||||
<< "======================================================================="
|
||||
<< "\n";
|
||||
|
||||
os << " Cerenkov process active: " << GetProcessActivation("Cerenkov") << "\n";
|
||||
os << " Cerenkov maximum photons per step: " << cerenkovMaxPhotons << "\n";
|
||||
os << " Cerenkov maximum beta change per step: " << cerenkovMaxBetaChange << " %\n";
|
||||
os << " Cerenkov stack photons: " << cerenkovStackPhotons << "\n";
|
||||
os << " Cerenkov track secondaries first: " << cerenkovTrackSecondariesFirst << "\n";
|
||||
os << " Scintillation process active: " << GetProcessActivation("Scintillation") << "\n";
|
||||
os << " Scintillation finite rise time: " << scintFiniteRiseTime << "\n";
|
||||
os << " Scintillation by particle type: " << scintByParticleType << "\n";
|
||||
os << " Cerenkov process active: "
|
||||
<< GetProcessActivation("Cerenkov") << "\n";
|
||||
os << " Cerenkov maximum photons per step: " << cerenkovMaxPhotons
|
||||
<< "\n";
|
||||
os << " Cerenkov maximum beta change per step: " << cerenkovMaxBetaChange
|
||||
<< " %\n";
|
||||
os << " Cerenkov stack photons: " << cerenkovStackPhotons
|
||||
<< "\n";
|
||||
os << " Cerenkov track secondaries first: "
|
||||
<< cerenkovTrackSecondariesFirst << "\n";
|
||||
os << " Scintillation process active: "
|
||||
<< GetProcessActivation("Scintillation") << "\n";
|
||||
os << " Scintillation finite rise time: " << scintFiniteRiseTime
|
||||
<< "\n";
|
||||
os << " Scintillation by particle type: " << scintByParticleType
|
||||
<< "\n";
|
||||
os << " Scintillation record track info: " << scintTrackInfo << "\n";
|
||||
os << " Scintillation stack photons: " << scintStackPhotons << "\n";
|
||||
os << " Scintillation track secondaries first: " << scintTrackSecondariesFirst << "\n";
|
||||
os << " WLS process active: " << GetProcessActivation("OpWLS") << "\n";
|
||||
os << " WLS time profile name: " << wlsTimeProfileName << "\n";
|
||||
os << " WLS2 process active: " << GetProcessActivation("OpWLS2") << "\n";
|
||||
os << " WLS2 time profile name: " << wls2TimeProfileName << "\n";
|
||||
os << " Boundary process active: " << GetProcessActivation("OpBoundary") << "\n";
|
||||
os << " Scintillation track secondaries first: " << scintTrackSecondariesFirst
|
||||
<< "\n";
|
||||
os << " WLS process active: "
|
||||
<< GetProcessActivation("OpWLS") << "\n";
|
||||
os << " WLS time profile name: " << wlsTimeProfileName
|
||||
<< "\n";
|
||||
os << " WLS2 process active: "
|
||||
<< GetProcessActivation("OpWLS2") << "\n";
|
||||
os << " WLS2 time profile name: " << wls2TimeProfileName
|
||||
<< "\n";
|
||||
os << " Boundary process active: "
|
||||
<< GetProcessActivation("OpBoundary") << "\n";
|
||||
os << " Boundary invoke sensitive detector: " << boundaryInvokeSD << "\n";
|
||||
os << " Rayleigh process active: " << GetProcessActivation("OpRayleigh") << "\n";
|
||||
os << " MieHG process active: " << GetProcessActivation("OpMieHG") << "\n";
|
||||
os << " Absorption process active: " << GetProcessActivation("OpAbsorption") << "\n";
|
||||
os << "=======================================================================" << "\n";
|
||||
os << " Rayleigh process active: "
|
||||
<< GetProcessActivation("OpRayleigh") << "\n";
|
||||
os << " MieHG process active: "
|
||||
<< GetProcessActivation("OpMieHG") << "\n";
|
||||
os << " Absorption process active: "
|
||||
<< GetProcessActivation("OpAbsorption") << "\n";
|
||||
os
|
||||
<< "======================================================================="
|
||||
<< "\n";
|
||||
os.precision(prec);
|
||||
}
|
||||
|
||||
@@ -452,7 +542,7 @@ void G4OpticalParameters::Dump() const
|
||||
#endif
|
||||
}
|
||||
|
||||
std::ostream& operator<< (std::ostream& os, const G4OpticalParameters& par)
|
||||
std::ostream& operator<<(std::ostream& os, const G4OpticalParameters& par)
|
||||
{
|
||||
par.StreamInfo(os);
|
||||
return os;
|
||||
@@ -461,7 +551,7 @@ std::ostream& operator<< (std::ostream& os, const G4OpticalParameters& par)
|
||||
G4bool G4OpticalParameters::IsLocked() const
|
||||
{
|
||||
return (!G4Threading::IsMasterThread() ||
|
||||
(fStateManager->GetCurrentState() != G4State_PreInit &&
|
||||
fStateManager->GetCurrentState() != G4State_Init &&
|
||||
fStateManager->GetCurrentState() != G4State_Idle));
|
||||
(fStateManager->GetCurrentState() != G4State_PreInit &&
|
||||
fStateManager->GetCurrentState() != G4State_Init &&
|
||||
fStateManager->GetCurrentState() != G4State_Idle));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user