Import Geant4 10.7.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2020-06-26 10:23:25 +02:00
parent c02c370437
commit 67ba86d073
1871 changed files with 174422 additions and 131884 deletions
@@ -53,8 +53,11 @@ GFlashHomoShowerParameterisation(G4Material * aMat,
Rhoh(0.), Alphah(0.), Tmaxh(0.), Betah(0.)
{
if(!aPar) { thePar = new GVFlashHomoShowerTuning; owning = true; }
else { thePar = aPar; owning = false; }
if(!aPar) {
thePar = new GVFlashHomoShowerTuning;
} else {
thePar = aPar;
}
SetMaterial(aMat);
PrintMaterial(aMat);
@@ -150,7 +153,7 @@ void GFlashHomoShowerParameterisation::SetMaterial(G4Material *mat)
GFlashHomoShowerParameterisation::~GFlashHomoShowerParameterisation()
{
if(owning) { delete thePar; }
delete thePar;
}
void GFlashHomoShowerParameterisation::
@@ -54,8 +54,11 @@ GFlashSamplingShowerParameterisation(G4Material* aMat1, G4Material* aMat2,
Rhoh(0.), Alphah(0.), Tmaxh(0.), Betah(0.), AveLogAlpha(0.), AveLogTmax(0.),
SigmaLogAlpha(0.), SigmaLogTmax(0.), Rho(0.), Alpha(0.), Tmax(0.), Beta(0.)
{
if(!aPar) { thePar = new GFlashSamplingShowerTuning; owning = true; }
else { thePar = aPar; owning = false; }
if(!aPar) {
thePar = new GFlashSamplingShowerTuning;
} else {
thePar = aPar;
}
SetMaterial(aMat1,aMat2 );
d1=dd1;
@@ -141,7 +144,7 @@ GFlashSamplingShowerParameterisation(G4Material* aMat1, G4Material* aMat2,
GFlashSamplingShowerParameterisation::~GFlashSamplingShowerParameterisation()
{
if(owning) { delete thePar; }
delete thePar;
}
// ------------------------------------------------------------
@@ -183,8 +186,9 @@ void GFlashSamplingShowerParameterisation::ComputeZAX0EFFetc()
G4double W2 = (d2*density2) / denominator;
Zeff = ( W1*Z1 ) + ( W2*Z2 ); //X0*Es/Ec;
Aeff = ( W1*A1 ) + ( W2*A2 );
X0eff = ( 1./ ( ( W1 / X01) +( W2 / X02) ) );
Rhoeff = ( (d1 *density1 ) + (d2 * density2 ))/G4double (d2 + d1 );
X0eff = (W1 * Rhoeff) / (X01 * density1) + (W2 * Rhoeff) / (X02 * density2 );
X0eff = 1./ X0eff;
Rmeff = 1/ ((((W1*Ec1)/ X01) + ((W2* Ec2)/ X02) ) / Es ) ;
Eceff = X0eff *((W1*Ec1)/ X01 + (W2* Ec2)/ X02 );
Fs = X0eff/G4double ((d1/mm )+(d2/mm) );
+8 -42
View File
@@ -40,19 +40,10 @@ MyGamma::~MyGamma(){}
//____________________________________________________________________________
double MyGamma::Gamma(double z)
{
// Computation of gamma(z) for all z>0.
//
// The algorithm is based on the article by C.Lanczos [1] as denoted in
// Numerical Recipes 2nd ed. on p. 207 (W.H.Press et al.).
//
// [1] C.Lanczos, SIAM Journal of Numerical Analysis B1 (1964), 86.
//
//--- Nve 14-nov-1998 UU-SAP Utrecht
if (z<=0) return 0;
double v = LnGamma(z);
return std::exp(v);
if (z <= 0)
return 0;
return std::tgamma(z);
}
//____________________________________________________________________________
@@ -145,33 +136,8 @@ double MyGamma::GamSer(double a,double x)
double MyGamma::LnGamma(double z)
{
// Computation of ln[gamma(z)] for all z>0.
//
// The algorithm is based on the article by C.Lanczos [1] as denoted in
// Numerical Recipes 2nd ed. on p. 207 (W.H.Press et al.).
//
// [1] C.Lanczos, SIAM Journal of Numerical Analysis B1 (1964), 86.
//
// The accuracy of the result is better than 2e-10.
//
//--- Nve 14-nov-1998 UU-SAP Utrecht
if (z<=0) return 0;
// Coefficients for the series expansion
double c[7] = { 2.5066282746310005, 76.18009172947146, -86.50532032941677
,24.01409824083091, -1.231739572450155, 0.1208650973866179e-2
,-0.5395239384953e-5};
double x = z;
double y = x;
double tmp = x+5.5;
tmp = (x+0.5)*Log(tmp)-tmp;
double ser = 1.000000000190015;
for (int i=1; i<7; i++) {
y += 1;
ser += c[i]/y;
}
double v = tmp+Log(c[0]*ser/x);
return v;
if (z <= 0)
return 0;
return std::lgamma(z);
}