Import Geant4 9.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:37:50 +02:00
parent a8e9364cea
commit 96c8bcd0af
6923 changed files with 198390 additions and 41849 deletions
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ionEffectiveCharge.cc,v 1.14 2006/08/15 16:21:39 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4ionEffectiveCharge.cc,v 1.17 2007/09/27 17:08:58 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
// -------------------------------------------------------------------
//
@@ -43,6 +43,7 @@
// 28.04.2006 Set upper energy limit to 50 MeV (V.Ivanchenko)
// 23.05.2006 Set upper energy limit to Z*10 MeV (V.Ivanchenko)
// 15.08.2006 Add protection for not defined material (V.Ivanchenko)
// 27-09-2007 Use Fermi energy from material, optimazed formulas (V.Ivanchenko)
//
// -------------------------------------------------------------------
@@ -92,70 +93,10 @@ G4double G4ionEffectiveCharge::EffectiveCharge(const G4ParticleDefinition* p,
G4double reducedEnergy = kineticEnergy * proton_mass_c2/mass ;
if( reducedEnergy > Zi*energyHighLimit || Zi < 1.5 || !material) return charge;
static G4double vFermi[92] = {
1.0309, 0.15976, 0.59782, 1.0781, 1.0486, 1.0, 1.058, 0.93942, 0.74562, 0.3424,
0.45259, 0.71074, 0.90519, 0.97411, 0.97184, 0.89852, 0.70827, 0.39816, 0.36552, 0.62712,
0.81707, 0.9943, 1.1423, 1.2381, 1.1222, 0.92705, 1.0047, 1.2, 1.0661, 0.97411,
0.84912, 0.95, 1.0903, 1.0429, 0.49715, 0.37755, 0.35211, 0.57801, 0.77773, 1.0207,
1.029, 1.2542, 1.122, 1.1241, 1.0882, 1.2709, 1.2542, 0.90094, 0.74093, 0.86054,
0.93155, 1.0047, 0.55379, 0.43289, 0.32636, 0.5131, 0.695, 0.72591, 0.71202, 0.67413,
0.71418, 0.71453, 0.5911, 0.70263, 0.68049, 0.68203, 0.68121, 0.68532, 0.68715, 0.61884,
0.71801, 0.83048, 1.1222, 1.2381, 1.045, 1.0733, 1.0953, 1.2381, 1.2879, 0.78654,
0.66401, 0.84912, 0.88433, 0.80746, 0.43357, 0.41923, 0.43638, 0.51464, 0.73087, 0.81065,
1.9578, 1.0257} ;
static G4double lFactor[92] = {
1.0, 1.0, 1.1, 1.06, 1.01, 1.03, 1.04, 0.99, 0.95, 0.9,
0.82, 0.81, 0.83, 0.88, 1.0, 0.95, 0.97, 0.99, 0.98, 0.97,
0.98, 0.97, 0.96, 0.93, 0.91, 0.9, 0.88, 0.9, 0.9, 0.9,
0.9, 0.85, 0.9, 0.9, 0.91, 0.92, 0.9, 0.9, 0.9, 0.9,
0.9, 0.88, 0.9, 0.88, 0.88, 0.9, 0.9, 0.88, 0.9, 0.9,
0.9, 0.9, 0.96, 1.2, 0.9, 0.88, 0.88, 0.85, 0.9, 0.9,
0.92, 0.95, 0.99, 1.03, 1.05, 1.07, 1.08, 1.1, 1.08, 1.08,
1.08, 1.08, 1.09, 1.09, 1.1, 1.11, 1.12, 1.13, 1.14, 1.15,
1.17, 1.2, 1.18, 1.17, 1.17, 1.16, 1.16, 1.16, 1.16, 1.16,
1.16, 1.16} ;
static G4double c[6] = {0.2865, 0.1266, -0.001429,
0.02402,-0.01135, 0.001475} ;
// get elements in the actual material,
const G4ElementVector* theElementVector = material->GetElementVector() ;
const G4double* theAtomicNumDensityVector =
material->GetAtomicNumDensityVector() ;
const G4int NumberOfElements = material->GetNumberOfElements() ;
// loop for the elements in the material
// to find out average values Z, vF, lF
G4double z = 0.0, vF = 0.0, lF = 0.0, norm = 0.0 ;
if( 1 == NumberOfElements ) {
z = material->GetZ() ;
G4int iz = G4int(z) - 1 ;
if(iz < 0) iz = 0 ;
else if(iz > 91) iz = 91 ;
vF = vFermi[iz] ;
lF = lFactor[iz] ;
} else {
for (G4int iel=0; iel<NumberOfElements; iel++)
{
const G4Element* element = (*theElementVector)[iel] ;
G4double z2 = element->GetZ() ;
const G4double weight = theAtomicNumDensityVector[iel] ;
norm += weight ;
z += z2 * weight ;
G4int iz = G4int(z2) - 1 ;
if(iz < 0) iz = 0 ;
else if(iz > 91) iz =91 ;
vF += vFermi[iz] * weight ;
lF += lFactor[iz] * weight ;
}
z /= norm ;
vF /= norm ;
lF /= norm ;
}
G4double z = material->GetIonisation()->GetZeffective();
reducedEnergy = std::max(reducedEnergy,energyLowLimit);
G4double q;
@@ -169,28 +110,40 @@ G4double G4ionEffectiveCharge::EffectiveCharge(const G4ParticleDefinition* p,
y *= Q;
x += y * c[i] ;
}
G4double ex;
if(x < 0.2) ex = x * (1 - 0.5*x);
else ex = 1. - std::exp(-x);
G4double tq = 7.6 - Q;
q = (1.0 + ( 0.007 + 0.00005 * z ) * std::exp( -tq*tq )) * std::sqrt(1.0 - std::exp(-x)) ;
G4double tq2= tq*tq;
G4double tt = ( 0.007 + 0.00005 * z );
if(tq2 < 0.2) tt *= (1.0 - tq2 + 0.5*tq2*tq2);
else tt *= std::exp(-tq2);
q = (1.0 + tt) * std::sqrt(ex);
// Heavy ion case
} else {
G4double z23 = std::pow(z, 0.666667);
G4double zi13 = std::pow(Zi, 0.33333);
G4double z23 = std::pow(z, 0.666666);
G4double zi13 = std::pow(Zi, 0.333333);
G4double zi23 = zi13*zi13;
G4double e = std::max(reducedEnergy,energyBohr/z23);
// v1 is ion velocity in vF unit
G4double v1 = std::sqrt( e / energyBohr )/ vF ;
G4double eF = material->GetIonisation()->GetFermiEnergy();
G4double v1sq = e/eF;
G4double vFsq = eF/energyBohr;
G4double vF = std::sqrt(vFsq);
G4double y ;
// Faster than Fermi velocity
if ( v1 > 1.0 ) {
y = vF * v1 * ( 1.0 + 0.2 / (v1*v1) ) / zi23 ;
if ( v1sq > 1.0 ) {
y = vF * std::sqrt(v1sq) * ( 1.0 + 0.2/v1sq ) / zi23 ;
// Slower than Fermi velocity
} else {
y = 0.6923 * vF * (1.0 + 2.0*v1*v1/3.0 + v1*v1*v1*v1/15.0) / zi23 ;
y = 0.6923 * vF * (1.0 + 0.666666*v1sq + v1sq*v1sq/15.0) / zi23 ;
}
G4double y3 = std::pow(y, 0.3) ;
@@ -204,16 +157,28 @@ G4double G4ionEffectiveCharge::EffectiveCharge(const G4ParticleDefinition* p,
if(q < qmin) q = qmin;
G4double tq = 7.6 - std::log(reducedEnergy/keV);
G4double sq = 1.0 + ( 0.18 + 0.0015 * z ) * std::exp( -tq*tq )/ (Zi*Zi);
G4double tq2= tq*tq;
G4double sq = ( 0.18 + 0.0015 * z ) / (Zi*Zi);
if(tq2 < 0.2) sq *= (1.0 - tq2 + 0.5*tq2*tq2);
else sq *= std::exp(-tq2);
sq += 1.0;
// G4cout << "sq= " << sq << G4endl;
// Screen length according to
// J.F.Ziegler and J.M.Manoyan, The stopping of ions in compaunds,
// Nucl. Inst. & Meth. in Phys. Res. B35 (1988) 215-228.
G4double lambda = 10.0 * vF * std::pow(1.0-q, 0.6667) / (zi13 * (6.0 + q)) ;
chargeCorrection = sq * (1.0 + (0.5/q - 0.5)*std::log(1.0 + lambda*lambda)/(vF*vF) );
G4double lambda = 10.0 * vF / (zi13 * (6.0 + q));
if(q < 0.2) lambda *= (1.0 - 0.666666*q - 0.444444*q*q);
else lambda *= std::pow(1.0-q, 0.666666);
G4double lambda2 = lambda*lambda;
G4double xx = (0.5/q - 0.5)/vFsq;
if(lambda2 < 0.2) xx *= lambda2*(1.0 - 0.5*lambda2);
else xx *= std::log(1.0 + lambda2);
chargeCorrection = sq * (1.0 + xx);
}
// G4cout << "G4ionEffectiveCharge: charge= " << charge << " q= " << q
// << " chargeCor= " << chargeCorrection