File indexing completed on 2026-09-13 09:10:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 #ifndef G4OpticalParameters_h
0052 #define G4OpticalParameters_h 1
0053
0054 #include "globals.hh"
0055 #include "G4ios.hh"
0056 #include "G4ThreeVector.hh"
0057 #include "G4Threading.hh"
0058 #include <vector>
0059 #include <memory>
0060
0061 class G4OpticalParametersMessenger;
0062 class G4StateManager;
0063
0064 enum G4OpticalProcessIndex
0065 {
0066 kCerenkov,
0067 kScintillation,
0068 kAbsorption,
0069 kRayleigh,
0070 kMieHG,
0071 kBoundary,
0072 kWLS,
0073 kWLS2,
0074 kNoProcess
0075 };
0076
0077 enum G4XRayModelType
0078 {
0079 kCerenkovDefault = 0,
0080 kScintillationDefault,
0081 };
0082
0083
0084 G4String G4OpticalProcessName(G4int);
0085
0086 inline G4String G4OpticalProcessName(G4int processNumber)
0087 {
0088 switch(processNumber)
0089 {
0090 case kCerenkov:
0091 return "Cerenkov";
0092 case kScintillation:
0093 return "Scintillation";
0094 case kAbsorption:
0095 return "OpAbsorption";
0096 case kRayleigh:
0097 return "OpRayleigh";
0098 case kMieHG:
0099 return "OpMieHG";
0100 case kBoundary:
0101 return "OpBoundary";
0102 case kWLS:
0103 return "OpWLS";
0104 case kWLS2:
0105 return "OpWLS2";
0106 default:
0107 return "NoProcess";
0108 }
0109 }
0110
0111 class G4OpticalParameters
0112 {
0113 public:
0114 static G4OpticalParameters* Instance();
0115
0116 ~G4OpticalParameters();
0117
0118 void SetDefaults();
0119
0120
0121 void StreamInfo(std::ostream& os) const;
0122 void Dump() const;
0123 friend std::ostream& operator<<(std::ostream& os, const G4OpticalParameters&);
0124
0125 void SetVerboseLevel(G4int);
0126 G4int GetVerboseLevel() const;
0127
0128 void SetProcessActivation(const G4String&, G4bool);
0129 G4bool GetProcessActivation(const G4String&) const;
0130
0131
0132 void SetCerenkovMaxPhotonsPerStep(G4int);
0133 G4int GetCerenkovMaxPhotonsPerStep() const;
0134 void SetCerenkovVerboseLevel(G4int);
0135 G4int GetCerenkovVerboseLevel() const;
0136 void SetCerenkovMaxBetaChange(G4double);
0137 G4double GetCerenkovMaxBetaChange() const;
0138 void SetCerenkovTrackSecondariesFirst(G4bool);
0139 G4bool GetCerenkovTrackSecondariesFirst() const;
0140 void SetCerenkovStackPhotons(G4bool);
0141 G4bool GetCerenkovStackPhotons() const;
0142 void SetCerenkovOffloadPhotons(G4bool);
0143 G4bool GetCerenkovOffloadPhotons() const;
0144 void EnableCerenkovGeneral(G4bool);
0145 G4bool CerenkovGeneral() const;
0146
0147
0148 void SetScintByParticleType(G4bool);
0149 G4bool GetScintByParticleType() const;
0150 void SetScintTrackInfo(G4bool);
0151 G4bool GetScintTrackInfo() const;
0152 void SetScintTrackSecondariesFirst(G4bool);
0153 G4bool GetScintTrackSecondariesFirst() const;
0154 void SetScintFiniteRiseTime(G4bool);
0155 G4bool GetScintFiniteRiseTime() const;
0156 void SetScintStackPhotons(G4bool);
0157 G4bool GetScintStackPhotons() const;
0158 void SetScintVerboseLevel(G4int);
0159 G4int GetScintVerboseLevel() const;
0160 void SetScintOffloadPhotons(G4bool);
0161 G4bool GetScintOffloadPhotons() const;
0162
0163
0164 void SetWLSTimeProfile(const G4String&);
0165 G4String GetWLSTimeProfile() const;
0166 void SetWLSVerboseLevel(G4int);
0167 G4int GetWLSVerboseLevel() const;
0168
0169
0170 void SetWLS2TimeProfile(const G4String&);
0171 G4String GetWLS2TimeProfile() const;
0172 void SetWLS2VerboseLevel(G4int);
0173 G4int GetWLS2VerboseLevel() const;
0174
0175
0176 void SetBoundaryVerboseLevel(G4int);
0177 G4int GetBoundaryVerboseLevel() const;
0178 void SetBoundaryInvokeSD(G4bool);
0179 G4bool GetBoundaryInvokeSD() const;
0180
0181
0182 void SetAbsorptionVerboseLevel(G4int);
0183 G4int GetAbsorptionVerboseLevel() const;
0184
0185
0186 void SetRayleighVerboseLevel(G4int);
0187 G4int GetRayleighVerboseLevel() const;
0188
0189
0190 void SetMieVerboseLevel(G4int);
0191 G4int GetMieVerboseLevel() const;
0192
0193
0194 const std::vector<std::pair<G4XRayModelType, const G4String> >&
0195 ActiveVolumes() const;
0196 void SetActiveVolume(const G4String& name, G4XRayModelType type);
0197
0198 private:
0199 G4OpticalParameters();
0200 void Initialise();
0201 G4bool IsLocked() const;
0202 void PrintWarning(G4ExceptionDescription& ed) const;
0203
0204 static G4OpticalParameters* theInstance;
0205
0206 G4OpticalParametersMessenger* theMessenger;
0207 G4StateManager* fStateManager;
0208
0209 G4int verboseLevel;
0210
0211
0212 std::map<G4String, G4bool> processActivation;
0213
0214
0215 G4bool cerenkovStackPhotons;
0216 G4bool cerenkovTrackSecondariesFirst;
0217 G4bool cerenkovOffloadPhotons;
0218 G4bool cerenkovGeneral;
0219 G4int cerenkovVerboseLevel;
0220 G4int cerenkovMaxPhotons;
0221 G4double cerenkovMaxBetaChange;
0222
0223
0224
0225
0226
0227
0228 G4bool scintFiniteRiseTime;
0229
0230
0231
0232
0233 G4bool scintByParticleType;
0234
0235
0236
0237 G4bool scintTrackInfo;
0238
0239
0240 G4bool scintStackPhotons;
0241
0242
0243 G4bool scintOffloadPhotons;
0244
0245 G4int scintVerboseLevel;
0246 G4bool scintTrackSecondariesFirst;
0247
0248
0249 G4String wlsTimeProfileName;
0250 G4int wlsVerboseLevel;
0251
0252
0253 G4String wls2TimeProfileName;
0254 G4int wls2VerboseLevel;
0255
0256
0257 G4int absorptionVerboseLevel;
0258
0259
0260 G4int rayleighVerboseLevel;
0261
0262
0263 G4int mieVerboseLevel;
0264
0265
0266
0267 G4bool boundaryInvokeSD;
0268 G4int boundaryVerboseLevel;
0269
0270
0271 std::vector<std::pair<G4XRayModelType, const G4String> > xrayVolumes;
0272
0273 #ifdef G4MULTITHREADED
0274 static G4Mutex opticalParametersMutex;
0275 #endif
0276 };
0277
0278
0279
0280 #endif