Import Geant4 7.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 11:11:55 +02:00
parent e083ffb441
commit 516dbf1a58
5914 changed files with 202605 additions and 71141 deletions
@@ -21,7 +21,7 @@
// ********************************************************************
//
//
// GEANT4 tag $Name: gcross-V05-02-01 $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
//
//
// GEANT4 physics class: G4ElectroNuclearCrossSection -- header file
@@ -145,10 +145,10 @@ inline G4double G4ElectroNuclearCrossSection::DFun(G4double x)// Parametrization
static const G4double pos=16.5; // HE Pomeron shift
static const G4double reg=.11; // HE Reggeon slope
static const G4double mel=0.5109989; // Mass of an electron in MeV
static const G4double lmel=log(mel); // Log of an electron mass
G4double y=exp(x-lastG-lmel); // y for the x
static const G4double lmel=std::log(mel); // Log of an electron mass
G4double y=std::exp(x-lastG-lmel); // y for the x
G4double flux=lastG*(2.-y*(2.-y))-1.; // flux factor
return (poc*(x-pos)+shd*exp(-reg*x))*flux;
return (poc*(x-pos)+shd*std::exp(-reg*x))*flux;
}
inline G4double G4ElectroNuclearCrossSection::Fun(G4double x) // Integrated PhoNuc cross section
@@ -161,44 +161,44 @@ inline G4double G4ElectroNuclearCrossSection::Fun(G4double x) // Integrated PhoN
inline G4double G4ElectroNuclearCrossSection::HighEnergyJ1(G4double lEn)
{
static const G4double le=log(50000.); // log(E0)
static const G4double le2=le*le; // log(E0)^2
static const G4double le=std::log(50000.); // std::log(E0)
static const G4double le2=le*le; // std::log(E0)^2
static const G4double a=.0375; // a
static const G4double ha=a*.5; // a/2
static const G4double ab=a*16.5; // a*b
static const G4double d=0.11; // d
static const G4double cd=1.0734/d; // c/d
static const G4double ele=exp(-d*le); // E0^(-d)
return ha*(lEn*lEn-le2)-ab*(lEn-le)-cd*(exp(-d*lEn)-ele);
static const G4double ele=std::exp(-d*le); // E0^(-d)
return ha*(lEn*lEn-le2)-ab*(lEn-le)-cd*(std::exp(-d*lEn)-ele);
}
inline G4double G4ElectroNuclearCrossSection::HighEnergyJ2(G4double lEn)
{
static const G4double e=50000.; // E0
static const G4double le=log(e); // log(E0)
static const G4double le1=(le-1.)*e; // (log(E0)-1)*E0
static const G4double le=std::log(e); // std::log(E0)
static const G4double le1=(le-1.)*e; // (std::log(E0)-1)*E0
static const G4double a=.0375; // a
static const G4double ab=a*16.5; // a*b
static const G4double d=1.-0.11; // 1-d
static const G4double cd=1.0734/d; // c/(1-d)
static const G4double ele=exp(d*le); // E0^(1-d)
G4double En=exp(lEn);
return a*((lEn-1.)*En-le1)-ab*(En-e)+cd*(exp(d*lEn)-ele);
static const G4double ele=std::exp(d*le); // E0^(1-d)
G4double En=std::exp(lEn);
return a*((lEn-1.)*En-le1)-ab*(En-e)+cd*(std::exp(d*lEn)-ele);
}
inline G4double G4ElectroNuclearCrossSection::HighEnergyJ3(G4double lEn)
{
static const G4double e=50000.; // E0
static const G4double le=log(e); // log(E0)
static const G4double le=std::log(e); // std::log(E0)
static const G4double e2=e*e; // E0^2
static const G4double leh=(le-.5)*e2; // (log(E0)-.5)*E0^2
static const G4double leh=(le-.5)*e2; // (std::log(E0)-.5)*E0^2
static const G4double ha=.0375*.5; // a/2
static const G4double hab=ha*16.5; // a*b/2
static const G4double d=2.-.11; // 2-d
static const G4double cd=1.0734/d; // c/(2-d)
static const G4double ele=exp(d*le); // E0^(2-d)
G4double lastE2=exp(lEn+lEn);
return ha*((lEn-.5)*lastE2-leh)-hab*(lastE2-e2)+cd*(exp(d*lEn)-ele);
static const G4double ele=std::exp(d*le); // E0^(2-d)
G4double lastE2=std::exp(lEn+lEn);
return ha*((lEn-.5)*lastE2-leh)-hab*(lastE2-e2)+cd*(std::exp(d*lEn)-ele);
}
#endif
@@ -21,7 +21,7 @@
// ********************************************************************
//
//
// GEANT4 tag $Name: gcross-V05-02-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
//
// GEANT4 Hadron physics class -- header file
@@ -21,7 +21,7 @@
// ********************************************************************
//
//
// GEANT4 tag $Name: gcross-V05-02-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
//
// GEANT4 physics class: G4PhotoNuclearCrossSection -- header file
@@ -72,25 +72,25 @@ class G4ProjectileFragmentCrossSection
inline G4double doit(G4double Ap, G4double Zp, G4double At, G4double Zt, G4double A, G4double Z)
{
// calculate mass yield
G4double Ap13 = pow(Ap, 1./3.);
G4double At13 = pow(At, 1./3.);
G4double Ap13 = std::pow(Ap, 1./3.);
G4double At13 = std::pow(At, 1./3.);
G4double S = p_S[2] * (At13 + Ap13 + p_S[1]);
// cout << "debug0 "<<S<<" "<<At13<<" "<<Ap13<<" "<<p_S[1]<<" "<<p_S[2]<<endl;
G4double p = exp(p_P[2]*Ap + p_P[1]);
G4double yield_a = p * S * exp(-p * (Ap - A));
G4double p = std::exp(p_P[2]*Ap + p_P[1]);
G4double yield_a = p * S * std::exp(-p * (Ap - A));
cout << "debug1 "<<yield_a<<endl;
// modification close to projectile
G4double f_mod_y=1.0;
if (A/Ap > corr_y[2])
{
f_mod_y=corr_y[1]*pow(A/Ap-corr_y[2], 2) + 1.0;
f_mod_y=corr_y[1]*std::pow(A/Ap-corr_y[2], 2) + 1.0;
}
yield_a= yield_a * f_mod_y;
cout << "debug1 "<<yield_a<<endl;
// calculate maximum of charge dispersion zprob
G4double zbeta = A/(1.98+0.0155*pow(A, (2./3.)));
G4double zbeta_p = Ap/(1.98+0.0155*pow(Ap, (2./3.)));
G4double zbeta = A/(1.98+0.0155*std::pow(A, (2./3.)));
G4double zbeta_p = Ap/(1.98+0.0155*std::pow(Ap, (2./3.)));
G4double delta;
if(A > p_Delta[4])
{
@@ -105,7 +105,7 @@ class G4ProjectileFragmentCrossSection
G4double f_mod=1.0;
if(A/Ap > corr_d[2])
{
f_mod = corr_d[1]*pow(A/Ap-corr_d[2], 2) + 1.0;
f_mod = corr_d[1]*std::pow(A/Ap-corr_d[2], 2) + 1.0;
}
delta = delta*f_mod;
G4double zprob = zbeta+delta;
@@ -114,13 +114,13 @@ class G4ProjectileFragmentCrossSection
G4double dq;
if((Zp-zbeta_p)>0)
{
dq = exp(p_mp[1] + G4double(A)/G4double(Ap)*p_mp[2]);
dq = std::exp(p_mp[1] + G4double(A)/G4double(Ap)*p_mp[2]);
cout << "dq "<<A<<" "<<Ap<<" "<<p_mp[1]
<<" "<<p_mp[2]<<" "<<dq<<" "<<p_mp[1] + A/Ap*p_mp[2]<<endl;
}
else
{
dq = p_mn[1]*pow(A/Ap, 2.0) + p_mn[2]*pow(A/Ap, 4.0);
dq = p_mn[1]*std::pow(A/Ap, 2.0) + p_mn[2]*std::pow(A/Ap, 4.0);
}
zprob = zprob + dq * (Zp-zbeta_p);
@@ -130,20 +130,20 @@ class G4ProjectileFragmentCrossSection
<<" "<<zbeta<<" "<<delta<<endl;
// calculate width parameter R
G4double r = exp(p_R[1] + p_R[2]*A);
G4double r = std::exp(p_R[1] + p_R[2]*A);
// modification close to projectile
f_mod=1.0;
if (A/Ap > corr_r[2])
{
f_mod = corr_r[1]*Ap*pow(A/Ap-corr_r[2], 4.0)+1.0;
f_mod = corr_r[1]*Ap*std::pow(A/Ap-corr_r[2], 4.0)+1.0;
}
r = r*f_mod;
// change width according to dev. from beta-stability
if ((Zp-zbeta_p) < 0.0)
{
r=r*(1.0-0.0833*abs(Zp-zbeta_p));
r=r*(1.0-0.0833*std::abs(Zp-zbeta_p));
}
// calculate slope parameters u_n, u_p
@@ -155,23 +155,23 @@ class G4ProjectileFragmentCrossSection
if((zprob-Z) > 0)
{
// neutron-rich
expo = -r*pow(abs(zprob-Z), u_n);
fract = exp(expo)*sqrt(r/3.14159);
expo = -r*std::pow(std::abs(zprob-Z), u_n);
fract = std::exp(expo)*std::sqrt(r/3.14159);
}
else
{
// proton-rich
expo = -r*pow(abs(zprob-Z), u_p);
fract = exp(expo)*sqrt(r/3.14159);
expo = -r*std::pow(std::abs(zprob-Z), u_p);
fract = std::exp(expo)*std::sqrt(r/3.14159);
cout << "1 "<<expo<<" "<<r<<" "<<zprob<<" "<<Z<<" "<<u_p<<endl;
// go to exponential slope
G4double dfdz = 1.2 + 0.647*pow(A/2.,0.3);
G4double z_exp = zprob + dfdz * log(10.) / (2.*r);
G4double dfdz = 1.2 + 0.647*std::pow(A/2.,0.3);
G4double z_exp = zprob + dfdz * std::log(10.) / (2.*r);
if( Z>z_exp )
{
expo = -r*pow(abs(zprob-z_exp), u_p);
fract = exp(expo)*sqrt(r/3.14159)
/ pow(pow(10, dfdz), Z-z_exp);
expo = -r*std::pow(std::abs(zprob-z_exp), u_p);
fract = std::exp(expo)*std::sqrt(r/3.14159)
/ std::pow(std::pow(10, dfdz), Z-z_exp);
}
}