Import Geant4 8.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:44:26 +02:00
parent 8a51e0bc40
commit 216a75eeb1
8717 changed files with 360418 additions and 141343 deletions
@@ -1,40 +1,41 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4DiffElasticHadrNucleus.hh,v 1.13 2005/11/25 19:17:32 dennis Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4DiffElasticHadrNucleus.hh,v 1.15 2006/06/29 20:08:59 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// G4DiffElasticHadrNucleus header file
//
// High energy hadron-nucleus elastic scattering
// Kinetic energy T > 1 GeV
// N. Starkov 2003.
// N. Starkov 2003.
//
// Modifications:
// 14.11.05 The HE elastic scattering on proton is added (N.Starkov)
// 23.11.05 int -> G4int, fabs -> abs (V.Ivanchenko)
// 30.05.06 New version, which not uses elastic data (N.Starkov)
// 30.05.06 cleanup (V.Ivanchenko)
//
#ifndef G4DiffElasticHadrNucleus_h
@@ -45,14 +46,52 @@
#include "G4HadronValues.hh"
#include "G4IntegrHadrNucleus.hh"
class G4DiffElasticHadrNucleus: public G4IntegrHadrNucleus
// ###############################################
class NucleusParameters
{
public:
NucleusParameters() {;}
virtual ~NucleusParameters(){;}
NucleusParameters & operator= (const NucleusParameters &t)
{
if(this!=&t)
{
R1 = t.R1;
R2 = t.R2;
Aeff = t.Aeff;
Pnucl = t.Pnucl;
}
return *this;
}
void GetNucleusParameters(G4int AtWeight);
G4double R1, R2, Aeff, Pnucl;
};
// ################################################
class G4DiffElasticHadrNucleus: public //G4HadronValues
G4IntegrHadrNucleus
{
public:
G4DiffElasticHadrNucleus();
G4DiffElasticHadrNucleus() : // G4HadronValues(),
G4IntegrHadrNucleus()
{
Factors();
Binom();
r0 = 1.1; // The WS's parameters
r01 = 1.16;
rAmax = 2.5;
NpointsB = 500;
FmToGeV = 5.068;
Fm2ToGeV2= FmToGeV*FmToGeV;
}
~G4DiffElasticHadrNucleus();
virtual ~G4DiffElasticHadrNucleus() {;}
G4double HadrNuclDifferCrSec(
const G4DynamicParticle * aHadron,
@@ -84,13 +123,13 @@ public:
G4double p);
// ====================================================
G4double MyJ0(G4double x)
{
G4double x1, x2, x3, x4, x5, x6, x7, f0, th0, res;
{
G4double x1, x2, x3, x4, x5, x6, x7, f0, th0, res;
x2 = x*x/9.0;
x2 = x*x/9.0;
if(std::abs(x)<=3.0)
{
if(std::fabs(x)<=3.0)
{
x3 = x2*x2;
x4 = x3*x2;
x5 = x4*x2;
@@ -99,9 +138,9 @@ public:
res = 1.0-2.2499997*x2+1.2656208*x3-
0.3163866*x4+0.0444479*x5-
0.0039444*x6+0.0002100*x7;
}
else
{
}
else
{
x1 = x/3.0;
x3 = x2*x1;
x4 = x3*x1;
@@ -116,12 +155,12 @@ public:
0.00054125/x4-0.00029333/x5+
0.00013558/x6;
res = f0*std::cos(th0)/std::sqrt(x);
}
return res;
}
}
return res;
}
// +++++++++++++++++++++++++++++++++++++++++++++
G4double MyI0(G4double x)
{
{
G4double p1=1.0, p2=3.5156229, p3=3.0899424,
p4=1.2067492, p5=0.2659732, p6=3.360768e-2,
p7=4.5813e-3;
@@ -129,61 +168,113 @@ public:
q4=-1.57565e-3, q5=9.16281e-3, q6=-2.057706e-2,
q7=2.635537e-2, q8=-1.647633e-2, q9=3.922377e-3;
G4double k1=3.75, ax=std::abs(x), y=0.0, result=0.0;
G4double k1=3.75, ax=std::fabs(x), y=0.0, result=0.0;
if(ax<k1)
{
G4double xx = x/k1;
y = xx*xx;
result = p1+y*(p2+y*(p3+y*(p4+y*(p5+y*(p6+y*p7)))));
}
{
G4double xx = x/k1;
y = xx*xx;
result = p1+y*(p2+y*(p3+y*(p4+y*(p5+y*(p6+y*p7)))));
}
else
{
y = k1/ax;
result = std::exp(ax)/std::sqrt(ax)*(q1+y*(q2+y*(q3+y*(q4+
y*(q5+y*(q6+y*(q7+y*(q8+y*q9))))))));
}
return result;
}
{
y = k1/ax;
result = std::exp(ax)/std::sqrt(ax)*(q1+y*(q2+y*(q3+y*(q4+
y*(q5+y*(q6+y*(q7+y*(q8+y*q9))))))));
}
return result;
}
private:
void Factors();
// private:
// ++++++++++++++++++++++++++++++++++++++++++++++++++
G4double binom(G4int N, G4int M)
{
G4double Fact1 = 1;
if ((N>1) & (N>=M))
{
Fact1 = Factorials[N]/Factorials[M]/
Factorials[N-M];
}
return Fact1;
}
void Binom()
{
G4int N, M;
G4double Fact1, J;
for(N=0; N<240; N++)
{
J = 1;
for(M=0; M<=N; M++)
{
Fact1 = 1;
if ((N>0) && (N>M) && M>0)
{
J = J*(N-M+1)/M;
Fact1 = J;
}
SetBinom[N][M] = Fact1;
// G4cout<<" N M "<<N<<" "<<M<<" F "<<Fact1<<G4endl;
}
}
return;
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++
G4double binom(G4int N, G4int M)
{
G4double Fact1 = 1;
if((N>1) & (N>=M))
Fact1 = Factorials[N]/Factorials[M]/Factorials[N-M];
return Fact1;
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++
G4double Factorial(G4int N)
{
G4double Res=1;
{
G4double Res=1;
if(N == 0) return Res;
if(N == 0) return Res;
if(N < 100) for(G4int M = 1; M<=N; M++) Res = Res*M;
if(N < 100) for(G4int M = 1; M<=N; M++) Res = Res*M;
if(N >= 100) Res = 2.50662827*
std::exp(static_cast<double>(-N-1))*
std::pow(static_cast<double>(N+1),N+0.5)*
(1+1/12/(N+1)+1/288/(N+1)/(N+1)-
139/51840/(N+1)/(N+1)/(N+1)-
571/2488320/(N+1)/(N+1)/(N+1)/(N+1));
if(N >= 100) Res = 2.50662827*
std::exp(static_cast<double>(-N-1))*
std::pow(static_cast<double>(N+1),N+0.5)*
(1.+1./12./(N+1)+1./288./(N+1)/(N+1)-
139./51840./(N+1)/(N+1)/(N+1)-
571./2488320./(N+1)/(N+1)/(N+1)/(N+1));
return Res;
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++
void Factors()
{
G4int ii, ll, mm;
G4double Sum1, Fac1, Fac3, Sum3;
return Res;
}
Factorials[0] = 1;
for( ii = 1; ii<140; ii++)
{
Factorials[ii] = Factorial(ii);
if(ii >= 100) Mnoj[ii] = 3.03; // there is the saturation
else
{
Sum1 = 0;
Fac1 = 1;
for( ll = 0; ll<=ii; ll++)
{
Fac1 = binom(ii,ll);
Fac3 = 1;
Sum3 = 1;
for( mm = 1; mm<=ii-ll; mm++)
{
Fac3 = binom(ii-ll,mm);
Sum3 = Sum3 + 1/Fac3;
} // mm
Sum1 = Sum1 + Sum3/Fac1;
} // ll
Mnoj[ii] = Sum1;
} // else
} // ii
Mnoj[0] = 1;
} // Factors
// --------------------------------------------------------
public:
G4double Fm2ToGeV2, FmToGeV;
G4double SigTot, Slope, ReOnIm, HdrE, ConstU, Q2;
G4double ProtonM, HadronM, HadronE, Sh, PM2, HM2;
@@ -201,6 +292,7 @@ public:
G4double r0, r01, rAmax;
G4double BoundaryP[7], BoundaryTL[7], BoundaryTG[7];
G4int NpointsB, HadrCodes[7], Intern;
G4double SetBinom[240][240];
};
#endif