Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:58:20

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 //
0029 // GEANT4 Class header file
0030 //
0031 //
0032 // File name:     G4eBremsstrahlungRelModel
0033 //                extention of standard G4eBremsstrahlungModel
0034 //
0035 // Author:        Andreas Schaelicke
0036 //
0037 // Creation date: 28.03.2008
0038 //
0039 // Modifications:
0040 //
0041 // 15.07.18  introduced data structures to store LPM functions and element depen
0042 //           dent data for faster run-time computation (see more in .cc M.Novak)
0043 //
0044 // Class Description:
0045 //
0046 // Implementation of energy loss for gamma emission by electrons and
0047 // positrons including an improved version of the LPM effect
0048 
0049 // -------------------------------------------------------------------
0050 //
0051 
0052 #ifndef G4eBremsstrahlungRelModel_h
0053 #define G4eBremsstrahlungRelModel_h 1
0054 
0055 #include "G4VEmModel.hh"
0056 #include <memory>
0057 
0058 class G4ParticleChangeForLoss;
0059 
0060 class G4eBremsstrahlungRelModel : public G4VEmModel {
0061 
0062 public:
0063 
0064   explicit G4eBremsstrahlungRelModel(const G4ParticleDefinition* p=nullptr,
0065                                      const G4String& nam="eBremLPM");
0066 
0067   ~G4eBremsstrahlungRelModel() override;
0068 
0069   void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
0070 
0071   void InitialiseLocal(const G4ParticleDefinition*,
0072                        G4VEmModel* masterModel) override;
0073 
0074   G4double ComputeDEDXPerVolume(const G4Material*,
0075                                 const G4ParticleDefinition*,
0076                                 G4double ekin,
0077                                 G4double cutEnergy) override;
0078 
0079   G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
0080                                       G4double ekin,
0081                                       G4double zet,
0082                                       G4double,
0083                                       G4double cutEnergy,
0084                                       G4double maxEnergy = DBL_MAX) override;
0085 
0086   void SampleSecondaries(std::vector<G4DynamicParticle*>*,
0087                          const G4MaterialCutsCouple*,
0088                          const G4DynamicParticle*,
0089                          G4double cutEnergy,
0090                          G4double maxEnergy) override;
0091 
0092   void SetupForMaterial(const G4ParticleDefinition*,
0093                         const G4Material*, G4double) override;
0094 
0095   G4double MinPrimaryEnergy(const G4Material*,
0096                             const G4ParticleDefinition*,
0097                             G4double cutEnergy) override;
0098 
0099 protected:
0100 
0101   virtual G4double ComputeDXSectionPerAtom(G4double gammaEnergy);
0102 
0103   void SetParticle(const G4ParticleDefinition* p);
0104 
0105 private:
0106 
0107   G4double ComputeBremLoss(G4double cutEnergy);
0108 
0109   G4double ComputeXSectionPerAtom(G4double cutEnergy);
0110 
0111   G4double ComputeRelDXSectionPerAtom(G4double gammaEnergy);
0112 
0113   // init special data per element i.e. per Z
0114   void InitialiseElementData();
0115 
0116   // methods for initialisation and run-time evaluation of LPM functions:
0117   void InitLPMFunctions();
0118 
0119   void ComputeLPMfunctions(G4double& funcXiS,
0120                            G4double& funcGS,
0121                            G4double& funcPhiS,
0122                            const G4double egamma);
0123 
0124   void GetLPMFunctions(G4double& lpmGs,
0125                        G4double& lpmPhis,
0126                        const G4double ss);
0127 
0128   void ComputeLPMGsPhis(G4double& funcGS,
0129                         G4double& funcPhiS,
0130                         const G4double varShat);
0131 
0132   // for evaluating screening related functions
0133   void ComputeScreeningFunctions(G4double& phi1,
0134                                  G4double& phi1m2,
0135                                  G4double& psi1,
0136                                  G4double& psi1m2,
0137                                  const G4double gam,
0138                                  const G4double eps);
0139   // hide assignment operator and cctr
0140   G4eBremsstrahlungRelModel& operator=
0141   (const G4eBremsstrahlungRelModel& right) = delete;
0142   G4eBremsstrahlungRelModel(const  G4eBremsstrahlungRelModel&) = delete;
0143 
0144 private:
0145 
0146   G4bool                      fIsUseCompleteScreening = false;
0147   G4bool                      fIsInitializer = false;
0148   G4bool                      fUseLPM = true;
0149 
0150 protected:
0151 
0152   G4bool                      fIsElectron = true;
0153   G4bool                      fIsScatOffElectron = false;
0154   G4bool                      fIsLPMActive = false;
0155   //
0156   G4int                       fCurrentIZ = 0;
0157   const G4ParticleDefinition* fPrimaryParticle = nullptr;
0158   G4ParticleDefinition*       fGammaParticle = nullptr;
0159   G4ParticleChangeForLoss*    fParticleChange = nullptr;
0160   // cash
0161   G4double                    fPrimaryParticleMass = 0.;
0162   G4double                    fPrimaryKinEnergy = 0.;
0163   G4double                    fPrimaryTotalEnergy = 0.;
0164   G4double                    fDensityFactor = 0.;
0165   G4double                    fDensityCorr = 0.;
0166   G4double                    fLowestKinEnergy;
0167   // scattering off electrons
0168   G4double                    fNucTerm = 0.;
0169   G4double                    fSumTerm = 0.;
0170 
0171 private:
0172 
0173   // LPM related members
0174   G4double                    fLPMEnergyThreshold;
0175   G4double                    fLPMEnergy;
0176 
0177 protected:
0178 
0179   static const G4double       gBremFactor;
0180   static const G4double       gMigdalConstant;
0181 
0182 private:
0183 
0184   static const G4int          gMaxZet;
0185   //
0186   static const G4double       gLPMconstant;
0187   //
0188   static const G4double       gXGL[8];
0189   static const G4double       gWGL[8];
0190   static const G4double       gFelLowZet[8];
0191   static const G4double       gFinelLowZet[8];
0192   //
0193   struct ElementData {
0194     /** @brief \f$ \ln(Z) \f$  */
0195     G4double  fLogZ;
0196     /** @brief \f$ \ln(Z)/3 + f_c \f$  */
0197     G4double  fFz;
0198     /** @brief \f$ ((Fel-fc)+Finel*invZ)\f$  */
0199     G4double  fZFactor1;
0200     /** @brief \f$ (Fel-fc)\f$  */
0201     G4double  fZFactor11;
0202     /** @brief \f$ (1.0+invZ)/12  \f$  */
0203     G4double  fZFactor2;
0204     // LPM variables
0205     G4double  fVarS1;
0206     G4double  fILVarS1;
0207     G4double  fILVarS1Cond;
0208     // constant factors to the screening function evaluations
0209     G4double  fGammaFactor;
0210     G4double  fEpsilonFactor;
0211   };
0212   //
0213   struct LPMFuncs {
0214     LPMFuncs() : fIsInitialized(false), fISDelta(100.), fSLimit(2.) {}
0215     G4bool                 fIsInitialized;
0216     G4double               fISDelta;
0217     G4double               fSLimit;
0218     std::vector<G4double>  fLPMFuncG;
0219     std::vector<G4double>  fLPMFuncPhi;
0220   };
0221   //
0222   static std::shared_ptr<LPMFuncs> gLPMFuncs();
0223   static std::shared_ptr<std::vector<ElementData*>> gElementData();
0224   std::shared_ptr<LPMFuncs> fLPMFuncs;
0225   std::shared_ptr<std::vector<ElementData*>> fElementData;
0226 };
0227 
0228 #endif