Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/electromagnetic/utils/src/G4OpticalParameters.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/electromagnetic/utils/src/G4OpticalParameters.cc (Version 11.3.0) and /processes/electromagnetic/utils/src/G4OpticalParameters.cc (Version 10.7)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 // -------------------------------------------     26 // -------------------------------------------------------------------
 27 //                                                 27 //
 28 // GEANT4 Class file                               28 // GEANT4 Class file
 29 //                                                 29 //
 30 // File name:     G4OpticalParameters              30 // File name:     G4OpticalParameters
 31 //                                                 31 //
 32 // Author:        Daren Sawkey based on G4EmPa     32 // Author:        Daren Sawkey based on G4EmParameters
 33 //                                                 33 //
 34 // Creation date: 14.07.2020                       34 // Creation date: 14.07.2020
 35 //                                                 35 //
 36 // Modifications:                                  36 // Modifications:
 37 //                                                 37 //
 38 // -------------------------------------------     38 // -------------------------------------------------------------------
 39 //                                                 39 //
 40 //....oooOO0OOooo........oooOO0OOooo........oo     40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 41 //....oooOO0OOooo........oooOO0OOooo........oo     41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 42                                                    42 
 43 #include "G4OpticalParameters.hh"                  43 #include "G4OpticalParameters.hh"
 44 #include "G4OpticalParametersMessenger.hh"         44 #include "G4OpticalParametersMessenger.hh"
 45 #include "G4PhysicalConstants.hh"                  45 #include "G4PhysicalConstants.hh"
 46 #include "G4UnitsTable.hh"                         46 #include "G4UnitsTable.hh"
 47 #include "G4SystemOfUnits.hh"                      47 #include "G4SystemOfUnits.hh"
 48 #include "G4ApplicationState.hh"                   48 #include "G4ApplicationState.hh"
 49 #include "G4StateManager.hh"                       49 #include "G4StateManager.hh"
 50                                                    50 
 51 G4OpticalParameters* G4OpticalParameters::theI     51 G4OpticalParameters* G4OpticalParameters::theInstance = nullptr;
 52                                                    52 
 53 #ifdef G4MULTITHREADED                             53 #ifdef G4MULTITHREADED
 54 G4Mutex G4OpticalParameters::opticalParameters <<  54   G4Mutex G4OpticalParameters::opticalParametersMutex = G4MUTEX_INITIALIZER;
 55 #endif                                             55 #endif
 56                                                    56 
 57 //....oooOO0OOooo........oooOO0OOooo........oo     57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
 58                                                    58 
 59 G4OpticalParameters* G4OpticalParameters::Inst     59 G4OpticalParameters* G4OpticalParameters::Instance()
 60 {                                                  60 {
 61   if(nullptr == theInstance)                   <<  61   if(nullptr == theInstance) {
 62   {                                            << 
 63 #ifdef G4MULTITHREADED                             62 #ifdef G4MULTITHREADED
 64     G4MUTEXLOCK(&opticalParametersMutex);          63     G4MUTEXLOCK(&opticalParametersMutex);
 65     if(nullptr == theInstance)                 <<  64     if(nullptr == theInstance) {
 66     {                                          << 
 67 #endif                                             65 #endif
 68       static G4OpticalParameters manager;          66       static G4OpticalParameters manager;
 69       theInstance = &manager;                      67       theInstance = &manager;
 70 #ifdef G4MULTITHREADED                             68 #ifdef G4MULTITHREADED
 71     }                                              69     }
 72     G4MUTEXUNLOCK(&opticalParametersMutex);        70     G4MUTEXUNLOCK(&opticalParametersMutex);
 73 #endif                                             71 #endif
 74   }                                                72   }
 75   return theInstance;                              73   return theInstance;
 76 }                                                  74 }
 77                                                    75 
 78 //....oooOO0OOooo........oooOO0OOooo........oo     76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
 79                                                    77 
 80 G4OpticalParameters::~G4OpticalParameters() {  <<  78 G4OpticalParameters::~G4OpticalParameters()
                                                   >>  79 {
                                                   >>  80   delete theMessenger;
                                                   >>  81 }
 81                                                    82 
 82 //....oooOO0OOooo........oooOO0OOooo........oo     83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
 83                                                    84 
 84 G4OpticalParameters::G4OpticalParameters()         85 G4OpticalParameters::G4OpticalParameters()
 85 {                                                  86 {
 86   theMessenger = new G4OpticalParametersMessen     87   theMessenger = new G4OpticalParametersMessenger(this);
 87   Initialise();                                    88   Initialise();
 88                                                    89 
 89   fStateManager = G4StateManager::GetStateMana     90   fStateManager = G4StateManager::GetStateManager();
 90 }                                                  91 }
 91                                                    92 
 92 void G4OpticalParameters::SetDefaults()            93 void G4OpticalParameters::SetDefaults()
 93 {                                                  94 {
 94   if(!IsLocked())                              <<  95   if(!IsLocked()) {
 95   {                                            << 
 96     Initialise();                                  96     Initialise();
 97   }                                                97   }
 98 }                                                  98 }
 99                                                    99 
100 void G4OpticalParameters::Initialise()            100 void G4OpticalParameters::Initialise()
101 {                                                 101 {
102   verboseLevel = 1;                            << 102   verboseLevel = 0;
103                                                   103 
104   cerenkovStackPhotons          = true;           104   cerenkovStackPhotons          = true;
105   cerenkovTrackSecondariesFirst = true;           105   cerenkovTrackSecondariesFirst = true;
106   cerenkovVerboseLevel          = 1;           << 106   cerenkovVerboseLevel          = 0;
107   cerenkovMaxPhotons            = 100;            107   cerenkovMaxPhotons            = 100;
108   cerenkovMaxBetaChange         = 10.;            108   cerenkovMaxBetaChange         = 10.;
109                                                   109 
110   scintByParticleType        = false;             110   scintByParticleType        = false;
111   scintTrackInfo             = false;             111   scintTrackInfo             = false;
112   scintStackPhotons          = true;              112   scintStackPhotons          = true;
                                                   >> 113   scintEnhancedTimeConstants = false;
113   scintFiniteRiseTime        = false;             114   scintFiniteRiseTime        = false;
114   scintTrackSecondariesFirst = true;              115   scintTrackSecondariesFirst = true;
115   scintVerboseLevel          = 1;              << 116   scintYieldFactor           = 1.;
                                                   >> 117   scintExcitationRatio       = 1.;
                                                   >> 118   scintVerboseLevel          = 0;
116                                                   119 
117   wlsTimeProfileName = "delta";                << 120   wlsTimeProfileName = "delta";
118   wlsVerboseLevel    = 1;                      << 121   wlsVerboseLevel    = 0;
119                                                   122 
120   wls2TimeProfileName = "delta";               << 123   wls2TimeProfileName = "delta";
121   wls2VerboseLevel    = 1;                     << 124   wls2VerboseLevel    = 0;
122                                                   125 
123   absorptionVerboseLevel = 1;                  << 126   absorptionVerboseLevel = 0;
124                                                   127 
125   rayleighVerboseLevel = 1;                    << 128   rayleighVerboseLevel = 0;
126                                                   129 
127   mieVerboseLevel = 1;                         << 130   mieVerboseLevel = 0;
128                                                   131 
129   boundaryInvokeSD     = false;                   132   boundaryInvokeSD     = false;
130   boundaryVerboseLevel = 1;                    << 133   boundaryVerboseLevel = 0;
131                                                   134 
132   processActivation["OpRayleigh"]    = true;      135   processActivation["OpRayleigh"]    = true;
133   processActivation["OpBoundary"]    = true;      136   processActivation["OpBoundary"]    = true;
134   processActivation["OpMieHG"]       = true;      137   processActivation["OpMieHG"]       = true;
135   processActivation["OpAbsorption"]  = true;      138   processActivation["OpAbsorption"]  = true;
136   processActivation["OpWLS"]         = true;      139   processActivation["OpWLS"]         = true;
137   processActivation["OpWLS2"]        = true;      140   processActivation["OpWLS2"]        = true;
138   processActivation["Cerenkov"]      = true;      141   processActivation["Cerenkov"]      = true;
139   processActivation["Scintillation"] = true;      142   processActivation["Scintillation"] = true;
                                                   >> 143 
140 }                                                 144 }
141                                                   145 
142 void G4OpticalParameters::SetVerboseLevel(G4in    146 void G4OpticalParameters::SetVerboseLevel(G4int val)
143 {                                                 147 {
144   if(IsLocked())                               << 148   if(IsLocked()) { return; }
145   {                                            << 
146     return;                                    << 
147   }                                            << 
148   verboseLevel = val;                             149   verboseLevel = val;
149   SetCerenkovVerboseLevel(verboseLevel);          150   SetCerenkovVerboseLevel(verboseLevel);
150   SetScintVerboseLevel(verboseLevel);             151   SetScintVerboseLevel(verboseLevel);
151   SetRayleighVerboseLevel(verboseLevel);          152   SetRayleighVerboseLevel(verboseLevel);
152   SetAbsorptionVerboseLevel(verboseLevel);        153   SetAbsorptionVerboseLevel(verboseLevel);
153   SetMieVerboseLevel(verboseLevel);               154   SetMieVerboseLevel(verboseLevel);
154   SetBoundaryVerboseLevel(verboseLevel);          155   SetBoundaryVerboseLevel(verboseLevel);
155   SetWLSVerboseLevel(verboseLevel);               156   SetWLSVerboseLevel(verboseLevel);
156   SetWLS2VerboseLevel(verboseLevel);              157   SetWLS2VerboseLevel(verboseLevel);
157 }                                                 158 }
158                                                   159 
159 G4int G4OpticalParameters::GetVerboseLevel() c << 160 G4int G4OpticalParameters::GetVerboseLevel() const
                                                   >> 161 {
                                                   >> 162   return verboseLevel;
                                                   >> 163 }
160                                                   164 
161 void G4OpticalParameters::SetProcessActivation << 165 void G4OpticalParameters::SetProcessActivation(const G4String& process, G4bool val)
162                                                << 
163 {                                                 166 {
164   // Configure the physics constructor to use/    167   // Configure the physics constructor to use/not use a selected process.
165   // This method can only be called in PreInit    168   // This method can only be called in PreInit> phase (before execution of
166   // ConstructProcess). The process is not add    169   // ConstructProcess). The process is not added to particle's process manager
167   // and so it cannot be re-activated later in    170   // and so it cannot be re-activated later in Idle> phase with the command
168   // /process/activate.                           171   // /process/activate.
169                                                   172 
170   if(IsLocked())                               << 173   if(IsLocked()) { return; }
171   {                                            << 174   if (processActivation[process] == val) return;
172     return;                                    << 
173   }                                            << 
174   if(processActivation[process] == val)        << 
175     return;                                    << 
176                                                   175 
177   // processActivation keys defined at initial    176   // processActivation keys defined at initialisation
178   if(processActivation.find(process) != proces << 177   if (processActivation.find(process) != processActivation.end()) {
179   {                                            << 
180     processActivation[process] = val;             178     processActivation[process] = val;
181   }                                               179   }
182   else                                         << 180   else {
183   {                                            << 
184     G4ExceptionDescription ed;                    181     G4ExceptionDescription ed;
185     ed << "Process name " << process << " out     182     ed << "Process name " << process << " out of bounds.";
186     G4Exception("G4OpticalParameters::SetProce    183     G4Exception("G4OpticalParameters::SetProcessActivation()", "Optical013",
187                 FatalException, ed);              184                 FatalException, ed);
188   }                                               185   }
189 }                                                 186 }
190                                                   187 
191 G4bool G4OpticalParameters::GetProcessActivati    188 G4bool G4OpticalParameters::GetProcessActivation(const G4String& process) const
                                                   >> 189 { return processActivation.find(process)->second; }
                                                   >> 190 
                                                   >> 191 void G4OpticalParameters::Configure(G4OpticalProcessIndex index, G4bool val)
192 {                                                 192 {
193   return processActivation.find(process)->seco << 193   // DEPRECATED. Use SetProcessActivation instead.
                                                   >> 194 
                                                   >> 195   // Configure the physics constructor to use/not use a selected process.
                                                   >> 196   // This method can only be called in PreInit> phase (before execution of
                                                   >> 197   // ConstructProcess). The process is not added to particle's process manager
                                                   >> 198   // and so it cannot be re-activated later in Idle> phase with the command
                                                   >> 199   // /process/activate.
                                                   >> 200 
                                                   >> 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;
                                                   >> 209   else {
                                                   >> 210     G4ExceptionDescription ed;
                                                   >> 211     ed << "Process index " << index << " out of bounds.";
                                                   >> 212     G4Exception("G4OpticalParameters::Configure()", "Optical010", FatalException, ed);
                                                   >> 213   }
                                                   >> 214   G4ExceptionDescription ed2;
                                                   >> 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.";
                                                   >> 218   PrintWarning(ed2);
                                                   >> 219 }
                                                   >> 220 
                                                   >> 221 G4bool G4OpticalParameters::GetConfiguration(G4OpticalProcessIndex index)
                                                   >> 222 {
                                                   >> 223   // DEPRECATED. Use GetProcessActivation 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"];
                                                   >> 231   else {
                                                   >> 232     G4ExceptionDescription ed;
                                                   >> 233     ed << "Process index " << index << " out of bounds.";
                                                   >> 234     G4Exception("G4OpticalParameters::GetConfiguration()", "Optical011", JustWarning, ed);
                                                   >> 235   }
                                                   >> 236   G4ExceptionDescription ed2;
                                                   >> 237   ed2 << "Method GetConfiguration(G4OpticalProcessIndex) is deprecated "
                                                   >> 238       << "and will be removed in a future Geant4 version. Please use "
                                                   >> 239       << "GetProcessActivation(G4String) instead.";
                                                   >> 240   PrintWarning(ed2);
                                                   >> 241   return true;
                                                   >> 242 }
                                                   >> 243 
                                                   >> 244 void G4OpticalParameters::SetTrackSecondariesFirst(G4OpticalProcessIndex index,
                                                   >> 245                                                 G4bool val)
                                                   >> 246 {
                                                   >> 247   // DEPRECATED. Use SetCerenkovTrackSecondariesFirst and
                                                   >> 248   //                 SetScintTrackSecondariesFirst instead.
                                                   >> 249   if(IsLocked()) { return; }
                                                   >> 250   if      (index == kCerenkov)      cerenkovTrackSecondariesFirst = val;
                                                   >> 251   else if (index == kScintillation) scintTrackSecondariesFirst = val;
                                                   >> 252   else {
                                                   >> 253     G4ExceptionDescription ed;
                                                   >> 254     ed << "Process index " << index << " out of bounds.";
                                                   >> 255     G4Exception("G4OpticalParameters::SetTrackSecondariesFirst()",
                                                   >> 256                 "Optical013", FatalException, ed);
                                                   >> 257   }
                                                   >> 258   G4ExceptionDescription ed2;
                                                   >> 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.";
                                                   >> 263   PrintWarning(ed2);
                                                   >> 264 
                                                   >> 265 }
                                                   >> 266 
                                                   >> 267 G4bool G4OpticalParameters::GetTrackSecondariesFirst(G4OpticalProcessIndex index)
                                                   >> 268 // DEPRECATED. Use GetCerenkovTrackSecondariesFirst and
                                                   >> 269 //                 GetScintTrackSecondariesFirst instead.
                                                   >> 270 {
                                                   >> 271   if      (index == kCerenkov)      return cerenkovTrackSecondariesFirst;
                                                   >> 272   else if (index == kScintillation) return scintTrackSecondariesFirst;
                                                   >> 273   else {
                                                   >> 274     G4ExceptionDescription ed;
                                                   >> 275     ed << "Process index " << index << " out of bounds.";
                                                   >> 276     G4Exception("G4OpticalParameters::GetTrackSecondariesFirst()",
                                                   >> 277                 "Optical012", JustWarning, ed);
                                                   >> 278   }
                                                   >> 279   G4ExceptionDescription ed2;
                                                   >> 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.";
                                                   >> 284   PrintWarning(ed2);
                                                   >> 285   return true;
194 }                                                 286 }
195                                                   287 
196 void G4OpticalParameters::SetCerenkovStackPhot    288 void G4OpticalParameters::SetCerenkovStackPhotons(G4bool val)
197 {                                                 289 {
198   if(IsLocked())                               << 290   if(IsLocked()) { return; }
199   {                                            << 
200     return;                                    << 
201   }                                            << 
202   cerenkovStackPhotons = val;                     291   cerenkovStackPhotons = val;
203 }                                                 292 }
204                                                   293 
205 G4bool G4OpticalParameters::GetCerenkovStackPh    294 G4bool G4OpticalParameters::GetCerenkovStackPhotons() const
206 {                                                 295 {
207   return cerenkovStackPhotons;                    296   return cerenkovStackPhotons;
208 }                                                 297 }
209                                                   298 
210 void G4OpticalParameters::SetCerenkovVerboseLe    299 void G4OpticalParameters::SetCerenkovVerboseLevel(G4int val)
211 {                                                 300 {
212   if(IsLocked())                               << 301   if(IsLocked()) { return; }
213   {                                            << 
214     return;                                    << 
215   }                                            << 
216   cerenkovVerboseLevel = val;                     302   cerenkovVerboseLevel = val;
217 }                                                 303 }
218                                                   304 
219 G4int G4OpticalParameters::GetCerenkovVerboseL    305 G4int G4OpticalParameters::GetCerenkovVerboseLevel() const
220 {                                                 306 {
221   return cerenkovVerboseLevel;                    307   return cerenkovVerboseLevel;
222 }                                                 308 }
223                                                   309 
224 void G4OpticalParameters::SetCerenkovMaxPhoton    310 void G4OpticalParameters::SetCerenkovMaxPhotonsPerStep(G4int val)
225 {                                                 311 {
226   if(IsLocked())                               << 312   if(IsLocked()) { return; }
227   {                                            << 
228     return;                                    << 
229   }                                            << 
230   cerenkovMaxPhotons = val;                       313   cerenkovMaxPhotons = val;
231 }                                                 314 }
232                                                   315 
233 G4int G4OpticalParameters::GetCerenkovMaxPhoto    316 G4int G4OpticalParameters::GetCerenkovMaxPhotonsPerStep() const
234 {                                                 317 {
235   return cerenkovMaxPhotons;                      318   return cerenkovMaxPhotons;
236 }                                                 319 }
237                                                   320 
238 void G4OpticalParameters::SetCerenkovMaxBetaCh    321 void G4OpticalParameters::SetCerenkovMaxBetaChange(G4double val)
239 {                                                 322 {
240   if(IsLocked())                               << 323   if(IsLocked()) { return; }
241   {                                            << 
242     return;                                    << 
243   }                                            << 
244   cerenkovMaxBetaChange = val;                    324   cerenkovMaxBetaChange = val;
245 }                                                 325 }
246                                                   326 
247 G4double G4OpticalParameters::GetCerenkovMaxBe    327 G4double G4OpticalParameters::GetCerenkovMaxBetaChange() const
248 {                                                 328 {
249   return cerenkovMaxBetaChange;                   329   return cerenkovMaxBetaChange;
250 }                                                 330 }
251                                                   331 
252 void G4OpticalParameters::SetCerenkovTrackSeco    332 void G4OpticalParameters::SetCerenkovTrackSecondariesFirst(G4bool val)
253 {                                                 333 {
254   if(IsLocked())                               << 334   if(IsLocked()) { return; }
255   {                                            << 
256     return;                                    << 
257   }                                            << 
258   cerenkovTrackSecondariesFirst = val;            335   cerenkovTrackSecondariesFirst = val;
259 }                                                 336 }
260                                                   337 
261 G4bool G4OpticalParameters::GetCerenkovTrackSe    338 G4bool G4OpticalParameters::GetCerenkovTrackSecondariesFirst() const
262 {                                                 339 {
263   return cerenkovTrackSecondariesFirst;           340   return cerenkovTrackSecondariesFirst;
264 }                                                 341 }
265                                                   342 
                                                   >> 343 void G4OpticalParameters::SetScintYieldFactor(G4double val)
                                                   >> 344 {
                                                   >> 345   if(IsLocked()) { return; }
                                                   >> 346   scintYieldFactor = val;
                                                   >> 347 }
                                                   >> 348 
                                                   >> 349 G4double G4OpticalParameters::GetScintYieldFactor() const
                                                   >> 350 {
                                                   >> 351   return scintYieldFactor;
                                                   >> 352 }
                                                   >> 353 
                                                   >> 354 void G4OpticalParameters::SetScintExcitationRatio(G4double val)
                                                   >> 355 {
                                                   >> 356   if(IsLocked()) { return; }
                                                   >> 357   scintExcitationRatio = val;
                                                   >> 358 }
                                                   >> 359 
                                                   >> 360 G4double G4OpticalParameters::GetScintExcitationRatio() const
                                                   >> 361 {
                                                   >> 362   return scintExcitationRatio;
                                                   >> 363 }
                                                   >> 364 
266 void G4OpticalParameters::SetScintByParticleTy    365 void G4OpticalParameters::SetScintByParticleType(G4bool val)
267 {                                                 366 {
268   if(IsLocked())                               << 367   if(IsLocked()) { return; }
269   {                                            << 
270     return;                                    << 
271   }                                            << 
272   scintByParticleType = val;                      368   scintByParticleType = val;
273 }                                                 369 }
274                                                   370 
275 G4bool G4OpticalParameters::GetScintByParticle    371 G4bool G4OpticalParameters::GetScintByParticleType() const
276 {                                                 372 {
277   return scintByParticleType;                     373   return scintByParticleType;
278 }                                                 374 }
279                                                   375 
280 void G4OpticalParameters::SetScintTrackInfo(G4    376 void G4OpticalParameters::SetScintTrackInfo(G4bool val)
281 {                                                 377 {
282   if(IsLocked())                               << 378   if(IsLocked()) { return; }
283   {                                            << 
284     return;                                    << 
285   }                                            << 
286   scintTrackInfo = val;                           379   scintTrackInfo = val;
287 }                                                 380 }
288                                                   381 
289 G4bool G4OpticalParameters::GetScintTrackInfo( << 382 G4bool G4OpticalParameters::GetScintTrackInfo() const
                                                   >> 383 {
                                                   >> 384   return scintTrackInfo;
                                                   >> 385 }
290                                                   386 
291 void G4OpticalParameters::SetScintTrackSeconda    387 void G4OpticalParameters::SetScintTrackSecondariesFirst(G4bool val)
292 {                                                 388 {
293   if(IsLocked())                               << 389   if(IsLocked()) { return; }
294   {                                            << 
295     return;                                    << 
296   }                                            << 
297   scintTrackSecondariesFirst = val;               390   scintTrackSecondariesFirst = val;
298 }                                                 391 }
299                                                   392 
300 G4bool G4OpticalParameters::GetScintTrackSecon    393 G4bool G4OpticalParameters::GetScintTrackSecondariesFirst() const
301 {                                                 394 {
302   return scintTrackSecondariesFirst;              395   return scintTrackSecondariesFirst;
303 }                                                 396 }
304                                                   397 
305 void G4OpticalParameters::SetScintFiniteRiseTi    398 void G4OpticalParameters::SetScintFiniteRiseTime(G4bool val)
306 {                                                 399 {
307   if(IsLocked())                               << 400   if(IsLocked()) { return; }
308   {                                            << 
309     return;                                    << 
310   }                                            << 
311   scintFiniteRiseTime = val;                      401   scintFiniteRiseTime = val;
312 }                                                 402 }
313                                                   403 
314 G4bool G4OpticalParameters::GetScintFiniteRise    404 G4bool G4OpticalParameters::GetScintFiniteRiseTime() const
315 {                                                 405 {
316   return scintFiniteRiseTime;                     406   return scintFiniteRiseTime;
317 }                                                 407 }
318                                                   408 
319 void G4OpticalParameters::SetScintStackPhotons    409 void G4OpticalParameters::SetScintStackPhotons(G4bool val)
320 {                                                 410 {
321   if(IsLocked())                               << 411   if(IsLocked()) { return; }
322   {                                            << 
323     return;                                    << 
324   }                                            << 
325   scintStackPhotons = val;                        412   scintStackPhotons = val;
326 }                                                 413 }
327                                                   414 
328 G4bool G4OpticalParameters::GetScintStackPhoto    415 G4bool G4OpticalParameters::GetScintStackPhotons() const
329 {                                                 416 {
330   return scintStackPhotons;                       417   return scintStackPhotons;
331 }                                                 418 }
332                                                   419 
333 void G4OpticalParameters::SetScintVerboseLevel    420 void G4OpticalParameters::SetScintVerboseLevel(G4int val)
334 {                                                 421 {
335   if(IsLocked())                               << 422   if(IsLocked()) { return; }
336   {                                            << 
337     return;                                    << 
338   }                                            << 
339   scintVerboseLevel = val;                        423   scintVerboseLevel = val;
340 }                                                 424 }
341                                                   425 
342 G4int G4OpticalParameters::GetScintVerboseLeve    426 G4int G4OpticalParameters::GetScintVerboseLevel() const
343 {                                                 427 {
344   return scintVerboseLevel;                       428   return scintVerboseLevel;
345 }                                                 429 }
346                                                   430 
                                                   >> 431 void G4OpticalParameters::SetScintEnhancedTimeConstants(G4bool val)
                                                   >> 432 {
                                                   >> 433   if(IsLocked()) { return; }
                                                   >> 434   scintEnhancedTimeConstants = val;
                                                   >> 435 }
                                                   >> 436 
                                                   >> 437 G4bool G4OpticalParameters::GetScintEnhancedTimeConstants() const
                                                   >> 438 {
                                                   >> 439   return scintEnhancedTimeConstants;
                                                   >> 440 }
                                                   >> 441 
347 void G4OpticalParameters::SetWLSTimeProfile(co    442 void G4OpticalParameters::SetWLSTimeProfile(const G4String& val)
348 {                                                 443 {
349   if(IsLocked())                               << 444   if(IsLocked()) { return; }
350   {                                            << 
351     return;                                    << 
352   }                                            << 
353   wlsTimeProfileName = val;                       445   wlsTimeProfileName = val;
354 }                                                 446 }
355                                                   447 
356 G4String G4OpticalParameters::GetWLSTimeProfil    448 G4String G4OpticalParameters::GetWLSTimeProfile() const
357 {                                                 449 {
358   return wlsTimeProfileName;                      450   return wlsTimeProfileName;
359 }                                                 451 }
360                                                   452 
361 void G4OpticalParameters::SetWLSVerboseLevel(G    453 void G4OpticalParameters::SetWLSVerboseLevel(G4int val)
362 {                                                 454 {
363   if(IsLocked())                               << 455   if(IsLocked()) {return; }
364   {                                            << 
365     return;                                    << 
366   }                                            << 
367   wlsVerboseLevel = val;                          456   wlsVerboseLevel = val;
368 }                                                 457 }
369                                                   458 
370 G4int G4OpticalParameters::GetWLSVerboseLevel(    459 G4int G4OpticalParameters::GetWLSVerboseLevel() const
371 {                                                 460 {
372   return wlsVerboseLevel;                         461   return wlsVerboseLevel;
373 }                                                 462 }
374                                                   463 
375 void G4OpticalParameters::SetWLS2TimeProfile(c    464 void G4OpticalParameters::SetWLS2TimeProfile(const G4String& val)
376 {                                                 465 {
377   if(IsLocked())                               << 466   if(IsLocked()) { return; }
378   {                                            << 
379     return;                                    << 
380   }                                            << 
381   wls2TimeProfileName = val;                      467   wls2TimeProfileName = val;
382 }                                                 468 }
383                                                   469 
384 G4String G4OpticalParameters::GetWLS2TimeProfi    470 G4String G4OpticalParameters::GetWLS2TimeProfile() const
385 {                                                 471 {
386   return wls2TimeProfileName;                     472   return wls2TimeProfileName;
387 }                                                 473 }
388                                                   474 
389 void G4OpticalParameters::SetWLS2VerboseLevel(    475 void G4OpticalParameters::SetWLS2VerboseLevel(G4int val)
390 {                                                 476 {
391   if(IsLocked())                               << 477   if(IsLocked()) {return; }
392   {                                            << 
393     return;                                    << 
394   }                                            << 
395   wls2VerboseLevel = val;                         478   wls2VerboseLevel = val;
396 }                                                 479 }
397                                                   480 
398 G4int G4OpticalParameters::GetWLS2VerboseLevel    481 G4int G4OpticalParameters::GetWLS2VerboseLevel() const
399 {                                                 482 {
400   return wls2VerboseLevel;                        483   return wls2VerboseLevel;
401 }                                                 484 }
402                                                   485 
403 void G4OpticalParameters::SetBoundaryVerboseLe    486 void G4OpticalParameters::SetBoundaryVerboseLevel(G4int val)
404 {                                                 487 {
405   if(IsLocked())                               << 488   if(IsLocked()) {return;}
406   {                                            << 
407     return;                                    << 
408   }                                            << 
409   boundaryVerboseLevel = val;                     489   boundaryVerboseLevel = val;
410 }                                                 490 }
411                                                   491 
412 G4int G4OpticalParameters::GetBoundaryVerboseL    492 G4int G4OpticalParameters::GetBoundaryVerboseLevel() const
413 {                                                 493 {
414   return boundaryVerboseLevel;                    494   return boundaryVerboseLevel;
415 }                                                 495 }
416                                                   496 
417 void G4OpticalParameters::SetBoundaryInvokeSD(    497 void G4OpticalParameters::SetBoundaryInvokeSD(G4bool val)
418 {                                                 498 {
419   if(IsLocked())                               << 499   if(IsLocked()) {return;}
420   {                                            << 
421     return;                                    << 
422   }                                            << 
423   boundaryInvokeSD = val;                         500   boundaryInvokeSD = val;
424 }                                                 501 }
425                                                   502 
426 G4bool G4OpticalParameters::GetBoundaryInvokeS    503 G4bool G4OpticalParameters::GetBoundaryInvokeSD() const
427 {                                                 504 {
428   return boundaryInvokeSD;                        505   return boundaryInvokeSD;
429 }                                                 506 }
430                                                   507 
431 void G4OpticalParameters::SetAbsorptionVerbose    508 void G4OpticalParameters::SetAbsorptionVerboseLevel(G4int val)
432 {                                                 509 {
433   if(IsLocked())                               << 510   if(IsLocked()) {return;}
434   {                                            << 
435     return;                                    << 
436   }                                            << 
437   absorptionVerboseLevel = val;                   511   absorptionVerboseLevel = val;
438 }                                                 512 }
439                                                   513 
440 G4int G4OpticalParameters::GetAbsorptionVerbos    514 G4int G4OpticalParameters::GetAbsorptionVerboseLevel() const
441 {                                                 515 {
442   return absorptionVerboseLevel;                  516   return absorptionVerboseLevel;
443 }                                                 517 }
444                                                   518 
445 void G4OpticalParameters::SetRayleighVerboseLe    519 void G4OpticalParameters::SetRayleighVerboseLevel(G4int val)
446 {                                                 520 {
447   if(IsLocked())                               << 521   if(IsLocked()) {return;}
448   {                                            << 
449     return;                                    << 
450   }                                            << 
451   rayleighVerboseLevel = val;                     522   rayleighVerboseLevel = val;
452 }                                                 523 }
453                                                   524 
454 G4int G4OpticalParameters::GetRayleighVerboseL    525 G4int G4OpticalParameters::GetRayleighVerboseLevel() const
455 {                                                 526 {
456   return rayleighVerboseLevel;                    527   return rayleighVerboseLevel;
457 }                                                 528 }
458                                                   529 
459 void G4OpticalParameters::SetMieVerboseLevel(G    530 void G4OpticalParameters::SetMieVerboseLevel(G4int val)
460 {                                                 531 {
461   if(IsLocked())                               << 532   if(IsLocked()) {return;}
462   {                                            << 
463     return;                                    << 
464   }                                            << 
465   mieVerboseLevel = val;                          533   mieVerboseLevel = val;
466 }                                                 534 }
467                                                   535 
468 G4int G4OpticalParameters::GetMieVerboseLevel(    536 G4int G4OpticalParameters::GetMieVerboseLevel() const
469 {                                                 537 {
470   return mieVerboseLevel;                         538   return mieVerboseLevel;
471 }                                                 539 }
472                                                   540 
473 void G4OpticalParameters::PrintWarning(G4Excep    541 void G4OpticalParameters::PrintWarning(G4ExceptionDescription& ed) const
474 {                                                 542 {
475   G4Exception("G4EmParameters", "Optical0020",    543   G4Exception("G4EmParameters", "Optical0020", JustWarning, ed);
476 }                                                 544 }
477                                                   545 
478 void G4OpticalParameters::StreamInfo(std::ostr    546 void G4OpticalParameters::StreamInfo(std::ostream& os) const
479 {                                                 547 {
480   G4long prec = os.precision(5);               << 548   G4int prec = os.precision(5);
481   os                                           << 549   os << "=======================================================================" << "\n";
482     << "====================================== << 550   os << "======                         Optical Physics Parameters      ========" << "\n";
483     << "\n";                                   << 551   os << "=======================================================================" << "\n";
484   os                                           << 552 
485     << "======                         Optical << 553   os << " Cerenkov process active:               " << GetProcessActivation("Cerenkov") << "\n";
486     << "\n";                                   << 554   os << " Cerenkov maximum photons per step:     " << cerenkovMaxPhotons << "\n";
487   os                                           << 555   os << " Cerenkov maximum beta change per step: " << cerenkovMaxBetaChange << " %\n";
488     << "====================================== << 556   os << " Cerenkov stack photons:                " << cerenkovStackPhotons << "\n";
489     << "\n";                                   << 557   os << " Cerenkov track secondaries first:      " << cerenkovTrackSecondariesFirst << "\n";
490                                                << 558   os << " Scintillation process active:          " << GetProcessActivation("Scintillation") << "\n";
491   os << " Cerenkov process active:             << 559   os << " Scintillation yield factor:            " << scintYieldFactor << "\n";
492      << GetProcessActivation("Cerenkov") << "\ << 560   os << " Scintillation excitation ratio:        " << scintExcitationRatio << "\n";
493   os << " Cerenkov maximum photons per step:   << 561   os << " Scintillation finite rise time:        " << scintFiniteRiseTime << "\n";
494      << "\n";                                  << 562   os << " Scintillation by particle type:        " << scintByParticleType << "\n";
495   os << " Cerenkov maximum beta change per ste << 
496      << " %\n";                                << 
497   os << " Cerenkov stack photons:              << 
498      << "\n";                                  << 
499   os << " Cerenkov track secondaries first:    << 
500      << cerenkovTrackSecondariesFirst << "\n"; << 
501   os << " Scintillation process active:        << 
502      << GetProcessActivation("Scintillation")  << 
503   os << " Scintillation finite rise time:      << 
504      << "\n";                                  << 
505   os << " Scintillation by particle type:      << 
506      << "\n";                                  << 
507   os << " Scintillation record track info:        563   os << " Scintillation record track info:       " << scintTrackInfo << "\n";
508   os << " Scintillation stack photons:            564   os << " Scintillation stack photons:           " << scintStackPhotons << "\n";
509   os << " Scintillation track secondaries firs << 565   os << " Scintillation use enhanced time constants: " << scintEnhancedTimeConstants << "\n";
510      << "\n";                                  << 566   os << " Scintillation track secondaries first: " << scintTrackSecondariesFirst << "\n";
511   os << " WLS process active:                  << 567   os << " WLS process active:                    " << GetProcessActivation("OpWLS") << "\n";
512      << GetProcessActivation("OpWLS") << "\n"; << 568   os << " WLS time profile name:                 " << wlsTimeProfileName << "\n";
513   os << " WLS time profile name:               << 569   os << " WLS2 process active:                   " << GetProcessActivation("OpWLS2") << "\n";
514      << "\n";                                  << 570   os << " WLS2 time profile name:                " << wls2TimeProfileName << "\n";
515   os << " WLS2 process active:                 << 571   os << " Boundary process active:               " << GetProcessActivation("OpBoundary") << "\n";
516      << GetProcessActivation("OpWLS2") << "\n" << 
517   os << " WLS2 time profile name:              << 
518      << "\n";                                  << 
519   os << " Boundary process active:             << 
520      << GetProcessActivation("OpBoundary") <<  << 
521   os << " Boundary invoke sensitive detector:     572   os << " Boundary invoke sensitive detector:    " << boundaryInvokeSD << "\n";
522   os << " Rayleigh process active:             << 573   os << " Rayleigh process active:               " << GetProcessActivation("OpRayleigh") << "\n";
523      << GetProcessActivation("OpRayleigh") <<  << 574   os << " MieHG process active:                  " << GetProcessActivation("OpMieHG") << "\n";
524   os << " MieHG process active:                << 575   os << " Absorption process active:             " << GetProcessActivation("OpAbsorption") << "\n";
525      << GetProcessActivation("OpMieHG") << "\n << 576   os << "=======================================================================" << "\n";
526   os << " Absorption process active:           << 
527      << GetProcessActivation("OpAbsorption") < << 
528   os                                           << 
529     << "====================================== << 
530     << "\n";                                   << 
531   os.precision(prec);                             577   os.precision(prec);
532 }                                                 578 }
533                                                   579 
534 void G4OpticalParameters::Dump() const            580 void G4OpticalParameters::Dump() const
535 {                                                 581 {
536 #ifdef G4MULTITHREADED                            582 #ifdef G4MULTITHREADED
537   G4MUTEXLOCK(&opticalParametersMutex);           583   G4MUTEXLOCK(&opticalParametersMutex);
538 #endif                                            584 #endif
539   StreamInfo(G4cout);                             585   StreamInfo(G4cout);
540 #ifdef G4MULTITHREADED                            586 #ifdef G4MULTITHREADED
541   G4MUTEXUNLOCK(&opticalParametersMutex);         587   G4MUTEXUNLOCK(&opticalParametersMutex);
542 #endif                                            588 #endif
543 }                                                 589 }
544                                                   590 
545 std::ostream& operator<<(std::ostream& os, con << 591 std::ostream& operator<< (std::ostream& os, const G4OpticalParameters& par)
546 {                                                 592 {
547   par.StreamInfo(os);                             593   par.StreamInfo(os);
548   return os;                                      594   return os;
549 }                                                 595 }
550                                                   596 
551 G4bool G4OpticalParameters::IsLocked() const      597 G4bool G4OpticalParameters::IsLocked() const
552 {                                                 598 {
553   return (!G4Threading::IsMasterThread() ||       599   return (!G4Threading::IsMasterThread() ||
554           (fStateManager->GetCurrentState() != << 600     (fStateManager->GetCurrentState() != G4State_PreInit &&
555            fStateManager->GetCurrentState() != << 601      fStateManager->GetCurrentState() != G4State_Init &&
556            fStateManager->GetCurrentState() != << 602      fStateManager->GetCurrentState() != G4State_Idle));
557 }                                                 603 }
558                                                   604