Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:48

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // -------------------------------------------------------------------
0027 //
0028 // GEANT4 Class header file
0029 //
0030 // File name:     G4OpticalParameters
0031 //
0032 // Author:        Daren Sawkey based on G4EmParameters
0033 //
0034 // Creation date: 14.07.2020
0035 //
0036 // Modifications:
0037 //
0038 //
0039 // Class Description:
0040 //
0041 // A utility static class, responsable for keeping parameters
0042 // for all optical physics processes and models.
0043 //
0044 // It is initialized by the master thread but can be updated
0045 // at any moment. Parameters may be used in run time or at
0046 // initialisation
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 
0060 class G4OpticalParametersMessenger;
0061 class G4StateManager;
0062 
0063 enum G4OpticalProcessIndex
0064 {
0065   kCerenkov,       ///< Cerenkov process index
0066   kScintillation,  ///< Scintillation process index
0067   kAbsorption,     ///< Absorption process index
0068   kRayleigh,       ///< Rayleigh scattering process index
0069   kMieHG,          ///< Mie scattering process index
0070   kBoundary,       ///< Boundary process index
0071   kWLS,            ///< Wave Length Shifting process index
0072   kWLS2,           ///< Second Wave Length Shifting process index
0073   kNoProcess       ///< Number of processes, no selected process
0074 };
0075 
0076 /// Return the name for a given optical process index
0077 G4String G4OpticalProcessName(G4int);
0078 
0079 inline G4String G4OpticalProcessName(G4int processNumber)
0080 {
0081   switch(processNumber)
0082   {
0083     case kCerenkov:
0084       return "Cerenkov";
0085     case kScintillation:
0086       return "Scintillation";
0087     case kAbsorption:
0088       return "OpAbsorption";
0089     case kRayleigh:
0090       return "OpRayleigh";
0091     case kMieHG:
0092       return "OpMieHG";
0093     case kBoundary:
0094       return "OpBoundary";
0095     case kWLS:
0096       return "OpWLS";
0097     case kWLS2:
0098       return "OpWLS2";
0099     default:
0100       return "NoProcess";
0101   }
0102 }
0103 
0104 class G4OpticalParameters
0105 {
0106  public:
0107   static G4OpticalParameters* Instance();
0108 
0109   ~G4OpticalParameters();
0110 
0111   void SetDefaults();
0112 
0113   // printing
0114   void StreamInfo(std::ostream& os) const;
0115   void Dump() const;
0116   friend std::ostream& operator<<(std::ostream& os, const G4OpticalParameters&);
0117 
0118   void  SetVerboseLevel(G4int);
0119   G4int GetVerboseLevel() const;
0120 
0121   void   SetProcessActivation(const G4String&, G4bool);
0122   G4bool GetProcessActivation(const G4String&) const;
0123 
0124   // Cerenkov
0125   void  SetCerenkovMaxPhotonsPerStep(G4int);
0126   G4int GetCerenkovMaxPhotonsPerStep() const;
0127   void  SetCerenkovVerboseLevel(G4int);
0128   G4int GetCerenkovVerboseLevel() const;
0129   void     SetCerenkovMaxBetaChange(G4double);
0130   G4double GetCerenkovMaxBetaChange() const;
0131   void   SetCerenkovTrackSecondariesFirst(G4bool);
0132   G4bool GetCerenkovTrackSecondariesFirst() const;
0133   void   SetCerenkovStackPhotons(G4bool);
0134   G4bool GetCerenkovStackPhotons() const;
0135 
0136   // Scintillation
0137   void   SetScintByParticleType(G4bool);
0138   G4bool GetScintByParticleType() const;
0139   void   SetScintTrackInfo(G4bool);
0140   G4bool GetScintTrackInfo() const;
0141   void   SetScintTrackSecondariesFirst(G4bool);
0142   G4bool GetScintTrackSecondariesFirst() const;
0143   void   SetScintFiniteRiseTime(G4bool);
0144   G4bool GetScintFiniteRiseTime() const;
0145   void   SetScintStackPhotons(G4bool);
0146   G4bool GetScintStackPhotons() const;
0147   void   SetScintVerboseLevel(G4int);
0148   G4int  GetScintVerboseLevel() const;
0149 
0150   // WLS
0151   void     SetWLSTimeProfile(const G4String&);
0152   G4String GetWLSTimeProfile() const;
0153   void  SetWLSVerboseLevel(G4int);
0154   G4int GetWLSVerboseLevel() const;
0155 
0156   // WLS2
0157   void     SetWLS2TimeProfile(const G4String&);
0158   G4String GetWLS2TimeProfile() const;
0159   void  SetWLS2VerboseLevel(G4int);
0160   G4int GetWLS2VerboseLevel() const;
0161 
0162   // boundary
0163   void  SetBoundaryVerboseLevel(G4int);
0164   G4int GetBoundaryVerboseLevel() const;
0165   void   SetBoundaryInvokeSD(G4bool);
0166   G4bool GetBoundaryInvokeSD() const;
0167 
0168   // absorption
0169   void  SetAbsorptionVerboseLevel(G4int);
0170   G4int GetAbsorptionVerboseLevel() const;
0171 
0172   // rayleigh
0173   void  SetRayleighVerboseLevel(G4int);
0174   G4int GetRayleighVerboseLevel() const;
0175 
0176   // mie
0177   void  SetMieVerboseLevel(G4int);
0178   G4int GetMieVerboseLevel() const;
0179 
0180  private:
0181   G4OpticalParameters();
0182   void Initialise();
0183   G4bool IsLocked() const;
0184   void PrintWarning(G4ExceptionDescription& ed) const;
0185 
0186   static G4OpticalParameters* theInstance;
0187 
0188   G4OpticalParametersMessenger* theMessenger;
0189   G4StateManager* fStateManager;
0190 
0191   G4int verboseLevel;
0192 
0193   // Whether to activate each process
0194   std::map<G4String, G4bool> processActivation;
0195 
0196   // cerenkov/////////////////
0197   G4bool cerenkovStackPhotons;
0198   G4bool cerenkovTrackSecondariesFirst;
0199   G4int cerenkovVerboseLevel;
0200   G4int cerenkovMaxPhotons;
0201   G4double cerenkovMaxBetaChange;
0202 
0203   // scintillation /////////////////
0204 
0205   /// option to set a finite rise-time; Note: the G4Scintillation
0206   /// process expects the user to have set the constant material
0207   /// property SCINTILLATIONRISETIME{1,2,3}
0208   G4bool scintFiniteRiseTime;
0209 
0210   /// option to  allow for the light yield to be a function of
0211   /// particle type and deposited energy in case of non-linear
0212   /// light emission in scintillators
0213   G4bool scintByParticleType;
0214 
0215   /// option to allow for G4ScintillationTrackInformation
0216   /// to be attached to a scintillation photon's track
0217   G4bool scintTrackInfo;
0218 
0219   /// option to allow stacking of secondary Scintillation photons
0220   G4bool scintStackPhotons;
0221 
0222   G4int scintVerboseLevel;
0223   G4bool scintTrackSecondariesFirst;
0224 
0225   ///////////////// WLS
0226   G4String wlsTimeProfileName;
0227   G4int wlsVerboseLevel;
0228 
0229   ///////////////// WLS2
0230   G4String wls2TimeProfileName;
0231   G4int wls2VerboseLevel;
0232 
0233   //////////////// absorption
0234   G4int absorptionVerboseLevel;
0235 
0236   //////////////// rayleigh
0237   G4int rayleighVerboseLevel;
0238 
0239   //////////////// mie
0240   G4int mieVerboseLevel;
0241 
0242   //////////////// boundary
0243   /// G4OpBoundaryProcess to call InvokeSD method
0244   G4bool boundaryInvokeSD;
0245   G4int boundaryVerboseLevel;
0246 
0247 #ifdef G4MULTITHREADED
0248   static G4Mutex opticalParametersMutex;
0249 #endif
0250 };
0251 
0252 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0253 
0254 #endif