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 11.0.p1)


  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   {                                                62   {
 63 #ifdef G4MULTITHREADED                             63 #ifdef G4MULTITHREADED
 64     G4MUTEXLOCK(&opticalParametersMutex);          64     G4MUTEXLOCK(&opticalParametersMutex);
 65     if(nullptr == theInstance)                     65     if(nullptr == theInstance)
 66     {                                              66     {
 67 #endif                                             67 #endif
 68       static G4OpticalParameters manager;          68       static G4OpticalParameters manager;
 69       theInstance = &manager;                      69       theInstance = &manager;
 70 #ifdef G4MULTITHREADED                             70 #ifdef G4MULTITHREADED
 71     }                                              71     }
 72     G4MUTEXUNLOCK(&opticalParametersMutex);        72     G4MUTEXUNLOCK(&opticalParametersMutex);
 73 #endif                                             73 #endif
 74   }                                                74   }
 75   return theInstance;                              75   return theInstance;
 76 }                                                  76 }
 77                                                    77 
 78 //....oooOO0OOooo........oooOO0OOooo........oo     78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
 79                                                    79 
 80 G4OpticalParameters::~G4OpticalParameters() {      80 G4OpticalParameters::~G4OpticalParameters() { delete theMessenger; }
 81                                                    81 
 82 //....oooOO0OOooo........oooOO0OOooo........oo     82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
 83                                                    83 
 84 G4OpticalParameters::G4OpticalParameters()         84 G4OpticalParameters::G4OpticalParameters()
 85 {                                                  85 {
 86   theMessenger = new G4OpticalParametersMessen     86   theMessenger = new G4OpticalParametersMessenger(this);
 87   Initialise();                                    87   Initialise();
 88                                                    88 
 89   fStateManager = G4StateManager::GetStateMana     89   fStateManager = G4StateManager::GetStateManager();
 90 }                                                  90 }
 91                                                    91 
 92 void G4OpticalParameters::SetDefaults()            92 void G4OpticalParameters::SetDefaults()
 93 {                                                  93 {
 94   if(!IsLocked())                                  94   if(!IsLocked())
 95   {                                                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   scintFiniteRiseTime        = false;             113   scintFiniteRiseTime        = false;
114   scintTrackSecondariesFirst = true;              114   scintTrackSecondariesFirst = true;
115   scintVerboseLevel          = 1;              << 115   scintVerboseLevel          = 0;
116                                                   116 
117   wlsTimeProfileName = "delta";                   117   wlsTimeProfileName = "delta";
118   wlsVerboseLevel    = 1;                      << 118   wlsVerboseLevel    = 0;
119                                                   119 
120   wls2TimeProfileName = "delta";                  120   wls2TimeProfileName = "delta";
121   wls2VerboseLevel    = 1;                     << 121   wls2VerboseLevel    = 0;
122                                                   122 
123   absorptionVerboseLevel = 1;                  << 123   absorptionVerboseLevel = 0;
124                                                   124 
125   rayleighVerboseLevel = 1;                    << 125   rayleighVerboseLevel = 0;
126                                                   126 
127   mieVerboseLevel = 1;                         << 127   mieVerboseLevel = 0;
128                                                   128 
129   boundaryInvokeSD     = false;                   129   boundaryInvokeSD     = false;
130   boundaryVerboseLevel = 1;                    << 130   boundaryVerboseLevel = 0;
131                                                   131 
132   processActivation["OpRayleigh"]    = true;      132   processActivation["OpRayleigh"]    = true;
133   processActivation["OpBoundary"]    = true;      133   processActivation["OpBoundary"]    = true;
134   processActivation["OpMieHG"]       = true;      134   processActivation["OpMieHG"]       = true;
135   processActivation["OpAbsorption"]  = true;      135   processActivation["OpAbsorption"]  = true;
136   processActivation["OpWLS"]         = true;      136   processActivation["OpWLS"]         = true;
137   processActivation["OpWLS2"]        = true;      137   processActivation["OpWLS2"]        = true;
138   processActivation["Cerenkov"]      = true;      138   processActivation["Cerenkov"]      = true;
139   processActivation["Scintillation"] = true;      139   processActivation["Scintillation"] = true;
140 }                                                 140 }
141                                                   141 
142 void G4OpticalParameters::SetVerboseLevel(G4in    142 void G4OpticalParameters::SetVerboseLevel(G4int val)
143 {                                                 143 {
144   if(IsLocked())                                  144   if(IsLocked())
145   {                                               145   {
146     return;                                       146     return;
147   }                                               147   }
148   verboseLevel = val;                             148   verboseLevel = val;
149   SetCerenkovVerboseLevel(verboseLevel);          149   SetCerenkovVerboseLevel(verboseLevel);
150   SetScintVerboseLevel(verboseLevel);             150   SetScintVerboseLevel(verboseLevel);
151   SetRayleighVerboseLevel(verboseLevel);          151   SetRayleighVerboseLevel(verboseLevel);
152   SetAbsorptionVerboseLevel(verboseLevel);        152   SetAbsorptionVerboseLevel(verboseLevel);
153   SetMieVerboseLevel(verboseLevel);               153   SetMieVerboseLevel(verboseLevel);
154   SetBoundaryVerboseLevel(verboseLevel);          154   SetBoundaryVerboseLevel(verboseLevel);
155   SetWLSVerboseLevel(verboseLevel);               155   SetWLSVerboseLevel(verboseLevel);
156   SetWLS2VerboseLevel(verboseLevel);              156   SetWLS2VerboseLevel(verboseLevel);
157 }                                                 157 }
158                                                   158 
159 G4int G4OpticalParameters::GetVerboseLevel() c    159 G4int G4OpticalParameters::GetVerboseLevel() const { return verboseLevel; }
160                                                   160 
161 void G4OpticalParameters::SetProcessActivation    161 void G4OpticalParameters::SetProcessActivation(const G4String& process,
162                                                   162                                                G4bool val)
163 {                                                 163 {
164   // Configure the physics constructor to use/    164   // Configure the physics constructor to use/not use a selected process.
165   // This method can only be called in PreInit    165   // This method can only be called in PreInit> phase (before execution of
166   // ConstructProcess). The process is not add    166   // ConstructProcess). The process is not added to particle's process manager
167   // and so it cannot be re-activated later in    167   // and so it cannot be re-activated later in Idle> phase with the command
168   // /process/activate.                           168   // /process/activate.
169                                                   169 
170   if(IsLocked())                                  170   if(IsLocked())
171   {                                               171   {
172     return;                                       172     return;
173   }                                               173   }
174   if(processActivation[process] == val)           174   if(processActivation[process] == val)
175     return;                                       175     return;
176                                                   176 
177   // processActivation keys defined at initial    177   // processActivation keys defined at initialisation
178   if(processActivation.find(process) != proces    178   if(processActivation.find(process) != processActivation.end())
179   {                                               179   {
180     processActivation[process] = val;             180     processActivation[process] = val;
181   }                                               181   }
182   else                                            182   else
183   {                                               183   {
184     G4ExceptionDescription ed;                    184     G4ExceptionDescription ed;
185     ed << "Process name " << process << " out     185     ed << "Process name " << process << " out of bounds.";
186     G4Exception("G4OpticalParameters::SetProce    186     G4Exception("G4OpticalParameters::SetProcessActivation()", "Optical013",
187                 FatalException, ed);              187                 FatalException, ed);
188   }                                               188   }
189 }                                                 189 }
190                                                   190 
191 G4bool G4OpticalParameters::GetProcessActivati    191 G4bool G4OpticalParameters::GetProcessActivation(const G4String& process) const
192 {                                                 192 {
193   return processActivation.find(process)->seco    193   return processActivation.find(process)->second;
194 }                                                 194 }
195                                                   195 
196 void G4OpticalParameters::SetCerenkovStackPhot    196 void G4OpticalParameters::SetCerenkovStackPhotons(G4bool val)
197 {                                                 197 {
198   if(IsLocked())                                  198   if(IsLocked())
199   {                                               199   {
200     return;                                       200     return;
201   }                                               201   }
202   cerenkovStackPhotons = val;                     202   cerenkovStackPhotons = val;
203 }                                                 203 }
204                                                   204 
205 G4bool G4OpticalParameters::GetCerenkovStackPh    205 G4bool G4OpticalParameters::GetCerenkovStackPhotons() const
206 {                                                 206 {
207   return cerenkovStackPhotons;                    207   return cerenkovStackPhotons;
208 }                                                 208 }
209                                                   209 
210 void G4OpticalParameters::SetCerenkovVerboseLe    210 void G4OpticalParameters::SetCerenkovVerboseLevel(G4int val)
211 {                                                 211 {
212   if(IsLocked())                                  212   if(IsLocked())
213   {                                               213   {
214     return;                                       214     return;
215   }                                               215   }
216   cerenkovVerboseLevel = val;                     216   cerenkovVerboseLevel = val;
217 }                                                 217 }
218                                                   218 
219 G4int G4OpticalParameters::GetCerenkovVerboseL    219 G4int G4OpticalParameters::GetCerenkovVerboseLevel() const
220 {                                                 220 {
221   return cerenkovVerboseLevel;                    221   return cerenkovVerboseLevel;
222 }                                                 222 }
223                                                   223 
224 void G4OpticalParameters::SetCerenkovMaxPhoton    224 void G4OpticalParameters::SetCerenkovMaxPhotonsPerStep(G4int val)
225 {                                                 225 {
226   if(IsLocked())                                  226   if(IsLocked())
227   {                                               227   {
228     return;                                       228     return;
229   }                                               229   }
230   cerenkovMaxPhotons = val;                       230   cerenkovMaxPhotons = val;
231 }                                                 231 }
232                                                   232 
233 G4int G4OpticalParameters::GetCerenkovMaxPhoto    233 G4int G4OpticalParameters::GetCerenkovMaxPhotonsPerStep() const
234 {                                                 234 {
235   return cerenkovMaxPhotons;                      235   return cerenkovMaxPhotons;
236 }                                                 236 }
237                                                   237 
238 void G4OpticalParameters::SetCerenkovMaxBetaCh    238 void G4OpticalParameters::SetCerenkovMaxBetaChange(G4double val)
239 {                                                 239 {
240   if(IsLocked())                                  240   if(IsLocked())
241   {                                               241   {
242     return;                                       242     return;
243   }                                               243   }
244   cerenkovMaxBetaChange = val;                    244   cerenkovMaxBetaChange = val;
245 }                                                 245 }
246                                                   246 
247 G4double G4OpticalParameters::GetCerenkovMaxBe    247 G4double G4OpticalParameters::GetCerenkovMaxBetaChange() const
248 {                                                 248 {
249   return cerenkovMaxBetaChange;                   249   return cerenkovMaxBetaChange;
250 }                                                 250 }
251                                                   251 
252 void G4OpticalParameters::SetCerenkovTrackSeco    252 void G4OpticalParameters::SetCerenkovTrackSecondariesFirst(G4bool val)
253 {                                                 253 {
254   if(IsLocked())                                  254   if(IsLocked())
255   {                                               255   {
256     return;                                       256     return;
257   }                                               257   }
258   cerenkovTrackSecondariesFirst = val;            258   cerenkovTrackSecondariesFirst = val;
259 }                                                 259 }
260                                                   260 
261 G4bool G4OpticalParameters::GetCerenkovTrackSe    261 G4bool G4OpticalParameters::GetCerenkovTrackSecondariesFirst() const
262 {                                                 262 {
263   return cerenkovTrackSecondariesFirst;           263   return cerenkovTrackSecondariesFirst;
264 }                                                 264 }
265                                                   265 
266 void G4OpticalParameters::SetScintByParticleTy    266 void G4OpticalParameters::SetScintByParticleType(G4bool val)
267 {                                                 267 {
268   if(IsLocked())                                  268   if(IsLocked())
269   {                                               269   {
270     return;                                       270     return;
271   }                                               271   }
272   scintByParticleType = val;                      272   scintByParticleType = val;
273 }                                                 273 }
274                                                   274 
275 G4bool G4OpticalParameters::GetScintByParticle    275 G4bool G4OpticalParameters::GetScintByParticleType() const
276 {                                                 276 {
277   return scintByParticleType;                     277   return scintByParticleType;
278 }                                                 278 }
279                                                   279 
280 void G4OpticalParameters::SetScintTrackInfo(G4    280 void G4OpticalParameters::SetScintTrackInfo(G4bool val)
281 {                                                 281 {
282   if(IsLocked())                                  282   if(IsLocked())
283   {                                               283   {
284     return;                                       284     return;
285   }                                               285   }
286   scintTrackInfo = val;                           286   scintTrackInfo = val;
287 }                                                 287 }
288                                                   288 
289 G4bool G4OpticalParameters::GetScintTrackInfo(    289 G4bool G4OpticalParameters::GetScintTrackInfo() const { return scintTrackInfo; }
290                                                   290 
291 void G4OpticalParameters::SetScintTrackSeconda    291 void G4OpticalParameters::SetScintTrackSecondariesFirst(G4bool val)
292 {                                                 292 {
293   if(IsLocked())                                  293   if(IsLocked())
294   {                                               294   {
295     return;                                       295     return;
296   }                                               296   }
297   scintTrackSecondariesFirst = val;               297   scintTrackSecondariesFirst = val;
298 }                                                 298 }
299                                                   299 
300 G4bool G4OpticalParameters::GetScintTrackSecon    300 G4bool G4OpticalParameters::GetScintTrackSecondariesFirst() const
301 {                                                 301 {
302   return scintTrackSecondariesFirst;              302   return scintTrackSecondariesFirst;
303 }                                                 303 }
304                                                   304 
305 void G4OpticalParameters::SetScintFiniteRiseTi    305 void G4OpticalParameters::SetScintFiniteRiseTime(G4bool val)
306 {                                                 306 {
307   if(IsLocked())                                  307   if(IsLocked())
308   {                                               308   {
309     return;                                       309     return;
310   }                                               310   }
311   scintFiniteRiseTime = val;                      311   scintFiniteRiseTime = val;
312 }                                                 312 }
313                                                   313 
314 G4bool G4OpticalParameters::GetScintFiniteRise    314 G4bool G4OpticalParameters::GetScintFiniteRiseTime() const
315 {                                                 315 {
316   return scintFiniteRiseTime;                     316   return scintFiniteRiseTime;
317 }                                                 317 }
318                                                   318 
319 void G4OpticalParameters::SetScintStackPhotons    319 void G4OpticalParameters::SetScintStackPhotons(G4bool val)
320 {                                                 320 {
321   if(IsLocked())                                  321   if(IsLocked())
322   {                                               322   {
323     return;                                       323     return;
324   }                                               324   }
325   scintStackPhotons = val;                        325   scintStackPhotons = val;
326 }                                                 326 }
327                                                   327 
328 G4bool G4OpticalParameters::GetScintStackPhoto    328 G4bool G4OpticalParameters::GetScintStackPhotons() const
329 {                                                 329 {
330   return scintStackPhotons;                       330   return scintStackPhotons;
331 }                                                 331 }
332                                                   332 
333 void G4OpticalParameters::SetScintVerboseLevel    333 void G4OpticalParameters::SetScintVerboseLevel(G4int val)
334 {                                                 334 {
335   if(IsLocked())                                  335   if(IsLocked())
336   {                                               336   {
337     return;                                       337     return;
338   }                                               338   }
339   scintVerboseLevel = val;                        339   scintVerboseLevel = val;
340 }                                                 340 }
341                                                   341 
342 G4int G4OpticalParameters::GetScintVerboseLeve    342 G4int G4OpticalParameters::GetScintVerboseLevel() const
343 {                                                 343 {
344   return scintVerboseLevel;                       344   return scintVerboseLevel;
345 }                                                 345 }
346                                                   346 
347 void G4OpticalParameters::SetWLSTimeProfile(co    347 void G4OpticalParameters::SetWLSTimeProfile(const G4String& val)
348 {                                                 348 {
349   if(IsLocked())                                  349   if(IsLocked())
350   {                                               350   {
351     return;                                       351     return;
352   }                                               352   }
353   wlsTimeProfileName = val;                       353   wlsTimeProfileName = val;
354 }                                                 354 }
355                                                   355 
356 G4String G4OpticalParameters::GetWLSTimeProfil    356 G4String G4OpticalParameters::GetWLSTimeProfile() const
357 {                                                 357 {
358   return wlsTimeProfileName;                      358   return wlsTimeProfileName;
359 }                                                 359 }
360                                                   360 
361 void G4OpticalParameters::SetWLSVerboseLevel(G    361 void G4OpticalParameters::SetWLSVerboseLevel(G4int val)
362 {                                                 362 {
363   if(IsLocked())                                  363   if(IsLocked())
364   {                                               364   {
365     return;                                       365     return;
366   }                                               366   }
367   wlsVerboseLevel = val;                          367   wlsVerboseLevel = val;
368 }                                                 368 }
369                                                   369 
370 G4int G4OpticalParameters::GetWLSVerboseLevel(    370 G4int G4OpticalParameters::GetWLSVerboseLevel() const
371 {                                                 371 {
372   return wlsVerboseLevel;                         372   return wlsVerboseLevel;
373 }                                                 373 }
374                                                   374 
375 void G4OpticalParameters::SetWLS2TimeProfile(c    375 void G4OpticalParameters::SetWLS2TimeProfile(const G4String& val)
376 {                                                 376 {
377   if(IsLocked())                                  377   if(IsLocked())
378   {                                               378   {
379     return;                                       379     return;
380   }                                               380   }
381   wls2TimeProfileName = val;                      381   wls2TimeProfileName = val;
382 }                                                 382 }
383                                                   383 
384 G4String G4OpticalParameters::GetWLS2TimeProfi    384 G4String G4OpticalParameters::GetWLS2TimeProfile() const
385 {                                                 385 {
386   return wls2TimeProfileName;                     386   return wls2TimeProfileName;
387 }                                                 387 }
388                                                   388 
389 void G4OpticalParameters::SetWLS2VerboseLevel(    389 void G4OpticalParameters::SetWLS2VerboseLevel(G4int val)
390 {                                                 390 {
391   if(IsLocked())                                  391   if(IsLocked())
392   {                                               392   {
393     return;                                       393     return;
394   }                                               394   }
395   wls2VerboseLevel = val;                         395   wls2VerboseLevel = val;
396 }                                                 396 }
397                                                   397 
398 G4int G4OpticalParameters::GetWLS2VerboseLevel    398 G4int G4OpticalParameters::GetWLS2VerboseLevel() const
399 {                                                 399 {
400   return wls2VerboseLevel;                        400   return wls2VerboseLevel;
401 }                                                 401 }
402                                                   402 
403 void G4OpticalParameters::SetBoundaryVerboseLe    403 void G4OpticalParameters::SetBoundaryVerboseLevel(G4int val)
404 {                                                 404 {
405   if(IsLocked())                                  405   if(IsLocked())
406   {                                               406   {
407     return;                                       407     return;
408   }                                               408   }
409   boundaryVerboseLevel = val;                     409   boundaryVerboseLevel = val;
410 }                                                 410 }
411                                                   411 
412 G4int G4OpticalParameters::GetBoundaryVerboseL    412 G4int G4OpticalParameters::GetBoundaryVerboseLevel() const
413 {                                                 413 {
414   return boundaryVerboseLevel;                    414   return boundaryVerboseLevel;
415 }                                                 415 }
416                                                   416 
417 void G4OpticalParameters::SetBoundaryInvokeSD(    417 void G4OpticalParameters::SetBoundaryInvokeSD(G4bool val)
418 {                                                 418 {
419   if(IsLocked())                                  419   if(IsLocked())
420   {                                               420   {
421     return;                                       421     return;
422   }                                               422   }
423   boundaryInvokeSD = val;                         423   boundaryInvokeSD = val;
424 }                                                 424 }
425                                                   425 
426 G4bool G4OpticalParameters::GetBoundaryInvokeS    426 G4bool G4OpticalParameters::GetBoundaryInvokeSD() const
427 {                                                 427 {
428   return boundaryInvokeSD;                        428   return boundaryInvokeSD;
429 }                                                 429 }
430                                                   430 
431 void G4OpticalParameters::SetAbsorptionVerbose    431 void G4OpticalParameters::SetAbsorptionVerboseLevel(G4int val)
432 {                                                 432 {
433   if(IsLocked())                                  433   if(IsLocked())
434   {                                               434   {
435     return;                                       435     return;
436   }                                               436   }
437   absorptionVerboseLevel = val;                   437   absorptionVerboseLevel = val;
438 }                                                 438 }
439                                                   439 
440 G4int G4OpticalParameters::GetAbsorptionVerbos    440 G4int G4OpticalParameters::GetAbsorptionVerboseLevel() const
441 {                                                 441 {
442   return absorptionVerboseLevel;                  442   return absorptionVerboseLevel;
443 }                                                 443 }
444                                                   444 
445 void G4OpticalParameters::SetRayleighVerboseLe    445 void G4OpticalParameters::SetRayleighVerboseLevel(G4int val)
446 {                                                 446 {
447   if(IsLocked())                                  447   if(IsLocked())
448   {                                               448   {
449     return;                                       449     return;
450   }                                               450   }
451   rayleighVerboseLevel = val;                     451   rayleighVerboseLevel = val;
452 }                                                 452 }
453                                                   453 
454 G4int G4OpticalParameters::GetRayleighVerboseL    454 G4int G4OpticalParameters::GetRayleighVerboseLevel() const
455 {                                                 455 {
456   return rayleighVerboseLevel;                    456   return rayleighVerboseLevel;
457 }                                                 457 }
458                                                   458 
459 void G4OpticalParameters::SetMieVerboseLevel(G    459 void G4OpticalParameters::SetMieVerboseLevel(G4int val)
460 {                                                 460 {
461   if(IsLocked())                                  461   if(IsLocked())
462   {                                               462   {
463     return;                                       463     return;
464   }                                               464   }
465   mieVerboseLevel = val;                          465   mieVerboseLevel = val;
466 }                                                 466 }
467                                                   467 
468 G4int G4OpticalParameters::GetMieVerboseLevel(    468 G4int G4OpticalParameters::GetMieVerboseLevel() const
469 {                                                 469 {
470   return mieVerboseLevel;                         470   return mieVerboseLevel;
471 }                                                 471 }
472                                                   472 
473 void G4OpticalParameters::PrintWarning(G4Excep    473 void G4OpticalParameters::PrintWarning(G4ExceptionDescription& ed) const
474 {                                                 474 {
475   G4Exception("G4EmParameters", "Optical0020",    475   G4Exception("G4EmParameters", "Optical0020", JustWarning, ed);
476 }                                                 476 }
477                                                   477 
478 void G4OpticalParameters::StreamInfo(std::ostr    478 void G4OpticalParameters::StreamInfo(std::ostream& os) const
479 {                                                 479 {
480   G4long prec = os.precision(5);               << 480   G4int prec = os.precision(5);
481   os                                              481   os
482     << "======================================    482     << "======================================================================="
483     << "\n";                                      483     << "\n";
484   os                                              484   os
485     << "======                         Optical    485     << "======                         Optical Physics Parameters      ========"
486     << "\n";                                      486     << "\n";
487   os                                              487   os
488     << "======================================    488     << "======================================================================="
489     << "\n";                                      489     << "\n";
490                                                   490 
491   os << " Cerenkov process active:                491   os << " Cerenkov process active:               "
492      << GetProcessActivation("Cerenkov") << "\    492      << GetProcessActivation("Cerenkov") << "\n";
493   os << " Cerenkov maximum photons per step:      493   os << " Cerenkov maximum photons per step:     " << cerenkovMaxPhotons
494      << "\n";                                     494      << "\n";
495   os << " Cerenkov maximum beta change per ste    495   os << " Cerenkov maximum beta change per step: " << cerenkovMaxBetaChange
496      << " %\n";                                   496      << " %\n";
497   os << " Cerenkov stack photons:                 497   os << " Cerenkov stack photons:                " << cerenkovStackPhotons
498      << "\n";                                     498      << "\n";
499   os << " Cerenkov track secondaries first:       499   os << " Cerenkov track secondaries first:      "
500      << cerenkovTrackSecondariesFirst << "\n";    500      << cerenkovTrackSecondariesFirst << "\n";
501   os << " Scintillation process active:           501   os << " Scintillation process active:          "
502      << GetProcessActivation("Scintillation")     502      << GetProcessActivation("Scintillation") << "\n";
503   os << " Scintillation finite rise time:         503   os << " Scintillation finite rise time:        " << scintFiniteRiseTime
504      << "\n";                                     504      << "\n";
505   os << " Scintillation by particle type:         505   os << " Scintillation by particle type:        " << scintByParticleType
506      << "\n";                                     506      << "\n";
507   os << " Scintillation record track info:        507   os << " Scintillation record track info:       " << scintTrackInfo << "\n";
508   os << " Scintillation stack photons:            508   os << " Scintillation stack photons:           " << scintStackPhotons << "\n";
509   os << " Scintillation track secondaries firs    509   os << " Scintillation track secondaries first: " << scintTrackSecondariesFirst
510      << "\n";                                     510      << "\n";
511   os << " WLS process active:                     511   os << " WLS process active:                    "
512      << GetProcessActivation("OpWLS") << "\n";    512      << GetProcessActivation("OpWLS") << "\n";
513   os << " WLS time profile name:                  513   os << " WLS time profile name:                 " << wlsTimeProfileName
514      << "\n";                                     514      << "\n";
515   os << " WLS2 process active:                    515   os << " WLS2 process active:                   "
516      << GetProcessActivation("OpWLS2") << "\n"    516      << GetProcessActivation("OpWLS2") << "\n";
517   os << " WLS2 time profile name:                 517   os << " WLS2 time profile name:                " << wls2TimeProfileName
518      << "\n";                                     518      << "\n";
519   os << " Boundary process active:                519   os << " Boundary process active:               "
520      << GetProcessActivation("OpBoundary") <<     520      << GetProcessActivation("OpBoundary") << "\n";
521   os << " Boundary invoke sensitive detector:     521   os << " Boundary invoke sensitive detector:    " << boundaryInvokeSD << "\n";
522   os << " Rayleigh process active:                522   os << " Rayleigh process active:               "
523      << GetProcessActivation("OpRayleigh") <<     523      << GetProcessActivation("OpRayleigh") << "\n";
524   os << " MieHG process active:                   524   os << " MieHG process active:                  "
525      << GetProcessActivation("OpMieHG") << "\n    525      << GetProcessActivation("OpMieHG") << "\n";
526   os << " Absorption process active:              526   os << " Absorption process active:             "
527      << GetProcessActivation("OpAbsorption") <    527      << GetProcessActivation("OpAbsorption") << "\n";
528   os                                              528   os
529     << "======================================    529     << "======================================================================="
530     << "\n";                                      530     << "\n";
531   os.precision(prec);                             531   os.precision(prec);
532 }                                                 532 }
533                                                   533 
534 void G4OpticalParameters::Dump() const            534 void G4OpticalParameters::Dump() const
535 {                                                 535 {
536 #ifdef G4MULTITHREADED                            536 #ifdef G4MULTITHREADED
537   G4MUTEXLOCK(&opticalParametersMutex);           537   G4MUTEXLOCK(&opticalParametersMutex);
538 #endif                                            538 #endif
539   StreamInfo(G4cout);                             539   StreamInfo(G4cout);
540 #ifdef G4MULTITHREADED                            540 #ifdef G4MULTITHREADED
541   G4MUTEXUNLOCK(&opticalParametersMutex);         541   G4MUTEXUNLOCK(&opticalParametersMutex);
542 #endif                                            542 #endif
543 }                                                 543 }
544                                                   544 
545 std::ostream& operator<<(std::ostream& os, con    545 std::ostream& operator<<(std::ostream& os, const G4OpticalParameters& par)
546 {                                                 546 {
547   par.StreamInfo(os);                             547   par.StreamInfo(os);
548   return os;                                      548   return os;
549 }                                                 549 }
550                                                   550 
551 G4bool G4OpticalParameters::IsLocked() const      551 G4bool G4OpticalParameters::IsLocked() const
552 {                                                 552 {
553   return (!G4Threading::IsMasterThread() ||       553   return (!G4Threading::IsMasterThread() ||
554           (fStateManager->GetCurrentState() !=    554           (fStateManager->GetCurrentState() != G4State_PreInit &&
555            fStateManager->GetCurrentState() !=    555            fStateManager->GetCurrentState() != G4State_Init &&
556            fStateManager->GetCurrentState() !=    556            fStateManager->GetCurrentState() != G4State_Idle));
557 }                                                 557 }
558                                                   558