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: G4ComptonScattering.cc,v 1.2 1999/03/04 16:31:23 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4ComptonScattering.cc,v 1.2.8.1 1999/12/07 20:50:56 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -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: G4EnergyLossMessenger.cc,v 1.1 1999/01/07 16:11:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4EnergyLossMessenger.cc,v 1.2.6.1 1999/12/07 20:50:56 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
#include "G4EnergyLossMessenger.hh"
|
||||
|
||||
#include "G4eEnergyLoss.hh"
|
||||
#include "G4hEnergyLoss.hh"
|
||||
#include "G4eEnergyLossPlus.hh"
|
||||
#include "G4hEnergyLossPlus.hh"
|
||||
|
||||
#include "G4UIcommand.hh"
|
||||
#include "G4UIparameter.hh"
|
||||
@@ -78,10 +81,18 @@ G4EnergyLossMessenger::~G4EnergyLossMessenger()
|
||||
void G4EnergyLossMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
{
|
||||
if (command == RndmStepCmd)
|
||||
{ G4eEnergyLoss::SetRndmStep(RndmStepCmd->GetNewBoolValue(newValue)); }
|
||||
{ G4eEnergyLoss::SetRndmStep(RndmStepCmd->GetNewBoolValue(newValue));
|
||||
G4hEnergyLoss::SetRndmStep(RndmStepCmd->GetNewBoolValue(newValue));
|
||||
G4eEnergyLossPlus::SetRndmStep(RndmStepCmd->GetNewBoolValue(newValue));
|
||||
G4hEnergyLossPlus::SetRndmStep(RndmStepCmd->GetNewBoolValue(newValue));
|
||||
}
|
||||
|
||||
if (command == EnlossFlucCmd)
|
||||
{ G4eEnergyLoss::SetEnlossFluc(EnlossFlucCmd->GetNewBoolValue(newValue)); }
|
||||
{ G4eEnergyLoss::SetEnlossFluc(EnlossFlucCmd->GetNewBoolValue(newValue));
|
||||
G4hEnergyLoss::SetEnlossFluc(EnlossFlucCmd->GetNewBoolValue(newValue));
|
||||
G4eEnergyLossPlus::SetEnlossFluc(EnlossFlucCmd->GetNewBoolValue(newValue));
|
||||
G4hEnergyLossPlus::SetEnlossFluc(EnlossFlucCmd->GetNewBoolValue(newValue));
|
||||
}
|
||||
|
||||
if (command == StepFuncCmd)
|
||||
{
|
||||
@@ -93,6 +104,9 @@ void G4EnergyLossMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
G4String unt = unts;
|
||||
v2 *= G4UIcommand::ValueOf(unt);
|
||||
G4eEnergyLoss::SetStepFunction(v1,v2);
|
||||
G4hEnergyLoss::SetStepFunction(v1,v2);
|
||||
G4eEnergyLossPlus::SetStepFunction(v1,v2);
|
||||
G4hEnergyLossPlus::SetStepFunction(v1,v2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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: G4GammaConversion.cc,v 1.2 1999/03/04 16:31:24 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4GammaConversion.cc,v 1.2.8.1 1999/12/07 20:50:56 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -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: G4IMultipleScattering.cc,v 1.2 1999/04/15 07:47:46 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4IMultipleScattering.cc,v 1.2.8.1 1999/12/07 20:50:57 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// $Id:
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -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: G4IeBremsstrahlung.cc,v 1.3 1999/05/03 11:04:13 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4IeBremsstrahlung.cc,v 1.3.8.1 1999/12/07 20:50:58 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// $Id:
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -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: G4IeEnergyLoss.cc,v 1.5 1999/06/18 11:30:12 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4IeEnergyLoss.cc,v 1.7.6.1 1999/12/07 20:50:58 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// $Id:
|
||||
// -----------------------------------------------------------
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "G4IeEnergyLoss.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
#include "G4EnergyLossMessenger.hh"
|
||||
#include "G4Poisson.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -1066,7 +1067,7 @@ G4double G4IeEnergyLoss::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;
|
||||
@@ -1109,14 +1110,14 @@ G4double G4IeEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
if (Tm <= 0.)
|
||||
{
|
||||
a1 = MeanLoss/e0;
|
||||
p1 = RandPoisson::shoot(a1);
|
||||
p1 = G4Poisson(a1);
|
||||
loss = p1*e0 ;
|
||||
}
|
||||
else
|
||||
{
|
||||
Em = Tm+e0;
|
||||
a1 = MeanLoss*(Em-e0)/(Em*e0*log(Em/e0));
|
||||
p1 = RandPoisson::shoot(a1);
|
||||
p1 = G4Poisson(a1);
|
||||
w = (Em-e0)/Em;
|
||||
// just to save time
|
||||
if (p1 > nmaxDirectFluct)
|
||||
@@ -1137,11 +1138,11 @@ G4double G4IeEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
|
||||
else // not so small Step
|
||||
{
|
||||
p1 = RandPoisson::shoot(a1);
|
||||
p2 = RandPoisson::shoot(a2);
|
||||
p1 = G4Poisson(a1);
|
||||
p2 = G4Poisson(a2);
|
||||
loss = p1*e1Fluct+p2*e2Fluct;
|
||||
if (loss>0.) loss += (1.-2.*G4UniformRand())*e1Fluct;
|
||||
p3 = RandPoisson::shoot(a3);
|
||||
p3 = G4Poisson(a3);
|
||||
|
||||
lossc = 0.; na = 0.; alfa = 1.;
|
||||
if (p3 > nmaxCont2)
|
||||
|
||||
@@ -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: G4IeIonisation.cc,v 1.3 1999/05/03 11:04:12 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4IeIonisation.cc,v 1.3.8.1 1999/12/07 20:50:58 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// $Id:
|
||||
// -------------------------------------------------------------
|
||||
|
||||
@@ -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: G4IeplusAnnihilation.cc,v 1.5 1999/06/25 14:59:19 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4IeplusAnnihilation.cc,v 1.5.8.1 1999/12/07 20:50:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// $Id:
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -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: G4IhEnergyLoss.cc,v 1.4 1999/06/18 11:30:20 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4IhEnergyLoss.cc,v 1.7.6.1 1999/12/07 20:50:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// $Id:
|
||||
// -----------------------------------------------------------
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "G4IhEnergyLoss.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
#include "G4Poisson.hh"
|
||||
|
||||
// Initialisation of static members ******************************************
|
||||
// contributing processes : ion.loss ->NumberOfProcesses is initialized
|
||||
@@ -102,8 +103,8 @@ G4double G4IhEnergyLoss::finalRange = 200.*micrometer ;
|
||||
G4bool G4IhEnergyLoss::rndmStepFlag = false ;
|
||||
G4bool G4IhEnergyLoss::EnlossFlucFlag = true ;
|
||||
|
||||
G4double G4IhEnergyLoss::LowestKineticEnergy= 1.00*keV;
|
||||
G4double G4IhEnergyLoss::HighestKineticEnergy= 100.*TeV;
|
||||
G4double G4IhEnergyLoss::LowestKineticEnergy;
|
||||
G4double G4IhEnergyLoss::HighestKineticEnergy;
|
||||
G4int G4IhEnergyLoss::TotBin;
|
||||
G4double G4IhEnergyLoss::RTable,G4IhEnergyLoss::LOGRTable;
|
||||
|
||||
@@ -1167,6 +1168,7 @@ G4VParticleChange* G4IhEnergyLoss::AlongStepDoIt(
|
||||
return &aParticleChange ;
|
||||
}
|
||||
|
||||
|
||||
G4double G4IhEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
G4Material* aMaterial,
|
||||
G4double MeanLoss)
|
||||
@@ -1194,7 +1196,7 @@ G4double G4IhEnergyLoss::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;
|
||||
@@ -1236,14 +1238,14 @@ G4double G4IhEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
if (Tm <= 0.)
|
||||
{
|
||||
a1 = MeanLoss/e0;
|
||||
p1 = RandPoisson::shoot(a1);
|
||||
p1 = G4Poisson(a1);
|
||||
loss = p1*e0 ;
|
||||
}
|
||||
else
|
||||
{
|
||||
Em = Tm+e0;
|
||||
a1 = MeanLoss*(Em-e0)/(Em*e0*log(Em/e0));
|
||||
p1 = RandPoisson::shoot(a1);
|
||||
p1 = G4Poisson(a1);
|
||||
w = (Em-e0)/Em;
|
||||
// just to save time
|
||||
if (p1 > nmaxDirectFluct)
|
||||
@@ -1264,11 +1266,11 @@ G4double G4IhEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
|
||||
else // not so small Step
|
||||
{
|
||||
p1 = RandPoisson::shoot(a1);
|
||||
p2 = RandPoisson::shoot(a2);
|
||||
p1 = G4Poisson(a1);
|
||||
p2 = G4Poisson(a2);
|
||||
loss = p1*e1Fluct+p2*e2Fluct;
|
||||
if (loss>0.) loss += (1.-2.*G4UniformRand())*e1Fluct;
|
||||
p3 = RandPoisson::shoot(a3);
|
||||
p3 = G4Poisson(a3);
|
||||
|
||||
lossc = 0.; na = 0.; alfa = 1.;
|
||||
if (p3 > nmaxCont2)
|
||||
|
||||
@@ -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: G4IhIonisation.cc,v 1.4 1999/05/03 11:04:14 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4IhIonisation.cc,v 1.5.8.1 1999/12/07 20:50:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
@@ -36,9 +36,6 @@
|
||||
G4IhIonisation::G4IhIonisation(const G4String& processName)
|
||||
: G4IhEnergyLoss(processName),
|
||||
theMeanFreePathTable(NULL),
|
||||
LowestKineticEnergy(1.00*keV),
|
||||
HighestKineticEnergy(100.*TeV),
|
||||
TotBin(100),
|
||||
NumberOfBuildPhysicsTableCalls(0),
|
||||
theProton (G4Proton::Proton()),
|
||||
theAntiProton (G4AntiProton::AntiProton()),
|
||||
@@ -67,6 +64,13 @@ void G4IhIonisation::BuildPhysicsTable(const G4ParticleDefinition& aParticleType
|
||||
NumberOfBuildPhysicsTableCalls += 1 ;
|
||||
if(NumberOfBuildPhysicsTableCalls == 1)
|
||||
{
|
||||
if(&aParticleType == G4Proton::Proton())
|
||||
{
|
||||
LowestKineticEnergy= 1.00*keV;
|
||||
HighestKineticEnergy= 100.*TeV;
|
||||
TotBin=100 ;
|
||||
}
|
||||
|
||||
ParticleMass = aParticleType.GetPDGMass() ;
|
||||
|
||||
G4double Charge = aParticleType.GetPDGCharge();
|
||||
@@ -643,6 +647,8 @@ void G4IhIonisation::BuildLossTable(const G4ParticleDefinition& aParticleType)
|
||||
|
||||
G4double LowEdgeEnergy , ionloss ;
|
||||
G4double RateMass ;
|
||||
G4double deltaloss ;
|
||||
|
||||
G4bool isOutRange ;
|
||||
static const G4MaterialTable* theMaterialTable=
|
||||
G4Material::GetMaterialTable();
|
||||
@@ -712,11 +718,18 @@ void G4IhIonisation::BuildLossTable(const G4ParticleDefinition& aParticleType)
|
||||
{
|
||||
LowEdgeEnergy = aVector->GetLowEdgeEnergy(i) ;
|
||||
tau = LowEdgeEnergy/proton_mass_c2 ;
|
||||
gamma = tau +1. ;
|
||||
bg2 = tau*(tau+2.) ;
|
||||
beta2 = bg2/(gamma*gamma) ;
|
||||
Tmax = 2.*electron_mass_c2*bg2
|
||||
/(1.+2.*gamma*RateMass+RateMass*RateMass) ;
|
||||
|
||||
if ( tau < taul )
|
||||
// low energy part , parametrized energy loss formulae
|
||||
{
|
||||
ionloss = 0. ;
|
||||
deltaloss = 0. ;
|
||||
|
||||
// loop for the elements in the material
|
||||
for (G4int iel=0; iel<NumberOfElements; iel++)
|
||||
{
|
||||
@@ -730,16 +743,21 @@ void G4IhIonisation::BuildLossTable(const G4ParticleDefinition& aParticleType)
|
||||
ionloss += theAtomicNumDensityVector[iel]
|
||||
* element->GetIonisation()->GetClow()/sqrt(tau) ;
|
||||
}
|
||||
if ( DeltaCutInKineticEnergyNow < Tmax)
|
||||
{
|
||||
deltaloss = log(Tmax/DeltaCutInKineticEnergyNow)-
|
||||
beta2*(1.-DeltaCutInKineticEnergyNow/Tmax) ;
|
||||
if(aParticleType.GetPDGSpin() == 0.5)
|
||||
deltaloss += 0.25*(Tmax-DeltaCutInKineticEnergyNow)*
|
||||
(Tmax-DeltaCutInKineticEnergyNow)/
|
||||
(LowEdgeEnergy*LowEdgeEnergy+proton_mass_c2*proton_mass_c2) ;
|
||||
deltaloss *= Factor*ElectronDensity/beta2 ;
|
||||
}
|
||||
ionloss -= deltaloss ;
|
||||
}
|
||||
else
|
||||
// high energy part , Bethe-Bloch formula
|
||||
{
|
||||
gamma = tau +1. ;
|
||||
bg2 = tau*(tau+2.) ;
|
||||
beta2 = bg2/(gamma*gamma) ;
|
||||
Tmax = 2.*electron_mass_c2*bg2
|
||||
/(1.+2.*gamma*RateMass+RateMass*RateMass) ;
|
||||
|
||||
if ( DeltaCutInKineticEnergyNow < Tmax)
|
||||
rcut = DeltaCutInKineticEnergyNow/Tmax ;
|
||||
else
|
||||
|
||||
@@ -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: G4MultipleScattering.cc,v 1.7 1999/06/14 12:51:08 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4MultipleScattering.cc,v 1.16.6.1 1999/12/07 20:50:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// $Id:
|
||||
// --------------------------------------------------------------
|
||||
@@ -21,6 +21,9 @@
|
||||
// **************************************************************
|
||||
// 24/10/97 correction in PostStepDoIt for tau << 1. L.Urban
|
||||
// 09/12/98: charge can be different from +-1 !!!! L.Urban
|
||||
// 29/07/99: corr. for low energy , L.Urban
|
||||
// 17/09/99: corr. for high energy and/or small step , L.Urban
|
||||
// 30/09/99: nuclear size effect correction, L.Urban
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "G4MultipleScattering.hh"
|
||||
@@ -49,6 +52,7 @@
|
||||
scatteringparameter(0.9),
|
||||
tuning (1.00),
|
||||
cpar (1.5),
|
||||
NuclCorrPar (0.0615),FactPar(0.40),
|
||||
fLatDisplFlag(true)
|
||||
{ }
|
||||
|
||||
@@ -68,13 +72,16 @@
|
||||
|
||||
// tables are built for MATERIALS
|
||||
{
|
||||
// parameter for "low energy" msc (not for ions)
|
||||
if((&aParticleType == G4Electron::Electron()) ||
|
||||
(&aParticleType == G4Positron::Positron()) )
|
||||
Tlimit = 100.*keV ;
|
||||
// Tlimit = 100.*keV ;
|
||||
;
|
||||
|
||||
const G4double sigmafactor = twopi*classic_electr_radius*
|
||||
classic_electr_radius ;
|
||||
G4double KineticEnergy,AtomicNumber,sigma,lambda ;
|
||||
G4double KineticEnergy,AtomicNumber,AtomicWeight,
|
||||
sigma,lambda ;
|
||||
G4double density ;
|
||||
|
||||
// destroy old tables if any
|
||||
@@ -119,9 +126,11 @@
|
||||
for (G4int iel=0; iel<NumberOfElements; iel++)
|
||||
{
|
||||
AtomicNumber = (*theElementVector)(iel)->GetZ() ;
|
||||
AtomicWeight = (*theElementVector)(iel)->GetA() ;
|
||||
sigma += theAtomicNumDensityVector[iel]*
|
||||
ComputeTransportCrossSection(aParticleType,
|
||||
KineticEnergy,AtomicNumber) ;
|
||||
KineticEnergy,
|
||||
AtomicNumber,AtomicWeight) ;
|
||||
}
|
||||
sigma *= sigmafactor ;
|
||||
|
||||
@@ -146,7 +155,7 @@
|
||||
G4double G4MultipleScattering::ComputeTransportCrossSection(
|
||||
const G4ParticleDefinition& aParticleType,
|
||||
G4double KineticEnergy,
|
||||
G4double AtomicNumber)
|
||||
G4double AtomicNumber,G4double AtomicWeight)
|
||||
{
|
||||
const G4double epsfactor = 2.*electron_mass_c2*electron_mass_c2*
|
||||
Bohr_radius*Bohr_radius/(hbarc*hbarc) ;
|
||||
@@ -295,6 +304,38 @@
|
||||
sigma *=ChargeSquare*AtomicNumber*AtomicNumber/rat2 ;
|
||||
sigma /= beta2*bg2 ;
|
||||
|
||||
// nuclear size effect correction for high energy
|
||||
// ( a simple approximation at present)
|
||||
G4double corrnuclsize,a,x0,w1,w2,w ;
|
||||
|
||||
x0 = 1. - NuclCorrPar*ParticleMass/(KineticEnergy*
|
||||
exp(log(AtomicWeight/(g/mole))/3.)) ;
|
||||
if((x0 < -1.) || (KineticEnergy <= 10.*MeV))
|
||||
{
|
||||
x0=-1. ;
|
||||
corrnuclsize = 1. ;
|
||||
}
|
||||
else
|
||||
{
|
||||
a = 1.+1./eps ;
|
||||
if(eps > epsmax)
|
||||
w1=log(2.*eps)+1./eps-3./(8.*eps*eps) ;
|
||||
else
|
||||
w1=log((a+1.)/(a-1.))-2./(a+1.) ;
|
||||
|
||||
w = 1./((1.-x0)*eps) ;
|
||||
if(w < epsmin)
|
||||
w2=-log(w)-1.+2.*w-1.5*w*w ;
|
||||
else
|
||||
w2 = log((a-x0)/(a-1.))-(1.-x0)/(a-x0) ;
|
||||
|
||||
corrnuclsize = w1/w2 ;
|
||||
|
||||
// ####################################################
|
||||
corrnuclsize = exp(-FactPar*proton_mass_c2/KineticEnergy)*
|
||||
(corrnuclsize-1.)+1. ;
|
||||
}
|
||||
|
||||
// correct this value using the corrections computed for e+/e-
|
||||
KineticEnergy *= electron_mass_c2/ParticleMass ;
|
||||
|
||||
@@ -364,6 +405,8 @@
|
||||
|
||||
sigma *= corrfactor ;
|
||||
|
||||
sigma /= corrnuclsize ;
|
||||
|
||||
return sigma ;
|
||||
}
|
||||
|
||||
@@ -372,7 +415,7 @@
|
||||
const G4Track& trackData,
|
||||
const G4Step& stepData)
|
||||
{
|
||||
static const G4double taulim = 1.e-10 , randlim = 0.25*taulim*taulim ;
|
||||
static G4double taulim=1.e-6 , randlim = 0.25*taulim*taulim ;
|
||||
static const G4double tausmall = 5.e-5,taubig =50.,
|
||||
kappa = 2.5, kappapl1 = kappa+1., kappami1 = kappa-1. ;
|
||||
const G4DynamicParticle* aParticle ;
|
||||
@@ -401,12 +444,19 @@
|
||||
if(stepFlag == 0)
|
||||
{
|
||||
tau = truestep/fTransportMeanFreePath ;
|
||||
|
||||
if(tau > taulim)
|
||||
prob = exp(-tau)*(1.+scatteringparameter*tau) ;
|
||||
else
|
||||
prob=1.-(1.-scatteringparameter)*tau ;
|
||||
}
|
||||
else
|
||||
{
|
||||
tau = truestep/range ;
|
||||
prob = exp((alpha1-1.)*log(1.-tau))*(1.+scatteringparameter*tau) ;
|
||||
if(tau < taulim)
|
||||
prob = exp(-(alpha1-1.)*tau)*(1.+scatteringparameter*tau) ;
|
||||
else
|
||||
prob = exp((alpha1-1.)*log(1.-tau))*(1.+scatteringparameter*tau) ;
|
||||
}
|
||||
|
||||
if(G4UniformRand()<prob)
|
||||
@@ -415,7 +465,10 @@
|
||||
{
|
||||
rand = G4UniformRand() ;
|
||||
if(rand > randlim)
|
||||
cth = 1.-tau*(1./sqrt(rand)-1.) ;
|
||||
{
|
||||
cth = 1.-scatteringparameter*tau*(1./sqrt(rand)-1.) ;
|
||||
if(cth < -1.) cth = -1. ;
|
||||
}
|
||||
else
|
||||
cth = -1. ;
|
||||
}
|
||||
@@ -441,6 +494,7 @@
|
||||
|
||||
G4ThreeVector newDirection(dirx,diry,dirz) ;
|
||||
|
||||
|
||||
newDirection.rotateUz(ParticleDirection) ;
|
||||
|
||||
fParticleChange.SetMomentumChange(newDirection.x(),
|
||||
|
||||
@@ -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: G4PAIenergyLoss.cc,v 1.2 1999/04/16 09:02:01 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4PAIenergyLoss.cc,v 1.2.8.1 1999/12/07 20:50:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// $Id:
|
||||
// -----------------------------------------------------------
|
||||
|
||||
@@ -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: G4PAIonisation.cc,v 1.2 1999/04/16 09:02:02 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4PAIonisation.cc,v 1.2.8.1 1999/12/07 20:51:00 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
|
||||
@@ -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: G4PAIxSection.cc,v 1.2 1999/04/16 09:02:03 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4PAIxSection.cc,v 1.3.6.1 1999/12/07 20:51:00 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// G4PAIxSection.cc -- class implementation file
|
||||
@@ -48,7 +48,7 @@ fRefGammaNumber = 29 ; // The number of gamma for creation of
|
||||
|
||||
// Local class constants
|
||||
|
||||
const G4double G4PAIxSection::fDelta = 0.05 ; // energy shift from interval border
|
||||
const G4double G4PAIxSection::fDelta = 0.005 ; // energy shift from interval border
|
||||
const G4double G4PAIxSection::fError = 0.005 ; // error in lin-log approximation
|
||||
|
||||
const G4int G4PAIxSection::fMaxSplineSize = 500 ; // Max size of output spline
|
||||
@@ -70,7 +70,7 @@ G4PAIxSection::G4PAIxSection(G4int materialIndex,
|
||||
GetElectronDensity() ;
|
||||
fIntervalNumber = (*theMaterialTable)[materialIndex]->
|
||||
GetSandiaTable()->GetMatNbOfIntervals() ;
|
||||
// G4cout<<fDensity<<"\t"<<fElectronDensity<<"\t"<<fIntervalNumber<<endl ;
|
||||
G4cout<<fDensity<<"\t"<<fElectronDensity<<"\t"<<fIntervalNumber<<endl ;
|
||||
// G4double maxEnergyTransfer = 100*keV ;
|
||||
|
||||
fEnergyInterval = new G4double[fIntervalNumber+2] ;
|
||||
@@ -125,6 +125,7 @@ G4PAIxSection::G4PAIxSection(G4int materialIndex,
|
||||
fA4[j] = fA4[j+1] ;
|
||||
}
|
||||
fIntervalNumber-- ;
|
||||
i-- ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +166,8 @@ G4PAIxSection::G4PAIxSection(G4int materialIndex,
|
||||
G4PAIxSection::G4PAIxSection( G4int materialIndex,
|
||||
G4double maxEnergyTransfer,
|
||||
G4double betaGammaSq,
|
||||
G4double** photoAbsCof, G4int intNumber )
|
||||
G4double** photoAbsCof,
|
||||
G4int intNumber )
|
||||
{
|
||||
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
|
||||
G4int i, j ;
|
||||
@@ -241,6 +243,7 @@ G4PAIxSection::G4PAIxSection( G4int materialIndex,
|
||||
fA4[j] = fA4[j+1] ;
|
||||
}
|
||||
fIntervalNumber-- ;
|
||||
i-- ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,6 +289,139 @@ G4PAIxSection::G4PAIxSection( G4int materialIndex,
|
||||
delete[] fA4 ;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Test Constructor with beta*gamma square value
|
||||
|
||||
G4PAIxSection::G4PAIxSection( G4int materialIndex,
|
||||
G4double maxEnergyTransfer,
|
||||
G4double betaGammaSq )
|
||||
{
|
||||
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
|
||||
G4int i, j, numberOfElements ;
|
||||
|
||||
fDensity = (*theMaterialTable)[materialIndex]->GetDensity();
|
||||
fElectronDensity = (*theMaterialTable)[materialIndex]->GetElectronDensity() ;
|
||||
|
||||
G4SandiaTable thisMaterialSandiaTable(materialIndex) ;
|
||||
numberOfElements = (*theMaterialTable)[materialIndex]->GetNumberOfElements() ;
|
||||
|
||||
G4int* thisMaterialZ = new G4int[numberOfElements] ;
|
||||
for(i=0;i<numberOfElements;i++)
|
||||
{
|
||||
thisMaterialZ[i] = (G4int)(*theMaterialTable)[materialIndex]->
|
||||
GetElement(i)->GetZ() ;
|
||||
}
|
||||
fIntervalNumber = thisMaterialSandiaTable.SandiaIntervals
|
||||
(thisMaterialZ,numberOfElements) ;
|
||||
|
||||
fIntervalNumber = thisMaterialSandiaTable.SandiaMixing
|
||||
( thisMaterialZ ,
|
||||
(*theMaterialTable)[materialIndex]->GetFractionVector() ,
|
||||
numberOfElements,fIntervalNumber) ;
|
||||
|
||||
|
||||
fEnergyInterval = new G4double[fIntervalNumber+2] ;
|
||||
fA1 = new G4double[fIntervalNumber+2] ;
|
||||
fA2 = new G4double[fIntervalNumber+2] ;
|
||||
fA3 = new G4double[fIntervalNumber+2] ;
|
||||
fA4 = new G4double[fIntervalNumber+2] ;
|
||||
for(i=1;i<=fIntervalNumber;i++)
|
||||
{
|
||||
fEnergyInterval[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,0) ;
|
||||
|
||||
fA1[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,1)*fDensity ;
|
||||
fA2[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,2)*fDensity ;
|
||||
fA3[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,3)*fDensity ;
|
||||
fA4[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,4)*fDensity ;
|
||||
|
||||
if( i == 1 || i == fIntervalNumber)
|
||||
{
|
||||
// G4cout<<fEnergyInterval[i]<<"\t"<<fA1[i]<<"\t"<<fA2[i]<<"\t"
|
||||
// <<fA3[i]<<"\t"<<fA4[i]<<"\t"<<endl ;
|
||||
}
|
||||
if(fEnergyInterval[i] >= maxEnergyTransfer)
|
||||
{
|
||||
fEnergyInterval[i] = maxEnergyTransfer ;
|
||||
fIntervalNumber = i ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(fEnergyInterval[fIntervalNumber] != maxEnergyTransfer)
|
||||
{
|
||||
fIntervalNumber++;
|
||||
fEnergyInterval[fIntervalNumber] = maxEnergyTransfer ;
|
||||
}
|
||||
|
||||
// Now checking, if two borders are too close together
|
||||
|
||||
for(i=1;i<fIntervalNumber;i++)
|
||||
{
|
||||
if(fEnergyInterval[i+1]-fEnergyInterval[i] >
|
||||
1.5*fDelta*(fEnergyInterval[i+1]+fEnergyInterval[i]))
|
||||
{
|
||||
continue ;
|
||||
}
|
||||
else
|
||||
{
|
||||
for(j=i;j<fIntervalNumber;j++)
|
||||
{
|
||||
fEnergyInterval[j] = fEnergyInterval[j+1] ;
|
||||
fA1[j] = fA1[j+1] ;
|
||||
fA2[j] = fA2[j+1] ;
|
||||
fA3[j] = fA3[j+1] ;
|
||||
fA4[j] = fA4[j+1] ;
|
||||
}
|
||||
fIntervalNumber-- ;
|
||||
i-- ;
|
||||
}
|
||||
}
|
||||
|
||||
/* *********************************
|
||||
fSplineEnergy = new G4double[fMaxSplineSize] ;
|
||||
fRePartDielectricConst = new G4double[fMaxSplineSize] ;
|
||||
fImPartDielectricConst = new G4double[fMaxSplineSize] ;
|
||||
fIntegralTerm = new G4double[fMaxSplineSize] ;
|
||||
fDifPAIxSection = new G4double[fMaxSplineSize] ;
|
||||
fIntegralPAIxSection = new G4double[fMaxSplineSize] ;
|
||||
|
||||
for(i=0;i<fMaxSplineSize;i++)
|
||||
{
|
||||
fSplineEnergy[i] = 0.0 ;
|
||||
fRePartDielectricConst[i] = 0.0 ;
|
||||
fImPartDielectricConst[i] = 0.0 ;
|
||||
fIntegralTerm[i] = 0.0 ;
|
||||
fDifPAIxSection[i] = 0.0 ;
|
||||
fIntegralPAIxSection[i] = 0.0 ;
|
||||
}
|
||||
*/ ////////////////////////
|
||||
|
||||
// Preparation of fSplineEnergy array corresponding to min ionisation, G~4
|
||||
|
||||
G4double betaGammaSqRef =
|
||||
fLorentzFactor[fRefGammaNumber]*fLorentzFactor[fRefGammaNumber] - 1;
|
||||
|
||||
NormShift(betaGammaSqRef) ;
|
||||
SplainPAI(betaGammaSqRef) ;
|
||||
|
||||
// Preparation of integral PAI cross section for input betaGammaSq
|
||||
|
||||
for(i = 1 ; i <= fSplineNumber ; i++)
|
||||
{
|
||||
fDifPAIxSection[i] = DifPAIxSection(i,betaGammaSq);
|
||||
}
|
||||
IntegralPAIxSection() ;
|
||||
|
||||
// delete[] fEnergyInterval ;
|
||||
delete[] fA1 ;
|
||||
delete[] fA2 ;
|
||||
delete[] fA3 ;
|
||||
delete[] fA4 ;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Destructor
|
||||
|
||||
G4PAIxSection::~G4PAIxSection()
|
||||
@@ -354,15 +490,15 @@ void G4PAIxSection::InitPAI()
|
||||
// Shifting from borders to intervals Creation of first energy points
|
||||
//
|
||||
|
||||
void
|
||||
G4PAIxSection::NormShift(G4double betaGammaSq)
|
||||
void G4PAIxSection::NormShift(G4double betaGammaSq)
|
||||
{
|
||||
G4int i,j;
|
||||
for(i=1;i<=fIntervalNumber-1;i++)
|
||||
{
|
||||
for(j=1;j<=2;j++)
|
||||
{
|
||||
fSplineNumber = (i-1)*2 + j;
|
||||
fSplineNumber = (i-1)*2 + j ;
|
||||
|
||||
if(j==1)
|
||||
{
|
||||
fSplineEnergy[fSplineNumber]=fEnergyInterval[i]*(1+fDelta);
|
||||
@@ -776,6 +912,44 @@ G4double G4PAIxSection::SumOverBorder( G4int i ,
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
G4double G4PAIxSection::GetStepEnergyLoss( G4double step )
|
||||
{
|
||||
G4int iTransfer ;
|
||||
G4long numOfCollisions ;
|
||||
G4double loss = 0.0 ;
|
||||
G4double meanNumber, position ;
|
||||
|
||||
// G4cout<<" G4PAIxSection::GetStepEnergyLoss "<<endl ;
|
||||
|
||||
|
||||
|
||||
meanNumber = fIntegralPAIxSection[1]*step ;
|
||||
numOfCollisions = RandPoisson::shoot(meanNumber) ;
|
||||
|
||||
// G4cout<<"numOfCollisions = "<<numOfCollisions<<endl ;
|
||||
|
||||
while(numOfCollisions)
|
||||
{
|
||||
position = fIntegralPAIxSection[1]*G4UniformRand() ;
|
||||
|
||||
for( iTransfer=1 ; iTransfer<=fSplineNumber ; iTransfer++ )
|
||||
{
|
||||
if( position >= fIntegralPAIxSection[iTransfer] ) break ;
|
||||
}
|
||||
loss += fSplineEnergy[iTransfer] ;
|
||||
numOfCollisions-- ;
|
||||
}
|
||||
// G4cout<<"PAI energy loss = "<<loss/keV<<" keV"<<endl ;
|
||||
|
||||
return loss ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Init array of Lorentz factors
|
||||
|
||||
@@ -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: G4PhotoElectricEffect.cc,v 1.7 1999/06/08 13:29:23 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4PhotoElectricEffect.cc,v 1.8.6.1 1999/12/07 20:51:00 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -305,10 +305,10 @@ void G4PhotoElectricEffect::PrintInfoDefinition()
|
||||
{
|
||||
G4String comments = "Total cross sections from a parametrisation. ";
|
||||
comments += "Good description from 10 KeV to 50 MeV for all Z";
|
||||
comments += "Sandia crossSection below 50 KeV";
|
||||
comments += "\n Sandia crossSection below 50 KeV";
|
||||
|
||||
G4cout << endl << GetProcessName() << ": " << comments
|
||||
<< "\n PhysicsTables from " << G4BestUnit(LowestEnergyLimit,"Energy")
|
||||
<< "\n PhysicsTables from " << G4BestUnit(LowestEnergyLimit,"Energy")
|
||||
<< " to " << G4BestUnit(HighestEnergyLimit,"Energy")
|
||||
<< " in " << NumbBinTable << " bins. \n";
|
||||
}
|
||||
|
||||
@@ -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: G4PolarizedComptonScattering.cc,v 1.1 1999/01/07 16:11:23 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4PolarizedComptonScattering.cc,v 1.1.10.1 1999/12/07 20:51:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
|
||||
@@ -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: G4SynchrotronRadiation.cc,v 1.1 1999/01/07 16:11:23 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4SynchrotronRadiation.cc,v 1.1.10.1 1999/12/07 20:51:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
|
||||
@@ -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: G4eBremsstrahlung.cc,v 1.6 1999/04/13 09:05:44 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4eBremsstrahlung.cc,v 1.6.8.1 1999/12/07 20:51:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -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: G4eBremsstrahlungPlus.cc,v 1.6 1999/04/13 09:05:45 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4eBremsstrahlungPlus.cc,v 1.6.8.1 1999/12/07 20:51:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -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: G4eEnergyLoss.cc,v 1.8 1999/06/18 11:30:10 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4eEnergyLoss.cc,v 1.10.6.1 1999/12/07 20:51:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// $Id:
|
||||
// -----------------------------------------------------------
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "G4eEnergyLoss.hh"
|
||||
#include "G4EnergyLossMessenger.hh"
|
||||
#include "G4Poisson.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -966,6 +967,7 @@ G4VParticleChange* G4eEnergyLoss::AlongStepDoIt( const G4Track& trackData,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
G4double G4eEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
G4Material* aMaterial,
|
||||
G4double MeanLoss)
|
||||
@@ -993,7 +995,7 @@ G4double G4eEnergyLoss::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;
|
||||
@@ -1044,7 +1046,7 @@ G4double G4eEnergyLoss::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
|
||||
@@ -1057,7 +1059,7 @@ G4double G4eEnergyLoss::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)
|
||||
@@ -1084,14 +1086,14 @@ G4double G4eEnergyLoss::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)
|
||||
@@ -1100,7 +1102,7 @@ G4double G4eEnergyLoss::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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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: G4eIonisation.cc,v 1.3 1999/04/13 09:05:39 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4eIonisation.cc,v 1.3.8.1 1999/12/07 20:51:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
|
||||
@@ -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: G4eIonisationPlus.cc,v 1.3 1999/04/13 09:05:41 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4eIonisationPlus.cc,v 1.3.8.1 1999/12/07 20:51:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
|
||||
@@ -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: G4eplusAnnihilation.cc,v 1.1 1999/01/07 16:11:25 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4eplusAnnihilation.cc,v 1.1.10.1 1999/12/07 20:51:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -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: G4hEnergyLoss.cc,v 1.9 1999/06/18 11:30:16 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4hEnergyLoss.cc,v 1.14.6.1 1999/12/07 20:51:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// $Id:
|
||||
// -----------------------------------------------------------
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "G4hEnergyLoss.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
#include "G4Poisson.hh"
|
||||
|
||||
// Initialisation of static members ******************************************
|
||||
// contributing processes : ion.loss ->NumberOfProcesses is initialized
|
||||
@@ -110,9 +111,8 @@ G4double G4hEnergyLoss::Charge ;
|
||||
G4bool G4hEnergyLoss::rndmStepFlag = false ;
|
||||
G4bool G4hEnergyLoss::EnlossFlucFlag = true ;
|
||||
|
||||
G4double G4hEnergyLoss::LowestKineticEnergy= 1.00*keV;
|
||||
G4double G4hEnergyLoss::HighestKineticEnergy= 100.*TeV;
|
||||
G4int G4hEnergyLoss::TotBin;
|
||||
G4double G4hEnergyLoss::LowestKineticEnergy,G4hEnergyLoss::HighestKineticEnergy;
|
||||
G4int G4hEnergyLoss::TotBin ;
|
||||
G4double G4hEnergyLoss::RTable,G4hEnergyLoss::LOGRTable;
|
||||
|
||||
// constructor and destructor
|
||||
@@ -268,8 +268,6 @@ void G4hEnergyLoss::BuildDEDXTable(
|
||||
}
|
||||
}
|
||||
// make the energy loss and the range table available
|
||||
const G4double lowestKineticEnergy(1.00*keV);
|
||||
const G4double highestKineticEnergy(100.*TeV);
|
||||
|
||||
G4EnergyLossTables::Register(&aParticleType,
|
||||
(Charge>0)?
|
||||
@@ -282,7 +280,7 @@ void G4hEnergyLoss::BuildDEDXTable(
|
||||
theLabTimepTable: theLabTimepbarTable,
|
||||
(Charge>0)?
|
||||
theProperTimepTable: theProperTimepbarTable,
|
||||
lowestKineticEnergy, highestKineticEnergy,
|
||||
LowestKineticEnergy, HighestKineticEnergy,
|
||||
proton_mass_c2/aParticleType.GetPDGMass(),TotBin);
|
||||
|
||||
}
|
||||
@@ -1158,6 +1156,7 @@ G4VParticleChange* G4hEnergyLoss::AlongStepDoIt(
|
||||
return &aParticleChange ;
|
||||
}
|
||||
|
||||
|
||||
G4double G4hEnergyLoss::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
G4Material* aMaterial,
|
||||
G4double MeanLoss)
|
||||
@@ -1185,7 +1184,7 @@ G4double G4hEnergyLoss::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;
|
||||
@@ -1234,7 +1233,7 @@ G4double G4hEnergyLoss::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
|
||||
@@ -1247,7 +1246,7 @@ G4double G4hEnergyLoss::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)
|
||||
@@ -1275,14 +1274,14 @@ G4double G4hEnergyLoss::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)
|
||||
@@ -1291,7 +1290,7 @@ G4double G4hEnergyLoss::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)
|
||||
|
||||
@@ -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: G4hEnergyLossPlus.cc,v 1.7 1999/06/18 11:30:18 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4hEnergyLossPlus.cc,v 1.16.6.1 1999/12/07 20:51:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// $Id:
|
||||
// -----------------------------------------------------------
|
||||
@@ -34,6 +34,9 @@
|
||||
|
||||
#include "G4hEnergyLossPlus.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
#include "G4Poisson.hh"
|
||||
#include "G4Navigator.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
|
||||
// Initialisation of static members ******************************************
|
||||
// contributing processes : ion.loss ->NumberOfProcesses is initialized
|
||||
@@ -107,7 +110,7 @@ G4double G4hEnergyLossPlus::c1lim = dRoverRange ;
|
||||
G4double G4hEnergyLossPlus::c2lim = 2.*(1.-dRoverRange)*finalRange ;
|
||||
G4double G4hEnergyLossPlus::c3lim = -(1.-dRoverRange)*finalRange*finalRange;
|
||||
|
||||
G4double G4hEnergyLossPlus::MinDeltaCutInRange = 0.1*mm ;
|
||||
G4double G4hEnergyLossPlus::MinDeltaCutInRange = 0.01*mm ;
|
||||
G4double* G4hEnergyLossPlus::MinDeltaEnergy = NULL ;
|
||||
|
||||
G4double G4hEnergyLossPlus::Charge ;
|
||||
@@ -115,8 +118,8 @@ G4double G4hEnergyLossPlus::Charge ;
|
||||
G4bool G4hEnergyLossPlus::rndmStepFlag = false ;
|
||||
G4bool G4hEnergyLossPlus::EnlossFlucFlag = true ;
|
||||
|
||||
G4double G4hEnergyLossPlus::LowestKineticEnergy= 1.00*keV;
|
||||
G4double G4hEnergyLossPlus::HighestKineticEnergy= 100.*TeV;
|
||||
G4double G4hEnergyLossPlus::LowestKineticEnergy;
|
||||
G4double G4hEnergyLossPlus::HighestKineticEnergy;
|
||||
G4int G4hEnergyLossPlus::TotBin;
|
||||
G4double G4hEnergyLossPlus::RTable,G4hEnergyLossPlus::LOGRTable;
|
||||
|
||||
@@ -1170,7 +1173,7 @@ G4VParticleChange* G4hEnergyLossPlus::AlongStepDoIt(
|
||||
|
||||
// subcutoff delta ray production start
|
||||
G4double MinDeltaEnergyNow,Tc,TmintoProduceDelta,w,ww ;
|
||||
G4double rcut,T0,presafety,postsafety,
|
||||
G4double rcut,T0,presafety,postsafety,safety,
|
||||
delta,fragment,Tmax,mass ;
|
||||
G4double frperstep,x1,y1,z1,dx,dy,dz,dTime,time0,DeltaTime;
|
||||
G4double epsil = MinKineticEnergy/2. ;
|
||||
@@ -1199,14 +1202,19 @@ G4VParticleChange* G4hEnergyLossPlus::AlongStepDoIt(
|
||||
if((Tc > MinDeltaEnergyNow) && (Tmax > 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) ;
|
||||
|
||||
if(safety < rcut)
|
||||
{
|
||||
|
||||
if((presafety>=rcut)&&(postsafety>=rcut))
|
||||
{
|
||||
fragment = 0. ;
|
||||
}
|
||||
else
|
||||
{
|
||||
x1=stepData.GetPreStepPoint()->GetPosition().x();
|
||||
y1=stepData.GetPreStepPoint()->GetPosition().y();
|
||||
z1=stepData.GetPreStepPoint()->GetPosition().z();
|
||||
@@ -1238,7 +1246,6 @@ G4VParticleChange* G4hEnergyLossPlus::AlongStepDoIt(
|
||||
|
||||
frperstep=-fragment/Step;
|
||||
}
|
||||
}
|
||||
|
||||
if(fragment>0.)
|
||||
{
|
||||
@@ -1254,13 +1261,22 @@ G4VParticleChange* G4hEnergyLossPlus::AlongStepDoIt(
|
||||
G4int N=int(fragment*(c0N/(E*T0)+c1N/T0-(c2N+c3N*T0)/Tc)*
|
||||
(aMaterial->GetTotNbOfElectPerVolume())+0.5) ;
|
||||
|
||||
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,
|
||||
delTkin,delLoss,rate,
|
||||
urandom ;
|
||||
G4ThreeVector ParticleDirection ;
|
||||
G4StepPoint *point ;
|
||||
|
||||
Tkin = E ;
|
||||
@@ -1268,7 +1284,6 @@ G4VParticleChange* G4hEnergyLossPlus::AlongStepDoIt(
|
||||
P = sqrt(Tkin*(Etot+mass)) ;
|
||||
|
||||
aParticleChange.SetNumberOfSecondaries(N);
|
||||
G4int subdelta = 0;
|
||||
do {
|
||||
subdelta += 1 ;
|
||||
|
||||
@@ -1296,16 +1311,7 @@ G4VParticleChange* G4hEnergyLossPlus::AlongStepDoIt(
|
||||
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.;
|
||||
}
|
||||
|
||||
|
||||
urandom = G4UniformRand() ;
|
||||
// distribute x,y,z along Pre-Post !
|
||||
G4double xd,yd,zd ;
|
||||
@@ -1314,8 +1320,6 @@ G4VParticleChange* G4hEnergyLossPlus::AlongStepDoIt(
|
||||
zd=z1+frperstep*dz*urandom ;
|
||||
G4ThreeVector DeltaPosition(xd,yd,zd) ;
|
||||
DeltaTime=time0+frperstep*dTime*urandom ;
|
||||
ParticleDirection=stepData.GetPostStepPoint()->
|
||||
GetMomentumDirection() ;
|
||||
|
||||
G4ThreeVector DeltaDirection(dirx,diry,dirz) ;
|
||||
DeltaDirection.rotateUz(ParticleDirection);
|
||||
@@ -1349,13 +1353,16 @@ G4VParticleChange* G4hEnergyLossPlus::AlongStepDoIt(
|
||||
|
||||
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 ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1388,6 +1395,7 @@ G4VParticleChange* G4hEnergyLossPlus::AlongStepDoIt(
|
||||
return &aParticleChange ;
|
||||
}
|
||||
|
||||
|
||||
G4double G4hEnergyLossPlus::GetLossWithFluct(const G4DynamicParticle* aParticle,
|
||||
G4Material* aMaterial,
|
||||
G4double MeanLoss)
|
||||
@@ -1415,7 +1423,7 @@ G4double G4hEnergyLossPlus::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;
|
||||
@@ -1464,7 +1472,7 @@ G4double G4hEnergyLossPlus::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
|
||||
@@ -1477,7 +1485,7 @@ G4double G4hEnergyLossPlus::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)
|
||||
@@ -1505,14 +1513,14 @@ G4double G4hEnergyLossPlus::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)
|
||||
@@ -1521,7 +1529,7 @@ G4double G4hEnergyLossPlus::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)
|
||||
|
||||
@@ -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: G4hIonisation.cc,v 1.3 1999/04/13 09:05:42 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4hIonisation.cc,v 1.6.8.1 1999/12/07 20:51:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
@@ -26,6 +26,7 @@
|
||||
// 07-04-98: remove 'tracking cut' of the ionizing particle, MMa
|
||||
// 22/10/98: cleanup L.Urban
|
||||
// 02/02/99: bugs fixed , L.Urban
|
||||
// 29/07/99: correction in BuildLossTable for low energy, L.Urban
|
||||
// --------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -37,9 +38,6 @@
|
||||
G4hIonisation::G4hIonisation(const G4String& processName)
|
||||
: G4hEnergyLoss(processName),
|
||||
theMeanFreePathTable(NULL),
|
||||
LowestKineticEnergy(1.00*keV),
|
||||
HighestKineticEnergy(100.*TeV),
|
||||
TotBin(100),
|
||||
theProton (G4Proton::Proton()),
|
||||
theAntiProton (G4AntiProton::AntiProton()),
|
||||
theElectron ( G4Electron::Electron() )
|
||||
@@ -65,6 +63,13 @@ void G4hIonisation::SetPhysicsTableBining(G4double lowE, G4double highE,
|
||||
void G4hIonisation::BuildPhysicsTable(const G4ParticleDefinition& aParticleType)
|
||||
// just call BuildLossTable+BuildLambdaTable
|
||||
{
|
||||
if(&aParticleType == G4Proton::Proton())
|
||||
{
|
||||
LowestKineticEnergy= 1.00*keV;
|
||||
HighestKineticEnergy= 100.*TeV;
|
||||
TotBin=100 ;
|
||||
}
|
||||
|
||||
ParticleMass = aParticleType.GetPDGMass() ;
|
||||
|
||||
Charge = aParticleType.GetPDGCharge();
|
||||
@@ -109,6 +114,7 @@ void G4hIonisation::BuildLossTable(const G4ParticleDefinition& aParticleType)
|
||||
DeltaCutInKineticEnergy = theElectron->GetCutsInEnergy() ;
|
||||
|
||||
G4double LowEdgeEnergy , ionloss ;
|
||||
G4double deltaloss ;
|
||||
G4double RateMass ;
|
||||
G4bool isOutRange ;
|
||||
static const G4MaterialTable* theMaterialTable=
|
||||
@@ -182,10 +188,18 @@ void G4hIonisation::BuildLossTable(const G4ParticleDefinition& aParticleType)
|
||||
LowEdgeEnergy = aVector->GetLowEdgeEnergy(i) ;
|
||||
tau = LowEdgeEnergy/proton_mass_c2 ;
|
||||
|
||||
gamma = tau +1. ;
|
||||
bg2 = tau*(tau+2.) ;
|
||||
beta2 = bg2/(gamma*gamma) ;
|
||||
Tmax = 2.*electron_mass_c2*bg2
|
||||
/(1.+2.*gamma*RateMass+RateMass*RateMass) ;
|
||||
|
||||
if ( tau < taul )
|
||||
// low energy part , parametrized energy loss formulae
|
||||
{
|
||||
ionloss = 0. ;
|
||||
deltaloss = 0. ;
|
||||
|
||||
// loop for the elements in the material
|
||||
for (G4int iel=0; iel<NumberOfElements; iel++)
|
||||
{
|
||||
@@ -199,16 +213,21 @@ void G4hIonisation::BuildLossTable(const G4ParticleDefinition& aParticleType)
|
||||
ionloss += theAtomicNumDensityVector[iel]
|
||||
* element->GetIonisation()->GetClow()/sqrt(tau) ;
|
||||
}
|
||||
if ( DeltaCutInKineticEnergyNow < Tmax)
|
||||
{
|
||||
deltaloss = log(Tmax/DeltaCutInKineticEnergyNow)-
|
||||
beta2*(1.-DeltaCutInKineticEnergyNow/Tmax) ;
|
||||
if(aParticleType.GetPDGSpin() == 0.5)
|
||||
deltaloss += 0.25*(Tmax-DeltaCutInKineticEnergyNow)*
|
||||
(Tmax-DeltaCutInKineticEnergyNow)/
|
||||
(LowEdgeEnergy*LowEdgeEnergy+proton_mass_c2*proton_mass_c2) ;
|
||||
deltaloss *= Factor*ElectronDensity/beta2 ;
|
||||
}
|
||||
ionloss -= deltaloss ;
|
||||
}
|
||||
else
|
||||
// high energy part , Bethe-Bloch formula
|
||||
{
|
||||
gamma = tau +1. ;
|
||||
bg2 = tau*(tau+2.) ;
|
||||
beta2 = bg2/(gamma*gamma) ;
|
||||
Tmax = 2.*electron_mass_c2*bg2
|
||||
/(1.+2.*gamma*RateMass+RateMass*RateMass) ;
|
||||
|
||||
if ( DeltaCutInKineticEnergyNow < Tmax)
|
||||
rcut = DeltaCutInKineticEnergyNow/Tmax ;
|
||||
else
|
||||
|
||||
@@ -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: G4hIonisationPlus.cc,v 1.2 1999/04/13 09:05:43 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4hIonisationPlus.cc,v 1.3.8.1 1999/12/07 20:51:04 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
@@ -37,9 +37,6 @@
|
||||
G4hIonisationPlus::G4hIonisationPlus(const G4String& processName)
|
||||
: G4hEnergyLossPlus(processName),
|
||||
theMeanFreePathTable(NULL),
|
||||
LowestKineticEnergy(1.00*keV),
|
||||
HighestKineticEnergy(100.*TeV),
|
||||
TotBin(100),
|
||||
theProton (G4Proton::Proton()),
|
||||
theAntiProton (G4AntiProton::AntiProton()),
|
||||
theElectron ( G4Electron::Electron() )
|
||||
@@ -65,6 +62,13 @@ void G4hIonisationPlus::SetPhysicsTableBining(G4double lowE, G4double highE,
|
||||
void G4hIonisationPlus::BuildPhysicsTable(const G4ParticleDefinition& aParticleType)
|
||||
// just call BuildLossTable+BuildLambdaTable
|
||||
{
|
||||
if(&aParticleType == G4Proton::Proton())
|
||||
{
|
||||
LowestKineticEnergy= 1.00*keV;
|
||||
HighestKineticEnergy= 100.*TeV;
|
||||
TotBin=100 ;
|
||||
}
|
||||
|
||||
ParticleMass = aParticleType.GetPDGMass() ;
|
||||
|
||||
Charge = aParticleType.GetPDGCharge();
|
||||
@@ -110,6 +114,7 @@ void G4hIonisationPlus::BuildLossTable(const G4ParticleDefinition& aParticleType
|
||||
|
||||
G4double LowEdgeEnergy , ionloss ;
|
||||
G4double RateMass ;
|
||||
G4double deltaloss ;
|
||||
G4bool isOutRange ;
|
||||
static const G4MaterialTable* theMaterialTable=
|
||||
G4Material::GetMaterialTable();
|
||||
@@ -182,10 +187,18 @@ void G4hIonisationPlus::BuildLossTable(const G4ParticleDefinition& aParticleType
|
||||
LowEdgeEnergy = aVector->GetLowEdgeEnergy(i) ;
|
||||
tau = LowEdgeEnergy/proton_mass_c2 ;
|
||||
|
||||
gamma = tau +1. ;
|
||||
bg2 = tau*(tau+2.) ;
|
||||
beta2 = bg2/(gamma*gamma) ;
|
||||
Tmax = 2.*electron_mass_c2*bg2
|
||||
/(1.+2.*gamma*RateMass+RateMass*RateMass) ;
|
||||
|
||||
if ( tau < taul )
|
||||
// low energy part , parametrized energy loss formulae
|
||||
{
|
||||
ionloss = 0. ;
|
||||
deltaloss = 0. ;
|
||||
|
||||
// loop for the elements in the material
|
||||
for (G4int iel=0; iel<NumberOfElements; iel++)
|
||||
{
|
||||
@@ -199,16 +212,21 @@ void G4hIonisationPlus::BuildLossTable(const G4ParticleDefinition& aParticleType
|
||||
ionloss += theAtomicNumDensityVector[iel]
|
||||
* element->GetIonisation()->GetClow()/sqrt(tau) ;
|
||||
}
|
||||
if ( DeltaCutInKineticEnergyNow < Tmax)
|
||||
{
|
||||
deltaloss = log(Tmax/DeltaCutInKineticEnergyNow)-
|
||||
beta2*(1.-DeltaCutInKineticEnergyNow/Tmax) ;
|
||||
if(aParticleType.GetPDGSpin() == 0.5)
|
||||
deltaloss += 0.25*(Tmax-DeltaCutInKineticEnergyNow)*
|
||||
(Tmax-DeltaCutInKineticEnergyNow)/
|
||||
(LowEdgeEnergy*LowEdgeEnergy+proton_mass_c2*proton_mass_c2) ;
|
||||
deltaloss *= Factor*ElectronDensity/beta2 ;
|
||||
}
|
||||
ionloss -= deltaloss ;
|
||||
}
|
||||
else
|
||||
// high energy part , Bethe-Bloch formula
|
||||
{
|
||||
gamma = tau +1. ;
|
||||
bg2 = tau*(tau+2.) ;
|
||||
beta2 = bg2/(gamma*gamma) ;
|
||||
Tmax = 2.*electron_mass_c2*bg2
|
||||
/(1.+2.*gamma*RateMass+RateMass*RateMass) ;
|
||||
|
||||
if ( DeltaCutInKineticEnergyNow < Tmax)
|
||||
rcut = DeltaCutInKineticEnergyNow/Tmax ;
|
||||
else
|
||||
|
||||
@@ -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: G4ionIonisation.cc,v 1.3 1999/04/15 16:04:10 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4ionIonisation.cc,v 1.3.8.1 1999/12/07 20:51:04 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
|
||||
Reference in New Issue
Block a user