Import Geant4 10.7.0.beta source tree
This commit is contained in:
@@ -16,6 +16,17 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Apr 17th, 2020, A. Zaborowska (gflash-V10-06-01)
|
||||
- Substitute Gamma calculation with STL following GitHub PR#3 from Marco Savelli.
|
||||
Makes LnGamma calculation 1.4 times faster, and Gamma 1.9 times faster.
|
||||
|
||||
Mar 26, 2020, I. Semeniouk (gflash-V10-06-00)
|
||||
- GFlashSamplingShowerParameterisation.cc : X0eff calculation
|
||||
- GFlashHomoShowerParameterisation, GVFlashHomoShowerTuning,
|
||||
GFlashSamplingShowerParameterisation,GFlashSamplingShowerTuning:
|
||||
GFlashXXXShowerTuning deleted locally in Destractor
|
||||
of GFlashXXXShowerParameterisation class
|
||||
|
||||
Oct 30st, 2019, A. Zaborowska (gflash-V10-05-01)
|
||||
- Add possibility to use sensitive detector from parallel world.
|
||||
|
||||
|
||||
@@ -91,7 +91,6 @@ class GFlashHomoShowerParameterisation : public GVFlashShowerParameterisation
|
||||
|
||||
// parametrization parameters
|
||||
GVFlashHomoShowerTuning * thePar;
|
||||
G4bool owning;
|
||||
|
||||
// Cashed parameters:
|
||||
// Longitudinal Coefficients for a homogeneous calo
|
||||
|
||||
@@ -101,7 +101,6 @@ class GFlashSamplingShowerParameterisation
|
||||
// parametrization parameters
|
||||
//
|
||||
GFlashSamplingShowerTuning * thePar;
|
||||
G4bool owning;
|
||||
|
||||
// Cashed parameters:
|
||||
// Longitudinal Coefficients for a homogenious calo
|
||||
|
||||
@@ -44,6 +44,10 @@
|
||||
// Please, see hep-ex/0001020 for details.
|
||||
|
||||
// Author: Joanna Weng - 11.2005
|
||||
//
|
||||
// Usage: use new statement for new instance of class, do not delete.
|
||||
// The instance of class will be deleted in
|
||||
// GFlashSamplingShowerParameterisation Destructor.
|
||||
//---------------------------------------------------------------
|
||||
#ifndef GFlashSamplingShowerTuning_hh
|
||||
#define GFlashSamplingShowerTuning_hh
|
||||
|
||||
@@ -54,6 +54,11 @@
|
||||
// alpha = a1+(a2+a3/Z)ln(y)
|
||||
|
||||
// Author: J.P. Wellisch - October 2004
|
||||
//
|
||||
// Usage: use new statement for new instance of class, do not delete.
|
||||
// The instance of class will be deleted in
|
||||
// GFlashHomoShowerParameterisation Destructor.
|
||||
|
||||
//---------------------------------------------------------------
|
||||
#ifndef GVFlashHomoShowerTuning_hh
|
||||
#define GVFlashHomoShowerTuning_hh
|
||||
|
||||
@@ -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) );
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user