Import Geant4 3.0.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.2 2000/06/07 16:54:26 maire Exp $
|
||||
$Id: History,v 1.5 2000/11/08 14:29:11 maire Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,15 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
08 nov 00: mma (muons-V02-00-03)
|
||||
- signature in GetLossWithFluct changed L.Urban 30/10/00
|
||||
|
||||
11 aug 00: mma (muons-V02-00-01)
|
||||
|
||||
03 aug 00: gc (muons-V02-00-00r)
|
||||
- G4VIMuEnergyLoss.cc: changed RandGauss to G4RandGauss to fix problem of
|
||||
events' reproducibility.
|
||||
|
||||
07 jun 00: mma (muons-V01-01-03)
|
||||
- virtual destructor for G4VEnergyLoss
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IMuBremsstrahlung.hh,v 1.3 2000/04/25 14:18:57 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IMuBremsstrahlung.icc,v 1.2 1999/12/15 14:51:41 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
// GEANT 4 class inlined methods file
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IMuIonisation.hh,v 1.3 2000/04/25 14:18:58 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IMuIonisation.icc,v 1.2 1999/12/15 14:51:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IMuPairProduction.hh,v 1.3 2000/04/25 14:18:58 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $Id:
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IMuPairProduction.icc,v 1.2 1999/12/15 14:51:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $Id:
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4MuBremsstrahlung.hh,v 1.8 2000/05/23 09:55:37 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4MuBremsstrahlung.icc,v 1.3 1999/12/15 14:51:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
// GEANT 4 class inlined methods file
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4MuIonisation.hh,v 1.8 2000/04/25 14:18:58 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4MuIonisation.icc,v 1.2 1999/12/15 14:51:43 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4MuPairProduction.hh,v 1.8 2000/05/23 16:03:25 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4MuPairProduction.icc,v 1.3 2000/02/10 08:29:13 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
// GEANT 4 class inlined methods file
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VIMuEnergyLoss.hh,v 1.2 2000/06/07 16:50:21 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4VIMuEnergyLoss.hh,v 1.3 2000/08/15 09:40:16 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $Id:
|
||||
// -------------------------------------------------------------------
|
||||
@@ -112,7 +112,10 @@ class G4VIMuEnergyLoss : public G4IVContinuousDiscreteProcess
|
||||
G4Material *aMaterial);
|
||||
|
||||
G4double GetLossWithFluct(const G4DynamicParticle *aParticle,
|
||||
G4Material *aMaterial) ;
|
||||
G4Material *aMaterial,
|
||||
G4double ChargeSquare,
|
||||
G4double MeanLoss,
|
||||
G4double Step ) ;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -263,6 +266,7 @@ class G4VIMuEnergyLoss : public G4IVContinuousDiscreteProcess
|
||||
|
||||
// data members to speed up the fluctuation calculation
|
||||
G4Material *lastMaterial ;
|
||||
G4int imat ;
|
||||
G4double f1Fluct,f2Fluct,e1Fluct,e2Fluct,rateFluct,ipotFluct;
|
||||
G4double e1LogFluct,e2LogFluct,ipotLogFluct;
|
||||
const G4double MaxExcitationNumber ;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VIMuEnergyLoss.icc,v 1.1 2000/04/25 14:18:59 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $Id:
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VMuEnergyLoss.hh,v 1.2 2000/06/07 16:50:21 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// -------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VMuEnergyLoss.icc,v 1.1 2000/04/25 14:18:59 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// ---------------------------------------------------------------
|
||||
// GEANT 4 class inlined methods file
|
||||
//
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IMuBremsstrahlung.cc,v 1.4 2000/04/25 14:19:00 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IMuIonisation.cc,v 1.4 2000/04/25 14:19:01 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IMuPairProduction.cc,v 1.5 2000/04/25 14:19:01 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $Id:
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4MuBremsstrahlung.cc,v 1.12 2000/05/23 09:58:48 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4MuIonisation.cc,v 1.11 2000/05/23 09:58:47 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4MuPairProduction.cc,v 1.15 2000/05/23 09:58:49 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VIMuEnergyLoss.cc,v 1.1 2000/04/25 14:19:02 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4VIMuEnergyLoss.cc,v 1.3 2000/08/15 09:40:41 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// $Id:
|
||||
// --------------------------------------------------------------
|
||||
// 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
|
||||
// ---------- G4VIMuEnergyLoss physics process -----------
|
||||
@@ -1313,7 +1313,7 @@ G4VParticleChange* G4VIMuEnergyLoss::AlongStepDoIt(
|
||||
fMeanLoss = E-0.5*(discr-RangeCoeffB)/RangeCoeffA ;
|
||||
|
||||
// now the loss with fluctuation
|
||||
finalT = E-GetLossWithFluct(aParticle,aMaterial) ;
|
||||
finalT = E-GetLossWithFluct(aParticle,aMaterial,1.,fMeanLoss,Step) ;
|
||||
if (finalT < 0.) finalT = 0. ;
|
||||
}
|
||||
}
|
||||
@@ -1337,191 +1337,234 @@ G4VParticleChange* G4VIMuEnergyLoss::AlongStepDoIt(
|
||||
|
||||
}
|
||||
|
||||
G4double G4VIMuEnergyLoss::GetLossWithFluct(const G4DynamicParticle *aParticle,
|
||||
G4Material *aMaterial)
|
||||
// calculate actual loss from the mean loss
|
||||
// The model used to get the fluctuation is the same as in
|
||||
// sr GLANDZ in GEANT3.
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4VIMuEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
G4Material* aMaterial,
|
||||
G4double ChargeSquare,
|
||||
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.
|
||||
|
||||
static const G4double minLoss = 1.*eV ;
|
||||
static const G4double probLim = 0.01 ;
|
||||
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)
|
||||
|
||||
if(aMaterial == lastMaterial)
|
||||
;
|
||||
else
|
||||
{
|
||||
lastMaterial= aMaterial;
|
||||
f1Fluct = aMaterial->GetIonisation()->GetF1fluct();
|
||||
f2Fluct = aMaterial->GetIonisation()->GetF2fluct();
|
||||
e1Fluct = aMaterial->GetIonisation()->GetEnergy1fluct();
|
||||
e2Fluct = aMaterial->GetIonisation()->GetEnergy2fluct();
|
||||
e1LogFluct = aMaterial->GetIonisation()->GetLogEnergy1fluct();
|
||||
e2LogFluct = aMaterial->GetIonisation()->GetLogEnergy2fluct();
|
||||
rateFluct = aMaterial->GetIonisation()->GetRateionexcfluct();
|
||||
ipotFluct = aMaterial->GetIonisation()->GetMeanExcitationEnergy();
|
||||
ipotLogFluct= aMaterial->GetIonisation()->GetLogMeanExcEnergy();
|
||||
}
|
||||
if (aMaterial != lastMaterial)
|
||||
{
|
||||
lastMaterial = aMaterial;
|
||||
imat = aMaterial->GetIndex();
|
||||
f1Fluct = aMaterial->GetIonisation()->GetF1fluct();
|
||||
f2Fluct = aMaterial->GetIonisation()->GetF2fluct();
|
||||
e1Fluct = aMaterial->GetIonisation()->GetEnergy1fluct();
|
||||
e2Fluct = aMaterial->GetIonisation()->GetEnergy2fluct();
|
||||
e1LogFluct = aMaterial->GetIonisation()->GetLogEnergy1fluct();
|
||||
e2LogFluct = aMaterial->GetIonisation()->GetLogEnergy2fluct();
|
||||
rateFluct = aMaterial->GetIonisation()->GetRateionexcfluct();
|
||||
ipotFluct = aMaterial->GetIonisation()->GetMeanExcitationEnergy();
|
||||
ipotLogFluct = aMaterial->GetIonisation()->GetLogMeanExcEnergy();
|
||||
}
|
||||
|
||||
G4double Tkin,rmass,tau,tau1,tau2,Tm,w1,w2,w3,lnw3,C,prob,
|
||||
beta2,suma,e0,Em,loss,lossc ,w ;
|
||||
G4double a1,a2,a3 ;
|
||||
G4long p1,p2,p3 ;
|
||||
G4int nb ;
|
||||
G4double Corrfac, na,alfa,rfac,namean,sa,alfa1,ea,sea ;
|
||||
G4double dp1,dnmaxDirectFluct,dp3,dnmaxCont2 ;
|
||||
G4double threshold,w1,w2,C,
|
||||
beta2,suma,e0,loss,lossc ,w,electronDensity;
|
||||
G4double a1,a2,a3;
|
||||
G4int p1,p2,p3;
|
||||
G4int nb;
|
||||
G4double Corrfac, na,alfa,rfac,namean,sa,alfa1,ea,sea;
|
||||
G4double dp1,dp3;
|
||||
G4double siga ;
|
||||
|
||||
// shortcut for very very small loss
|
||||
if(MeanLoss < minLoss) return MeanLoss ;
|
||||
|
||||
// get particle data
|
||||
// get particle data
|
||||
G4double Tkin = aParticle->GetKineticEnergy();
|
||||
ParticleMass = aParticle->GetMass() ;
|
||||
|
||||
Tkin = aParticle->GetKineticEnergy();
|
||||
threshold =((*G4Electron::Electron()).GetCutsInEnergy())[imat];
|
||||
G4double rmass = electron_mass_c2/ParticleMass;
|
||||
G4double tau = Tkin/ParticleMass, tau1 = tau+1., tau2 = tau*(tau+2.);
|
||||
G4double Tm = 2.*electron_mass_c2*tau2/(1.+2.*tau1*rmass+rmass*rmass);
|
||||
|
||||
rmass=electron_mass_c2/ParticleMass;
|
||||
tau = Tkin/ParticleMass;
|
||||
tau1 = tau+1.;
|
||||
tau2 = tau*(tau+2.);
|
||||
Tm = 2.*electron_mass_c2*tau2/(1.+2.*tau1*rmass+rmass*rmass)
|
||||
-ipotFluct;
|
||||
if (Tm<0.)
|
||||
Tm = 0.;
|
||||
else if (Tm>ParticleCutInKineticEnergyNow)
|
||||
Tm = ParticleCutInKineticEnergyNow ;
|
||||
if (Tm <= ipotFluct) Tm = ipotFluct ;
|
||||
|
||||
w1 = Tm+ipotFluct;
|
||||
w2 = w1/ipotFluct;
|
||||
w3 = 2.*electron_mass_c2*tau2;
|
||||
lnw3 = log(w3);
|
||||
if(Tm > threshold) Tm = threshold;
|
||||
beta2 = tau2/(tau1*tau1);
|
||||
|
||||
C = (1.-rateFluct)*fMeanLoss/(lnw3-ipotLogFluct-beta2);
|
||||
|
||||
a1 = C*f1Fluct*(lnw3-e1LogFluct-beta2)/e1Fluct;
|
||||
a2 = C*f2Fluct*(lnw3-e2LogFluct-beta2)/e2Fluct;
|
||||
if(Tm>0.)
|
||||
a3 = rateFluct*fMeanLoss*Tm/(ipotFluct*w1*log(w2));
|
||||
else
|
||||
// Gaussian fluctuation ?
|
||||
if(MeanLoss >= kappa*Tm)
|
||||
{
|
||||
a1 /= rateFluct;
|
||||
a2 /= rateFluct;
|
||||
a3 = 0.;
|
||||
electronDensity = aMaterial->GetElectronDensity() ;
|
||||
siga = sqrt(MeanLoss*Tm*(0.5-0.25*beta2)*step*
|
||||
factor*electronDensity*ChargeSquare/beta2) ;
|
||||
loss = G4RandGauss::shoot(MeanLoss,siga) ;
|
||||
if(loss < 0.) loss = 0. ;
|
||||
return loss ;
|
||||
}
|
||||
|
||||
w1 = Tm/ipotFluct;
|
||||
w2 = log(2.*electron_mass_c2*tau2);
|
||||
|
||||
suma = a1+a2+a3 ;
|
||||
C = MeanLoss*(1.-rateFluct)/(w2-ipotLogFluct-beta2);
|
||||
|
||||
if ( suma>MaxExcitationNumber)
|
||||
// no fluctuation if the loss is too big................
|
||||
loss = fMeanLoss ;
|
||||
a1 = C*f1Fluct*(w2-e1LogFluct-beta2)/e1Fluct;
|
||||
a2 = C*f2Fluct*(w2-e2LogFluct-beta2)/e2Fluct;
|
||||
if(Tm > ipotFluct)
|
||||
a3 = rateFluct*MeanLoss*(Tm-ipotFluct)/(ipotFluct*Tm*log(w1));
|
||||
else
|
||||
// fluctuation....................................
|
||||
|
||||
{
|
||||
a1 /= 1.-rateFluct ;
|
||||
a2 /= 1.-rateFluct ;
|
||||
a3 = 0. ;
|
||||
}
|
||||
|
||||
if(suma<50.)
|
||||
prob = exp(-suma) ;
|
||||
else
|
||||
prob = 0.;
|
||||
suma = a1+a2+a3;
|
||||
|
||||
if( prob>probLimFluct)
|
||||
// very small Step
|
||||
{
|
||||
e0 = aMaterial->GetIonisation()->GetEnergy0fluct();
|
||||
loss = 0. ;
|
||||
|
||||
if( Tm<= 0.)
|
||||
if(suma < sumaLim) // very small Step
|
||||
{
|
||||
a1=fMeanLoss/e0;
|
||||
p1 = G4Poisson(a1);
|
||||
loss = p1*e0 ;
|
||||
}
|
||||
else
|
||||
{
|
||||
Em = Tm+e0;
|
||||
a1 = fMeanLoss*(Em-e0)/(Em*e0*log(Em/e0));
|
||||
p1 = G4Poisson(a1);
|
||||
w = (Em-e0)/Em;
|
||||
// just to save time .....
|
||||
if ( p1> nmaxDirectFluct)
|
||||
e0 = aMaterial->GetIonisation()->GetEnergy0fluct();
|
||||
|
||||
if(Tm == ipotFluct)
|
||||
{
|
||||
dp1 = p1;
|
||||
dnmaxDirectFluct=nmaxDirectFluct;
|
||||
Corrfac = dp1/dnmaxDirectFluct;
|
||||
p1 = nmaxDirectFluct;
|
||||
a3 = MeanLoss/e0;
|
||||
|
||||
if(a3>alim)
|
||||
{
|
||||
siga=sqrt(a3) ;
|
||||
p3 = G4std::max(0,int(G4RandGauss::shoot(a3,siga)+0.5));
|
||||
}
|
||||
p3 = G4Poisson(a3);
|
||||
|
||||
loss = p3*e0 ;
|
||||
|
||||
if(p3 > 0)
|
||||
loss += (1.-2.*G4UniformRand())*e0 ;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Tm = Tm-ipotFluct+e0 ;
|
||||
a3 = MeanLoss*(Tm-e0)/(Tm*e0*log(Tm/e0));
|
||||
|
||||
if(a3>alim)
|
||||
{
|
||||
siga=sqrt(a3) ;
|
||||
p3 = G4std::max(0,int(G4RandGauss::shoot(a3,siga)+0.5));
|
||||
}
|
||||
else
|
||||
p3 = G4Poisson(a3);
|
||||
|
||||
if(p3 > 0)
|
||||
{
|
||||
w = (Tm-e0)/Tm ;
|
||||
if(p3 > nmaxCont2)
|
||||
{
|
||||
dp3 = G4float(p3) ;
|
||||
Corrfac = dp3/G4float(nmaxCont2) ;
|
||||
p3 = nmaxCont2 ;
|
||||
}
|
||||
else
|
||||
Corrfac = 1. ;
|
||||
|
||||
for(G4int i=0; i<p3; i++) loss += 1./(1.-w*G4UniformRand()) ;
|
||||
loss *= e0*Corrfac ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else // not so small Step
|
||||
|
||||
{
|
||||
// excitation type 1
|
||||
if(a1>alim)
|
||||
{
|
||||
siga=sqrt(a1) ;
|
||||
p1 = G4std::max(0,int(G4RandGauss::shoot(a1,siga)+0.5));
|
||||
}
|
||||
else
|
||||
Corrfac = 1.;
|
||||
p1 = G4Poisson(a1);
|
||||
|
||||
loss =0.;
|
||||
for (long i=0; i<p1; i++)
|
||||
loss += 1./(1.-w*G4UniformRand());
|
||||
loss *= e0;
|
||||
// excitation type 2
|
||||
if(a2>alim)
|
||||
{
|
||||
siga=sqrt(a2) ;
|
||||
p2 = G4std::max(0,int(G4RandGauss::shoot(a2,siga)+0.5));
|
||||
}
|
||||
else
|
||||
p2 = G4Poisson(a2);
|
||||
|
||||
loss *= Corrfac ;
|
||||
loss = p1*e1Fluct+p2*e2Fluct;
|
||||
|
||||
// smearing to avoid unphysical peaks
|
||||
if(p2 > 0)
|
||||
loss += (1.-2.*G4UniformRand())*e2Fluct;
|
||||
else if (loss>0.)
|
||||
loss += (1.-2.*G4UniformRand())*e1Fluct;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
// not so small Step ...
|
||||
{
|
||||
p1 = G4Poisson(a1);
|
||||
p2 = G4Poisson(a2);
|
||||
loss = p1*e1Fluct+p2*e2Fluct;
|
||||
if(loss>0.)
|
||||
loss += (1.-2.*G4UniformRand())*e1Fluct;
|
||||
|
||||
p3 = G4Poisson(a3);
|
||||
|
||||
// direct sampling of the 'ionization' loss
|
||||
// --------it is slow-------------------
|
||||
// w = Tm/(Tm+ipotFluct);
|
||||
// lossc = 0.;
|
||||
// for (long j=0; j<p3; j++)
|
||||
// lossc += 1./(1.-G4UniformRand()*w);
|
||||
// lossc *= ipotFluct;
|
||||
// loss += lossc ;
|
||||
|
||||
// just to save computing time ....
|
||||
|
||||
lossc = 0.;
|
||||
na = 0.;
|
||||
alfa = 1.;
|
||||
|
||||
|
||||
if( p3>nmaxCont2)
|
||||
// ionisation .......................................
|
||||
if(a3 > 0.)
|
||||
{
|
||||
dp3= p3 ;
|
||||
dnmaxCont2 = nmaxCont2;
|
||||
rfac=dp3/(dnmaxCont2+dp3);
|
||||
namean=p3*rfac;
|
||||
sa=nmaxCont1*rfac;
|
||||
na=RandGauss::shoot(namean,sa);
|
||||
if(a3>alim)
|
||||
{
|
||||
siga=sqrt(a3) ;
|
||||
p3 = G4std::max(0,int(G4RandGauss::shoot(a3,siga)+0.5));
|
||||
}
|
||||
else
|
||||
|
||||
if(na>0.)
|
||||
{
|
||||
alfa=w2*(nmaxCont2+p3)/(w2*nmaxCont2+p3);
|
||||
alfa1=alfa*log(alfa)/(alfa-1.);
|
||||
ea=na*ipotFluct*alfa1;
|
||||
sea=ipotFluct*sqrt(na*(alfa-alfa1*alfa1));
|
||||
lossc +=RandGauss::shoot(ea,sea);
|
||||
p3 = G4Poisson(a3);
|
||||
|
||||
}
|
||||
lossc = 0.;
|
||||
if(p3 > 0)
|
||||
{
|
||||
na = 0.;
|
||||
alfa = 1.;
|
||||
if (p3 > nmaxCont2)
|
||||
{
|
||||
dp3 = G4float(p3);
|
||||
rfac = dp3/(G4float(nmaxCont2)+dp3);
|
||||
namean = G4float(p3)*rfac;
|
||||
sa = G4float(nmaxCont1)*rfac;
|
||||
na = G4RandGauss::shoot(namean,sa);
|
||||
if (na > 0.)
|
||||
{
|
||||
alfa = w1*G4float(nmaxCont2+p3)/(w1*G4float(nmaxCont2)+G4float(p3));
|
||||
alfa1 = alfa*log(alfa)/(alfa-1.);
|
||||
ea = na*ipotFluct*alfa1;
|
||||
sea = ipotFluct*sqrt(na*(alfa-alfa1*alfa1));
|
||||
lossc += G4RandGauss::shoot(ea,sea);
|
||||
}
|
||||
}
|
||||
|
||||
nb = G4int(G4float(p3)-na);
|
||||
if (nb > 0)
|
||||
{
|
||||
w2 = alfa*ipotFluct;
|
||||
w = (Tm-w2)/Tm;
|
||||
for (G4int k=0; k<nb; k++) lossc += w2/(1.-w*G4UniformRand());
|
||||
|
||||
}
|
||||
}
|
||||
loss += lossc;
|
||||
}
|
||||
}
|
||||
|
||||
nb = G4int(p3-na);
|
||||
|
||||
|
||||
if(nb>0)
|
||||
{
|
||||
w2=alfa*ipotFluct;
|
||||
w=(w1-w2)/w1;
|
||||
|
||||
for (G4int k=0; k<nb; k++)
|
||||
lossc += w2/(1.-w*G4UniformRand());
|
||||
}
|
||||
|
||||
loss += lossc ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return loss ;
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VMuEnergyLoss.cc,v 1.5 2000/06/13 16:36:25 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4VMuEnergyLoss.cc,v 1.7 2000/10/30 07:17:30 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
@@ -24,6 +24,7 @@
|
||||
// corrections by L.Urban on 27/05/98 (other corrs come soon!)
|
||||
// cleanup L.Urban on 23/10/98
|
||||
// corrections due to new e.m. structure L.Urban 10/02/00
|
||||
// signature in GetLossWithFluct changed L.Urban 30/10/00
|
||||
// --------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -432,7 +433,7 @@ G4VParticleChange* G4VMuEnergyLoss::AlongStepDoIt(
|
||||
if ((EnlossFlucFlag) && (finalT > 0.) && (finalT < E)&&(E > LowerBoundEloss))
|
||||
|
||||
{
|
||||
finalT = E-GetLossWithFluct(aParticle,aMaterial,MeanLoss);
|
||||
finalT = E-GetLossWithFluct(aParticle,aMaterial,1.,MeanLoss,Step);
|
||||
if (finalT < 0.) finalT = 0. ;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user