Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-25 09:13:11

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