Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // 26 // 27 // ------------------------------------------- 27 // ---------------------------------------------------------------------------- 28 // 28 // 29 // GEANT4 Class header file 29 // GEANT4 Class header file 30 // 30 // 31 // File name: G4GSMottCorrection 31 // File name: G4GSMottCorrection 32 // 32 // 33 // Author: Mihaly Novak 33 // Author: Mihaly Novak 34 // 34 // 35 // Creation date: 23.08.2017 35 // Creation date: 23.08.2017 36 // 36 // 37 // Modifications: 37 // Modifications: 38 // 38 // 39 // Class description: 39 // Class description: 40 // An object of this calss is used in the G4 40 // An object of this calss is used in the G4GoudsmitSaundersonTable when Mott-correction 41 // was required by the user in the G4Goudsmi 41 // was required by the user in the G4GoudsmitSaundersonMscModel. 42 // The class is responsible to handle pre-co 42 // The class is responsible to handle pre-computed Mott correction (rejection) functions 43 // obtained as a ratio of GS angular distrib 43 // obtained as a ratio of GS angular distributions computed based on the Screened-Rutherford 44 // DCS to GS angular distributions computed 44 // DCS to GS angular distributions computed based on a more accurate corrected DCS_{cor}. 45 // The DCS used to compute the accurate Goud 45 // The DCS used to compute the accurate Goudsmit-Saunderson angular distributions is [1]: 46 // DCS_{cor} = DCS_{SR}x[ DCS_{R}/DCS_{Mott} 46 // DCS_{cor} = DCS_{SR}x[ DCS_{R}/DCS_{Mott}] where : 47 // # DCS_{SR} is the relativistic Screened- 47 // # DCS_{SR} is the relativistic Screened-Rutherford DCS (first Born approximate 48 // solution of the Klein-Gordon i.e. rela 48 // solution of the Klein-Gordon i.e. relativistic Schrodinger equation => 49 // scattering of spinless e- on exponenti 49 // scattering of spinless e- on exponentially screened Coulomb potential) 50 // note: the default (without using Mott- 50 // note: the default (without using Mott-correction) GS angular distributions 51 // are based on this DCS_{SR} with Molier 51 // are based on this DCS_{SR} with Moliere's screening parameter! 52 // # DCS_{R} is the Rutherford DCS which is 52 // # DCS_{R} is the Rutherford DCS which is the same as above but without 53 // screening 53 // screening 54 // # DCS_{Mott} is the Mott DCS i.e. soluti 54 // # DCS_{Mott} is the Mott DCS i.e. solution of the Dirac equation with a bare 55 // Coulomb potential i.e. scattering of p 55 // Coulomb potential i.e. scattering of particles with spin (e- or e+) on a 56 // point-like unscreened Coulomb potentia 56 // point-like unscreened Coulomb potential [2] 57 // # moreover, the screening parameter of t 57 // # moreover, the screening parameter of the DCS_{cor} was determined such that 58 // the DCS_{cor} with this corrected screenin 58 // the DCS_{cor} with this corrected screening parameter reproduce the first 59 // transport cross sections obtained from the 59 // transport cross sections obtained from the corresponding most accurate DCS [3]. 60 // Unlike the default GS, the Mott-corrected 60 // Unlike the default GS, the Mott-corrected angular distributions are particle type 61 // (different for e- and e+ <= the DCS_{Mott} 61 // (different for e- and e+ <= the DCS_{Mott} and the screening correction) and target 62 // (Z and material) dependent. 62 // (Z and material) dependent. 63 // 63 // 64 // References: 64 // References: 65 // [2] I.Kawrakow, E.Mainegra-Hing, D.W.O.Ro 65 // [2] I.Kawrakow, E.Mainegra-Hing, D.W.O.Rogers, F.Tessier,B.R.B.Walters, NRCC 66 // Report PIRS-701 (2013) 66 // Report PIRS-701 (2013) 67 // [2] N.F. Mott, Proc. Roy. Soc. (London) 67 // [2] N.F. Mott, Proc. Roy. Soc. (London) A 124 (1929) 425. 68 // [3] F.Salvat, A.Jablonski, C.J. Powell, C 68 // [3] F.Salvat, A.Jablonski, C.J. Powell, CPC 165(2005) 157-190 69 // 69 // 70 // ------------------------------------------- 70 // ----------------------------------------------------------------------------- 71 71 72 #ifndef G4GSMottCorrection_h 72 #ifndef G4GSMottCorrection_h 73 #define G4GSMottCorrection_h 1 73 #define G4GSMottCorrection_h 1 74 74 75 #include <CLHEP/Units/SystemOfUnits.h> 75 #include <CLHEP/Units/SystemOfUnits.h> 76 76 77 #include "globals.hh" 77 #include "globals.hh" 78 78 79 #include <vector> 79 #include <vector> 80 #include <string> 80 #include <string> 81 #include <sstream> 81 #include <sstream> 82 82 83 class G4Material; 83 class G4Material; 84 class G4Element; 84 class G4Element; 85 85 86 86 87 class G4GSMottCorrection { 87 class G4GSMottCorrection { 88 public: 88 public: 89 G4GSMottCorrection(G4bool iselectron=true); 89 G4GSMottCorrection(G4bool iselectron=true); 90 90 91 ~G4GSMottCorrection(); 91 ~G4GSMottCorrection(); 92 92 93 void Initialise(); 93 void Initialise(); 94 94 95 void GetMottCorrectionFactors(G4double l 95 void GetMottCorrectionFactors(G4double logekin, G4double beta2, G4int matindx, 96 G4double & 96 G4double &mcToScr, G4double &mcToQ1, G4double &mcToG2PerG1); 97 97 98 G4double GetMottRejectionValue(G4double loge 98 G4double GetMottRejectionValue(G4double logekin, G4double G4beta2, G4double q1, G4double cost, 99 G4int matindx 99 G4int matindx, G4int &ekindx, G4int &deltindx); 100 100 101 static G4int GetMaxZet() { return gMaxZet; } 101 static G4int GetMaxZet() { return gMaxZet; } 102 102 103 private: 103 private: 104 void InitMCDataPerElement(); 104 void InitMCDataPerElement(); 105 105 106 void InitMCDataPerMaterials(); 106 void InitMCDataPerMaterials(); 107 107 108 void LoadMCDataElement(const G4Element*); 108 void LoadMCDataElement(const G4Element*); 109 109 110 void ReadCompressedFile(const std::string& f << 110 void ReadCompressedFile(std::string fname, std::istringstream &iss); 111 111 112 void InitMCDataMaterial(const G4Material*); 112 void InitMCDataMaterial(const G4Material*); 113 // 113 // 114 // dat structures 114 // dat structures 115 struct DataPerDelta { 115 struct DataPerDelta { 116 G4double fSA; // a,b,c 116 G4double fSA; // a,b,c,d spline interpolation parameters for the last \sin(0.5\theta) bin 117 G4double fSB; 117 G4double fSB; 118 G4double fSC; 118 G4double fSC; 119 G4double fSD; 119 G4double fSD; 120 G4double *fRejFuntion; // rejec 120 G4double *fRejFuntion; // rejection func. for a given E_{kin}, \delta, e^-/e^+ over the \sin(0.5\theta) grid 121 }; 121 }; 122 122 123 struct DataPerEkin { 123 struct DataPerEkin { 124 G4double fMCScreening; // corre 124 G4double fMCScreening; // correction factor to Moliere screening parameter 125 G4double fMCFirstMoment; // corre 125 G4double fMCFirstMoment; // correction factor to first moment 126 G4double fMCSecondMoment; // corre 126 G4double fMCSecondMoment; // correction factor to second 127 DataPerDelta **fDataPerDelta; // per d 127 DataPerDelta **fDataPerDelta; // per delta value data structure for each delta values 128 }; 128 }; 129 129 130 // either per material or per Z 130 // either per material or per Z 131 struct DataPerMaterial { 131 struct DataPerMaterial { 132 DataPerEkin **fDataPerEkin; // per kin 132 DataPerEkin **fDataPerEkin; // per kinetic energy data structure for each kinetic energy value 133 }; 133 }; 134 // 134 // 135 void AllocateDataPerMaterial(DataPerMaterial 135 void AllocateDataPerMaterial(DataPerMaterial*); 136 void DeAllocateDataPerMaterial(DataPerMateri 136 void DeAllocateDataPerMaterial(DataPerMaterial*); 137 void ClearMCDataPerElement(); 137 void ClearMCDataPerElement(); 138 void ClearMCDataPerMaterial(); 138 void ClearMCDataPerMaterial(); 139 // 139 // 140 // data members: 140 // data members: 141 // - Mott correction data are computed over 141 // - Mott correction data are computed over a : 142 // I. Kinetic energy grid [both rejection 142 // I. Kinetic energy grid [both rejection functions and correction factors]: 143 // 1. kinetic energy grid from 1[keV] - 143 // 1. kinetic energy grid from 1[keV] - 100[keV] with log-spacing 16 points: 144 // # linear interpolation on 144 // # linear interpolation on \ln[E_{kin}] will be used 145 // 2. \beta^2 grid from E_{kin} = 100[k 145 // 2. \beta^2 grid from E_{kin} = 100[keV](~0.300546) - \beta^2=0.9999(~50.5889MeV]) with linear spacing 16 points: 146 // # linear interpolation on 146 // # linear interpolation on \beta^2 will be used 147 // 3. the overall kinetic energy grid i 147 // 3. the overall kinetic energy grid is from E_{kin}=1[keV] - E_{kin}<=\beta^2=0.9999(~50.5889MeV]) with 31 points 148 // II. Delta value grid [rejection function 148 // II. Delta value grid [rejection functions at a given kinetic energy(also depends on \theta;Z,e-/e+)]: 149 // 1. \delta=2 Q_{1SR} (\eta_{MCcor})/ 149 // 1. \delta=2 Q_{1SR} (\eta_{MCcor})/ [1-2 Q_{1SR} (\eta_{MCcor})] where Q_{1SR} is the first moment i.e. 150 // Q_{1SR}(\eta_{MCcor}) =s/\lambda_ 150 // Q_{1SR}(\eta_{MCcor}) =s/\lambda_{el}G_{1SR}(\eta_{MCcor}) where s/\lambda_{el} is the mean number of elastic 151 // scattering along the path s and G 151 // scattering along the path s and G_{1SR}(\eta_{MCcor}) is the first, Screened-Rutherford transport coefficient 152 // but computed by using the Mott-co 152 // but computed by using the Mott-corrected Moliere screening parameter 153 // 2. the delta value grid is from [0(1 153 // 2. the delta value grid is from [0(1e-3) - 0.9] with linear spacing of 28 points: 154 // # linear interpolation wi 154 // # linear interpolation will be used on \delta 155 // III. \sin(0.5\theta) grid[rejection funct 155 // III. \sin(0.5\theta) grid[rejection function at a given kinetic energy - delta value pair (also depends on Z,e-/e+)]: 156 // 1. 32 \sin(0.5\theta) pints between 156 // 1. 32 \sin(0.5\theta) pints between [0,1] with linear spacing: # linear interpolation on \sin(0.5\theta) will 157 // be used exept the last bin where 157 // be used exept the last bin where spline is used (the corresponding 4 spline parameters are also stored) 158 private: 158 private: 159 G4bool fIsElectron; 159 G4bool fIsElectron; 160 static constexpr G4int gNumEkin = 31; 160 static constexpr G4int gNumEkin = 31; // number of kinetic energy grid points for Mott correction 161 static constexpr G4int gNumBeta2 = 16; 161 static constexpr G4int gNumBeta2 = 16; // \beta^2 values between [fMinBeta2-fMaxBeta2] 162 static constexpr G4int gNumDelta = 28; 162 static constexpr G4int gNumDelta = 28; // \delta values between [0(1.e-3)-0.9] 163 static constexpr G4int gNumAngle = 32; 163 static constexpr G4int gNumAngle = 32; // 164 static constexpr G4int gMaxZet = 98; 164 static constexpr G4int gMaxZet = 98; // max. Z for which Mott-correction data were computed (98) 165 static constexpr G4double gMinEkin = 1. 165 static constexpr G4double gMinEkin = 1.*CLHEP::keV; // minimum kinetic energy value 166 static constexpr G4double gMidEkin = 100. 166 static constexpr G4double gMidEkin = 100.*CLHEP::keV; // kinetic energy at the border of the E_{kin}-\beta^2 grids 167 static constexpr G4double gMaxBeta2 = 0. 167 static constexpr G4double gMaxBeta2 = 0.9999; // maximum \beta^2 value 168 static constexpr G4double gMaxDelta = 0. 168 static constexpr G4double gMaxDelta = 0.9; // maximum \delta value (the minimum is 0(1.e-3)) 169 // 169 // 170 G4double fMaxEkin; 170 G4double fMaxEkin; // from max fMaxBeta2 = 0.9999 (~50.5889 [MeV]) 171 G4double fLogMinEkin; 171 G4double fLogMinEkin; // \ln[fMinEkin] 172 G4double fInvLogDelEkin; 172 G4double fInvLogDelEkin; // 1/[\ln(fMidEkin/fMinEkin)/(fNumEkin-fNumBeta2)] 173 G4double fMinBeta2; 173 G4double fMinBeta2; // <= E_{kin}=100 [keV] (~0.300546) 174 G4double fInvDelBeta2; 174 G4double fInvDelBeta2; // 1/[(fMaxBeta2-fMinBeta2)/(fNumBeta2-1)] 175 G4double fInvDelDelta; 175 G4double fInvDelDelta; // 1/[0.9/(fNumDelta-1)] 176 G4double fInvDelAngle; 176 G4double fInvDelAngle; // 1/[(1-0)/fNumAngle-1] 177 // 177 // 178 static const std::string gElemSymbols[]; 178 static const std::string gElemSymbols[]; 179 // 179 // 180 std::vector<DataPerMaterial*> fMCDataPerEle 180 std::vector<DataPerMaterial*> fMCDataPerElement; // size will be gMaxZet+1; won't be null only at used Z indices 181 std::vector<DataPerMaterial*> fMCDataPerMat 181 std::vector<DataPerMaterial*> fMCDataPerMaterial; // size will #materials; won't be null only at used mat. indices 182 }; 182 }; 183 183 184 #endif // G4GSMottCorrection_h 184 #endif // G4GSMottCorrection_h 185 185