Import Geant4 9.5.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:46:55 +02:00
parent 89a9605df1
commit b1eb5424d2
10957 changed files with 888481 additions and 160139 deletions
@@ -27,86 +27,83 @@
// G.Folger, 29-sept-2006: extend to 1TeV, using a constant above 20GeV
// 22 Dec 2006 - DHW added isotope dependence
// G.Folger, 25-Nov-2009: extend to 100TeV, using a constant above 20GeV
// V.Ivanchenko, 18-Aug-2011: migration to new design and cleanup;
// make it applicable for Z>1
//
#include "G4ProtonInelasticCrossSection.hh"
#include "G4DynamicParticle.hh"
#include "G4Proton.hh"
#include "G4HadTmpUtil.hh"
#include "globals.hh"
#include "G4NistManager.hh"
G4double G4ProtonInelasticCrossSection::
GetCrossSection(const G4DynamicParticle* aPart,
const G4Element* anEle, G4double /*aTemperature*/)
G4ProtonInelasticCrossSection::G4ProtonInelasticCrossSection()
: G4VCrossSectionDataSet("Axen-Wellisch"),thEnergy(19.8*CLHEP::GeV)
{
G4int nIso = anEle->GetNumberOfIsotopes();
G4double KE = aPart->GetKineticEnergy();
G4double cross_section = 0;
if (nIso) {
G4double psig;
G4IsotopeVector* isoVector = anEle->GetIsotopeVector();
G4double* abundVector = anEle->GetRelativeAbundanceVector();
G4int ZZ;
G4int AA;
for (G4int i = 0; i < nIso; i++) {
ZZ = (*isoVector)[i]->GetZ();
AA = (*isoVector)[i]->GetN();
psig = GetCrossSection(KE, AA, ZZ);
cross_section += psig*abundVector[i];
}
} else {
G4int ZZ = G4lrint(anEle->GetZ());
G4int AA = G4lrint(anEle->GetN());
cross_section = GetCrossSection(KE, AA, ZZ);
}
return cross_section;
nist = G4NistManager::Instance();
theProton = G4Proton::Proton();
}
G4ProtonInelasticCrossSection::~G4ProtonInelasticCrossSection()
{}
G4double G4ProtonInelasticCrossSection::
GetCrossSection(G4double kineticEnergy, G4int atomicNumber, G4int nOfProtons)
{
if (kineticEnergy > 19.9*GeV )
{ // constant cross section above ~20GeV.
return GetCrossSection(19.8*GeV,atomicNumber,nOfProtons);
}
G4int nOfNeutrons = atomicNumber-nOfProtons;
G4bool
G4ProtonInelasticCrossSection::IsElementApplicable(
const G4DynamicParticle* aPart,
G4int Z, const G4Material*)
{
return ((1 < Z) && (aPart->GetDefinition() == theProton));
}
G4double G4ProtonInelasticCrossSection::GetElementCrossSection(
const G4DynamicParticle* aPart,
G4int Z, const G4Material*)
{
return GetProtonCrossSection(aPart->GetKineticEnergy(), Z);
}
G4double G4ProtonInelasticCrossSection::GetProtonCrossSection(
G4double kineticEnergy, G4int Z)
{
if(kineticEnergy <= 0.0) { return 0.0; }
// constant cross section above ~20GeV
if (kineticEnergy > thEnergy) { kineticEnergy = thEnergy; }
G4double a = nist->GetAtomicMassAmu(Z);
G4double a13 = std::pow(a,-0.3333333333);
G4int nOfNeutrons = G4lrint(a) - Z;
kineticEnergy /=GeV;
G4double a = atomicNumber;
G4double alog10E = std::log10(kineticEnergy);
const G4double nuleonRadius=1.36E-15;
const G4double pi=3.14159265;
G4double fac=pi*nuleonRadius*nuleonRadius;
G4double b0=2.247-0.915*(1-std::pow(a,-0.3333));
G4double fac1=b0*(1-std::pow(a,-0.3333));
G4double fac2=1.;
if(nOfNeutrons > 1) fac2=std::log((G4double(nOfNeutrons)));
G4double crossSection = 1E31*fac*fac2*(1+std::pow(a,0.3333)-fac1);
const G4double fac=CLHEP::pi*nuleonRadius*nuleonRadius;
G4double b0 = 2.247-0.915*(1 - a13);
G4double fac1 = b0*(1 - a13);
G4double fac2 = 1.;
if(nOfNeutrons > 1) { fac2=std::log((G4double(nOfNeutrons))); }
G4double crossSection = 1.0E31*fac*fac2*(1. + 1./a13 - fac1);
// high energy correction
crossSection *= (1 - 0.15*std::exp(-kineticEnergy))/(1.0 - 0.0007*a);
crossSection = (1-0.15*std::exp(-kineticEnergy))*crossSection/(1.00-0.0007*a);
// first try on low energies: rise
G4double ff1= 0.70-0.002*a; // slope of the drop at medium energies.
G4double ff2= 1.00+1/a; // start of the slope.
G4double ff3= 0.8+18/a-0.002*a; // stephight
fac = 1.0;
if (kineticEnergy > DBL_MIN)
fac= 1.0 - (1.0/(1+std::exp(-8*ff1*(std::log10(kineticEnergy)+1.37*ff2))));
crossSection = crossSection*(1+ff3*fac);
G4double ff4= 1.0 - (1.0/(1+std::exp(-8*ff1*(alog10E + 1.37*ff2))));
crossSection *= (1 + ff3*ff4);
// low energy return to zero
ff1=1.-1/a-0.001*a; // slope of the rise
ff2=1.17-2.7/a-0.0014*a; // start of the rise
fac = 0.0;
if (kineticEnergy > DBL_MIN) {
fac=-8.*ff1*(std::log10(kineticEnergy)+2.0*ff2);
fac=1/(1+std::exp(fac));
}
crossSection = crossSection*fac;
return crossSection*millibarn;
ff1=1. - 1./a - 0.001*a; // slope of the rise
ff2=1.17 - 2.7/a - 0.0014*a; // start of the rise
ff4=-8.*ff1*(alog10E + 2.0*ff2);
crossSection *= millibarn/(1. + std::exp(ff4));
return crossSection;
}