Import Geant4 3.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:55:53 +02:00
parent e7d7193284
commit cfcb558cfe
3050 changed files with 91703 additions and 48310 deletions
@@ -1,23 +1,28 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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.
//
// $Id: G4VeLowEnergyLoss.cc,v 1.2 2000/06/22 02:38:12 pia Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4VeLowEnergyLoss.cc,v 1.6 2000/11/22 16:06:57 vnivanch Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
// For information related to this code contact:
// CERN, CN Division, ASD Group
// GEANT4 Collaboration
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// --------------------------------------------------------------
// ------------------------------------------------------------
//
// Modifications:
// 20/09/00 update fluctuations V.Ivanchenko
// 22/11/00 minor fix in fluctuations V.Ivanchenko
//
// --------------------------------------------------------------
#include "G4VeLowEnergyLoss.hh"
@@ -844,7 +849,8 @@ G4PhysicsTable* G4VeLowEnergyLoss::BuildRangeCoeffCTable(G4PhysicsTable* theRang
G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
G4Material* aMaterial,
G4double MeanLoss)
G4double MeanLoss,
G4double step)
// calculate actual loss from the mean loss
// The model used to get the fluctuation is essentially the same as in Glandz in Geant3.
{
@@ -853,6 +859,7 @@ G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
static const G4double sumaLim = -log(probLim) ;
static const G4double alim=10.;
static const G4double kappa = 10. ;
static const G4double factor = twopi_mc2_rcl2 ;
// check if the material has changed ( cache mechanism)
@@ -903,10 +910,11 @@ G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
// Gaussian fluctuation ?
if(MeanLoss >= kappa*Tm)
{
siga = sqrt(MeanLoss*Tm*(1.-0.5*beta2)) ;
loss = RandGauss::shoot(MeanLoss,siga) ;
G4double electronDensity = aMaterial->GetElectronDensity() ;
siga = sqrt(Tm*(1.0-0.5*beta2)*step*
factor*electronDensity/beta2) ;
loss = G4RandGauss::shoot(MeanLoss,siga) ;
if(loss < 0.) loss = 0. ;
// G4cout << "MGP Gaussian: Tm = " << Tm << ", siga = " << siga << ", loss = " << loss << G4endl;
return loss ;
}
@@ -942,7 +950,7 @@ G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
if(a3>alim)
{
siga=sqrt(a3) ;
p3 = G4std::max(0,G4int(RandGauss::shoot(a3,siga)+0.5));
p3 = G4std::max(0,G4int(G4RandGauss::shoot(a3,siga)+0.5));
}
else p3 = G4Poisson(a3);
@@ -960,7 +968,7 @@ G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
if (Tm <= 0.)
{
loss = MeanLoss;
p3 = 0.;
p3 = 0;
// G4cout << "MGP correction loss = MeanLoss " << loss/keV << G4endl;
}
else
@@ -972,7 +980,7 @@ G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
if(a3>alim)
{
siga=sqrt(a3) ;
p3 = G4std::max(0,G4int(RandGauss::shoot(a3,siga)+0.5));
p3 = G4std::max(0,G4int(G4RandGauss::shoot(a3,siga)+0.5));
}
else
p3 = G4Poisson(a3);
@@ -1006,7 +1014,7 @@ G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
if(a1>alim)
{
siga=sqrt(a1) ;
p1 = G4std::max(0,int(RandGauss::shoot(a1,siga)+0.5));
p1 = G4std::max(0,int(G4RandGauss::shoot(a1,siga)+0.5));
}
else
p1 = G4Poisson(a1);
@@ -1015,7 +1023,7 @@ G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
if(a2>alim)
{
siga=sqrt(a2) ;
p2 = G4std::max(0,int(RandGauss::shoot(a2,siga)+0.5));
p2 = G4std::max(0,int(G4RandGauss::shoot(a2,siga)+0.5));
}
else
p2 = G4Poisson(a2);
@@ -1034,7 +1042,7 @@ G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
if(a3>alim)
{
siga=sqrt(a3) ;
p3 = G4std::max(0,int(RandGauss::shoot(a3,siga)+0.5));
p3 = G4std::max(0,int(G4RandGauss::shoot(a3,siga)+0.5));
}
else
p3 = G4Poisson(a3);
@@ -1050,14 +1058,14 @@ G4double G4VeLowEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
rfac = dp3/(G4double(nmaxCont2)+dp3);
namean = G4double(p3)*rfac;
sa = G4double(nmaxCont1)*rfac;
na = RandGauss::shoot(namean,sa);
na = G4RandGauss::shoot(namean,sa);
if (na > 0.)
{
alfa = w1*G4double(nmaxCont2+p3)/(w1*G4double(nmaxCont2)+G4double(p3));
alfa1 = alfa*log(alfa)/(alfa-1.);
ea = na*ipotFluct*alfa1;
sea = ipotFluct*sqrt(na*(alfa-alfa1*alfa1));
lossc += RandGauss::shoot(ea,sea);
lossc += G4RandGauss::shoot(ea,sea);
}
}