Import Geant4 0.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:09:25 +02:00
parent b97f8d0df7
commit aaa409b6ee
2922 changed files with 55107 additions and 81674 deletions
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4MultipleScattering.icc,v 2.7 1998/12/02 16:47:12 urban Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4MultipleScattering.icc,v 1.2 1999/02/16 13:21:24 urban Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
// $Id:
// -------------------------------------------------------------
@@ -23,76 +23,6 @@
// 22/10/98: cleanup , L.Urban
//---------------------------------------------------------------
inline G4double G4MultipleScattering::TrueToGeomTransformation(
const G4DynamicParticle *aParticle,
G4Material *aMaterial,
G4double truePathLength)
// it sets the data member fTransportMeanFreePath and
// performs the true path length -> geometrical path length
// transformation
{
const G4double tausmall=5.e-5 , taubig = 50. ;
const G4double lowexp=0.4 ,biglambda = 1.e10;
G4double KineticEnergy,tau,etau,geomPathLength ;
G4int materialIndex ;
G4bool isOut ;
KineticEnergy = aParticle->GetKineticEnergy() ;
if((lastMaterial == aMaterial) && (lastKineticEnergy == KineticEnergy))
{
;
}
else
{
lastMaterial=aMaterial;
lastKineticEnergy=KineticEnergy;
materialIndex = aMaterial->GetIndex() ;
if(KineticEnergy<LowestKineticEnergy)
fTransportMeanFreePath =
exp(lowexp*log((KineticEnergy/LowestKineticEnergy)))*
(*theTransportMeanFreePathTable)
(materialIndex)->GetValue(LowestKineticEnergy,isOut);
else {
if(KineticEnergy>HighestKineticEnergy) KineticEnergy=HighestKineticEnergy;
fTransportMeanFreePath = (*theTransportMeanFreePathTable)
(materialIndex)->GetValue(KineticEnergy,isOut);
}
}
// do the true -> geom transformation
if( fTransportMeanFreePath > biglambda )
{
geomPathLength = truePathLength ;
}
else
{
tau = truePathLength/fTransportMeanFreePath ;
if(tau<tausmall)
etau = tau ;
else
{
if(tau>taubig)
etau = 1. ;
else
etau = 1.-exp(-tau) ;
}
geomPathLength = fTransportMeanFreePath*etau ;
}
tLast = truePathLength ;
zLast = geomPathLength ;
return geomPathLength ;
}
inline G4double G4MultipleScattering::GetContinuousStepLimit(
const G4Track& track,
G4double,
@@ -101,18 +31,69 @@ inline G4double G4MultipleScattering::GetContinuousStepLimit(
{
G4double zPathLength,tPathLength ;
const G4DynamicParticle* aParticle ;
G4Material* aMaterial ;
G4double KineticEnergy,tau ;
G4bool isOut ;
// this process is not a candidate for selection!!!!!!!!!
SetGPILSelection(NotCandidateForSelection) ;
if(track.GetCurrentStepNumber() == 1)
stepFlag = 0 ;
tPathLength = currentMinimumStep ;
aMaterial = track.GetMaterial() ;
materialIndex = aMaterial->GetIndex() ;
aParticle = track.GetDynamicParticle() ;
zPathLength = TrueToGeomTransformation(aParticle,
track.GetMaterial(),
tPathLength);
return zPathLength ;
KineticEnergy = aParticle->GetKineticEnergy() ;
if((lastMaterial != aMaterial) || (lastKineticEnergy != KineticEnergy))
{
lastMaterial = aMaterial;
lastKineticEnergy = KineticEnergy ;
materialIndex = aMaterial->GetIndex() ;
if((KineticEnergy >= Tlimit)&&(stepFlag != 1))
fTransportMeanFreePath = (*theTransportMeanFreePathTable)
(materialIndex)->GetValue(KineticEnergy,isOut);
else if((KineticEnergy < Tlimit)&&(stepFlag != 1))
{
stepFlag = 1 ;
range = G4EnergyLossTables::GetRange(aParticle->GetDefinition(),
KineticEnergy,aMaterial) ;
alpha1 = range/fTransportMeanFreePath+1 ;
}
}
// do the true -> geom transformation
if( fTransportMeanFreePath > biglambda )
{
zPathLength = tPathLength ;
}
else if(stepFlag == 0)
{
tau = tPathLength/fTransportMeanFreePath ;
zPathLength = fTransportMeanFreePath*(1.-exp(-tau)) ;
}
else
{
tau = tPathLength/range ;
if(tau<0.99)
zPathLength = range*(1.-exp(alpha1*log(1.-tau)))/alpha1 ;
else
zPathLength = range/alpha1 ;
}
tLast = tPathLength ;
zLast = zPathLength ;
return zPathLength ;
}
inline G4double G4MultipleScattering::GetMeanFreePath(
const G4Track& track,
G4double,
@@ -131,10 +112,7 @@ inline G4VParticleChange* G4MultipleScattering::AlongStepDoIt(
const G4Track& track,const G4Step& Step)
// only a geom path->true path transformation is performed
{
//!!! const G4double tausmall=5.e-5,taubig=0.9999,trueBig=5. ;
const G4double tausmall=5.e-5,taubig=0.9999,trueBig=9.21034 ;
const G4double biglambda=1.e10 ;
G4double tau ,geomPathLength, truePathLength ;
G4double tau,geomPathLength, truePathLength ;
fParticleChange.Initialize(track);
@@ -144,26 +122,19 @@ inline G4VParticleChange* G4MultipleScattering::AlongStepDoIt(
{
truePathLength = tLast ;
}
else
else if( fTransportMeanFreePath > biglambda )
{
if( fTransportMeanFreePath > biglambda )
{
truePathLength = track.GetStepLength() ;
}
else
{
tau = track.GetStepLength()/fTransportMeanFreePath ;
if(tau<tausmall)
truePathLength = fTransportMeanFreePath*tau*(1.+0.5*tau) ;
else
{
if(tau<taubig)
truePathLength = -fTransportMeanFreePath*log(1.-tau) ;
else
truePathLength = fTransportMeanFreePath*trueBig ;
}
}
truePathLength = geomPathLength ;
}
else if(stepFlag == 0)
{
tau = geomPathLength/fTransportMeanFreePath ;
truePathLength = -fTransportMeanFreePath*log(1.-tau) ;
}
else
{
truePathLength = range*(1.-exp(log(1.-alpha1*geomPathLength/range)/
alpha1)) ;
}
fParticleChange.SetTrueStepLength(truePathLength) ;