Import Geant4 1.0.0 source tree
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
// 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: G4eEnergyLossPlus.cc,v 1.11 1999/06/18 11:30:14 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4eEnergyLossPlus.cc,v 1.16.6.1 1999/12/07 20:51:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// $Id:
|
||||
// -----------------------------------------------------------
|
||||
@@ -31,6 +31,10 @@
|
||||
|
||||
#include "G4eEnergyLossPlus.hh"
|
||||
#include "G4EnergyLossMessenger.hh"
|
||||
#include "G4Poisson.hh"
|
||||
#include "G4Navigator.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -1003,7 +1007,14 @@ G4VParticleChange* G4eEnergyLossPlus::AlongStepDoIt( const G4Track& trackData,
|
||||
if(Tc > MinDeltaEnergyNow)
|
||||
{
|
||||
presafety = stepData.GetPreStepPoint()->GetSafety() ;
|
||||
postsafety = stepData.GetPostStepPoint()->GetSafety() ;
|
||||
|
||||
// postsafety = stepData.GetPostStepPoint()->GetSafety() ;
|
||||
|
||||
G4Navigator *navigator=
|
||||
G4TransportationManager::GetTransportationManager()
|
||||
->GetNavigatorForTracking();
|
||||
postsafety =
|
||||
navigator->ComputeSafety(stepData.GetPostStepPoint()->GetPosition());
|
||||
|
||||
safety=min(presafety,postsafety);
|
||||
|
||||
@@ -1016,12 +1027,6 @@ G4VParticleChange* G4eEnergyLossPlus::AlongStepDoIt( const G4Track& trackData,
|
||||
if(T0<MinDeltaEnergyNow) T0=MinDeltaEnergyNow ;
|
||||
// ..................................................................
|
||||
|
||||
if((presafety>=rcut)&&(postsafety>=rcut))
|
||||
{
|
||||
fragment = 0. ;
|
||||
}
|
||||
else
|
||||
{
|
||||
x1=stepData.GetPreStepPoint()->GetPosition().x();
|
||||
y1=stepData.GetPreStepPoint()->GetPosition().y();
|
||||
z1=stepData.GetPreStepPoint()->GetPosition().z();
|
||||
@@ -1052,7 +1057,6 @@ G4VParticleChange* G4eEnergyLossPlus::AlongStepDoIt( const G4Track& trackData,
|
||||
time0 += dTime ;
|
||||
frperstep=-fragment/Step;
|
||||
}
|
||||
}
|
||||
|
||||
if(fragment>0.)
|
||||
{
|
||||
@@ -1061,14 +1065,22 @@ G4VParticleChange* G4eEnergyLossPlus::AlongStepDoIt( const G4Track& trackData,
|
||||
(aMaterial->GetTotNbOfElectPerVolume())/T0+0.5) ;
|
||||
if(N > Ndeltamax)
|
||||
N = Ndeltamax ;
|
||||
G4double Px,Py,Pz ;
|
||||
G4ThreeVector ParticleDirection ;
|
||||
ParticleDirection=stepData.GetPostStepPoint()->
|
||||
GetMomentumDirection() ;
|
||||
Px =ParticleDirection.x() ;
|
||||
Py =ParticleDirection.y() ;
|
||||
Pz =ParticleDirection.z() ;
|
||||
|
||||
G4int subdelta = 0;
|
||||
|
||||
if(N > 0)
|
||||
{
|
||||
G4double Tkin,Etot,P,T,p,costheta,sintheta,phi,dirx,diry,dirz,
|
||||
Pnew,Px,Py,Pz,delToverTc,
|
||||
Pnew,delToverTc,
|
||||
sumT,delTkin,delLoss,rate,
|
||||
urandom ;
|
||||
G4ThreeVector ParticleDirection ;
|
||||
G4StepPoint *point ;
|
||||
|
||||
sumT=0.;
|
||||
@@ -1078,7 +1090,6 @@ G4VParticleChange* G4eEnergyLossPlus::AlongStepDoIt( const G4Track& trackData,
|
||||
P = sqrt(Tkin*(Etot+electron_mass_c2)) ;
|
||||
|
||||
aParticleChange.SetNumberOfSecondaries(N);
|
||||
G4int subdelta = 0;
|
||||
do {
|
||||
subdelta += 1 ;
|
||||
|
||||
@@ -1103,15 +1114,6 @@ G4VParticleChange* G4eEnergyLossPlus::AlongStepDoIt( const G4Track& trackData,
|
||||
dirx=sintheta*cos(phi);
|
||||
diry=sintheta*sin(phi);
|
||||
dirz=costheta;
|
||||
}
|
||||
else
|
||||
{
|
||||
T=epsil ;
|
||||
p=sqrt(T*(T+2.*electron_mass_c2)) ;
|
||||
dirx=0.;
|
||||
diry=0.;
|
||||
dirz=1.;
|
||||
}
|
||||
|
||||
sumT += T ;
|
||||
|
||||
@@ -1157,10 +1159,13 @@ G4VParticleChange* G4eEnergyLossPlus::AlongStepDoIt( const G4Track& trackData,
|
||||
|
||||
aParticleChange.AddSecondary(deltaTrack) ;
|
||||
|
||||
}
|
||||
|
||||
} while (subdelta<N) ;
|
||||
|
||||
// update the particle direction and kinetic energy
|
||||
aParticleChange.SetMomentumChange(Px,Py,Pz) ;
|
||||
if(subdelta > 0)
|
||||
aParticleChange.SetMomentumChange(Px,Py,Pz) ;
|
||||
E = Tkin ;
|
||||
|
||||
}
|
||||
@@ -1198,6 +1203,7 @@ G4VParticleChange* G4eEnergyLossPlus::AlongStepDoIt( const G4Track& trackData,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
G4double G4eEnergyLossPlus::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
G4Material* aMaterial,
|
||||
G4double MeanLoss)
|
||||
@@ -1226,7 +1232,7 @@ G4double G4eEnergyLossPlus::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
G4double threshold,w1,w2,w3,lnw3,C,prob,
|
||||
beta2,suma,e0,Em,loss,lossc ,w;
|
||||
G4double a1,a2,a3;
|
||||
long p1,p2,p3;
|
||||
G4long p1,p2,p3;
|
||||
G4int nb;
|
||||
G4double Corrfac, na,alfa,rfac,namean,sa,alfa1,ea,sea;
|
||||
G4double dp1,dnmaxDirectFluct,dp3,dnmaxCont2;
|
||||
@@ -1276,7 +1282,7 @@ G4double G4eEnergyLossPlus::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
p1 = max(0,int(RandGauss::shoot(a1,siga)+0.5));
|
||||
}
|
||||
else
|
||||
p1 = RandPoisson::shoot(a1);
|
||||
p1 = G4Poisson(a1);
|
||||
loss = p1*e0 ;
|
||||
}
|
||||
else
|
||||
@@ -1289,7 +1295,7 @@ G4double G4eEnergyLossPlus::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
p1 = max(0,int(RandGauss::shoot(a1,siga)+0.5));
|
||||
}
|
||||
else
|
||||
p1 = RandPoisson::shoot(a1);
|
||||
p1 = G4Poisson(a1);
|
||||
w = (Em-e0)/Em;
|
||||
// just to save time
|
||||
if (p1 > nmaxDirectFluct)
|
||||
@@ -1316,14 +1322,14 @@ G4double G4eEnergyLossPlus::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
p1 = max(0,int(RandGauss::shoot(a1,siga)+0.5));
|
||||
}
|
||||
else
|
||||
p1 = RandPoisson::shoot(a1);
|
||||
p1 = G4Poisson(a1);
|
||||
if(a2>alim)
|
||||
{
|
||||
siga=sqrt(a2) ;
|
||||
p2 = max(0,int(RandGauss::shoot(a2,siga)+0.5));
|
||||
}
|
||||
else
|
||||
p2 = RandPoisson::shoot(a2);
|
||||
p2 = G4Poisson(a2);
|
||||
loss = p1*e1Fluct+p2*e2Fluct;
|
||||
if (loss>0.) loss += (1.-2.*G4UniformRand())*e1Fluct;
|
||||
if(a3>alim)
|
||||
@@ -1332,7 +1338,7 @@ G4double G4eEnergyLossPlus::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
p3 = max(0,int(RandGauss::shoot(a3,siga)+0.5));
|
||||
}
|
||||
else
|
||||
p3 = RandPoisson::shoot(a3);
|
||||
p3 = G4Poisson(a3);
|
||||
|
||||
lossc = 0.; na = 0.; alfa = 1.;
|
||||
if (p3 > nmaxCont2)
|
||||
|
||||
Reference in New Issue
Block a user