Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4eBremParametrizedModel.cc 74581 2013-10-15 12:03:25Z gcosmo $
// GEANT4 tag $Name: geant4-09-04 $
//
// -------------------------------------------------------------------
@@ -60,6 +60,8 @@
#include "G4ParticleChangeForLoss.hh"
#include "G4LossTableManager.hh"
#include "G4ModifiedTsai.hh"
#include "G4Exp.hh"
#include "G4Log.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -68,6 +70,30 @@ const G4double G4eBremParametrizedModel::xgi[]={ 0.0199, 0.1017, 0.2372, 0.4083,
const G4double G4eBremParametrizedModel::wgi[]={ 0.0506, 0.1112, 0.1569, 0.1813,
0.1813, 0.1569, 0.1112, 0.0506 };
static const G4double tlow = 1.*CLHEP::MeV;
//
// GEANT4 internal units.
//
static const G4double
ah10 = 4.67733E+00, ah11 =-6.19012E-01, ah12 = 2.02225E-02,
ah20 =-7.34101E+00, ah21 = 1.00462E+00, ah22 =-3.20985E-02,
ah30 = 2.93119E+00, ah31 =-4.03761E-01, ah32 = 1.25153E-02;
static const G4double
bh10 = 4.23071E+00, bh11 =-6.10995E-01, bh12 = 1.95531E-02,
bh20 =-7.12527E+00, bh21 = 9.69160E-01, bh22 =-2.74255E-02,
bh30 = 2.69925E+00, bh31 =-3.63283E-01, bh32 = 9.55316E-03;
static const G4double
al00 =-2.05398E+00, al01 = 2.38815E-02, al02 = 5.25483E-04,
al10 =-7.69748E-02, al11 =-6.91499E-02, al12 = 2.22453E-03,
al20 = 4.06463E-02, al21 =-1.01281E-02, al22 = 3.40919E-04;
static const G4double
bl00 = 1.04133E+00, bl01 =-9.43291E-03, bl02 =-4.54758E-04,
bl10 = 1.19253E-01, bl11 = 4.07467E-02, bl12 =-1.30718E-03,
bl20 =-1.59391E-02, bl21 = 7.27752E-03, bl22 =-1.94405E-04;
using namespace std;
@@ -101,8 +127,8 @@ G4eBremParametrizedModel::G4eBremParametrizedModel(const G4ParticleDefinition* p
void G4eBremParametrizedModel::InitialiseConstants()
{
facFel = log(184.15);
facFinel = log(1194.);
facFel = G4Log(184.15);
facFinel = G4Log(1194.);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -155,7 +181,7 @@ void G4eBremParametrizedModel::Initialise(const G4ParticleDefinition* p,
currentZ = 0.;
InitialiseElementSelectors(p, cuts);
if(IsMaster()) { InitialiseElementSelectors(p, cuts); }
if(isInitialised) { return; }
fParticleChange = GetParticleChangeForLoss();
@@ -164,6 +190,14 @@ void G4eBremParametrizedModel::Initialise(const G4ParticleDefinition* p,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4eBremParametrizedModel::InitialiseLocal(const G4ParticleDefinition*,
G4VEmModel* masterModel)
{
SetElementSelectors(masterModel->GetElementSelectors());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4eBremParametrizedModel::ComputeDEDXPerVolume(
const G4Material* material,
const G4ParticleDefinition* p,
@@ -192,7 +226,6 @@ G4double G4eBremParametrizedModel::ComputeDEDXPerVolume(
}
dedx *= bremFactor;
return dedx;
}
@@ -259,14 +292,13 @@ G4double G4eBremParametrizedModel::ComputeCrossSectionPerAtom(
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4eBremParametrizedModel::ComputeXSectionPerAtom(G4double cut)
{
G4double cross = 0.0;
// number of intervals and integration step
G4double vcut = log(cut/totalEnergy);
G4double vmax = log(kinEnergy/totalEnergy);
G4double vcut = G4Log(cut/totalEnergy);
G4double vmax = G4Log(kinEnergy/totalEnergy);
G4int n = (G4int)(0.45*(vmax - vcut)) + 4;
// n=1; // integration test
G4double delta = (vmax - vcut)/G4double(n);
@@ -279,7 +311,7 @@ G4double G4eBremParametrizedModel::ComputeXSectionPerAtom(G4double cut)
for(G4int i=0; i<8; i++) {
G4double eg = exp(e0 + xgi[i]*delta)*totalEnergy;
G4double eg = G4Exp(e0 + xgi[i]*delta)*totalEnergy;
xs = ComputeDXSectionPerAtom(eg);
@@ -295,40 +327,14 @@ G4double G4eBremParametrizedModel::ComputeXSectionPerAtom(G4double cut)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//
// GEANT4 internal units.
//
static const G4double
ah10 = 4.67733E+00, ah11 =-6.19012E-01, ah12 = 2.02225E-02,
ah20 =-7.34101E+00, ah21 = 1.00462E+00, ah22 =-3.20985E-02,
ah30 = 2.93119E+00, ah31 =-4.03761E-01, ah32 = 1.25153E-02;
static const G4double
bh10 = 4.23071E+00, bh11 =-6.10995E-01, bh12 = 1.95531E-02,
bh20 =-7.12527E+00, bh21 = 9.69160E-01, bh22 =-2.74255E-02,
bh30 = 2.69925E+00, bh31 =-3.63283E-01, bh32 = 9.55316E-03;
static const G4double
al00 =-2.05398E+00, al01 = 2.38815E-02, al02 = 5.25483E-04,
al10 =-7.69748E-02, al11 =-6.91499E-02, al12 = 2.22453E-03,
al20 = 4.06463E-02, al21 =-1.01281E-02, al22 = 3.40919E-04;
static const G4double
bl00 = 1.04133E+00, bl01 =-9.43291E-03, bl02 =-4.54758E-04,
bl10 = 1.19253E-01, bl11 = 4.07467E-02, bl12 =-1.30718E-03,
bl20 =-1.59391E-02, bl21 = 7.27752E-03, bl22 =-1.94405E-04;
static const G4double tlow = 1.*MeV;
G4double ScreenFunction1(G4double ScreenVariable)
// compute the value of the screening function 3*PHI1 - PHI2
G4double G4eBremParametrizedModel::ScreenFunction1(G4double ScreenVariable)
{
G4double screenVal;
if (ScreenVariable > 1.)
screenVal = 42.24 - 8.368*std::log(ScreenVariable+0.952);
screenVal = 42.24 - 8.368*G4Log(ScreenVariable+0.952);
else
screenVal = 42.392 - ScreenVariable* (7.796 - 1.961*ScreenVariable);
@@ -337,40 +343,43 @@ G4double ScreenFunction1(G4double ScreenVariable)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double ScreenFunction2(G4double ScreenVariable)
// compute the value of the screening function 1.5*PHI1 - 0.5*PHI2
G4double G4eBremParametrizedModel::ScreenFunction2(G4double ScreenVariable)
{
G4double screenVal;
if (ScreenVariable > 1.)
screenVal = 42.24 - 8.368*std::log(ScreenVariable+0.952);
screenVal = 42.24 - 8.368*G4Log(ScreenVariable+0.952);
else
screenVal = 41.734 - ScreenVariable* (6.484 - 1.250*ScreenVariable);
return screenVal;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
// Parametrized cross section
G4double ComputeParametrizedDXSectionPerAtom(G4double kineticEnergy, G4double gammaEnergy, G4double Z) {
G4double lnZ = std::log(Z); // 3.*(anElement->GetIonisation()->GetlogZ3());
G4double G4eBremParametrizedModel::ComputeParametrizedDXSectionPerAtom(
G4double kineticEnergy,
G4double gammaEnergy, G4double Z)
{
SetCurrentElement(Z);
G4double FZ = lnZ* (4.- 0.55*lnZ);
G4double ZZ = std::pow (Z*(Z+1.),1./3.); // anElement->GetIonisation()->GetZZ3();
G4double Z3 = std::pow (Z,1./3.); // (anElement->GetIonisation()->GetZ3())
G4double Z3 = z13;
G4double ZZ = z13*nist->GetZ13(G4lrint(Z)+1);
G4double totalEnergy = kineticEnergy + electron_mass_c2;
totalEnergy = kineticEnergy + electron_mass_c2;
// G4double x, epsil, greject, migdal, grejmax, q;
G4double epsil, greject;
G4double U = log(kineticEnergy/electron_mass_c2);
G4double U = G4Log(kineticEnergy/electron_mass_c2);
G4double U2 = U*U;
// precalculated parameters
G4double ah, bh;
if (kineticEnergy > tlow) {
if (kineticEnergy > tlow) {
G4double ah1 = ah10 + ZZ* (ah11 + ZZ* ah12);
G4double ah2 = ah20 + ZZ* (ah21 + ZZ* ah22);
@@ -424,7 +433,7 @@ if (kineticEnergy > tlow) {
*/
}
return greject;
return greject;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -454,8 +463,7 @@ G4double G4eBremParametrizedModel::ComputeDXSectionPerAtom(G4double gammaEnergy)
G4double main2 = ComputeParametrizedDXSectionPerAtom(kinEnergy,gammaEnergy,currentZ);
std::cout<<"main2 = "<<main2<<std::endl;
std::cout<<"main2tot = "<<main2 * ( (Fel-fCoulomb) + Finel/currentZ ) / (Fel-fCoulomb);
std::cout<<"main2tot = "<<main2 * ( (Fel-fCoulomb) + Finel/currentZ )/(Fel-fCoulomb);
G4double cross = main2; //main+secondTerm;
return cross;
@@ -486,12 +494,12 @@ void G4eBremParametrizedModel::SampleSecondaries(
totalEnergy = kineticEnergy + particleMass;
densityCorr = densityFactor*totalEnergy*totalEnergy;
G4double xmin = log(cut*cut + densityCorr);
G4double xmax = log(emax*emax + densityCorr);
G4double xmin = G4Log(cut*cut + densityCorr);
G4double xmax = G4Log(emax*emax + densityCorr);
G4double gammaEnergy, f, x;
do {
x = exp(xmin + G4UniformRand()*(xmax - xmin)) - densityCorr;
x = G4Exp(xmin + G4UniformRand()*(xmax - xmin)) - densityCorr;
if(x < 0.0) x = 0.0;
gammaEnergy = sqrt(x);
f = ComputeDXSectionPerAtom(gammaEnergy);