Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4OpticalParameters.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// -------------------------------------------------------------------
27//
28// GEANT4 Class header file
29//
30// File name: G4OpticalParameters
31//
32// Author: Daren Sawkey based on G4EmParameters
33//
34// Creation date: 14.07.2020
35//
36// Modifications:
37//
38//
39// Class Description:
40//
41// A utility static class, responsable for keeping parameters
42// for all optical physics processes and models.
43//
44// It is initialized by the master thread but can be updated
45// at any moment. Parameters may be used in run time or at
46// initialisation
47//
48// -------------------------------------------------------------------
49//
50
51#ifndef G4OpticalParameters_h
52#define G4OpticalParameters_h 1
53
54#include "globals.hh"
55#include "G4ios.hh"
56#include "G4ThreeVector.hh"
57#include "G4Threading.hh"
58#include <vector>
59
61class G4StateManager;
62
64 kCerenkov, ///< Cerenkov process index
65 kScintillation, ///< Scintillation process index
66 kAbsorption, ///< Absorption process index
67 kRayleigh, ///< Rayleigh scattering process index
68 kMieHG, ///< Mie scattering process index
69 kBoundary, ///< Boundary process index
70 kWLS, ///< Wave Length Shifting process index
71 kWLS2, ///< Second Wave Length Shifting process index
72 kNoProcess ///< Number of processes, no selected process
73};
74
75/// Return the name for a given optical process index
77
78inline
80{
81 switch ( processNumber ) {
82 case kCerenkov: return "Cerenkov";
83 case kScintillation: return "Scintillation";
84 case kAbsorption: return "OpAbsorption";
85 case kRayleigh: return "OpRayleigh";
86 case kMieHG: return "OpMieHG";
87 case kBoundary: return "OpBoundary";
88 case kWLS: return "OpWLS";
89 case kWLS2: return "OpWLS2";
90 default: return "NoProcess";
91 }
92}
93
94
95
97{
98public:
99
101
103
104 void SetDefaults();
105
106 // printing
107 void StreamInfo(std::ostream& os) const;
108 void Dump() const;
109 friend std::ostream& operator<< (std::ostream& os, const G4OpticalParameters&);
110
112 G4int GetVerboseLevel() const;
113
116
117 // DEPRECATED, use Set/GetProcessActivation instead
120
121 // DEPRECATED, use Set/GetCerenkovTrackSecondariesFirst and
122 // Set/GetScintTrackSecondariesFirst instead
125
126 // Cerenkov
137
138 // Scintillation
157
158 // WLS
159 void SetWLSTimeProfile(const G4String&);
163
164 // WLS2
165 void SetWLS2TimeProfile(const G4String&);
169
170 // boundary
175
176 // absorption
179
180 // rayleigh
183
184 // mie
187
188private:
189
191 void Initialise();
192 G4bool IsLocked() const;
193 void PrintWarning(G4ExceptionDescription& ed) const;
194 static G4OpticalParameters* theInstance;
195
196 G4OpticalParametersMessenger* theMessenger;
197 G4StateManager* fStateManager;
198
199 G4int verboseLevel;
200
201 // Whether to activate each process
202 std::map<G4String, G4bool> processActivation;
203
204 // cerenkov/////////////////
205 G4bool cerenkovStackPhotons;
206 G4bool cerenkovTrackSecondariesFirst;
207 G4int cerenkovVerboseLevel;
208 G4int cerenkovMaxPhotons;
209 G4double cerenkovMaxBetaChange;
210
211 // scintillation /////////////////
212 G4double scintYieldFactor;
213
214 /// Note: this is to be removed in the next major release.
215 /// Use material properties SCINTILLATIONYIELD1, 2, 3 instead
216 G4double scintExcitationRatio;
217
218 /// option to set a finite rise-time; Note: the G4Scintillation
219 /// process expects the user to have set the constant material
220 /// property FAST/SLOWSCINTILLATIONRISETIME
221 G4bool scintFiniteRiseTime;
222
223 /// option to allow for the light yield to be a function of
224 /// particle type and deposited energy in case of non-linear
225 /// light emission in scintillators
226 G4bool scintByParticleType;
227
228 /// option to allow for G4ScintillationTrackInformation
229 /// to be attached to a scintillation photon's track
230 G4bool scintTrackInfo;
231
232 /// option to allow stacking of secondary Scintillation photons
233 G4bool scintStackPhotons;
234
235 /// new in version 10.7; allow > 2 time constants, and > 1 time
236 /// constant for scintillation by particle type
237 G4bool scintEnhancedTimeConstants;
238
239 G4int scintVerboseLevel;
240 G4bool scintTrackSecondariesFirst;
241
242 ///////////////// WLS
243 G4String wlsTimeProfileName;
244 G4int wlsVerboseLevel;
245
246 ///////////////// WLS2
247 G4String wls2TimeProfileName;
248 G4int wls2VerboseLevel;
249
250 //////////////// absorption
251 G4int absorptionVerboseLevel;
252
253 //////////////// rayleigh
254 G4int rayleighVerboseLevel;
255
256 //////////////// mie
257 G4int mieVerboseLevel;
258
259 //////////////// boundary
260 /// G4OpBoundaryProcess to call InvokeSD method
261 G4bool boundaryInvokeSD;
262 G4int boundaryVerboseLevel;
263
264
265#ifdef G4MULTITHREADED
266 static G4Mutex opticalParametersMutex;
267#endif
268};
269
270//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
271
272#endif
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
G4OpticalProcessIndex
@ kWLS
Wave Length Shifting process index.
@ kScintillation
Scintillation process index.
@ kWLS2
Second Wave Length Shifting process index.
@ kRayleigh
Rayleigh scattering process index.
@ kAbsorption
Absorption process index.
@ kBoundary
Boundary process index.
@ kNoProcess
Number of processes, no selected process.
@ kCerenkov
Cerenkov process index.
@ kMieHG
Mie scattering process index.
G4String G4OpticalProcessName(G4int)
Return the name for a given optical process index.
std::mutex G4Mutex
Definition: G4Threading.hh:81
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
G4bool GetBoundaryInvokeSD() const
void SetScintByParticleType(G4bool)
void SetCerenkovMaxBetaChange(G4double)
void SetRayleighVerboseLevel(G4int)
void SetCerenkovMaxPhotonsPerStep(G4int)
void SetBoundaryInvokeSD(G4bool)
void Configure(G4OpticalProcessIndex, G4bool)
void SetBoundaryVerboseLevel(G4int)
G4int GetCerenkovVerboseLevel() const
void SetScintTrackSecondariesFirst(G4bool)
void SetScintEnhancedTimeConstants(G4bool)
friend std::ostream & operator<<(std::ostream &os, const G4OpticalParameters &)
G4int GetScintVerboseLevel() const
void StreamInfo(std::ostream &os) const
void SetTrackSecondariesFirst(G4OpticalProcessIndex, G4bool)
G4int GetAbsorptionVerboseLevel() const
void SetScintStackPhotons(G4bool)
G4bool GetScintStackPhotons() const
G4int GetBoundaryVerboseLevel() const
G4int GetRayleighVerboseLevel() const
G4int GetWLS2VerboseLevel() const
G4String GetWLS2TimeProfile() const
G4bool GetTrackSecondariesFirst(G4OpticalProcessIndex)
G4int GetMieVerboseLevel() const
void SetWLS2TimeProfile(const G4String &)
G4int GetCerenkovMaxPhotonsPerStep() const
static G4OpticalParameters * Instance()
G4double GetCerenkovMaxBetaChange() const
G4double GetScintExcitationRatio() const
G4bool GetConfiguration(G4OpticalProcessIndex)
void SetAbsorptionVerboseLevel(G4int)
G4bool GetProcessActivation(const G4String &) const
void SetCerenkovStackPhotons(G4bool)
void SetCerenkovTrackSecondariesFirst(G4bool)
void SetScintFiniteRiseTime(G4bool)
G4String GetWLSTimeProfile() const
G4bool GetScintEnhancedTimeConstants() const
G4bool GetScintByParticleType() const
void SetWLSTimeProfile(const G4String &)
G4bool GetScintFiniteRiseTime() const
void SetCerenkovVerboseLevel(G4int)
G4double GetScintYieldFactor() const
G4bool GetScintTrackInfo() const
void SetScintExcitationRatio(G4double)
G4bool GetCerenkovTrackSecondariesFirst() const
void SetScintYieldFactor(G4double)
G4int GetWLSVerboseLevel() const
void SetProcessActivation(const G4String &, G4bool)
G4bool GetScintTrackSecondariesFirst() const
G4bool GetCerenkovStackPhotons() const