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
@@ -34,8 +34,8 @@
if(Nucleus == 208)
{ // R1 = 20.73; R2 = 15.74.
R1 = 4.1408*pow(static_cast<double>(Nucleus),0.3018);
R2 = 3.806*pow(Nucleus-10.068,0.2685);
R1 = 4.1408*std::pow(static_cast<double>(Nucleus),0.3018);
R2 = 3.806*std::pow(Nucleus-10.068,0.2685);
Pnucl = 0.9;
Aeff = 1.1;
R1 = 19.5;
@@ -78,10 +78,10 @@
}
else
{
R1 = 4.45*pow(Nucleus-1.0,0.309);
R1 = 4.45*std::pow(Nucleus-1.0,0.309);
if(Nucleus == 28)
R1 = 4.25*pow(Nucleus-1.0,0.309);
R2 = 2.3*pow(static_cast<double>(Nucleus),0.36);
R1 = 4.25*std::pow(Nucleus-1.0,0.309);
R2 = 2.3*std::pow(static_cast<double>(Nucleus),0.36);
Pnucl = 0.176+0.00167*Nucleus+
8.69E-6*Nucleus*Nucleus;
Aeff = 0.9;
@@ -163,15 +163,15 @@
MassH = aHadron->GetMass()/1000;
MassN = Nucleus*0.938;
S = 2*MassN*HadrEnergy+MassN*MassN+MassH*MassH;
EcmH = (S-MassN*MassN+MassH*MassH)/2/sqrt(S);
MomentumCMN = sqrt(EcmH*EcmH-MassH*MassH);
EcmH = (S-MassN*MassN+MassH*MassH)/2/std::sqrt(S);
MomentumCMN = std::sqrt(EcmH*EcmH-MassH*MassH);
G4double MbToB = 2.568; // from mb to GeV^-2
G4double Pi1 = 3.1416;
G4double Stot = HadrTot*MbToB; //In GeV-2
G4double Bhad = HadrSlope; //In GeV-2
G4double Asq = 1+HadrReIm*HadrReIm;
G4double Rho2 = sqrt(Asq);
G4double Rho2 = std::sqrt(Asq);
G4double Pnuclp = 0.001;
Pnuclp = Pnucl;
G4double R12 = R1*R1;
@@ -192,10 +192,10 @@
G4double R22Apd = 2/R22Ap;
G4double R12ApdR22Ap = 0.5*(R12Apd+R22Apd);
G4double DDSec1p = (DDSect2+DDSect3*log(1.06*2*HadrEnergy/R1/4));
G4double DDSec2p = (DDSect2+DDSect3*log(1.06*2*HadrEnergy/
sqrt((R12+R22)/2)/4));
G4double DDSec3p = (DDSect2+DDSect3*log(1.06*2*HadrEnergy/R2/4));
G4double DDSec1p = (DDSect2+DDSect3*std::log(1.06*2*HadrEnergy/R1/4));
G4double DDSec2p = (DDSect2+DDSect3*std::log(1.06*2*HadrEnergy/
std::sqrt((R12+R22)/2)/4));
G4double DDSec3p = (DDSect2+DDSect3*std::log(1.06*2*HadrEnergy/R2/4));
G4double Norm = (R12*R1-Pnucl*R22*R2)*Aeff;
G4double Normp = (R12*R1-Pnuclp*R22*R2)*Aeff;
@@ -204,7 +204,7 @@
G4double Unucl = Stot/2/Pi1/Norm*R13;
G4double UnuclScr = Stot/2/Pi1/Normp*R13Ap;
G4double SinFi = HadrReIm/Rho2;
G4double FiH = asin(SinFi);
G4double FiH = std::asin(SinFi);
G4double N = -1;
G4double N2 = R23/R13;
@@ -220,21 +220,21 @@
{
N = -N*Unucl*(Nucleus-i+1)/i*Rho2;
N4 = 1;
Prod1 = exp(-Q2/i*R12B/4)/i*R12B;
Prod1 = std::exp(-Q2/i*R12B/4)/i*R12B;
medTot = R12B/i;
for(G4int l=1; l<=i; l++)
{
exp1 = l/R22B+(i-l)/R12B;
N4 = -N4*(i-l+1)/l*N2;
Prod1 = Prod1+N4/exp1*exp(-Q2/exp1/4);
Prod1 = Prod1+N4/exp1*std::exp(-Q2/exp1/4);
medTot = medTot+N4/exp1;
} // end l
ReElasticAmpl0 = ReElasticAmpl0+Prod1*N*sin(FiH*i);
ImElasticAmpl0 = ImElasticAmpl0+Prod1*N*cos(FiH*i);
Tot1 = Tot1+medTot*N*cos(FiH*i);
if(abs(Prod1*N/ImElasticAmpl0) < 0.000001) break;
ReElasticAmpl0 = ReElasticAmpl0+Prod1*N*std::sin(FiH*i);
ImElasticAmpl0 = ImElasticAmpl0+Prod1*N*std::cos(FiH*i);
Tot1 = Tot1+medTot*N*std::cos(FiH*i);
if(std::abs(Prod1*N/ImElasticAmpl0) < 0.000001) break;
} // i
ImElasticAmpl0 = ImElasticAmpl0*Pi1/2.568; // The amplitude in mB
@@ -242,9 +242,9 @@
Tot1 = Tot1*Pi1*2.0/2.568;
G4double N1p = 1;
G4double Din1 = 0.5*(R13Ap*R13Ap*exp(-Q2/8*R12Ap)/2*R12Ap/2*DDSec1p-
2*R23Ap*R13Ap/2/R12ApdR22Ap*exp(-Q2/4/R12ApdR22Ap)*DDSec2p+
R23Ap*R23Ap/2*R22Ap/2*exp(-Q2/8*R22Ap)*DDSec3p); // at i=0
G4double Din1 = 0.5*(R13Ap*R13Ap*std::exp(-Q2/8*R12Ap)/2*R12Ap/2*DDSec1p-
2*R23Ap*R13Ap/2/R12ApdR22Ap*std::exp(-Q2/4/R12ApdR22Ap)*DDSec2p+
R23Ap*R23Ap/2*R22Ap/2*std::exp(-Q2/8*R22Ap)*DDSec3p); // at i=0
DTot1 = 0.5*(R13Ap*R13Ap/2*R12Ap/2*DDSec1p-
2*R23Ap*R13Ap/2/R12ApdR22Ap*DDSec2p+
@@ -279,9 +279,9 @@
exp3p = exp1+R22Apd;
Din2 = Din2 + N2p*BinCoeff*
(R13Ap*R13Ap/2/exp1p*exp(-Q2/4/exp1p)*DDSec1p-
2*R13Ap*R23Ap/2/exp2p*exp(-Q2/4/exp2p)*DDSec2p+
R23Ap*R23Ap/2/exp3p*exp(-Q2/4/exp3p)*DDSec3p);
(R13Ap*R13Ap/2/exp1p*std::exp(-Q2/4/exp1p)*DDSec1p-
2*R13Ap*R23Ap/2/exp2p*std::exp(-Q2/4/exp2p)*DDSec2p+
R23Ap*R23Ap/2/exp3p*std::exp(-Q2/4/exp3p)*DDSec3p);
DmedTot = DmedTot + N2p*BinCoeff*
(R13Ap*R13Ap/2/exp1p*DDSec1p-
@@ -291,9 +291,9 @@
N2p = -N2p*R23dR13;
} // l
Din1 = Din1+Din2*N1p*Mnoj[i]/(i+2)/(i+1)*cos(FiH*i);
DTot1 = DTot1+DmedTot*N1p*Mnoj[i]/(i+2)/(i+1)*cos(FiH*i);
if(abs(Din2*N1p/Din1) < 0.000001) break;
Din1 = Din1+Din2*N1p*Mnoj[i]/(i+2)/(i+1)*std::cos(FiH*i);
DTot1 = DTot1+DmedTot*N1p*Mnoj[i]/(i+2)/(i+1)*std::cos(FiH*i);
if(std::abs(Din2*N1p/Din1) < 0.000001) break;
} // i
Din1 = -1*Din1*Nucleus*(Nucleus-1)
@@ -87,7 +87,7 @@
for( ii = 0; ii<iPoE; ii++)
{
curE = Energies[ii]*dPower;
curP = sqrt(curE*curE-mHadr*mHadr); // MeV
curP = std::sqrt(curE*curE-mHadr*mHadr); // MeV
pTableE[ii+ik*iPoE] = curE;
inVector.setZ(curP); // MeV
innerHadron->SetMomentum(inVector);
@@ -210,7 +210,7 @@
iKindWork = 4;
// G4cout<<" R1 (1) "<<R1<<G4endl;
G4double nuclMass = (G4double) iNnucl;
R1 = 0.74*pow(nuclMass,0.3333)*5.0;
R1 = 0.74*std::pow(nuclMass,0.3333)*5.0;
maxQ2 = GetQ2limit(R1); // MeV^2
//G4cout<<" R1 (2) "<<R1<<G4endl;
@@ -234,7 +234,7 @@
for(ik=0; ik<AreaNumb; ik++)
{
dPower = pow(10.0,ik);
dPower = std::pow(10.0,ik);
for(kk=0; kk<iPoE; kk++)
{
@@ -508,14 +508,14 @@
G4double invS = sqrMass+2*inEnHadr*MassNucl; // MeV^2
G4double invU = 2*sqrMass-invS+ranQ2; // MeV^2
G4double outEnHadr = (sqrMass-invU)/2/MassNucl; // MeV
G4double outMomHdr = sqrt(outEnHadr*outEnHadr- // MeV
G4double outMomHdr = std::sqrt(outEnHadr*outEnHadr- // MeV
MassHadr*MassHadr);
G4double cosHadr = (-ranQ2-2*MassHadr*MassHadr+
2*inEnHadr*outEnHadr)/2
/inLabMom/outMomHdr;
//---------------- For final state of nucleus -----------------
G4double outEnNucl = (2*MassNucl*MassNucl+ranQ2)/2/MassNucl;
G4double outMomNcl = sqrt(outEnNucl*outEnNucl- // MeV
G4double outMomNcl = std::sqrt(outEnNucl*outEnNucl- // MeV
MassNucl*MassNucl);
G4double cosNucl = (invU-sqrMass+2*inEnHadr*outEnNucl)
/2/inLabMom/outMomNcl;
@@ -527,14 +527,14 @@
G4double NucMomHdrSys[3];
G4double NucMomOldSys[3];
// ------------ The hadron angles in its own system ------------
G4double sinHadr = sqrt(1-cosHadr*cosHadr);
G4double sinFiHadr = sin(ranFi);
G4double cosFiHadr = cos(ranFi);
G4double sinHadr = std::sqrt(1-cosHadr*cosHadr);
G4double sinFiHadr = std::sin(ranFi);
G4double cosFiHadr = std::cos(ranFi);
// ---- The unit vector of a hadron momentum in its own system ---
NewMomHdrSys[0] = sinHadr*cosFiHadr;
NewMomHdrSys[1] = sinHadr*sinFiHadr;
NewMomHdrSys[2] = cosHadr;
G4double sinNucl = sqrt(1-cosNucl*cosNucl);
G4double sinNucl = std::sqrt(1-cosNucl*cosNucl);
// ----------- The unit vector of a nucleus momentum -----------
NucMomHdrSys[0] = -sinNucl*cosFiHadr;
NucMomHdrSys[1] = -sinNucl*sinFiHadr;
@@ -552,7 +552,7 @@
}
else
{
sinTet = sqrt(1-cosTet*cosTet);
sinTet = std::sqrt(1-cosTet*cosTet);
sinFi = aParticle->GetMomentumDirection().y()/
sinTet;
cosFi = aParticle->GetMomentumDirection().x()/
@@ -611,16 +611,16 @@
if(iContr == 137)
{
G4cout<<" HadrEn from Mom. "<<sqrt(hadrMass*hadrMass+pxnew*pxnew+
G4cout<<" HadrEn from Mom. "<<std::sqrt(hadrMass*hadrMass+pxnew*pxnew+
pynew*pynew+pznew*pznew)<<G4endl;
G4cout<<G4endl<<" Q2 "<< ranQ2<<" Hdr Mom Tet "<<outMomHdr
<<" "<< acos(cosHadr)*180/3.1416
<<" Nucl Mom Tet "<<sqrt(pow(NucMomOldSys[0],2)+
pow(NucMomOldSys[1],2)+
pow(NucMomOldSys[2],2))
<<" "<< std::acos(cosHadr)*180/3.1416
<<" Nucl Mom Tet "<<std::sqrt(std::pow(NucMomOldSys[0],2)+
std::pow(NucMomOldSys[1],2)+
std::pow(NucMomOldSys[2],2))
*outMomNcl<<" "
<<acos(cosNucl)*180/3.1416<<G4endl<<G4endl;
<<std::acos(cosNucl)*180/3.1416<<G4endl<<G4endl;
G4cout<<" HadronEn "<<outEnHadr<<G4endl;
G4cout<<" Rotation: old UnitVec "
<<NewMomHdrSys[0]<<" "<<NewMomHdrSys[1]<<" "
@@ -661,7 +661,7 @@ G4cout<<G4endl<<" Q2 "<< ranQ2<<" Hdr Mom Tet "<<outMomHdr
<<SecPartNuc->GetDefinition()->GetParticleName()<<G4endl;
G4ThreeVector outVectorN = SecPartNuc->GetMomentum();
// G4double outENucl = SecPartNuc->GetTotalEnergy();
// G4double outPNucl = sqrt(outENucl*outENucl-
// G4double outPNucl = std::sqrt(outENucl*outENucl-
// 938.27*938.27*MassNucl*MassNucl);
// G4double secEnergyNucl = SecPartNuc->GetKineticEnergy();
G4cout<<"----------- End Applay ------------"<<G4endl<<G4endl;
@@ -871,7 +871,7 @@ void G4ElasticHadrNucleusHE::ArrayForHeavy(
G4double Stot = HadrTot*MbToB; // Gev^-2
G4double Bhad = HadrSlope; // GeV^-2
G4double Asq = 1+HadrReIm*HadrReIm;
G4double Rho2 = sqrt(Asq);
G4double Rho2 = std::sqrt(Asq);
G4double R12 = R1*R1;
G4double R22 = R2*R2;
@@ -895,17 +895,17 @@ void G4ElasticHadrNucleusHE::ArrayForHeavy(
G4double R23 = Pnucl*R22*R2/R22B;
G4double Unucl = Stot/2/Pi1/Norm*R13;
//// G4double Unclprod = Stot/2/Pi1/NormP*R13Ap;
G4double FiH = asin(HadrReIm/Rho2);
G4double FiH = std::asin(HadrReIm/Rho2);
G4double NN2 = R23/R13;
/// G4double DDSec1p = (DDSect2+
/// DDSect3*log(1.06*2*Ehad/R1/4));
/// DDSect3*std::log(1.06*2*Ehad/R1/4));
/// G4double DDSec2p = (DDSect2+
/// DDSect3*log(1.06*2*Ehad/sqrt((R12+R22)/2)/4));
/// DDSect3*std::log(1.06*2*Ehad/std::sqrt((R12+R22)/2)/4));
/// G4double DDSec3p = (DDSect2+
/// DDSect3*log(1.06*2*Ehad/R2/4));
/// DDSect3*std::log(1.06*2*Ehad/R2/4));
/// G4double R12ApdR22Ap = 0.5*(R12Apd+R22Apd);
@@ -933,7 +933,7 @@ void G4ElasticHadrNucleusHE::ArrayForHeavy(
for(G4int i2 = 1; i2<=Nucleus; i2++) ////+++++++++ i2
{
N2 = -N2*Unucl*(Nucleus-i2+1)/i2*Rho2;
G4double Prod2 = 0; //exp(-Q2/i2*R12B/4)/i2*R12B;
G4double Prod2 = 0; //std::exp(-Q2/i2*R12B/4)/i2*R12B;
G4double N5 = -1/NN2;
for(G4int m2=0; m2<= i2; m2++) ////+++++++++ m2
@@ -948,7 +948,7 @@ void G4ElasticHadrNucleusHE::ArrayForHeavy(
exp1 = m1/R22B+(i1-m1)/R12B;
N4 = -N4*NN2;
Prod3 = Prod3+N4/exp1/exp2*
(1-exp(-Q2*(1/exp1+1/exp2)/4))/
(1-std::exp(-Q2*(1/exp1+1/exp2)/4))/
(1/exp1+1/exp2)*4*
Factorials1[i1]/
Factorials1[m1]/
@@ -963,14 +963,14 @@ void G4ElasticHadrNucleusHE::ArrayForHeavy(
Factorials1[i2-m2];
} // m2
Prod1 = Prod1 + Prod2*N2*cos(FiH*(i1-i2));
Tot0 = Tot0 + Prod2*N2*sin(FiH*(i1-i2));
if (abs(Prod2*N2/Prod1)<1e-6) break;
Prod1 = Prod1 + Prod2*N2*std::cos(FiH*(i1-i2));
Tot0 = Tot0 + Prod2*N2*std::sin(FiH*(i1-i2));
if (std::abs(Prod2*N2/Prod1)<1e-6) break;
} // i2
// ImDistr = Tot0 + Tot0*N1;
Prod0 = Prod0 + Prod1*N1;
if(abs(N1*Prod1/Prod0) < 1e-6) break;
if(std::abs(N1*Prod1/Prod0) < 1e-6) break;
} // i1
Prod0 = Prod0*Pi1/2.568/4; // This is in mb
@@ -994,7 +994,7 @@ G4double G4ElasticHadrNucleusHE::InterPol(
G4double F32 = X3*X3;
G4double D0 = F12*X2+X1*F32+X3*F22-F32*X2-F22*X1-F12*X3;
if(abs(D0) < 1e-8 || D0 == 0)
if(std::abs(D0) < 1e-8 || D0 == 0)
ranQ2 = (Y2+(X-X2)*(Y3-Y2) /(X3-X2)); // MeV^2
else {
@@ -32,7 +32,7 @@
G4ParticleDefinition * dHadron = aHadron->GetDefinition();
G4int iHadron;
G4int iHadron=-1; // dummy value to shut off compiler warning
if(dHadron == G4Proton::Proton() ||
dHadron == G4Neutron::Neutron() ||
@@ -69,9 +69,9 @@
G4double mHadr = aHadron->GetMass()/1000.; // In GeV
G4double HadrEnergy = aHadron->GetTotalEnergy()/1000.; // In GeV
G4double sHadr = 2*HadrEnergy*0.938+0.938*0.938+mHadr*mHadr;
G4double sqrS = sqrt(sHadr);
G4double sqrS = std::sqrt(sHadr);
G4double Ecm = (sHadr-mHadr*mHadr+0.938*.938)/2/sqrS;
MomentumCM = sqrt(Ecm*Ecm-0.938*0.938);
MomentumCM = std::sqrt(Ecm*Ecm-0.938*0.938);
if(HadrEnergy<1.0)
{
@@ -88,10 +88,10 @@
if(HadrEnergy<40)
Delta = 0.916+0.0021*HadrEnergy;
HadrTot = 5.2+5.2*log(HadrEnergy)
+51*pow(HadrEnergy,-0.35); // mb
HadrSlope = 6.44+0.88*log(sHadr)-1; // GeV-2
HadrReIm = 0.13*log(sHadr/350)*pow(sHadr,-0.18);
HadrTot = 5.2+5.2*std::log(HadrEnergy)
+51*std::pow(HadrEnergy,-0.35); // mb
HadrSlope = 6.44+0.88*std::log(sHadr)-1; // GeV-2
HadrReIm = 0.13*std::log(sHadr/350)*std::pow(sHadr,-0.18);
DDSect2 = 11; //mb*GeV-2
DDSect3 = 3; //mb*GeV-2
@@ -123,14 +123,14 @@
case 1: // antiproton
sqrS = sqrt(sHadr);
HadrTot = 5.2+5.2*log(HadrEnergy)
+123.2*pow(HadrEnergy,-0.5); // mb
HadrSlope = 8.32+0.57*log(sHadr); //GeV-2
sqrS = std::sqrt(sHadr);
HadrTot = 5.2+5.2*std::log(HadrEnergy)
+123.2*std::pow(HadrEnergy,-0.5); // mb
HadrSlope = 8.32+0.57*std::log(sHadr); //GeV-2
if(HadrEnergy<1000)
HadrReIm =0.06*(sqrS-2.236)*(sqrS-14.14)*pow(sHadr,-0.8);
HadrReIm =0.06*(sqrS-2.236)*(sqrS-14.14)*std::pow(sHadr,-0.8);
else
HadrReIm = 0.6*log(sHadr/350)*pow(sHadr,-0.25);
HadrReIm = 0.6*std::log(sHadr/350)*std::pow(sHadr,-0.25);
DDSect2 = 11; //mb*GeV-2
DDSect3 = 3; //mb*GeV-2
@@ -163,45 +163,45 @@
case 2: // pi plus
HadrTot = 10.6+2.*log(HadrEnergy)+
25*pow(HadrEnergy,-0.43); // mb
HadrSlope = 7.28+0.245*log(sHadr); //GeV-2
HadrReIm = 0.2*log(sHadr/100)*pow(sHadr,-0.15);
HadrTot = 10.6+2.*std::log(HadrEnergy)+
25*std::pow(HadrEnergy,-0.43); // mb
HadrSlope = 7.28+0.245*std::log(sHadr); //GeV-2
HadrReIm = 0.2*std::log(sHadr/100)*std::pow(sHadr,-0.15);
DDSect2 = 4.6; //mb*GeV-2
DDSect3 = 1.33; //mb*GeV-2
break;
case 3: // pi minus
HadrTot = 10.6+2*log(HadrEnergy)+
30*pow(HadrEnergy,-0.43); // mb
HadrSlope = 7.28+0.245*log(sHadr); // GeV-2
HadrReIm = 0.2*log(sHadr/100)*pow(sHadr,-0.15);
HadrTot = 10.6+2*std::log(HadrEnergy)+
30*std::pow(HadrEnergy,-0.43); // mb
HadrSlope = 7.28+0.245*std::log(sHadr); // GeV-2
HadrReIm = 0.2*std::log(sHadr/100)*std::pow(sHadr,-0.15);
DDSect2 = 4.6; //mb*GeV-2
DDSect3 = 1.33; //mb*GeV-2
break;
case 4: // K plus
HadrTot = 10.6+1.8*log(HadrEnergy)+
9.0*pow(HadrEnergy,-0.55); // mb
HadrTot = 10.6+1.8*std::log(HadrEnergy)+
9.0*std::pow(HadrEnergy,-0.55); // mb
if(HadrEnergy>100) HadrSlope = 15.0;
else
HadrSlope = 5.28+1.76*log(sHadr)-
2.84*pow(sHadr,-0.5); // GeV-2
HadrReIm = 0.4*(sHadr-20)*(sHadr-150)*pow(sHadr+50,-2.1);
HadrSlope = 5.28+1.76*std::log(sHadr)-
2.84*std::pow(sHadr,-0.5); // GeV-2
HadrReIm = 0.4*(sHadr-20)*(sHadr-150)*std::pow(sHadr+50,-2.1);
DDSect2 = 3.5; //mb*GeV-2
DDSect3 = 1.03; //mb*GeV-2
break;
case 5: // K minus
HadrTot = 10+1.8*log(HadrEnergy)
+25*pow(HadrEnergy,-0.5); // mb
HadrSlope = 6.98+0.127*log(sHadr); // GeV-2
HadrTot = 10+1.8*std::log(HadrEnergy)
+25*std::pow(HadrEnergy,-0.5); // mb
HadrSlope = 6.98+0.127*std::log(sHadr); // GeV-2
// if(HadrEnergy<8) HadrReIm = 0.7;
// else
HadrReIm = 0.4*(sHadr-20)*(sHadr-20)*pow(sHadr+50,-2.1);
HadrReIm = 0.4*(sHadr-20)*(sHadr-20)*std::pow(sHadr+50,-2.1);
DDSect2 = 3.5; //mb*GeV-2
DDSect3 = 1.03; //mb*GeV-2
break;
@@ -55,16 +55,16 @@
Bhad = HadrSlope; //{In GeV-2}
Asq = 1+HadrReIm*HadrReIm;
R0 = sqrt(0.99); //{ This is fermi}
if (Anucleus >10) R0 = sqrt(0.84);
if (Anucleus >20) R0 = sqrt((35.34+0.5*Anucleus)
R0 = std::sqrt(0.99); //{ This is fermi}
if (Anucleus >10) R0 = std::sqrt(0.84);
if (Anucleus >20) R0 = std::sqrt((35.34+0.5*Anucleus)
/(40.97+Anucleus));
if (Anucleus == 16) R0 = sqrt(0.75);
if (Anucleus == 58) R0 = sqrt(0.6);
if (Anucleus == 16) R0 = std::sqrt(0.75);
if (Anucleus == 58) R0 = std::sqrt(0.6);
// R0 = sqrt(0.64);
// R0 = std::sqrt(0.64);
Rnucl = R0*pow(static_cast<double>(Anucleus),0.3333); //{In Fermi }
Rnucl = R0*std::pow(static_cast<double>(Anucleus),0.3333); //{In Fermi }
if(Anucleus == 4) Rnucl = 1.2;
@@ -107,7 +107,7 @@
// Inel2 = Inel2+Inel1*N3;
Prod0 = Prod0+Prod1*N3;
if(abs(N1/i/Inel0) < 0.0001) break;
if(std::abs(N1/i/Inel0) < 0.0001) break;
} // i
Tot0 = Tot0*HadrTot;
@@ -117,17 +117,17 @@
Tot00 = Tot0;
ak = (Rnuc2*2*Pi1/Stot);
G4double DDSect1 = (DDSect2+DDSect3*log(1.06*2*HadrEnergy
/Rnucl/sqrt(25.68)/4));
G4double DDSect1 = (DDSect2+DDSect3*std::log(1.06*2*HadrEnergy
/Rnucl/std::sqrt(25.68)/4));
Dtot = 8*Pi1*ak/HadrTot*(1-(1+Anucleus/ak)
*exp(-Anucleus/ak))*DDSect1/MbToB;
*std::exp(-Anucleus/ak))*DDSect1/MbToB;
DTot00 = Dtot;
bk = (1-1/ak)/Stot/(1-1/ak/4);
bd = bk*bk*DDSect1*(1-(1+Anucleus/ak*(1-1/ak/4))*
exp(-Anucleus/ak*(1-1/4/ak)))*Rnuc2;
std::exp(-Anucleus/ak*(1-1/4/ak)))*Rnuc2;
Dprod = bd*4*Pi1*Pi1*MbToB;
@@ -90,7 +90,7 @@ G4LEnp::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
//
E += G4Proton::Proton()->GetPDGMass();
G4double E02 = E*E - P*P;
E0 = sqrt(abs(E02));
E0 = std::sqrt(std::abs(E02));
if (E02 < 0)E0 *= -1;
Q += Z;
G4cout << "G4LEnp:ApplyYourself: total:" << G4endl;
@@ -112,7 +112,7 @@ G4LEnp::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
je1 = midBin;
} while (je2 - je1 > 1);
// G4int j;
//abs(ek-elab[je1]) < abs(ek-elab[je2]) ? j = je1 : j = je2;
//std::abs(ek-elab[je1]) < std::abs(ek-elab[je2]) ? j = je1 : j = je2;
G4double delab = elab[je2] - elab[je1];
// Sample the angle
@@ -167,7 +167,7 @@ G4LEnp::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
G4double theta = (0.5 + kint)*pi/180.;
// G4int k;
//abs(sample-sig[j][ke1]) < abs(sample-sig[j][ke2]) ? k = ke1 : k = ke2;
//std::abs(sample-sig[j][ke1]) < std::abs(sample-sig[j][ke2]) ? k = ke1 : k = ke2;
// G4double theta = (0.5 + k)*pi/180.;
if (verboseLevel > 1) {
@@ -185,15 +185,15 @@ G4LEnp::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
G4double E2 = targetParticle->GetTotalEnergy();
G4double M2 = targetParticle->GetDefinition()->GetPDGMass();
G4double totalEnergy = E1 + E2;
G4double pseudoMass = sqrt(totalEnergy*totalEnergy - P*P);
// pseudoMass also = sqrt(M1*M1 + M2*M2 + 2*M2*E1)
G4double pseudoMass = std::sqrt(totalEnergy*totalEnergy - P*P);
// pseudoMass also = std::sqrt(M1*M1 + M2*M2 + 2*M2*E1)
// Transform into centre of mass system
G4double px = (M2/pseudoMass)*Px;
G4double py = (M2/pseudoMass)*Py;
G4double pz = (M2/pseudoMass)*Pz;
G4double p = sqrt(px*px + py*py + pz*pz);
G4double p = std::sqrt(px*px + py*py + pz*pz);
if (verboseLevel > 1) {
G4cout << " E1, M1 (GeV) " << E1/GeV << " " << M1/GeV << G4endl;
@@ -204,19 +204,19 @@ G4LEnp::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
// First scatter w.r.t. Z axis
G4double phi = G4UniformRand()*twopi;
G4double pxnew = p*sin(theta)*cos(phi);
G4double pynew = p*sin(theta)*sin(phi);
G4double pznew = p*cos(theta);
G4double pxnew = p*std::sin(theta)*std::cos(phi);
G4double pynew = p*std::sin(theta)*std::sin(phi);
G4double pznew = p*std::cos(theta);
// Rotate according to the direction of the incident particle
if (px*px + py*py > 0) {
G4double cost, sint, ph, cosp, sinp;
cost = pz/p;
sint = (sqrt(abs((1-cost)*(1+cost))) + sqrt(px*px+py*py)/p)/2;
sint = (std::sqrt(std::abs((1-cost)*(1+cost))) + std::sqrt(px*px+py*py)/p)/2;
py < 0 ? ph = 3*halfpi : ph = halfpi;
if (abs(px) > 0.000001*GeV) ph = atan2(py,px);
cosp = cos(ph);
sinp = sin(ph);
if (std::abs(px) > 0.000001*GeV) ph = std::atan2(py,px);
cosp = std::cos(ph);
sinp = std::sin(ph);
px = (cost*cosp*pxnew - sinp*pynew + sint*cosp*pznew);
py = (cost*sinp*pxnew + cosp*pynew + sint*sinp*pznew);
pz = (-sint*pxnew + cost*pznew);
@@ -244,7 +244,7 @@ G4LEnp::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
G4double betaCMx = Px/E1pM2;
G4double betaCMy = Py/E1pM2;
G4double betaCMz = Pz/E1pM2;
G4double gammaCM = E1pM2/sqrt(E1pM2*E1pM2 - P*P);
G4double gammaCM = E1pM2/std::sqrt(E1pM2*E1pM2 - P*P);
if (verboseLevel > 1) {
G4cout << " betaCM " << betaCMx << " " << betaCMy << " "
@@ -265,7 +265,7 @@ G4LEnp::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
PA[1] = px;
PA[2] = py;
PA[3] = pz;
PA[4] = sqrt(M1*M1 + p*p);
PA[4] = std::sqrt(M1*M1 + p*p);
G4double BETPA = BETA[1]*PA[1] + BETA[2]*PA[2] + BETA[3]*PA[3];
G4double BPGAM = (BETPA * BETA[4]/(BETA[4] + 1.) - PA[4]) * BETA[4];
@@ -284,7 +284,7 @@ G4LEnp::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
PA[1] = -px;
PA[2] = -py;
PA[3] = -pz;
PA[4] = sqrt(M2*M2 + p*p);
PA[4] = std::sqrt(M2*M2 + p*p);
BETPA = BETA[1]*PA[1] + BETA[2]*PA[2] + BETA[3]*PA[3];
BPGAM = (BETPA * BETA[4]/(BETA[4] + 1.) - PA[4]) * BETA[4];
@@ -111,7 +111,7 @@ G4LEpp::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
//
E += G4Proton::Proton()->GetPDGMass();
G4double E02 = E*E - P*P;
E0 = sqrt(abs(E02));
E0 = std::sqrt(std::abs(E02));
if (E02 < 0)E0 *= -1;
Q += Z;
G4cout << "G4LEpp:ApplyYourself: total:" << G4endl;
@@ -133,7 +133,7 @@ G4LEpp::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
je1 = midBin;
} while (je2 - je1 > 1);
// G4int j;
//abs(ek-elab[je1]) < abs(ek-elab[je2]) ? j = je1 : j = je2;
//std::abs(ek-elab[je1]) < std::abs(ek-elab[je2]) ? j = je1 : j = je2;
G4double delab = elab[je2] - elab[je1];
// Sample the angle
@@ -189,7 +189,7 @@ G4LEpp::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
if (theta < 0.) theta = 0.;
// G4int k;
//abs(sample-sig[j][ke1]) < abs(sample-sig[j][ke2]) ? k = ke1 : k = ke2;
//std::abs(sample-sig[j][ke1]) < std::abs(sample-sig[j][ke2]) ? k = ke1 : k = ke2;
// G4double theta = (0.5 + k)*pi/180.;
if (verboseLevel > 1) {
@@ -207,15 +207,15 @@ G4LEpp::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
G4double E2 = targetParticle->GetTotalEnergy();
G4double M2 = targetParticle->GetDefinition()->GetPDGMass();
G4double totalEnergy = E1 + E2;
G4double pseudoMass = sqrt(totalEnergy*totalEnergy - P*P);
// pseudoMass also = sqrt(M1*M1 + M2*M2 + 2*M2*E1)
G4double pseudoMass = std::sqrt(totalEnergy*totalEnergy - P*P);
// pseudoMass also = std::sqrt(M1*M1 + M2*M2 + 2*M2*E1)
// Transform into centre of mass system
G4double px = (M2/pseudoMass)*Px;
G4double py = (M2/pseudoMass)*Py;
G4double pz = (M2/pseudoMass)*Pz;
G4double p = sqrt(px*px + py*py + pz*pz);
G4double p = std::sqrt(px*px + py*py + pz*pz);
if (verboseLevel > 1) {
G4cout << " E1, M1 (GeV) " << E1/GeV << " " << M1/GeV << G4endl;
@@ -226,19 +226,19 @@ G4LEpp::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
// First scatter w.r.t. Z axis
G4double phi = G4UniformRand()*twopi;
G4double pxnew = p*sin(theta)*cos(phi);
G4double pynew = p*sin(theta)*sin(phi);
G4double pznew = p*cos(theta);
G4double pxnew = p*std::sin(theta)*std::cos(phi);
G4double pynew = p*std::sin(theta)*std::sin(phi);
G4double pznew = p*std::cos(theta);
// Rotate according to the direction of the incident particle
if (px*px + py*py > 0) {
G4double cost, sint, ph, cosp, sinp;
cost = pz/p;
sint = (sqrt(abs((1-cost)*(1+cost))) + sqrt(px*px+py*py)/p)/2;
sint = (std::sqrt(std::abs((1-cost)*(1+cost))) + std::sqrt(px*px+py*py)/p)/2;
py < 0 ? ph = 3*halfpi : ph = halfpi;
if (abs(px) > 0.000001*GeV) ph = atan2(py,px);
cosp = cos(ph);
sinp = sin(ph);
if (std::abs(px) > 0.000001*GeV) ph = std::atan2(py,px);
cosp = std::cos(ph);
sinp = std::sin(ph);
px = (cost*cosp*pxnew - sinp*pynew + sint*cosp*pznew);
py = (cost*sinp*pxnew + cosp*pynew + sint*sinp*pznew);
pz = (-sint*pxnew + cost*pznew);
@@ -266,7 +266,7 @@ G4LEpp::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
G4double betaCMx = Px/E1pM2;
G4double betaCMy = Py/E1pM2;
G4double betaCMz = Pz/E1pM2;
G4double gammaCM = E1pM2/sqrt(E1pM2*E1pM2 - P*P);
G4double gammaCM = E1pM2/std::sqrt(E1pM2*E1pM2 - P*P);
if (verboseLevel > 1) {
G4cout << " betaCM " << betaCMx << " " << betaCMy << " "
@@ -287,7 +287,7 @@ G4LEpp::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
PA[1] = px;
PA[2] = py;
PA[3] = pz;
PA[4] = sqrt(M1*M1 + p*p);
PA[4] = std::sqrt(M1*M1 + p*p);
G4double BETPA = BETA[1]*PA[1] + BETA[2]*PA[2] + BETA[3]*PA[3];
G4double BPGAM = (BETPA * BETA[4]/(BETA[4] + 1.) - PA[4]) * BETA[4];
@@ -307,7 +307,7 @@ G4LEpp::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
PA[1] = -px;
PA[2] = -py;
PA[3] = -pz;
PA[4] = sqrt(M2*M2 + p*p);
PA[4] = std::sqrt(M2*M2 + p*p);
BETPA = BETA[1]*PA[1] + BETA[2]*PA[2] + BETA[3]*PA[3];
BPGAM = (BETPA * BETA[4]/(BETA[4] + 1.) - PA[4]) * BETA[4];