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 // $Id: G4ionEffectiveCharge.cc,v 1.17.2.1 2008/04/22 15:28:13 vnivanch Exp $ >> 27 // GEANT4 tag $Name: geant4-09-01-patch-03 $ 26 // 28 // 27 // ------------------------------------------- 29 // ------------------------------------------------------------------- 28 // 30 // 29 // GEANT4 Class file 31 // GEANT4 Class file 30 // 32 // 31 // 33 // 32 // File name: G4ionEffectiveCharge 34 // File name: G4ionEffectiveCharge 33 // 35 // 34 // Author: Vladimir Ivanchenko 36 // Author: Vladimir Ivanchenko 35 // 37 // 36 // Creation date: 07.05.2002 38 // Creation date: 07.05.2002 37 // 39 // 38 // Modifications: 40 // Modifications: 39 // 12.09.2004 Set low energy limit to 1 keV (V 41 // 12.09.2004 Set low energy limit to 1 keV (V.Ivanchenko) 40 // 25.01.2005 Add protection - min Charge 0.1 42 // 25.01.2005 Add protection - min Charge 0.1 eplus (V.Ivanchenko) 41 // 28.04.2006 Set upper energy limit to 50 MeV 43 // 28.04.2006 Set upper energy limit to 50 MeV (V.Ivanchenko) 42 // 23.05.2006 Set upper energy limit to Z*10 M 44 // 23.05.2006 Set upper energy limit to Z*10 MeV (V.Ivanchenko) 43 // 15.08.2006 Add protection for not defined m 45 // 15.08.2006 Add protection for not defined material (V.Ivanchenko) 44 // 27-09-2007 Use Fermi energy from material, 46 // 27-09-2007 Use Fermi energy from material, optimazed formulas (V.Ivanchenko) 45 // 47 // 46 48 47 // ------------------------------------------- 49 // ------------------------------------------------------------------- 48 // 50 // 49 //....oooOO0OOooo........oooOO0OOooo........oo 51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 50 //....oooOO0OOooo........oooOO0OOooo........oo 52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 51 53 52 #include "G4ionEffectiveCharge.hh" 54 #include "G4ionEffectiveCharge.hh" 53 #include "G4PhysicalConstants.hh" << 54 #include "G4SystemOfUnits.hh" << 55 #include "G4UnitsTable.hh" 55 #include "G4UnitsTable.hh" >> 56 #include "G4ParticleDefinition.hh" 56 #include "G4Material.hh" 57 #include "G4Material.hh" 57 #include "G4NistManager.hh" << 58 #include "G4Log.hh" << 59 #include "G4Exp.hh" << 60 #include "G4Pow.hh" << 61 58 62 //....oooOO0OOooo........oooOO0OOooo........oo 59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 63 60 64 G4ionEffectiveCharge::G4ionEffectiveCharge() 61 G4ionEffectiveCharge::G4ionEffectiveCharge() 65 { 62 { 66 chargeCorrection = 1.0; 63 chargeCorrection = 1.0; 67 energyHighLimit = 20.0*CLHEP::MeV; << 64 energyHighLimit = 10.0*MeV; 68 energyLowLimit = 1.0*CLHEP::keV; << 65 energyLowLimit = 1.0*keV; 69 energyBohr = 25.*CLHEP::keV; << 66 energyBohr = 25.*keV; 70 massFactor = CLHEP::amu_c2/(CLHEP::pro << 67 massFactor = amu_c2/(proton_mass_c2*keV); 71 minCharge = 1.0; << 68 minCharge = 0.1; 72 lastKinEnergy = 0.0; << 73 effCharge = CLHEP::eplus; << 74 inveplus = 1.0/CLHEP::eplus; << 75 g4calc = G4Pow::GetInstance(); << 76 } 69 } 77 70 78 //....oooOO0OOooo........oooOO0OOooo........oo 71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 79 72 >> 73 G4ionEffectiveCharge::~G4ionEffectiveCharge() >> 74 {} >> 75 >> 76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 77 80 G4double G4ionEffectiveCharge::EffectiveCharge 78 G4double G4ionEffectiveCharge::EffectiveCharge(const G4ParticleDefinition* p, 81 79 const G4Material* material, 82 << 80 G4double kineticEnergy) 83 { 81 { 84 if(p == lastPart && material == lastMat && k << 82 G4double mass = p->GetPDGMass(); 85 return effCharge; << 83 G4double charge = p->GetPDGCharge(); >> 84 G4double Zi = charge/eplus; 86 85 87 lastPart = p; << 88 lastMat = material; << 89 lastKinEnergy = kineticEnergy; << 90 << 91 G4double mass = p->GetPDGMass(); << 92 effCharge = p->GetPDGCharge(); << 93 G4int Zi = G4lrint(effCharge*inveplus); << 94 chargeCorrection = 1.0; 86 chargeCorrection = 1.0; 95 if(Zi <= 1) { return effCharge; } << 96 87 97 // The aproximation of ion effective charge 88 // The aproximation of ion effective charge from: 98 // J.F.Ziegler, J.P. Biersack, U. Littmark 89 // J.F.Ziegler, J.P. Biersack, U. Littmark 99 // The Stopping and Range of Ions in Matter, 90 // The Stopping and Range of Ions in Matter, 100 // Vol.1, Pergamon Press, 1985 91 // Vol.1, Pergamon Press, 1985 101 // Fast ions or hadrons 92 // Fast ions or hadrons 102 G4double reducedEnergy = kineticEnergy * CLH << 93 G4double reducedEnergy = kineticEnergy * proton_mass_c2/mass ; >> 94 if( reducedEnergy > Zi*energyHighLimit || Zi < 1.5 || !material) return charge; 103 95 104 //G4cout << "e= " << reducedEnergy << " Zi= << 96 static G4double c[6] = {0.2865, 0.1266, -0.001429, 105 //<< material->GetName() << G4endl; << 97 0.02402,-0.01135, 0.001475} ; 106 98 107 if(reducedEnergy > effCharge*energyHighLimit << 99 G4double z = material->GetIonisation()->GetZeffective(); 108 return effCharge; << 109 } << 110 G4double z = material->GetIonisation()->GetZ << 111 reducedEnergy = std::max(reducedEnergy,energ 100 reducedEnergy = std::max(reducedEnergy,energyLowLimit); >> 101 G4double q; 112 102 113 // Helium ion case 103 // Helium ion case 114 if( Zi <= 2 ) { << 104 if( Zi < 2.5 ) { 115 105 116 static const G4double c[6] = << 106 G4double Q = std::max(0.0,std::log(reducedEnergy*massFactor)); 117 {0.2865,0.1266,-0.001429,0.02402,-0.0113 << 118 << 119 G4double Q = std::max(0.0,G4Log(reducedEne << 120 G4double x = c[0]; 107 G4double x = c[0]; 121 G4double y = 1.0; 108 G4double y = 1.0; 122 for (G4int i=1; i<6; ++i) { << 109 for (G4int i=1; i<6; i++) { 123 y *= Q; 110 y *= Q; 124 x += y * c[i] ; 111 x += y * c[i] ; 125 } 112 } 126 G4double ex = (x < 0.2) ? x * (1 - 0.5*x) << 113 G4double ex; >> 114 if(x < 0.2) ex = x * (1 - 0.5*x); >> 115 else ex = 1. - std::exp(-x); 127 116 128 G4double tq = 7.6 - Q; 117 G4double tq = 7.6 - Q; 129 G4double tq2= tq*tq; 118 G4double tq2= tq*tq; 130 G4double tt = ( 0.007 + 0.00005 * z ); 119 G4double tt = ( 0.007 + 0.00005 * z ); 131 if(tq2 < 0.2) { tt *= (1.0 - tq2 + 0.5*tq2 << 120 if(tq2 < 0.2) tt *= (1.0 - tq2 + 0.5*tq2*tq2); 132 else { tt *= G4Exp(-tq2); } << 121 else tt *= std::exp(-tq2); 133 << 122 q = (1.0 + tt) * std::sqrt(ex); 134 effCharge *= (1.0 + tt) * std::sqrt(ex); << 135 123 136 // Heavy ion case 124 // Heavy ion case 137 } else { 125 } else { 138 126 139 G4double zi13 = g4calc->Z13(Zi); << 127 G4double z23 = std::pow(z, 0.666666); >> 128 G4double zi13 = std::pow(Zi, 0.333333); 140 G4double zi23 = zi13*zi13; 129 G4double zi23 = zi13*zi13; >> 130 G4double e = std::max(reducedEnergy,energyBohr/z23); 141 131 142 // v1 is ion velocity in vF unit 132 // v1 is ion velocity in vF unit 143 G4double eF = material->GetIonisation()- 133 G4double eF = material->GetIonisation()->GetFermiEnergy(); 144 G4double v1sq = reducedEnergy/eF; << 134 G4double v1sq = e/eF; 145 G4double vFsq = eF/energyBohr; 135 G4double vFsq = eF/energyBohr; 146 G4double vF = std::sqrt(vFsq); << 136 G4double vF = std::sqrt(vFsq); >> 137 >> 138 G4double y ; >> 139 >> 140 // Faster than Fermi velocity >> 141 if ( v1sq > 1.0 ) { >> 142 y = vF * std::sqrt(v1sq) * ( 1.0 + 0.2/v1sq ) / zi23 ; 147 143 148 G4double y = ( v1sq > 1.0 ) << 149 // Faster than Fermi velocity << 150 ? vF * std::sqrt(v1sq) * ( 1.0 + 0.2/v1s << 151 // Slower than Fermi velocity 144 // Slower than Fermi velocity 152 : 0.692308 * vF * (1.0 + 0.666666*v1sq + << 145 } else { >> 146 y = 0.692308 * vF * (1.0 + 0.666666*v1sq + v1sq*v1sq/15.0) / zi23 ; >> 147 } >> 148 >> 149 G4double y3 = std::pow(y, 0.3) ; >> 150 // G4cout << "y= " << y << " y3= " << y3 << " v1= " << v1 << " vF= " << vF << G4endl; >> 151 q = 1.0 - std::exp( 0.803*y3 - 1.3167*y3*y3 - 0.38157*y - 0.008983*y*y ) ; >> 152 >> 153 // q = 1.0 - std::exp(-0.95*std::sqrt(reducedEnergy/energyBohr)/zi23); >> 154 >> 155 G4double qmin = minCharge/Zi; 153 156 154 G4double y3 = G4Exp(0.3*G4Log(y)); << 157 if(q < qmin) q = qmin; 155 // G4cout<<"y= "<<y<<" y3= "<<y3<<" v1= "< << 156 G4double q = std::max(1.0 - G4Exp( 0.803*y << 157 - 0.00898 << 158 158 159 // compute charge correction << 159 G4double tq = 7.6 - std::log(reducedEnergy/keV); 160 G4double tq = 7.6 - G4Log(reducedEnergy/CL << 161 G4double tq2= tq*tq; 160 G4double tq2= tq*tq; 162 G4double sq = 1.0 + ( 0.18 + 0.0015 * z )* << 161 G4double sq = ( 0.18 + 0.0015 * z ) / (Zi*Zi); >> 162 if(tq2 < 0.2) sq *= (1.0 - tq2 + 0.5*tq2*tq2); >> 163 else sq *= std::exp(-tq2); >> 164 sq += 1.0; 163 // G4cout << "sq= " << sq << G4endl; 165 // G4cout << "sq= " << sq << G4endl; 164 166 165 // Screen length according to 167 // Screen length according to 166 // J.F.Ziegler and J.M.Manoyan, The stoppi 168 // J.F.Ziegler and J.M.Manoyan, The stopping of ions in compaunds, 167 // Nucl. Inst. & Meth. in Phys. Res. B35 ( 169 // Nucl. Inst. & Meth. in Phys. Res. B35 (1988) 215-228. 168 170 169 G4double lambda = 10.0 * vF *g4calc->A23(1 << 171 G4double lambda = 10.0 * vF / (zi13 * (6.0 + q)); >> 172 if(q < 0.2) lambda *= (1.0 - 0.666666*q - q*q/9.0); >> 173 else lambda *= std::pow(1.0-q, 0.666666); >> 174 170 G4double lambda2 = lambda*lambda; 175 G4double lambda2 = lambda*lambda; 171 G4double xx = (0.5/q - 0.5)*G4Log(1.0 + la << 172 176 173 effCharge *= q; << 177 G4double xx = (0.5/q - 0.5)/vFsq; >> 178 if(lambda2 < 0.2) xx *= lambda2*(1.0 - 0.5*lambda2); >> 179 else xx *= std::log(1.0 + lambda2); >> 180 174 chargeCorrection = sq * (1.0 + xx); 181 chargeCorrection = sq * (1.0 + xx); 175 } 182 } 176 // G4cout << "G4ionEffectiveCharge: charge= 183 // G4cout << "G4ionEffectiveCharge: charge= " << charge << " q= " << q 177 // << " chargeCor= " << chargeCorrec 184 // << " chargeCor= " << chargeCorrection 178 // << " e(MeV)= " << kineticEnergy << 185 // << " e(MeV)= " << kineticEnergy/MeV << G4endl; 179 return effCharge; << 186 return q*charge; 180 } 187 } 181 188 182 //....oooOO0OOooo........oooOO0OOooo........oo 189 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 190 >> 191 183 192