Back to home page

EIC code displayed by LXR

 
 

    


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

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 // File name:     G4GSMottCorrection
0032 //
0033 // Author:        Mihaly Novak
0034 //
0035 // Creation date: 23.08.2017
0036 //
0037 // Modifications:
0038 //
0039 // Class description:
0040 //   An object of this calss is used in the G4GoudsmitSaundersonTable when Mott-correction
0041 //   was required by the user in the G4GoudsmitSaundersonMscModel.
0042 //   The class is responsible to handle pre-computed Mott correction (rejection) functions
0043 //   obtained as a ratio of GS angular distributions computed based on the Screened-Rutherford
0044 //   DCS to GS angular distributions computed based on a more accurate corrected DCS_{cor}.
0045 //   The DCS used to compute the accurate Goudsmit-Saunderson angular distributions is [1]:
0046 //   DCS_{cor} = DCS_{SR}x[ DCS_{R}/DCS_{Mott}] where :
0047 //    # DCS_{SR} is the relativistic Screened-Rutherford DCS (first Born approximate
0048 //      solution of the Klein-Gordon i.e. relativistic Schrodinger equation =>
0049 //      scattering of spinless e- on exponentially screened Coulomb potential)
0050 //      note: the default (without using Mott-correction) GS angular distributions
0051 //      are based on this DCS_{SR} with Moliere's screening parameter!
0052 //    # DCS_{R} is the Rutherford DCS which is the same as above but without
0053 //      screening
0054 //    # DCS_{Mott} is the Mott DCS i.e. solution of the Dirac equation with a bare
0055 //      Coulomb potential i.e. scattering of particles with spin (e- or e+) on a
0056 //      point-like unscreened Coulomb potential [2]
0057 //    # moreover, the screening parameter of the DCS_{cor} was determined such that
0058 //  the DCS_{cor} with this corrected screening parameter reproduce the first
0059 //  transport cross sections obtained from the corresponding most accurate DCS [3].
0060 //  Unlike the default GS, the Mott-corrected angular distributions are particle type
0061 //  (different for e- and e+ <= the DCS_{Mott} and the screening correction) and target
0062 //  (Z and material) dependent.
0063 //
0064 // References:
0065 //   [2] I.Kawrakow, E.Mainegra-Hing, D.W.O.Rogers, F.Tessier,B.R.B.Walters, NRCC
0066 //       Report PIRS-701 (2013)
0067 //   [2]  N.F. Mott, Proc. Roy. Soc. (London) A 124 (1929) 425.
0068 //   [3] F.Salvat, A.Jablonski, C.J. Powell, CPC 165(2005) 157-190
0069 //
0070 // -----------------------------------------------------------------------------
0071 
0072 #ifndef G4GSMottCorrection_h
0073 #define G4GSMottCorrection_h 1
0074 
0075 #include <CLHEP/Units/SystemOfUnits.h>
0076 
0077 #include "globals.hh"
0078 
0079 #include <vector>
0080 #include <string>
0081 #include <sstream>
0082 
0083 class G4Material;
0084 class G4Element;
0085 
0086 
0087 class G4GSMottCorrection {
0088 public:
0089   G4GSMottCorrection(G4bool iselectron=true);
0090 
0091  ~G4GSMottCorrection();
0092 
0093   void     Initialise();
0094 
0095   void     GetMottCorrectionFactors(G4double logekin, G4double beta2, G4int matindx,
0096                                     G4double &mcToScr, G4double &mcToQ1, G4double &mcToG2PerG1);
0097 
0098   G4double GetMottRejectionValue(G4double logekin, G4double G4beta2, G4double q1, G4double cost,
0099                                  G4int matindx, G4int &ekindx, G4int &deltindx);
0100 
0101   static G4int GetMaxZet() { return gMaxZet; }
0102 
0103 private:
0104   void InitMCDataPerElement();
0105 
0106   void InitMCDataPerMaterials();
0107 
0108   void LoadMCDataElement(const G4Element*);
0109 
0110   void ReadCompressedFile(std::string fname, std::istringstream &iss);
0111 
0112   void InitMCDataMaterial(const G4Material*);
0113   //
0114   // dat structures
0115   struct DataPerDelta {
0116     G4double         fSA;             // a,b,c,d spline interpolation parameters for the last \sin(0.5\theta) bin
0117     G4double         fSB;
0118     G4double         fSC;
0119     G4double         fSD;
0120     G4double        *fRejFuntion;     // rejection func. for a given E_{kin}, \delta, e^-/e^+ over the \sin(0.5\theta) grid
0121   };
0122 
0123   struct DataPerEkin {
0124     G4double         fMCScreening;    // correction factor to Moliere screening parameter
0125     G4double         fMCFirstMoment;  // correction factor to first moment
0126     G4double         fMCSecondMoment; // correction factor to second
0127     DataPerDelta   **fDataPerDelta;   // per delta value data structure for each delta values
0128   };
0129 
0130   // either per material or per Z
0131   struct DataPerMaterial {
0132     DataPerEkin  **fDataPerEkin;    // per kinetic energy data structure for each kinetic energy value
0133   };
0134   //
0135   void AllocateDataPerMaterial(DataPerMaterial*);
0136   void DeAllocateDataPerMaterial(DataPerMaterial*);
0137   void ClearMCDataPerElement();
0138   void ClearMCDataPerMaterial();
0139   //
0140   // data members:
0141   // - Mott correction data are computed over a :
0142   //  I.  Kinetic energy grid [both rejection functions and correction factors]:
0143   //      1. kinetic energy grid from 1[keV] - 100[keV] with log-spacing 16 points:
0144   //                 # linear interpolation on \ln[E_{kin}] will be used
0145   //      2. \beta^2 grid from E_{kin} = 100[keV](~0.300546) - \beta^2=0.9999(~50.5889MeV]) with linear spacing 16 points:
0146   //                 # linear interpolation on \beta^2 will be used
0147   //      3. the overall kinetic energy grid is from E_{kin}=1[keV] - E_{kin}<=\beta^2=0.9999(~50.5889MeV]) with 31 points
0148   //  II. Delta value grid [rejection functions at a given kinetic energy(also depends on \theta;Z,e-/e+)]:
0149   //      1. \delta=2 Q_{1SR} (\eta_{MCcor})/ [1-2 Q_{1SR} (\eta_{MCcor})] where Q_{1SR} is the first moment i.e.
0150   //         Q_{1SR}(\eta_{MCcor}) =s/\lambda_{el}G_{1SR}(\eta_{MCcor}) where s/\lambda_{el} is the mean number of elastic
0151   //         scattering along the path s and G_{1SR}(\eta_{MCcor}) is the first, Screened-Rutherford transport coefficient
0152   //         but computed by using the Mott-corrected Moliere screening parameter
0153   //      2. the delta value grid is from [0(1e-3) - 0.9] with linear spacing of 28 points:
0154   //                 # linear interpolation will be used on \delta
0155   // III. \sin(0.5\theta) grid[rejection function at a given kinetic energy - delta value pair (also depends on Z,e-/e+)]:
0156   //      1. 32 \sin(0.5\theta) pints between [0,1] with linear spacing: # linear interpolation on \sin(0.5\theta) will
0157   //         be used exept the last bin where spline is used (the corresponding 4 spline parameters are also stored)
0158 private:
0159   G4bool                     fIsElectron;
0160   static constexpr G4int     gNumEkin   = 31;                 // number of kinetic energy grid points for Mott correction
0161   static constexpr G4int     gNumBeta2  = 16;                 // \beta^2 values between [fMinBeta2-fMaxBeta2]
0162   static constexpr G4int     gNumDelta  = 28;                 // \delta values between [0(1.e-3)-0.9]
0163   static constexpr G4int     gNumAngle  = 32;                 //
0164   static constexpr G4int     gMaxZet    = 98;                 // max. Z for which Mott-correction data were computed (98)
0165   static constexpr G4double  gMinEkin   =   1.*CLHEP::keV;   // minimum kinetic energy value
0166   static constexpr G4double  gMidEkin   = 100.*CLHEP::keV;   // kinetic energy at the border of the E_{kin}-\beta^2 grids
0167   static constexpr G4double  gMaxBeta2  =   0.9999;           // maximum \beta^2 value
0168   static constexpr G4double  gMaxDelta  =   0.9;              // maximum \delta value (the minimum is 0(1.e-3))
0169   //
0170   G4double                   fMaxEkin;        // from max fMaxBeta2 = 0.9999 (~50.5889 [MeV])
0171   G4double                   fLogMinEkin;     // \ln[fMinEkin]
0172   G4double                   fInvLogDelEkin;  // 1/[\ln(fMidEkin/fMinEkin)/(fNumEkin-fNumBeta2)]
0173   G4double                   fMinBeta2;       // <= E_{kin}=100 [keV] (~0.300546)
0174   G4double                   fInvDelBeta2;    // 1/[(fMaxBeta2-fMinBeta2)/(fNumBeta2-1)]
0175   G4double                   fInvDelDelta;    // 1/[0.9/(fNumDelta-1)]
0176   G4double                   fInvDelAngle;    // 1/[(1-0)/fNumAngle-1]
0177   //
0178   static const std::string   gElemSymbols[];
0179   //
0180   std::vector<DataPerMaterial*>  fMCDataPerElement;   // size will be gMaxZet+1; won't be null only at used Z indices
0181   std::vector<DataPerMaterial*>  fMCDataPerMaterial;  // size will #materials; won't be null only at used mat. indices
0182 };
0183 
0184 #endif // G4GSMottCorrection_h