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] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/electromagnetic/standard/src/G4IonCoulombCrossSection.cc (Version 11.3.0) and /processes/electromagnetic/standard/src/G4IonCoulombCrossSection.cc (Version 9.5.p1)


  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 //      G4IonCoulombCrossSection.cc                26 //      G4IonCoulombCrossSection.cc
 27 //--------------------------------------------     27 //-------------------------------------------------------------------
 28 //                                                 28 //
 29 // GEANT4 Class header file                        29 // GEANT4 Class header file
 30 //                                                 30 //
 31 // File name:    G4IonCoulombCrossSection          31 // File name:    G4IonCoulombCrossSection
 32 //                                                 32 //
 33 // Author:      Cristina Consolandi                33 // Author:      Cristina Consolandi
 34 //                                                 34 //
 35 // Creation date: 05.10.2010 from G4eCoulombSc     35 // Creation date: 05.10.2010 from G4eCoulombScatteringModel 
 36 //                                                 36 //                                 
 37 // Class Description:                              37 // Class Description:
 38 //  Computation of Screen-Coulomb Cross Sectio     38 //  Computation of Screen-Coulomb Cross Section 
 39 //  for protons, alpha and heavy Ions              39 //  for protons, alpha and heavy Ions
 40 //                                                 40 //
 41 //                                                 41 //
 42 // Reference:                                      42 // Reference:
 43 //      M.J. Boschini et al. "Nuclear and Non-     43 //      M.J. Boschini et al. "Nuclear and Non-Ionizing Energy-Loss 
 44 //      for Coulomb Scattered Particles from L     44 //      for Coulomb Scattered Particles from Low Energy up to Relativistic 
 45 //      Regime in Space Radiation Environment"     45 //      Regime in Space Radiation Environment"
 46 //      Accepted for publication in the Procee     46 //      Accepted for publication in the Proceedings of  the  ICATPP Conference
 47 //      on Cosmic Rays for Particle and Astrop     47 //      on Cosmic Rays for Particle and Astroparticle Physics, Villa  Olmo, 7-8
 48 //      October,  2010, to be published by Wor     48 //      October,  2010, to be published by World Scientific (Singapore).
 49 //                                                 49 //
 50 //      Available for downloading at:              50 //      Available for downloading at:
 51 //      http://arxiv.org/abs/1011.4822             51 //      http://arxiv.org/abs/1011.4822
 52 //                                                 52 //
 53 // -------------------------------------------     53 // -------------------------------------------------------------------
 54 //                                                 54 //
 55 //....oooOO0OOooo........oooOO0OOooo........oo     55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 56                                                << 
 57 #include "G4IonCoulombCrossSection.hh"             56 #include "G4IonCoulombCrossSection.hh"
 58 #include "G4PhysicalConstants.hh"              << 
 59 #include "Randomize.hh"                            57 #include "Randomize.hh"
 60 #include "G4Proton.hh"                             58 #include "G4Proton.hh"
 61 #include "G4Exp.hh"                            <<  59 #include "G4LossTableManager.hh"
 62 #include "G4Log.hh"                            << 
 63                                                    60 
 64 //....oooOO0OOooo........oooOO0OOooo........oo     61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 65                                                    62 
 66 using namespace std;                           << 
 67                                                    63 
 68 const G4double a0 = CLHEP::electron_mass_c2/0. <<  64 using namespace std;
 69                                                    65 
 70 G4IonCoulombCrossSection::G4IonCoulombCrossSec     66 G4IonCoulombCrossSection::G4IonCoulombCrossSection():
 71    cosThetaMin(1.0),                               67    cosThetaMin(1.0),
 72    cosThetaMax(-1.0),                              68    cosThetaMax(-1.0),
 73    alpha2(fine_structure_const*fine_structure_     69    alpha2(fine_structure_const*fine_structure_const)
 74 {                                                  70 {
 75   fNistManager = G4NistManager::Instance();    <<  71     fNistManager = G4NistManager::Instance();
 76   fG4pow = G4Pow::GetInstance();               <<  72         theProton   = G4Proton::Proton();
 77   theProton   = G4Proton::Proton();            <<  73         particle=0;
 78   particle = nullptr;                          <<  74 
 79                                                <<  75     G4double p0 = electron_mass_c2*classic_electr_radius;
 80   G4double p0 = electron_mass_c2*classic_elect <<  76     coeff  = twopi*p0*p0;
 81   coeff  = twopi*p0*p0;                        <<  77 
 82                                                <<  78   cosTetMinNuc=0;
 83   cosTetMinNuc=0;                              <<  79   cosTetMaxNuc=0;
 84   cosTetMaxNuc=0;                              <<  80   nucXSection =0;
 85   nucXSection =0;                              <<  81 
 86                                                    82 
 87   chargeSquare = spin = mass = 0.0;            <<  83   chargeSquare = spin = mass =0;
 88   tkinLab = momLab2 = invbetaLab2 = tkin = mom <<  84   tkinLab = momLab2 = invbetaLab2=0;
                                                   >>  85         tkin = mom2 = invbeta2=0;
                                                   >>  86 
                                                   >>  87   targetZ = targetMass = screenZ =0;
                                                   >>  88         ScreenRSquare=0.;
                                                   >>  89 
                                                   >>  90   etag = ecut = 0.0;
 89                                                    91 
 90   targetZ = targetMass = screenZ = ScreenRSqua << 
 91 }                                                  92 }
                                                   >>  93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 92                                                    94 
                                                   >>  95 G4IonCoulombCrossSection::~G4IonCoulombCrossSection()
                                                   >>  96 {}
 93 //....oooOO0OOooo........oooOO0OOooo........oo     97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 94                                                    98 
 95 void G4IonCoulombCrossSection::Initialise(cons     99 void G4IonCoulombCrossSection::Initialise(const G4ParticleDefinition* p,
 96                                           G4do    100                                           G4double CosThetaLim)
 97 {                                                 101 {
 98   SetupParticle(p);                            << 
 99   nucXSection = tkin = targetZ = mom2 = 0.0;   << 
100   etag = DBL_MAX;                              << 
101   particle = p;                                << 
102   cosThetaMin = CosThetaLim;                   << 
103 }                                              << 
104                                                   102 
                                                   >> 103   SetupParticle(p);
                                                   >> 104     nucXSection = 0.0;
                                                   >> 105     tkin = targetZ = mom2 = DBL_MIN;
                                                   >> 106     ecut = etag = DBL_MAX;
                                                   >> 107     particle = p;
                                                   >> 108 
                                                   >> 109     
                                                   >> 110     cosThetaMin = CosThetaLim; 
                                                   >> 111 
                                                   >> 112 }
105 //....oooOO0OOooo........oooOO0OOooo........oo    113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
106                                                   114 
107 void G4IonCoulombCrossSection::SetupKinematic( << 115 void G4IonCoulombCrossSection::SetupKinematic(G4double ekin,
                                                   >> 116                                                      G4double cut,G4int iz )
108 {                                                 117 {
109   if(ekin != tkinLab || tmass != targetMass) { << 118         if(ekin != tkinLab || ecut != cut) {
                                                   >> 119 
                                                   >> 120                 // lab
                                                   >> 121                 tkinLab = ekin;
                                                   >> 122                 momLab2 = tkinLab*(tkinLab + 2.0*mass);
                                                   >> 123                 invbetaLab2 = 1.0 +  mass*mass/momLab2;
110                                                   124 
111     // lab                                     << 125                 G4double etot = tkinLab + mass;
112     tkinLab = ekin;                            << 126                 G4double ptot = sqrt(momLab2);
113     momLab2 = tkinLab*(tkinLab + 2.0*mass);    << 127                 G4double m12  = mass*mass;
114     invbetaLab2 = 1.0 +  mass*mass/momLab2;    << 
115                                                   128 
116     G4double etot = tkinLab + mass;            << 129                 targetMass=fNistManager->GetAtomicMassAmu(iz)*amu_c2;
117     G4double ptot = sqrt(momLab2);             << 130                 G4double m2   = targetMass;
118     G4double m12  = mass*mass;                 << 131 
119     // relativistic reduced mass from publucat << 132         // relativistic reduced mass from publucation
120     // A.P. Martynenko, R.N. Faustov, Teoret.  << 133         // A.P. Martynenko, R.N. Faustov, Teoret. mat. Fiz. 64 (1985) 179
121                                                   134         
122     //incident particle & target nucleus       << 135     //incident particle & target nucleus
123     targetMass = tmass;                        << 136           G4double Ecm=sqrt(m12 + m2*m2 + 2.0*etot*m2);
124     G4double Ecm=sqrt(m12 + targetMass*targetM << 137                 G4double mu_rel=mass*m2/Ecm;
125     G4double mu_rel=mass*targetMass/Ecm;       << 138                 G4double momCM= ptot*m2/Ecm;
126     G4double momCM= ptot*targetMass/Ecm;       << 139                 // relative system
127     // relative system                         << 140                 mom2 = momCM*momCM;
128     mom2 = momCM*momCM;                        << 141                 invbeta2 = 1.0 +  mu_rel*mu_rel/mom2;
129     invbeta2 = 1.0 +  mu_rel*mu_rel/mom2;      << 142                 tkin = momCM*sqrt(invbeta2) - mu_rel;//Ekin of mu_rel
130     tkin = momCM*sqrt(invbeta2) - mu_rel;//Eki << 143                 //.........................................................
131                                                << 
132     cosTetMinNuc = cosThetaMin;                << 
133     cosTetMaxNuc = cosThetaMax;                << 
134   }                                            << 
135 }                                              << 
136                                                   144 
                                                   >> 145                 cosTetMinNuc = cosThetaMin;
                                                   >> 146                 cosTetMaxNuc = cosThetaMax;
                                                   >> 147 
                                                   >> 148         }
                                                   >> 149 
                                                   >> 150 }
137 //....oooOO0OOooo........oooOO0OOooo........oo    151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
138                                                   152 
139 void G4IonCoulombCrossSection::SetupTarget(G4d << 153 
140              G4int)                            << 154 void G4IonCoulombCrossSection::SetupTarget(G4double Z, G4double e, G4int heavycorr)
141 {                                              << 155 {
142   if(Z != targetZ || e != etag) {              << 156         if(Z != targetZ || e != etag) {
143     etag    = e;                               << 157                 etag    = e;
144     targetZ = Z;                               << 158                 targetZ = Z;
145     G4int iz= G4lrint(Z);                      << 159                 G4int iz= G4int(Z);
146                                                << 160 
147     SetScreenRSquare(iz);                      << 161                 SetScreenRSquare(iz);
148     screenZ = 0;                               << 162       screenZ =0;
149     screenZ = ScreenRSquare/mom2;              << 163           screenZ = ScreenRSquare/mom2;
150     //heavycorr = 0;                           << 164 
151     //  G4cout<< "heavycorr "<<heavycorr<<G4en << 165   //  G4cout<< "heavycorr "<<heavycorr<<G4endl;
152                                                << 166 
153     G4double corr=5.*twopi*Z*std::sqrt(chargeS << 167     if(heavycorr!=0 && particle != theProton){
154     corr=G4Exp(G4Log(corr)*0.04);              << 168       G4double corr=5.*twopi*Z*std::sqrt(chargeSquare*alpha2);
155     screenZ *=0.5*(1.13 + corr*3.76*Z*Z*charge << 169       corr=std::pow(corr,0.12);
156     // G4cout<<" heavycorr Z e corr....2As "<< << 170       screenZ *=(1.13 + corr*3.76*Z*Z*chargeSquare*invbeta2*alpha2)/2.;
157     //  <<Z <<"\t"<<e/MeV <<"\t"<<screenZ<<G4e << 171 //      G4cout<<" heavycorr Z e corr....2As "<< heavycorr << "\t"
158                                                << 172 //        <<Z <<"\t"<<e/MeV <<"\t"<<screenZ<<G4endl;
159     if(1 == iz && particle == theProton && cos << 173 
160       cosTetMaxNuc = 0.0;                      << 174     }else{ screenZ *=(1.13 + 3.76*Z*Z*chargeSquare*invbeta2*alpha2)/2.;
161     }                                          << 175 //                        G4cout<<"  heavycorr Z e....2As "<< heavycorr << "\t"
162   }                                            << 176 //        <<Z <<"\t"<< e/MeV <<"\t"  <<screenZ<<G4endl;
                                                   >> 177     }
                                                   >> 178 
                                                   >> 179                 if(1 == iz && particle == theProton && cosTetMaxNuc < 0.0) {
                                                   >> 180                         cosTetMaxNuc = 0.0;
                                                   >> 181                 }
                                                   >> 182 
                                                   >> 183         }
163 }                                                 184 }
164                                                   185 
165 //....oooOO0OOooo........oooOO0OOooo........oo    186 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 187 void G4IonCoulombCrossSection::SetScreenRSquare(G4int iz){
166                                                   188 
167 void G4IonCoulombCrossSection::SetScreenRSquar << 189                 G4double a0 = electron_mass_c2/0.88534;
168 {                                              << 
169   //for proton Thomas-Fermi screening length   << 
170   G4int Z1 = G4lrint(std::sqrt(chargeSquare)); << 
171   G4double Z113  = fG4pow->Z13(iz);            << 
172   G4double Z1023 = fG4pow->powZ(Z1,0.23);      << 
173   G4double Z2023 = fG4pow->powZ(iz,0.23);      << 
174   G4double x=a0*(Z1023+Z2023);                 << 
175                                                << 
176   // Universal screening length                << 
177   if(particle == theProton){                   << 
178      x = a0*Z113;                              << 
179   }                                            << 
180                                                   190 
181   ScreenRSquare = alpha2*x*x;                  << 191                 //target nucleus
182 }                                              << 192                 G4double Z1=std::sqrt(chargeSquare);
                                                   >> 193                 G4double Z2=targetZ;
                                                   >> 194         
                                                   >> 195                 G4double Z1023=std::pow(Z1,0.23);
                                                   >> 196           G4double Z2023=std::pow(Z2,0.23);
                                                   >> 197         
                                                   >> 198     // Universal screening length
                                                   >> 199     G4double x=a0*(Z1023+Z2023);
                                                   >> 200 
                                                   >> 201           //for proton Thomas-Fermi screening length  
                                                   >> 202     if(particle == theProton){ 
                                                   >> 203         x = a0*fNistManager->GetZ13(iz);
                                                   >> 204                     }   
                                                   >> 205                 ScreenRSquare  = alpha2*x*x;
183                                                   206 
                                                   >> 207    
                                                   >> 208 }
184 //....oooOO0OOooo........oooOO0OOooo........oo    209 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
185                                                   210 
186 G4double G4IonCoulombCrossSection::NuclearCros    211 G4double G4IonCoulombCrossSection::NuclearCrossSection()
187 {                                                 212 {
188   // This method needs initialisation before b << 213     // This method needs initialisation before be called
189   // scattering with target nucleus            << 214 
190   G4double fac = coeff*targetZ*(targetZ)*charg << 215   // scattering with target nucleus
191                                                << 216         G4double fac = coeff*targetZ*targetZ*chargeSquare*invbeta2/mom2;
192   nucXSection  = 0.0;                          << 217 
193                                                << 218     nucXSection  = 0.0;
194   G4double x  = 1.0 - cosTetMinNuc;            << 219 
195   G4double x1 = x + screenZ;                   << 220     G4double x  = 1.0 - cosTetMinNuc;
196                                                << 221     G4double x1 = x + screenZ;
197   // scattering with nucleus                   << 222 
198   if(cosTetMaxNuc < cosTetMinNuc) {            << 223   // scattering with nucleus
199     nucXSection = fac*(cosTetMinNuc - cosTetMa << 224     if(cosTetMaxNuc < cosTetMinNuc) {
200       (x1*(1.0 - cosTetMaxNuc + screenZ));     << 225 
201   }                                            << 226     nucXSection =fac*(cosTetMinNuc - cosTetMaxNuc)/
                                                   >> 227                         (x1*(1.0 - cosTetMaxNuc + screenZ));
                                                   >> 228 
                                                   >> 229         }
202                                                   230 
203   return nucXSection;                             231   return nucXSection;
204 }                                                 232 }
205                                                   233 
206 //....oooOO0OOooo........oooOO0OOooo........oo    234 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
207                                                   235 
208 G4double G4IonCoulombCrossSection::SampleCosin    236 G4double G4IonCoulombCrossSection::SampleCosineTheta()
209 {                                              << 237 {
210   G4double z1 = 0.0;                           << 238     
211   if(cosTetMaxNuc < cosTetMinNuc) {            << 239     if(cosTetMaxNuc >= cosTetMinNuc) return 0.0;
212                                                << 240 
213     G4double x1 = 1. - cosTetMinNuc + screenZ; << 241     G4double x1 = 1. - cosTetMinNuc + screenZ;
214     G4double x2 = 1. - cosTetMaxNuc + screenZ; << 242     G4double x2 = 1. - cosTetMaxNuc + screenZ;
215     G4double dx = cosTetMinNuc - cosTetMaxNuc; << 243     G4double dx = cosTetMinNuc - cosTetMaxNuc;
216     z1 = x1*x2/(x1 + G4UniformRand()*dx) - scr << 244     G4double /*grej,*/ z1;
217   }                                            << 245 
                                                   >> 246         z1 = x1*x2/(x1 + G4UniformRand()*dx) - screenZ;
                                                   >> 247                 //grej = 1.0/(1.0 + z1);
218   return z1;                                      248   return z1;
219 }                                                 249 }
220                                                   250 
221 //....oooOO0OOooo........oooOO0OOooo........oo    251 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
222                                                   252 
223                                                   253 
224                                                   254 
225                                                   255 
226                                                   256