Import Geant4 4.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:18:25 +02:00
parent 36c080dca6
commit 921d3b1cda
3990 changed files with 185376 additions and 82884 deletions
@@ -21,10 +21,10 @@
// ********************************************************************
//
//
// $Id: G4ComptonScattering.hh,v 1.4.4.1 2001/06/28 19:12:33 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4ComptonScattering.hh,v 1.8 2001/10/01 15:00:28 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// ------------ G4ComptonScattering physics process ------
//------------------ G4ComptonScattering physics process -----------------------
// by Michel Maire, April 1996
//
// 10-06-96, updated by M.Maire
@@ -33,8 +33,13 @@
// 17-02-97, New Physics scheme
// 25-02-97, GetMeanFreePath() now is public function
// 12-03-97, new physics scheme again
// 13-08-98, new methods SetBining() PrintInfo()
// ------------------------------------------------------------
// 13-08-98, new methods SetBining() PrintInfo()
// 03-08-01, new methods Store/Retrieve PhysicsTable (mma)
// 06-08-01, BuildThePhysicsTable() called from constructor (mma)
// 19-09-01, come back to previous ProcessName "compt"
// 20-09-01, DoIt: fminimalEnergy = 1*eV (mma)
// 01-10-01, come back to BuildPhysicsTable(const G4ParticleDefinition&)
// -----------------------------------------------------------------------------
// class description
//
@@ -76,18 +81,26 @@ class G4ComptonScattering : public G4VDiscreteProcess
// Allows to define the binning of the PhysicsTables,
// before to build them.
void BuildPhysicsTable(const G4ParticleDefinition& GammaType);
void BuildPhysicsTable(const G4ParticleDefinition&);
// It builds the total CrossSectionPerAtom table, for Gamma,
// and for every element contained in the elementTable.
// It builds the MeanFreePath table, for Gamma,
// and for every material contained in the materialTable.
// This function overloads a virtual function of the base class.
// It is invoked by the G4ParticleWithCuts::SetCut() method.
// and for every material contained in the materialTable.
G4bool StorePhysicsTable(G4ParticleDefinition* ,
const G4String& directory, G4bool);
// store CrossSection and MeanFreePath tables into an external file
// specified by 'directory' (must exist before invokation)
G4bool RetrievePhysicsTable(G4ParticleDefinition* ,
const G4String& directory, G4bool);
// retrieve CrossSection and MeanFreePath tables from an external file
// specified by 'directory'
void PrintInfoDefinition();
// Print few lines of informations about the process: validity range,
// origine ..etc..
// Invoked by BuildPhysicsTable().
// Invoked by BuildThePhysicsTable().
G4double GetMeanFreePath(const G4Track& aTrack,
G4double previousStepSize,
@@ -128,11 +141,17 @@ class G4ComptonScattering : public G4VDiscreteProcess
G4PhysicsTable* theCrossSectionTable; // table for crosssection
G4PhysicsTable* theMeanFreePathTable; // table for mean free path
G4double LowestEnergyLimit ; // low energy limit of the crossection formula
G4double HighestEnergyLimit ; // high energy limit of the crossection formula
G4int NumbBinTable ; // number of bins in the crossection table
G4double LowestEnergyLimit; // low energy limit of the tables
G4double HighestEnergyLimit; // high energy limit of the tables
G4int NumbBinTable; // number of bins in the tables
protected:
G4double fminimalEnergy; // minimalEnergy of produced particles
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ComptonScattering.icc"
#endif
@@ -21,35 +21,31 @@
// ********************************************************************
//
//
// $Id: G4ComptonScattering.icc,v 1.3.2.2 2001/06/28 20:19:46 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4ComptonScattering.icc,v 1.8 2001/09/21 09:50:53 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// ---------------------------------------------------------------
// GEANT 4 class inlined methods file
//
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// ------------ G4ComptonScattering physics process ---------
//------------------ G4ComptonScattering physics process -----------------------
// by Michel Maire, April 1996
// ***************************************************************
//
// 10-06-96, updated by M.Maire
// 06-01-97, crossection table + meanfreepath table, M.Maire
// 12-03-97, new Physics scheme
// 21-11-97, change for lowest energy limit default action
// 15-12-98, return DBL_MAX below LowestEnergyLimit
// 28-05-01, V.Ivanchenko minor changes to provide ANSI -wall compilation
// ---------------------------------------------------------------
// 28-05-01, V.Ivanchenko minor changes to provide ANSI -wall compilation
// 17-09-01, migration of Materials to pure STL (mma)
//------------------------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4bool G4ComptonScattering::IsApplicable(const G4ParticleDefinition& particle)
inline G4bool G4ComptonScattering::IsApplicable(
const G4ParticleDefinition& particle)
{
return ( &particle == G4Gamma::Gamma() );
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4ComptonScattering::GetMeanFreePath(const G4Track& aTrack,
G4double,
@@ -63,18 +59,17 @@ inline G4double G4ComptonScattering::GetMeanFreePath(const G4Track& aTrack,
G4Material* aMaterial = aTrack.GetMaterial();
G4double MeanFreePath;
G4bool isOutRange ;
G4bool isOutRange;
if (GammaEnergy > HighestEnergyLimit || GammaEnergy < LowestEnergyLimit)
MeanFreePath = DBL_MAX;
else
MeanFreePath = (*theMeanFreePathTable)(aMaterial->GetIndex())->
GetValue(GammaEnergy, isOutRange);
GetValue(GammaEnergy, isOutRange);
return MeanFreePath;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4ComptonScattering::ComputeMeanFreePath(G4double GammaEnergy,
G4Material* aMaterial)
@@ -83,25 +78,24 @@ inline G4double G4ComptonScattering::ComputeMeanFreePath(G4double GammaEnergy,
{
const G4ElementVector* theElementVector = aMaterial->GetElementVector() ;
const G4double* NbOfAtomsPerVolume = aMaterial->GetVecNbOfAtomsPerVolume();
const G4double* NbOfAtomsPerVolume = aMaterial->GetVecNbOfAtomsPerVolume();
G4double SIGMA = 0. ;
G4double SIGMA = 0.;
for ( size_t elm=0 ; elm < aMaterial->GetNumberOfElements() ; elm++ )
{
SIGMA += NbOfAtomsPerVolume[elm] *
ComputeCrossSectionPerAtom( GammaEnergy,
(*theElementVector)(elm)->GetZ());
SIGMA += NbOfAtomsPerVolume[elm] *
ComputeCrossSectionPerAtom(GammaEnergy,
(*theElementVector)[elm]->GetZ());
}
return SIGMA > DBL_MIN ? 1./SIGMA : DBL_MAX;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4ComptonScattering::GetMicroscopicCrossSection(
G4DynamicParticle* aDynamicGamma,
G4Element* anElement)
G4DynamicParticle* aDynamicGamma,
G4Element* anElement)
// gives the microscopic total cross section in GEANT4 internal units
@@ -109,15 +103,14 @@ inline G4double G4ComptonScattering::GetMicroscopicCrossSection(
G4double crossSection;
G4double GammaEnergy = aDynamicGamma->GetKineticEnergy();
G4bool isOutRange ;
if (GammaEnergy < LowestEnergyLimit || GammaEnergy > HighestEnergyLimit)
crossSection = 0.;
else
crossSection = (*theCrossSectionTable)(anElement->GetIndex())->
GetValue(GammaEnergy, isOutRange);
GetValue(GammaEnergy, isOutRange);
return crossSection;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -21,10 +21,10 @@
// ********************************************************************
//
//
// $Id: G4GammaConversion.hh,v 1.4.4.1 2001/06/28 19:12:34 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4GammaConversion.hh,v 1.9 2001/10/01 15:00:28 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// ------------ G4GammaConversion physics process ------
//------------------ G4GammaConversion physics process -------------------------
// by Michel Maire, 24 May 1996
//
// 11-06-96, Added GetRandomAtom() method and new data member
@@ -34,8 +34,13 @@
// 14-01-97, crossection table + meanfreepath table.
// PartialSumSigma removed, M.Maire
// 14-03-97, new physics scheme for geant4alpha, M.Maire
// 13-08-98, new methods SetBining() PrintInfo()
// ------------------------------------------------------------
// 13-08-98, new methods SetBining() PrintInfo()
// 03-08-01, new methods Store/Retrieve PhysicsTable (mma)
// 06-08-01, BuildThePhysicsTable() called from constructor (mma)
// 19-09-01, come back to previous ProcessName: "conv"
// 20-09-01, DoIt: fminimalEnergy = 1*eV (mma)
// 01-10-01, come back to BuildPhysicsTable(const G4ParticleDefinition&)
// -----------------------------------------------------------------------------
// class description
//
@@ -79,18 +84,26 @@ class G4GammaConversion : public G4VDiscreteProcess
// Allows to define the binning of the PhysicsTables,
// before to build them.
void BuildPhysicsTable(const G4ParticleDefinition& GammaType);
void BuildPhysicsTable(const G4ParticleDefinition&);
// It builds the total CrossSectionPerAtom table, for Gamma,
// and for every element contained in the elementTable.
// It builds the MeanFreePath table, for Gamma,
// and for every material contained in the materialTable.
// This function overloads a virtual function of the base class.
// It is invoked by the G4ParticleWithCuts::SetCut() method.
G4bool StorePhysicsTable(G4ParticleDefinition* ,
const G4String& directory, G4bool);
// store CrossSection and MeanFreePath tables into an external file
// specified by 'directory' (must exist before invokation)
G4bool RetrievePhysicsTable(G4ParticleDefinition* ,
const G4String& directory, G4bool);
// retrieve CrossSection and MeanFreePath tables from an external file
// specified by 'directory'
void PrintInfoDefinition();
// Print few lines of informations about the process: validity range,
// origine ..etc..
// Invoked by BuildPhysicsTable().
// Invoked by BuildThePhysicsTable().
G4double GetMeanFreePath(const G4Track& aTrack,
G4double previousStepSize,
@@ -98,11 +111,11 @@ class G4GammaConversion : public G4VDiscreteProcess
// It returns the MeanFreePath of the process for the current track :
// (energy, material)
// The previousStepSize and G4ForceCondition* are not used.
// This function overloads a virtual function of the base class.
// This function overloads a virtual function of the base class.
// It is invoked by the ProcessManager of the Particle.
G4double GetMicroscopicCrossSection(const G4DynamicParticle* aDynamicGamma,
G4Element* anElement);
G4double GetCrossSectionPerAtom(const G4DynamicParticle* aDynamicGamma,
G4Element* anElement);
// It returns the total CrossSectionPerAtom of the process,
// for the current DynamicGamma (energy), in anElement.
@@ -115,8 +128,8 @@ class G4GammaConversion : public G4VDiscreteProcess
protected:
virtual G4double ComputeMicroscopicCrossSection(G4double GammaEnergy,
G4double AtomicNumber);
virtual G4double ComputeCrossSectionPerAtom(G4double GammaEnergy,
G4double AtomicNumber);
virtual G4double ComputeMeanFreePath (G4double GammaEnergy,
G4Material* aMaterial);
@@ -141,13 +154,17 @@ class G4GammaConversion : public G4VDiscreteProcess
G4PhysicsTable* theCrossSectionTable; // table for crossection
G4PhysicsTable* theMeanFreePathTable;
G4double LowestEnergyLimit ; // low energy limit of the crossection formula
G4double HighestEnergyLimit ; // high energy limit of the crossection formula
G4int NumbBinTable ; // number of bins in the crossection table
G4double MeanFreePath; // actual Mean Free Path (current medium)
G4double LowestEnergyLimit ; // low energy limit of the tables
G4double HighestEnergyLimit ; // high energy limit of the tables
G4int NumbBinTable ; // number of bins in the tables
G4double fminimalEnergy; // minimalEnergy of produced particles
G4double MeanFreePath; // actual MeanFreePath (current medium)
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4GammaConversion.icc"
#endif
@@ -21,41 +21,38 @@
// ********************************************************************
//
//
// $Id: G4GammaConversion.icc,v 1.3.2.2 2001/06/28 20:19:46 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4GammaConversion.icc,v 1.7 2001/09/17 17:07:11 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// ---------------------------------------------------------------
// GEANT 4 class inlined methods file
//
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// ------------ G4GammaConversion physics process ---------
// ------------ G4GammaConversion physics process -------------------------
// by Michel Maire, 24 May 1996
// ***************************************************************
//
// 11-06-96, in GetMeanFreePath() the partial sum is stored, by M.Maire
// 16-09-96, dynamical array PartialSumSigma, by M.Maire
// 13-12-96, Sign corrected in the ScreenFunctions, by L.Urban
// 14-01-97, crossection table + meanfreepath table.
// PartialSumSigma removed, by M.Maire
// 14-01-97, new physics scheme for geant4alpha, M.Maire
// 28-05-01, V.Ivanchenko minor changes to provide ANSI -wall compilation
// ---------------------------------------------------------------
// 28-05-01, V.Ivanchenko minor changes to provide ANSI -wall compilation
// 17-09-01, migration of Materials to pure STL (mma)
// -----------------------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4bool G4GammaConversion::IsApplicable(const G4ParticleDefinition& particle)
inline G4bool G4GammaConversion::IsApplicable(
const G4ParticleDefinition& particle)
{
return ( &particle == G4Gamma::Gamma() );
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4GammaConversion::GetMicroscopicCrossSection(
inline G4double G4GammaConversion::GetCrossSectionPerAtom(
const G4DynamicParticle* aDynamicGamma,
G4Element* anElement)
// gives the microscopic total cross section in GEANT4 internal units
// gives the total cross section per atom in GEANT4 internal units
{
G4double crossSection;
@@ -65,7 +62,7 @@ inline G4double G4GammaConversion::GetMicroscopicCrossSection(
if (GammaEnergy < LowestEnergyLimit)
crossSection = 0. ;
else {
if (GammaEnergy > HighestEnergyLimit) GammaEnergy = 0.99*HighestEnergyLimit ;
if (GammaEnergy > HighestEnergyLimit) GammaEnergy=0.99*HighestEnergyLimit;
crossSection = (*theCrossSectionTable)(anElement->GetIndex())->
GetValue( GammaEnergy, isOutRange );
}
@@ -73,7 +70,7 @@ inline G4double G4GammaConversion::GetMicroscopicCrossSection(
return crossSection;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4GammaConversion::GetMeanFreePath(const G4Track& aTrack,
G4double,
@@ -87,12 +84,12 @@ inline G4double G4GammaConversion::GetMeanFreePath(const G4Track& aTrack,
G4double GammaEnergy = aDynamicGamma->GetKineticEnergy();
G4Material* aMaterial = aTrack.GetMaterial();
G4bool isOutRange ;
G4bool isOutRange;
if (GammaEnergy < LowestEnergyLimit)
MeanFreePath = DBL_MAX;
else {
if (GammaEnergy > HighestEnergyLimit) GammaEnergy = 0.99*HighestEnergyLimit ;
if (GammaEnergy > HighestEnergyLimit) GammaEnergy=0.99*HighestEnergyLimit;
MeanFreePath = (*theMeanFreePathTable)(aMaterial->GetIndex())->
GetValue( GammaEnergy, isOutRange );
}
@@ -100,7 +97,7 @@ inline G4double G4GammaConversion::GetMeanFreePath(const G4Track& aTrack,
return MeanFreePath;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4GammaConversion::ComputeMeanFreePath(G4double GammaEnergy,
G4Material* aMaterial)
@@ -108,22 +105,22 @@ inline G4double G4GammaConversion::ComputeMeanFreePath(G4double GammaEnergy,
// computes and returns the photon mean free path in GEANT4 internal units
{
const G4ElementVector* theElementVector = aMaterial->GetElementVector() ;
const G4double* theAtomNumDensityVector = aMaterial->GetAtomicNumDensityVector();
const G4ElementVector* theElementVector = aMaterial->GetElementVector();
const G4double* NbOfAtomsPerVolume = aMaterial->GetVecNbOfAtomsPerVolume();
G4double SIGMA = 0 ;
for ( size_t i=0 ; i < aMaterial->GetNumberOfElements() ; i++ )
{
SIGMA += theAtomNumDensityVector[i] *
ComputeMicroscopicCrossSection(GammaEnergy,
(*theElementVector)(i)->GetZ() );
SIGMA += NbOfAtomsPerVolume[i] *
ComputeCrossSectionPerAtom(GammaEnergy,
(*theElementVector)[i]->GetZ());
}
return SIGMA > DBL_MIN ? 1./SIGMA : DBL_MAX;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4GammaConversion::ScreenFunction1(G4double ScreenVariable)
@@ -135,12 +132,12 @@ inline G4double G4GammaConversion::ScreenFunction1(G4double ScreenVariable)
if (ScreenVariable > 1.)
screenVal = 42.24 - 8.368*log(ScreenVariable+0.952);
else
screenVal = 42.392 - ScreenVariable* (7.796 - 1.961*ScreenVariable);
screenVal = 42.392 - ScreenVariable*(7.796 - 1.961*ScreenVariable);
return screenVal;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4GammaConversion::ScreenFunction2(G4double ScreenVariable)
@@ -152,9 +149,9 @@ inline G4double G4GammaConversion::ScreenFunction2(G4double ScreenVariable)
if (ScreenVariable > 1.)
screenVal = 42.24 - 8.368*log(ScreenVariable+0.952);
else
screenVal = 41.405 - ScreenVariable* (5.828 - 0.8945*ScreenVariable);
screenVal = 41.405 - ScreenVariable*(5.828 - 0.8945*ScreenVariable);
return screenVal;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4PAIonisation.hh,v 1.8.2.2 2001/06/28 20:19:46 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PAIonisation.hh,v 1.11 2001/10/29 16:23:40 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// ------------------------------------------------------------
@@ -133,9 +133,9 @@ class G4PAIonisation : public G4VPAIenergyLoss
// static
static G4double GetMaxKineticEnergy() { return HighestKineticEnergy ; } ;
static G4double GetMinKineticEnergy() { return LowestKineticEnergy ; } ;
static G4int GetBinNumber() { return TotBin ; } ;
static G4double GetMaxKineticEnergy();
static G4double GetMinKineticEnergy();
static G4int GetBinNumber();
// Access to Sandia table coefficients
@@ -166,8 +166,8 @@ class G4PAIonisation : public G4VPAIenergyLoss
// cut in range
G4double CutInRange ;
G4double lastCutInRange ;
G4double* CutInRange ;
G4double* lastCutInRange ;
// particles , cuts in kinetic energy
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4PAIxSection.hh,v 1.4.4.1 2001/06/28 19:12:34 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PAIxSection.hh,v 1.5 2001/07/11 10:03:28 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// G4PAIxSection.hh -- header file
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4PhotoElectricEffect.hh,v 1.6.2.1 2001/06/28 19:12:34 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PhotoElectricEffect.hh,v 1.10 2001/10/01 15:00:28 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//
@@ -36,6 +36,11 @@
// 13-08-98, new methods SetBining() PrintInfo()
// 17-11-98, use table of atomic shells in PostStepDoIt, mma
// 06-01-99, Sandia crossSection below 50 keV, V.Grichine mma
// 03-08-01, new methods Store/Retrieve PhysicsTable (mma)
// 06-08-01, BuildThePhysicsTable() called from constructor (mma)
// 19-09-01, come back to previous process name "phot"
// 20-09-01, DoIt: fminimalEnergy = 1*eV (mma)
// 01-10-01, come back to BuildPhysicsTable(const G4ParticleDefinition&)
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -79,18 +84,26 @@ class G4PhotoElectricEffect : public G4VDiscreteProcess
// Allows to define the binning of the PhysicsTables,
// before to build them.
void BuildPhysicsTable(const G4ParticleDefinition& PhotonType);
void BuildPhysicsTable(const G4ParticleDefinition&);
// It builds the total CrossSectionPerAtom table, for Gamma,
// and for every element contained in the elementTable.
// It builds the MeanFreePath table, for Gamma,
// and for every material contained in the materialTable.
// This function overloads a virtual function of the base class.
// It is invoked by the G4ParticleWithCuts::SetCut() method.
G4bool StorePhysicsTable(G4ParticleDefinition* ,
const G4String& directory, G4bool);
// store CrossSection and MeanFreePath tables into an external file
// specified by 'directory' (must exist before invokation)
G4bool RetrievePhysicsTable(G4ParticleDefinition* ,
const G4String& directory, G4bool);
// retrieve CrossSection and MeanFreePath tables from an external file
// specified by 'directory'
void PrintInfoDefinition();
// Print few lines of informations about the process: validity range,
// origine ..etc..
// Invoked by BuildPhysicsTable().
// Invoked by BuildThePhysicsTable().
G4double GetMeanFreePath(const G4Track& aTrack,
G4double previousStepSize,
@@ -148,13 +161,17 @@ class G4PhotoElectricEffect : public G4VDiscreteProcess
G4PhysicsTable* theCrossSectionTable; // table for crossection
G4PhysicsTable* theMeanFreePathTable; // table for Mean free path
G4double LowestEnergyLimit ; // low energy limit of the physics tables
G4double HighestEnergyLimit ; // high energy limit of the physics tables
G4int NumbBinTable ; // number of bins in the tables
G4double MeanFreePath; // actual Mean Free Path (current medium)
G4double LowestEnergyLimit ; // low energy limit of the tables
G4double HighestEnergyLimit ; // high energy limit of the tables
G4int NumbBinTable ; // number of bins in the tables
G4double fminimalEnergy; // minimalEnergy of produced particles
G4double MeanFreePath; // actual Mean Free Path (current medium)
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4PhotoElectricEffect.icc"
#endif
@@ -21,10 +21,10 @@
// ********************************************************************
//
//
// $Id: G4PhotoElectricEffect.icc,v 1.5.2.1 2001/06/28 19:12:35 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PhotoElectricEffect.icc,v 1.8 2001/09/17 17:07:11 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// 12-06-96, update by M.Maire
// 17-09-96, PartialSumSigma(i)
@@ -34,21 +34,23 @@
// 20-11-97, change for lowest energy limit default action
// 17-11-98, use table of atomic shells in PostStepDoIt, mma
// 06-01-99, use Sandia crossSection, V.Grichine mma
// 28-05-01, V.Ivanchenko minor changes to provide ANSI -wall compilation
// 28-05-01, V.Ivanchenko minor changes to provide ANSI -wall compilation
// 17-09-01, migration of Materials to pure STL (mma)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4bool G4PhotoElectricEffect::IsApplicable(const G4ParticleDefinition& particle)
inline G4bool G4PhotoElectricEffect::IsApplicable(const G4ParticleDefinition&
particle)
{
return ( &particle == G4Gamma::Gamma() );
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4PhotoElectricEffect::GetCrossSectionPerAtom(
const G4DynamicParticle* aDynamicGamma,
G4Element* anElement)
const G4DynamicParticle* aDynamicGamma,
G4Element* anElement)
// gives the microscopic total cross section in GEANT4 internal units
@@ -69,7 +71,7 @@ inline G4double G4PhotoElectricEffect::GetCrossSectionPerAtom(
return crossSection;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4PhotoElectricEffect::GetMeanFreePath(const G4Track& aTrack,
G4double,
@@ -97,30 +99,30 @@ inline G4double G4PhotoElectricEffect::GetMeanFreePath(const G4Track& aTrack,
return MeanFreePath;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4PhotoElectricEffect::ComputeMeanFreePath(G4double GammaEnergy,
G4Material* aMaterial)
G4Material* aMaterial)
// returns the gamma mean free path in GEANT4 internal units
{
const G4ElementVector* theElementVector = aMaterial->GetElementVector() ;
const G4double* NbOfAtomsPerVolume = aMaterial->GetVecNbOfAtomsPerVolume();
const G4ElementVector* theElementVector = aMaterial->GetElementVector();
const G4double* NbOfAtomsPerVolume = aMaterial->GetVecNbOfAtomsPerVolume();
G4double SIGMA = 0 ;
G4double SIGMA = 0;
for ( size_t elm=0 ; elm < aMaterial->GetNumberOfElements() ; elm++ )
{
SIGMA += NbOfAtomsPerVolume[elm] *
ComputeCrossSectionPerAtom(GammaEnergy,
(*theElementVector)(elm)->GetZ());
(*theElementVector)[elm]->GetZ());
}
return SIGMA > DBL_MIN ? 1./SIGMA : DBL_MAX ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline
G4double G4PhotoElectricEffect::ComputeSandiaMeanFreePath(G4double GammaEnergy,
@@ -138,7 +140,7 @@ G4double G4PhotoElectricEffect::ComputeSandiaMeanFreePath(G4double GammaEnergy,
return SIGMA > DBL_MIN ? 1./SIGMA : DBL_MAX ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4PhotoElectricEffect::ComputeKBindingEnergy (G4double Z)
@@ -152,7 +154,7 @@ inline G4double G4PhotoElectricEffect::ComputeKBindingEnergy (G4double Z)
return Z*Z*(aK + Z* (bK + Z* (cK + Z* dK)));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4PhotoElectricEffect::ComputeL1BindingEnergy (G4double Z)
@@ -166,7 +168,7 @@ inline G4double G4PhotoElectricEffect::ComputeL1BindingEnergy (G4double Z)
return Z*Z*(aL1 + Z* (bL1 + Z* (cL1 + Z* dL1)));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4PhotoElectricEffect::ComputeL2BindingEnergy (G4double Z)
@@ -180,6 +182,6 @@ inline G4double G4PhotoElectricEffect::ComputeL2BindingEnergy (G4double Z)
return Z*Z*(aL2 + Z* (bL2 + Z* (cL2 + Z* dL2)));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -21,13 +21,13 @@
// ********************************************************************
//
//
// $Id: G4PolarizedComptonScattering.hh,v 1.4.4.1 2001/06/28 19:12:35 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PolarizedComptonScattering.hh,v 1.6 2001/08/31 14:58:47 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// --------- G4PolarizedComptonScattering physics process -----
// --------- G4PolarizedComptonScattering physics process ----------------------
// by Vicente Lara, March 1998
//
// ------------------------------------------------------------
// -----------------------------------------------------------------------------
// class description
//
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4SynchrotronRadiation.hh,v 1.5.2.2 2001/06/28 20:19:46 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4SynchrotronRadiation.hh,v 1.6 2001/07/11 10:03:28 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// ------------------------------------------------------------
// GEANT 4 class header file
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VPAIenergyLoss.hh,v 1.2.4.2 2001/06/28 20:19:47 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VPAIenergyLoss.hh,v 1.7 2001/11/08 08:13:24 urban Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// ------------------------------------------------------------
// GEANT 4 class header file
@@ -47,6 +47,7 @@
// corrected by V. Grichine on 24/11/97
// corrected by L. Urban on 27/05/98 (other corrections come soon!)
// 10/02/00 modifications , new e.m. structure, L.Urban
// 08/11/01 BuildDEDXTable is not static any more, L.Urban
// ------------------------------------------------------------
#ifndef G4VPAIenergyLoss_h
@@ -55,7 +56,6 @@
#include "G4ios.hh"
#include "g4std/fstream"
#include "g4std/iomanip"
#include "g4rw/tpordvec.h"
#include "globals.hh"
#include "Randomize.hh"
@@ -119,7 +119,7 @@ class G4VPAIenergyLoss : public G4VEnergyLoss
// Build energy loss table (total continuous energy loss)
static void BuildDEDXTable(const G4ParticleDefinition& aParticleType);
void BuildDEDXTable(const G4ParticleDefinition& aParticleType);
//----------------------------------------------
// public functions .........................
@@ -141,34 +141,34 @@ class G4VPAIenergyLoss : public G4VEnergyLoss
G4Material *aMaterial);
// static
G4PhysicsTable* GetPAItransferBank(){ return fPAItransferBank ; } ;
G4PhysicsTable* GetPAItransferBank(){ return fPAItransferBank ; };
static G4double GetMaxKineticEnergy() { return UpperBoundEloss ; } ;
static G4double GetMinKineticEnergy() { return LowerBoundEloss ; } ;
static G4int GetBinNumber() { return NbinEloss ; } ;
static G4double GetMaxKineticEnergy();
static G4double GetMinKineticEnergy();
static G4int GetBinNumber();
public: // With description
static void SetNbOfProcesses(G4int nb) {NbOfProcesses=nb;};
static void SetNbOfProcesses(G4int nb);
// Sets number of processes giving contribution to the energy loss
static void PlusNbOfProcesses() {NbOfProcesses++ ;};
static void PlusNbOfProcesses();
// Increases number of processes giving contribution to the energy loss
static void MinusNbOfProcesses() {NbOfProcesses-- ;};
static void MinusNbOfProcesses();
// Decreases number of processes giving contribution to the energy loss
static G4int GetNbOfProcesses() {return NbOfProcesses;};
static G4int GetNbOfProcesses();
// Gets number of processes giving contribution to the energy loss
// ( default value = 1)
static void SetLowerBoundEloss(G4double val) {LowerBoundEloss=val;};
static void SetUpperBoundEloss(G4double val) {UpperBoundEloss=val;};
static void SetNbinEloss(G4int nb) {NbinEloss=nb;};
static void SetLowerBoundEloss(G4double val);
static void SetUpperBoundEloss(G4double val);
static void SetNbinEloss(G4int nb);
static G4double GetLowerBoundEloss() {return LowerBoundEloss;};
static G4double GetUpperBoundEloss() {return UpperBoundEloss;};
static G4int GetNbinEloss() {return NbinEloss;};
static G4double GetLowerBoundEloss();
static G4double GetUpperBoundEloss();
static G4int GetNbinEloss();
protected:
@@ -255,7 +255,7 @@ class G4VPAIenergyLoss : public G4VEnergyLoss
// cut in range
static G4double CutInRange;
static G4double* CutInRange;
// cuts in kinetic energy ........
G4double* ParticleCutInKineticEnergy ;
@@ -21,18 +21,20 @@
// ********************************************************************
//
//
// $Id: G4VeEnergyLoss.hh,v 1.5.4.1 2001/06/28 19:12:35 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VeEnergyLoss.hh,v 1.10 2001/11/08 08:45:43 urban Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// ---------------------------------------------------------------
// 18/11/98 It is a modified version of G4VeEnergyLoss: continuous energy loss
// -----------------------------------------------------------------------------
// 18-11-98 It is a modified version of G4VeEnergyLoss: continuous energy loss
// with generation of subcutoff delta rays, L. Urban
// 02/02/99 new data members , L.Urban
// 10/02/00 modifications , new e.m. structure, L.Urban
// 02-02-99 new data members , L.Urban
// 10-02-00 modifications , new e.m. structure, L.Urban
// 29-10-01 all static functions no more inlined (mma)
// 08-11-01 Charge,lastCharge not data members, L.Urban
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef G4VeEnergyLoss_h
#define G4VeEnergyLoss_h 1
@@ -53,14 +55,13 @@
#include "G4PhysicsLinearVector.hh"
#include "G4EnergyLossTables.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Class description:
//
// This class is the implementation of the unified Energy Loss process
// with generation of subcutoff secondaries , see description of
// *****************************************
// the AlongStepDoIt method.
// the AlongStepDoIt method.
// It calculates the continuous energy loss for e+/e-.
// The following processes give contributions to the continuous
// energy loss (by default) :
@@ -74,7 +75,7 @@
//
// Class description - end
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4VeEnergyLoss : public G4VEnergyLoss
@@ -140,10 +141,7 @@ class G4VeEnergyLoss : public G4VEnergyLoss
G4PhysicsTable* theLossTable;
G4double MinKineticEnergy ; //
G4double Charge,lastCharge ;
G4double MinKineticEnergy ;
private:
@@ -157,7 +155,7 @@ class G4VeEnergyLoss : public G4VEnergyLoss
G4double linLossLimit ; //
G4double c1N,c2N ; // coeffs to compute nb of deltas
G4double cN ; // coeffs to compute nb of deltas
G4int Ndeltamax ; // upper limit for nb of subcutoff
// delta rays in one step
@@ -166,26 +164,26 @@ class G4VeEnergyLoss : public G4VEnergyLoss
//
public: // With description
static void SetNbOfProcesses(G4int nb) {NbOfProcesses=nb;};
static void SetNbOfProcesses(G4int nb);
// Sets number of processes giving contribution to the energy loss
static void PlusNbOfProcesses() {NbOfProcesses++ ;};
static void PlusNbOfProcesses();
// Increases number of processes giving contribution to the energy loss
static void MinusNbOfProcesses() {NbOfProcesses-- ;};
static void MinusNbOfProcesses();
// Decreases number of processes giving contribution to the energy loss
static G4int GetNbOfProcesses() {return NbOfProcesses;};
static G4int GetNbOfProcesses();
// Gets number of processes giving contribution to the energy loss
// ( default value = 2)
static void SetLowerBoundEloss(G4double val) {LowerBoundEloss=val;};
static void SetUpperBoundEloss(G4double val) {UpperBoundEloss=val;};
static void SetNbinEloss(G4int nb) {NbinEloss=nb;};
static void SetLowerBoundEloss(G4double val);
static void SetUpperBoundEloss(G4double val);
static void SetNbinEloss(G4int nb);
static G4double GetLowerBoundEloss() {return LowerBoundEloss;};
static G4double GetUpperBoundEloss() {return UpperBoundEloss;};
static G4int GetNbinEloss() {return NbinEloss;};
static G4double GetLowerBoundEloss();
static G4double GetUpperBoundEloss();
static G4int GetNbinEloss();
protected:
@@ -239,6 +237,8 @@ class G4VeEnergyLoss : public G4VEnergyLoss
public: // With description
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4VeEnergyLoss.icc"
@@ -21,16 +21,18 @@
// ********************************************************************
//
//
// $Id: G4VeEnergyLoss.icc,v 1.3.2.1 2001/06/28 19:12:35 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VeEnergyLoss.icc,v 1.7 2001/11/09 13:56:28 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//
// 18/11/98, L. Urban
// It is a modified version of G4VeEnergyLoss:
// continuous energy loss with generation of subcutoff delta rays
// 18/11/98 L. Urban
// It is a modified version of G4VeEnergyLoss:
// continuous energy loss with generation of subcutoff delta rays
// 08-11-01 Charge,lastCharge not data members, L.Urban
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4VeEnergyLoss::GetConstraints(
const G4DynamicParticle* aParticle,
@@ -43,9 +45,6 @@ inline G4double G4VeEnergyLoss::GetConstraints(
G4double StepLimit;
const G4ParticleDefinition* ParticleType=aParticle->GetDefinition();
Charge = aParticle->GetDefinition()->GetPDGCharge();
if (Charge != lastCharge) lastCharge = Charge;
G4double KineticEnergy = aParticle->GetKineticEnergy();
fdEdx = G4EnergyLossTables::GetDEDX(ParticleType,KineticEnergy,aMaterial);
@@ -66,7 +65,7 @@ inline G4double G4VeEnergyLoss::GetConstraints(
return StepLimit;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4VeEnergyLoss::GetContinuousStepLimit(
const G4Track& track,
@@ -83,7 +82,7 @@ inline G4double G4VeEnergyLoss::GetContinuousStepLimit(
return Step ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4bool G4VeEnergyLoss::IsApplicable(const G4ParticleDefinition&
particle)
@@ -92,4 +91,4 @@ inline G4bool G4VeEnergyLoss::IsApplicable(const G4ParticleDefinition&
||(&particle == G4Positron::Positron()) );
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -21,19 +21,12 @@
// ********************************************************************
//
//
// $Id: G4VhEnergyLoss.hh,v 1.7.4.2 2001/06/28 20:19:48 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VhEnergyLoss.hh,v 1.14 2001/11/09 13:56:28 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// ---------- G4VhEnergyLoss physics process -----------
// ------------- G4VhEnergyLoss physics process --------------------------------
// by Laszlo Urban, 30 May 1997
//
// ************************************************************
// It is the first implementation of the NEW UNIFIED ENERGY LOSS PROCESS.
// It calculates the continuous energy loss for charged hadrons.
// Processes giving contribution to the continuous loss :
// ionisation (= cont.ion.loss + delta ray production)
@@ -43,15 +36,17 @@
// The energy loss for other charged hadrons is calculated from the p/pbar
// tables with scaled kinetic energy.
//
// ****************************************************************************
// It is assumed that the cut in range is the same for all the charged hadrons!
// ****************************************************************************
//
// -----------------------------------------------------------------------------
// 7/10/98 some bugs fixed + some cleanup , L.Urban
// 22/10/98 cleanup , L.Urban
// 02/02/99 several bugs fixed, L.Urban
// 10/02/00 modifications , new e.m. structure, L.Urban
// 10/02/00 modifications , new e.m. structure, L.Urban
// 10/09/01 bugfix in subcutoff delta generation, L.Urban
// 29-10-01 all static functions no more inlined (mma)
// 08-11-01 BuildDEDXTable not static,Charge local variable, L.Urban
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef G4VhEnergyLoss_h
#define G4VhEnergyLoss_h 1
@@ -70,6 +65,8 @@
#include "G4Step.hh"
#include "G4PhysicsLogVector.hh"
#include "G4PhysicsLinearVector.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4VhEnergyLoss : public G4VEnergyLoss
@@ -82,34 +79,24 @@ class G4VhEnergyLoss : public G4VEnergyLoss
G4bool IsApplicable(const G4ParticleDefinition&);
G4double GetContinuousStepLimit(
const G4Track& track,
void BuildDEDXTable(const G4ParticleDefinition& aParticleType);
G4double GetContinuousStepLimit(const G4Track& track,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety) ;
G4double& currentSafety);
G4VParticleChange* AlongStepDoIt(const G4Track& track ,const G4Step& Step) ;
G4VParticleChange* AlongStepDoIt(const G4Track& track, const G4Step& Step);
virtual G4double GetMeanFreePath(
const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition
) = 0 ;
virtual G4double GetMeanFreePath(const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition) = 0;
virtual G4VParticleChange* PostStepDoIt(const G4Track& track,
const G4Step& Step) = 0 ;
protected:
const G4Step& Step) = 0;
private:
// hide assignment operator
G4VhEnergyLoss(G4VhEnergyLoss &);
G4VhEnergyLoss & operator=(const G4VhEnergyLoss &right);
G4double GetConstraints(const G4DynamicParticle *aParticle,
G4Material *aMaterial);
@@ -118,104 +105,86 @@ class G4VhEnergyLoss : public G4VEnergyLoss
G4double ChargeSquare,
G4double MeanLoss,
G4double Step);
//hide assignment operator
G4VhEnergyLoss(G4VhEnergyLoss &);
G4VhEnergyLoss & operator=(const G4VhEnergyLoss &right);
// =====================================================================
public:
protected:
G4PhysicsTable* theLossTable ;
G4PhysicsTable* theLossTable;
G4double MinKineticEnergy ;
G4double MinKineticEnergy;
private:
static G4PhysicsTable* theDEDXTable ;
static G4PhysicsTable* theDEDXTable;
G4double fdEdx; // computed in GetContraints
G4double fRangeNow ; // computed in GetContraints
G4double linLossLimit ;
G4double fdEdx; // computed in GetContraints
G4double fRangeNow; // computed in GetContraints
G4double linLossLimit;
// ====================================================================
//
// static part of the cc: // With description
//
public:
static void SetNbOfProcesses(G4int nb) {NbOfProcesses=nb;};
static void SetNbOfProcesses(G4int nb);
// Sets number of processes giving contribution to the energy loss
static void PlusNbOfProcesses() {NbOfProcesses++ ;};
static void PlusNbOfProcesses();
// Increases number of processes giving contribution to the energy loss
static void MinusNbOfProcesses() {NbOfProcesses-- ;};
static void MinusNbOfProcesses();
// Decreases number of processes giving contribution to the energy loss
static G4int GetNbOfProcesses() {return NbOfProcesses;};
static G4int GetNbOfProcesses();
// Gets number of processes giving contribution to the energy loss
// ( default value = 1)
static void SetLowerBoundEloss(G4double val) {LowerBoundEloss=val;};
static void SetUpperBoundEloss(G4double val) {UpperBoundEloss=val;};
static void SetNbinEloss(G4int nb) {NbinEloss=nb;};
static G4double GetLowerBoundEloss() {return LowerBoundEloss;};
static G4double GetUpperBoundEloss() {return UpperBoundEloss;};
static G4int GetNbinEloss() {return NbinEloss;};
static void SetLowerBoundEloss(G4double val);
static void SetUpperBoundEloss(G4double val);
static void SetNbinEloss(G4int nb);
static G4double GetLowerBoundEloss();
static G4double GetUpperBoundEloss();
static G4int GetNbinEloss();
protected:
static void BuildDEDXTable(const G4ParticleDefinition& aParticleType);
private:
static const G4Proton* theProton ;
static const G4AntiProton* theAntiProton ;
// ====================================================================
public:
protected:
static G4PhysicsTable* theDEDXpTable ;
static G4PhysicsTable* theDEDXpbarTable ;
static G4PhysicsTable* theRangepTable ;
static G4PhysicsTable* theRangepbarTable ;
static G4PhysicsTable* theDEDXpTable;
static G4PhysicsTable* theDEDXpbarTable;
static G4PhysicsTable* theRangepTable;
static G4PhysicsTable* theRangepbarTable;
//inverse of the range tables
static G4PhysicsTable* theInverseRangepTable ;
static G4PhysicsTable* theInverseRangepbarTable ;
static G4PhysicsTable* theInverseRangepTable;
static G4PhysicsTable* theInverseRangepbarTable;
//lab and proper time tables
static G4PhysicsTable* theLabTimepTable ;
static G4PhysicsTable* theLabTimepbarTable ;
static G4PhysicsTable* theLabTimepTable;
static G4PhysicsTable* theLabTimepbarTable;
static G4PhysicsTable* theProperTimepTable ;
static G4PhysicsTable* theProperTimepbarTable ;
static G4PhysicsTable* theProperTimepTable;
static G4PhysicsTable* theProperTimepbarTable;
// processes inherited from G4VhEnergyLoss
// register themselves in the static array Recorder
static G4int NbOfProcesses ;
static G4int NbOfProcesses;
static G4PhysicsTable** RecorderOfpProcess;
static G4PhysicsTable** RecorderOfpbarProcess;
static G4int CounterOfpProcess ;
static G4int CounterOfpbarProcess ;
static G4int CounterOfpProcess;
static G4int CounterOfpbarProcess;
// cut in range
static G4double ptableElectronCutInRange;
static G4double pbartableElectronCutInRange;
static G4double Charge ;
static G4double* ptableElectronCutInRange;
static G4double* pbartableElectronCutInRange;
private:
static G4int NbinEloss; // number of bins in table,
// calculated in BuildPhysicTable
static G4int NbinEloss; // number of bins in table,
// calculated in BuildPhysicTable
static G4double LowerBoundEloss;
static G4double UpperBoundEloss;
static G4double RTable,LOGRTable; // LOGRTable=log(UpperBoundEloss-
@@ -233,11 +202,13 @@ class G4VhEnergyLoss : public G4VEnergyLoss
static G4PhysicsTable* thepbarRangeCoeffBTable;
static G4PhysicsTable* thepbarRangeCoeffCTable;
static G4double c0N,c1N,c2N,c3N ; // coeffs to compute nb of deltas
static G4int Ndeltamax ; // upper limit for nb of subcutoff
// delta rays in one step
static G4double cN; // coeff to compute nb of deltas
static G4int Ndeltamax; // upper limit for nb of subcutoff
// delta rays in one step
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4VhEnergyLoss.icc"
@@ -21,42 +21,37 @@
// ********************************************************************
//
//
// $Id: G4VhEnergyLoss.icc,v 1.2.4.2 2001/06/28 20:19:48 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VhEnergyLoss.icc,v 1.4 2001/11/09 13:56:28 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// ---------------------------------------------------------------
// GEANT 4 class inlined methods file
//
// History: based on object model of
// 2nd December 1995, G.Cosmo
// ------------ G4VhEnergyLoss physics process ------------
// ---------------- G4VhEnergyLoss physics process -----------------------------
// by Laszlo Urban, 30 May 1997
// ***************************************************************
// It is the first implementation of the NEW UNIFIED ENERGY LOSS PROCESS.
// It calculates the energy loss of charged hadrons.
// ***************************************************************
//
// -----------------------------------------------------------------------------
// 22/10/98: cleanup , L.Urban
// ---------------------------------------------------------------
// -----------------------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4bool G4VhEnergyLoss::IsApplicable(const G4ParticleDefinition&
particle)
{
return(particle.GetPDGCharge()!= 0.);
}
inline G4double G4VhEnergyLoss::GetContinuousStepLimit(
const G4Track& track,
G4double,
G4double currentMinimumStep,
G4double&)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4VhEnergyLoss::GetContinuousStepLimit(const G4Track& track,
G4double,
G4double currentMinimumStep,
G4double&)
{
G4double Step =
GetConstraints(track.GetDynamicParticle(),track.GetMaterial()) ;
if((Step>0.0)&&(Step<currentMinimumStep))
currentMinimumStep = Step ;
return Step ;
G4double Step = GetConstraints(track.GetDynamicParticle(),track.GetMaterial());
if ((Step > 0.0)&&(Step < currentMinimumStep)) currentMinimumStep = Step;
return Step;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -21,26 +21,33 @@
// ********************************************************************
//
//
// $Id: G4eBremsstrahlung.hh,v 1.8.2.2 2001/06/28 20:19:48 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4eBremsstrahlung.hh,v 1.13 2001/10/29 16:23:41 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
// CERN Geneva Switzerland
//
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// ------------ G4eBremsstrahlung physics process ------
// by Michel Maire, 24 July 1996
// ************************************************************
// 1-10-96 : new type G4OrderedTable; ComputePartialSumSigma()
// 20/03/97: new energy loss+ionisation+brems scheme, L.Urban
// 01-09-98, new method PrintInfo()
// 10/02/00 modifications , new e.m. structure, L.Urban
// 07/08/00 new cross section/en.loss parametrisation, LPM flag , L.Urban
// by Laszlo Urban, 24 July 1996
//
// 01-10-96 new type G4OrderedTable; ComputePartialSumSigma()
// 20-03-97 new energy loss+ionisation+brems scheme, L.Urban
// 01-09-98 new method PrintInfo()
// 10-02-00 modifications , new e.m. structure, L.Urban
// 07-08-00 new cross section/en.loss parametrisation, LPM flag , L.Urban
// 09-08-01 new methods Store/Retrieve PhysicsTable (mma)
// 19-09-01 come back to previous process name "eBrem"
// 29-10-01 all static functions no more inlined (mma)
// ------------------------------------------------------------
// Class description
//
// This class manages the bremsstrahlung for e-/e+
// it inherites from G4VContinuousDiscreteProcess via G4VeEnergyLoss.
//
// Class description - end
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef G4eBremsstrahlung_h
#define G4eBremsstrahlung_h 1
@@ -56,7 +63,9 @@
#include "G4OrderedTable.hh"
#include "G4PhysicsTable.hh"
#include "G4PhysicsLogVector.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class G4eBremsstrahlung : public G4VeEnergyLoss
{
@@ -83,9 +92,18 @@ class G4eBremsstrahlung : public G4VeEnergyLoss
G4VParticleChange *PostStepDoIt(const G4Track& track,
const G4Step& step);
G4double GetLambda(
G4double KineticEnergy,G4Material* material);
G4double GetLambda(G4double KineticEnergy,G4Material* material);
G4bool StorePhysicsTable(G4ParticleDefinition* ,
const G4String& directory, G4bool);
// store eLoss and MeanFreePath tables into an external file
// specified by 'directory' (must exist before invokation)
G4bool RetrievePhysicsTable(G4ParticleDefinition* ,
const G4String& directory, G4bool);
// retrieve eLoss and MeanFreePath tables from an external file
// specified by 'directory'
protected:
G4double ComputeMeanFreePath( const G4ParticleDefinition* ParticleType,
@@ -96,7 +114,7 @@ class G4eBremsstrahlung : public G4VeEnergyLoss
G4double KineticEnergy,
const G4Material* aMaterial);
virtual G4double ComputeMicroscopicCrossSection(
virtual G4double ComputeCrossSectionPerAtom(
const G4ParticleDefinition* ParticleType,
G4double KineticEnergy,
G4double AtomicNumber,
@@ -131,12 +149,12 @@ class G4eBremsstrahlung : public G4VeEnergyLoss
private:
G4PhysicsTable* theMeanFreePathTable ;
G4PhysicsTable* theMeanFreePathTable;
G4OrderedTable PartialSumSigma; // partial sum of total crosssection
static G4double LowerBoundLambda; // low energy limit of the crossection formula
static G4double UpperBoundLambda; // high energy limit of the crossection formula
static G4double LowerBoundLambda; // low energy limit of crossection table
static G4double UpperBoundLambda; // high energy limit of crossection table
static G4int NbinLambda; // number of bins in the tables
G4double MinThreshold; // minimun value for the production threshold
@@ -144,22 +162,24 @@ class G4eBremsstrahlung : public G4VeEnergyLoss
G4double LowestKineticEnergy,HighestKineticEnergy; // bining of the Eloss table
G4int TotBin; // (from G4VeEnergyLoss)
static G4double probsup ;
static G4bool LPMflag ;
static G4double probsup;
static G4bool LPMflag;
public:
static void SetLowerBoundLambda(G4double val) {LowerBoundLambda = val;};
static void SetUpperBoundLambda(G4double val) {UpperBoundLambda = val;};
static void SetNbinLambda(G4int n) {NbinLambda = n;};
static G4double GetLowerBoundLambda() { return LowerBoundLambda;};
static G4double GetUpperBoundLambda() { return UpperBoundLambda;};
static G4int GetNbinLambda() {return NbinLambda;};
static void SetLowerBoundLambda(G4double val);
static void SetUpperBoundLambda(G4double val);
static void SetNbinLambda(G4int n);
static G4double GetLowerBoundLambda();
static G4double GetUpperBoundLambda();
static G4int GetNbinLambda();
static void SetLPMflag(G4bool val) { LPMflag = val ; } ;
static G4bool GetLPMflag() { return LPMflag ; } ;
static void SetLPMflag(G4bool val);
static G4bool GetLPMflag();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4eBremsstrahlung.icc"
#endif
@@ -21,22 +21,16 @@
// ********************************************************************
//
//
// $Id: G4eBremsstrahlung.icc,v 1.4.2.2 2001/06/28 20:19:48 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4eBremsstrahlung.icc,v 1.6 2001/08/09 17:24:22 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// ---------------------------------------------------------------
// GEANT 4 class inlined methods file
//
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// ------------ G4eBremsstrahlung physics process ---------
// by Michel Maire, 27 July 1996
// ***************************************************************
//
// 13-12-96 : Sign corrected in the ScreenFunctions, L.Urban
// 20/03/97 : new energy loss+ionisation+brems scheme, L.Urban
// 28/05/01 V.Ivanchenko minor changes to provide ANSI -wall compilation
// ***************************************************************
// 28/05/01 : V.Ivanchenko minor changes to provide ANSI -wall compilation
// ---------------------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -61,10 +55,9 @@ inline G4double G4eBremsstrahlung::GetMeanFreePath(const G4Track& track,
G4Material* aMaterial = track.GetMaterial();
G4double MeanFreePath;
G4bool isOutRange ;
G4bool isOutRange;
if (KineticEnergy < LowestKineticEnergy)
MeanFreePath = DBL_MAX;
if (KineticEnergy < LowestKineticEnergy) MeanFreePath = DBL_MAX;
else {
if (KineticEnergy > HighestKineticEnergy) KineticEnergy = 0.99*HighestKineticEnergy ;
MeanFreePath = (*theMeanFreePathTable)(aMaterial->GetIndex())->
@@ -114,13 +107,9 @@ inline G4double G4eBremsstrahlung::GetLambda(
G4double KineticEnergy,
G4Material* material)
{
G4bool isOut;
//const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable() ;
G4double lambda = (*theMeanFreePathTable)
[material->GetIndex()]->
GetValue(KineticEnergy,isOut);
return lambda;
G4bool isOut;
return (*theMeanFreePathTable)[material->GetIndex()]->
GetValue(KineticEnergy,isOut);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -21,80 +21,114 @@
// ********************************************************************
//
//
// $Id: G4eIonisation.hh,v 1.7.4.2 2001/06/28 20:19:48 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4eIonisation.hh,v 1.15 2001/10/29 16:23:41 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History: based on object model of
// 2nd December 1995, G.Cosmo
// ---------- G4eIonisation physics process -----------
//--------------- G4eIonisation physics process --------------------------------
// by Laszlo Urban, 20 March 1997
// ************************************************************
// It is the first implementation of the NEW IONISATION
// PROCESS. ( delta rays + continuous energy loss)
// It calculates the ionisation for e+/e-.
// ************************************************************
//
// 10/02/00 modifications , new e.m. structure, L.Urban
// ------------------------------------------------------------
// 10-02-00 modifications , new e.m. structure, L.Urban
// 03-08-01 new methods Store/Retrieve PhysicsTable (mma)
// 13-08-01 new function ComputeRestrictedMeandEdx() (mma)
// 19-09-01 come back to previous ProcessName "eIoni"
// 29-10-01 all static functions no more inlined (mma)
//
//------------------------------------------------------------------------------
// Class description
//
// This class manages the ionisation process for e-/e+
// it inherites from G4VContinuousDiscreteProcess via G4VeEnergyLoss.
//
// Class description - end
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef G4eIonisation_h
#define G4eIonisation_h 1
#include "G4ios.hh"
#include "globals.hh"
#include "Randomize.hh"
#include "G4VeEnergyLoss.hh"
#include "globals.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4Electron.hh"
#include "G4Positron.hh"
#include "G4Gamma.hh"
#include "G4PhysicsLogVector.hh"
#include "G4PhysicsLinearVector.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4eIonisation : public G4VeEnergyLoss
{
public:
public: // with description
G4eIonisation(const G4String& processName = "eIoni");
~G4eIonisation();
G4bool IsApplicable(const G4ParticleDefinition&);
G4bool IsApplicable(const G4ParticleDefinition&);
// return true for e+/e-, false otherwise
void BuildPhysicsTable(const G4ParticleDefinition& aParticleType);
// this function overloads a virtual function of the base class.
// It is invoked by the G4ParticleWithCuts::SetCut() method.
// It invokes BuildLambdaTable(), BuildLossTable(), BuildDEDXTable()
void BuildLossTable(const G4ParticleDefinition& aParticleType);
// build the dE/dx tables due to the ionisation, for every materials.
// (restricted stopping power, Berger-Seltzer formula)
void BuildLambdaTable(const G4ParticleDefinition& aParticleType);
// build mean free path tables for the delta rays production.
// the tables are built for every materials.
G4bool StorePhysicsTable(G4ParticleDefinition* ,
const G4String& directory, G4bool);
// store eLoss and MeanFreePath tables into an external file
// specified by 'directory' (must exist before invokation)
G4bool RetrievePhysicsTable(G4ParticleDefinition* ,
const G4String& directory, G4bool);
// retrieve eLoss and MeanFreePath tables from an external file
// specified by 'directory'
void PrintInfoDefinition();
// Print few lines of informations about the process: validity range,
// origine ..etc..
// Invoked by BuildPhysicsTable().
G4double GetMeanFreePath(const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition ) ;
G4ForceCondition* condition );
// It returns the MeanFreePath of the process for the current track :
// (energy, material)
// The previousStepSize and G4ForceCondition* are not used.
// This function overloads a virtual function of the base class.
// It is invoked by the ProcessManager of the Particle.
G4VParticleChange *PostStepDoIt(const G4Track& track,
const G4Step& Step ) ;
const G4Step& Step );
// It computes the final state of the process (at end of step),
// returned as a ParticleChange object.
// This function overloads a virtual function of the base class.
// It is invoked by the ProcessManager of the Particle.
G4double GetLambda(G4double KineticEnergy, G4Material* material);
// It returns the MeanFreePath of the process for a (energy, material)
G4double GetLambda(
G4double KineticEnergy,G4Material* material);
protected:
virtual G4double ComputeMicroscopicCrossSection(
protected: // with description
virtual G4double ComputeRestrictedMeandEdx(
const G4ParticleDefinition& aParticleType,
G4double KineticEnergy,
const G4Material* material,
G4double DeltaThreshold);
// computes restricted mean dE/dx in Geant4 internal units.
virtual G4double ComputeCrossSectionPerAtom(
const G4ParticleDefinition& aParticleType,
G4double KineticEnergy,
G4double AtomicNumber,
G4double DeltaThreshold);
// computes total cross section per atom in Geant4 internal units.
protected:
G4PhysicsTable* theMeanFreePathTable;
private:
@@ -105,24 +139,29 @@ class G4eIonisation : public G4VeEnergyLoss
private:
// G4PhysicsTable* theMeanFreePathTable;
static G4double LowerBoundLambda; // binning for mean free path table
static G4double UpperBoundLambda;
static G4int NbinLambda;
G4double LowestKineticEnergy; // binning for dE/dx table
G4double HighestKineticEnergy;
G4int TotBin;
static G4double LowerBoundLambda ; // bining for lambda table
static G4double UpperBoundLambda ;
static G4int NbinLambda ;
G4double LowestKineticEnergy,HighestKineticEnergy ;
G4int TotBin ;
public:
static void SetLowerBoundLambda(G4double val) {LowerBoundLambda = val;};
static void SetUpperBoundLambda(G4double val) {UpperBoundLambda = val;};
static void SetNbinLambda(G4int n) {NbinLambda = n;};
static G4double GetLowerBoundLambda() { return LowerBoundLambda;};
static G4double GetUpperBoundLambda() { return UpperBoundLambda;};
static G4int GetNbinLambda() {return NbinLambda;};
public: // with description
static void SetLowerBoundLambda(G4double val);
static void SetUpperBoundLambda(G4double val);
static void SetNbinLambda(G4int n);
// set the parameters of the mean free path table.
static G4double GetLowerBoundLambda();
static G4double GetUpperBoundLambda();
static G4int GetNbinLambda();
// get the parameters of the mean free path table.
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4eIonisation.icc"
@@ -21,71 +21,56 @@
// ********************************************************************
//
//
// $Id: G4eIonisation.icc,v 1.4.2.2 2001/06/28 20:19:49 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4eIonisation.icc,v 1.10 2001/11/09 13:56:28 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// ---------------------------------------------------------------
// GEANT 4 class inlined methods file
//
// ------------ G4eIonisation physics process ------------
//----------------- G4eIonisation physics process ------------------------------
// by Laszlo Urban, 20 March 1997
// ***************************************************************
// It is the first implementation of the NEW IONISATION PROCESS.
// It calculates the ionisation of e+/e-.
// ***************************************************************
//------------------------------------------------------------------------------
//
// 24-11-97: correction on MeanFreePath for KinEnergy > HighestLimit
// 28-05-01: V.Ivanchenko minor changes to provide ANSI -wall compilation
//
// ---------------------------------------------------------------
//------------------------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4bool G4eIonisation::IsApplicable(
const G4ParticleDefinition& particle)
inline G4bool G4eIonisation::IsApplicable(const G4ParticleDefinition& particle)
{
return( (&particle == G4Electron::Electron())
||(&particle == G4Positron::Positron()) );
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4eIonisation::GetMeanFreePath(
const G4Track& track,
G4double,
inline G4double G4eIonisation::GetMeanFreePath(const G4Track& track, G4double,
G4ForceCondition*)
{
const G4DynamicParticle* aParticle = track.GetDynamicParticle();
G4double KineticEnergy = aParticle->GetKineticEnergy();
G4Material* aMaterial = track.GetMaterial();
G4double KineticEnergy = track.GetDynamicParticle()->GetKineticEnergy();
G4Material* aMaterial = track.GetMaterial();
G4double MeanFreePath;
G4bool isOutRange ;
G4double MeanFreePath;
G4bool isOut;
if (KineticEnergy > HighestKineticEnergy) KineticEnergy = HighestKineticEnergy;
if (KineticEnergy > LowestKineticEnergy)
MeanFreePath = ((*theMeanFreePathTable)(aMaterial->GetIndex()))->
GetValue(KineticEnergy, isOut);
else MeanFreePath = DBL_MAX;
if( KineticEnergy < LowestKineticEnergy )
MeanFreePath = DBL_MAX;
else {
if (KineticEnergy > HighestKineticEnergy) KineticEnergy = HighestKineticEnergy;
MeanFreePath = ((*theMeanFreePathTable)(aMaterial->GetIndex()))->
GetValue( KineticEnergy, isOutRange);
}
return MeanFreePath ;
return MeanFreePath;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4eIonisation::GetLambda(
G4double KineticEnergy,
G4Material* material)
inline
G4double G4eIonisation::GetLambda(G4double KineticEnergy, G4Material* material)
{
G4bool isOut;
//const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable() ;
G4double lambda = (*theMeanFreePathTable)
[material->GetIndex()]->
GetValue(KineticEnergy,isOut);
return lambda;
return (*theMeanFreePathTable)[material->GetIndex()]->
GetValue(KineticEnergy,isOut);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -21,15 +21,19 @@
// ********************************************************************
//
//
// $Id: G4eplusAnnihilation.hh,v 1.4.2.1 2001/06/28 19:12:36 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4eplusAnnihilation.hh,v 1.9 2001/10/01 15:00:28 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// 10-01-97, crossection table + meanfreepath table, M.Maire
// 17-03-97, merge 'in fly' and 'at rest', M.Maire
// 31-08-98, new methods SetBining() and PrintInfo()
// 31-08-98, new methods SetBining() and PrintInfo()
// 03-08-01, new methods Store/Retrieve PhysicsTable (mma)
// 06-08-01, BuildThePhysicsTable() called from constructor (mma)
// 20-09-01, DoIt: fminimalEnergy = 1*eV (mma)
// 01-10-01, come back to BuildPhysicsTable(const G4ParticleDefinition&)
//
// class description
@@ -73,18 +77,26 @@ class G4eplusAnnihilation : public G4VRestDiscreteProcess
// Allows to define the binning of the PhysicsTables,
// before to build them.
void BuildPhysicsTable(const G4ParticleDefinition& PositronType);
void BuildPhysicsTable(const G4ParticleDefinition&);
// It builds the total CrossSectionPerAtom table, for e+,
// and for every element contained in the elementTable.
// It builds the MeanFreePath table, for e+,
// and for every material contained in the materialTable.
// This function overloads a virtual function of the base class.
// It is invoked by the G4ParticleWithCuts::SetCut() method.
G4bool StorePhysicsTable(G4ParticleDefinition* ,
const G4String& directory, G4bool);
// store CrossSection and MeanFreePath tables into an external file
// specified by 'directory' (must exist before invokation)
G4bool RetrievePhysicsTable(G4ParticleDefinition* ,
const G4String& directory, G4bool);
// retrieve CrossSection and MeanFreePath tables from an external file
// specified by 'directory'
void PrintInfoDefinition();
// Print few lines of informations about the process: validity range,
// origine ..etc..
// Invoked by BuildPhysicsTable().
// Invoked by BuildThePhysicsTable().
G4double GetMeanFreePath(const G4Track& aTrack,
G4double previousStepSize,
@@ -92,7 +104,7 @@ class G4eplusAnnihilation : public G4VRestDiscreteProcess
// It returns the MeanFreePath of the process for the current track :
// (energy, material)
// The previousStepSize and G4ForceCondition* are not used.
// This function overloads a virtual function of the base class.
// This function overloads a virtual function of the base class.
// It is invoked by the ProcessManager of the Particle.
G4double GetCrossSectionPerAtom(G4DynamicParticle* aDynamicPositron,
@@ -125,7 +137,7 @@ class G4eplusAnnihilation : public G4VRestDiscreteProcess
protected:
virtual G4double ComputeCrossSectionPerAtom(G4double PositKinEnergy,
G4double AtomicNumber);
G4double AtomicNumber);
virtual G4double ComputeMeanFreePath(G4double PositKinEnergy,
G4Material* aMaterial);
@@ -133,19 +145,22 @@ class G4eplusAnnihilation : public G4VRestDiscreteProcess
private:
// hide assignment operator as private
G4eplusAnnihilation& operator=(const G4eplusAnnihilation &right);
G4eplusAnnihilation& operator=(const G4eplusAnnihilation& right);
G4eplusAnnihilation(const G4eplusAnnihilation& );
private:
G4PhysicsTable* theCrossSectionTable; // table for crossection
G4PhysicsTable* theCrossSectionTable;
G4PhysicsTable* theMeanFreePathTable;
G4double LowestEnergyLimit ; // low energy limit of the crossection formula
G4double HighestEnergyLimit ; // high energy limit of the crossection formula
G4int NumbBinTable ; // number of bins in the crossection table
G4double LowestEnergyLimit; // low energy limit of the tables
G4double HighestEnergyLimit; // high energy limit of the tables
G4int NumbBinTable; // number of bins in the tables
G4double fminimalEnergy; // minimalEnergy of produced particles
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4eplusAnnihilation.icc"
#endif
@@ -21,30 +21,32 @@
// ********************************************************************
//
//
// $Id: G4eplusAnnihilation.icc,v 1.4.2.1 2001/06/28 19:12:36 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4eplusAnnihilation.icc,v 1.8 2001/09/17 17:07:11 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// 10-01-97, crossection table + meanfreepath table, M.Maire
// 17-03-97, merge 'in fly' and 'at rest', M.Maire
// 28-05-01, V.Ivanchenko minor changes to provide ANSI -wall compilation
// 17-09-01, migration of Materials to pure STL (mma)
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4bool G4eplusAnnihilation::IsApplicable(const G4ParticleDefinition& particle)
inline G4bool G4eplusAnnihilation::IsApplicable(
const G4ParticleDefinition& particle)
{
return ( &particle == G4Positron::Positron() );
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4eplusAnnihilation::GetCrossSectionPerAtom(
G4DynamicParticle* aDynamicPositron,
G4Element* anElement)
// gives the microscopic total cross section in GEANT4 internal units
// return the total cross section per atom in GEANT4 internal units
{
G4double crossSection;
@@ -62,7 +64,7 @@ inline G4double G4eplusAnnihilation::GetCrossSectionPerAtom(
return crossSection;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4eplusAnnihilation::GetMeanFreePath(const G4Track& aTrack,
G4double,
@@ -71,48 +73,50 @@ inline G4double G4eplusAnnihilation::GetMeanFreePath(const G4Track& aTrack,
// returns the positron mean free path in GEANT4 internal units
{
const G4DynamicParticle* aDynamicPositron = aTrack.GetDynamicParticle();
G4double PositronEnergy = aDynamicPositron->GetKineticEnergy();
G4Material* aMaterial = aTrack.GetMaterial();
const G4DynamicParticle* aDynamicPositron = aTrack.GetDynamicParticle();
G4double PositronEnergy = aDynamicPositron->GetKineticEnergy();
G4Material* aMaterial = aTrack.GetMaterial();
G4double MeanFreePath;
G4bool isOutRange ;
G4double MeanFreePath;
G4bool isOutRange ;
if (PositronEnergy > HighestEnergyLimit)
MeanFreePath = DBL_MAX;
else {
if (PositronEnergy < LowestEnergyLimit) PositronEnergy = 1.01*LowestEnergyLimit;
if (PositronEnergy > HighestEnergyLimit) MeanFreePath = DBL_MAX;
else
{
if (PositronEnergy < LowestEnergyLimit)
PositronEnergy = 1.01*LowestEnergyLimit;
MeanFreePath = (*theMeanFreePathTable)(aMaterial->GetIndex())->
GetValue( PositronEnergy, isOutRange );
}
}
return MeanFreePath;
return MeanFreePath;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4eplusAnnihilation::ComputeMeanFreePath(G4double PositKinEnergy,
inline G4double G4eplusAnnihilation::ComputeMeanFreePath(
G4double PositKinEnergy,
G4Material* aMaterial)
// returns the positron mean free path in GEANT4 internal units
{
const G4ElementVector* theElementVector = aMaterial->GetElementVector() ;
const G4double* NbOfAtomsPerVolume = aMaterial->GetVecNbOfAtomsPerVolume();
const G4ElementVector* theElementVector = aMaterial->GetElementVector();
const G4double* NbOfAtomsPerVolume = aMaterial->GetVecNbOfAtomsPerVolume();
G4double SIGMA = 0 ;
for ( size_t elm=0 ; elm < aMaterial->GetNumberOfElements() ; elm++ )
{
SIGMA += NbOfAtomsPerVolume[elm] *
ComputeCrossSectionPerAtom(PositKinEnergy,
(*theElementVector)(elm)->GetZ());
}
for (size_t elm=0 ; elm < aMaterial->GetNumberOfElements() ; elm++ )
{
SIGMA += NbOfAtomsPerVolume[elm] *
ComputeCrossSectionPerAtom(PositKinEnergy,
(*theElementVector)[elm]->GetZ());
}
return SIGMA > DBL_MIN ? 1./SIGMA : DBL_MAX;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4eplusAnnihilation::GetMeanLifeTime(const G4Track&,
G4ForceCondition*)
@@ -123,5 +127,5 @@ inline G4double G4eplusAnnihilation::GetMeanLifeTime(const G4Track&,
return 0.0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -21,117 +21,151 @@
// ********************************************************************
//
//
// $Id: G4hIonisation.hh,v 1.10.4.2 2001/06/28 20:19:49 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4hIonisation.hh,v 1.17 2001/11/09 13:56:28 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
// --------------- G4hIonisation physics process -------------------------------
// by Laszlo Urban, 30 May 1997
// -----------------------------------------------------------------------------
//
// History: based on object model of
// 2nd December 1995, G.Cosmo
// ---------- G4hIonisation physics process -----------
// by Laszlo Urban, 30 May 1997
// ************************************************************
// It is the first implementation of the NEW IONISATION
// PROCESS. ( delta rays + continuous energy loss)
// It calculates the ionisation for charged hadrons.
// ************************************************************
// corrected by L.Urban on 24/09/97
// corrected by L.Urban on 13/01/98
// bugs fixed by L.Urban on 02/02/99
// 10/02/00 modifications , new e.m. structure, L.Urban
// ------------------------------------------------------------
// 10/02/00 modifications , new e.m. structure, L.Urban
// 10-08-01 new methods Store/Retrieve PhysicsTable (mma)
// 14-08-01 new function ComputeRestrictedMeandEdx() + 'cleanup' (mma)
// 19-09-01 come back to previous process name "hIoni"
// 29-10-01 all static functions no more inlined
//
// -----------------------------------------------------------------------------
// Class description
//
// This class manages the ionisation process for hadrons.
// it inherites from G4VContinuousDiscreteProcess via G4VhEnergyLoss.
//
// Class description - end
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef G4hIonisation_h
#define G4hIonisation_h 1
#include "G4ios.hh"
#include "globals.hh"
#include "Randomize.hh"
#include "G4VhEnergyLoss.hh"
#include "globals.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4Electron.hh"
#include "G4PhysicsLogVector.hh"
#include "G4PhysicsLinearVector.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4hIonisation : public G4VhEnergyLoss
{
public:
public: // with description
G4hIonisation(const G4String& processName = "hIoni");
G4hIonisation(const G4String& processName = "hIoni");
~G4hIonisation();
~G4hIonisation();
G4bool IsApplicable(const G4ParticleDefinition&);
// return true for charged particles, false otherwise
void BuildPhysicsTable(const G4ParticleDefinition& aParticleType);
virtual void BuildLossTable(const G4ParticleDefinition& aParticleType);
// this function overloads a virtual function of the base class.
// It is invoked by the G4ParticleWithCuts::SetCut() method.
// It invokes BuildLambdaTable(), BuildLossTable(), BuildDEDXTable()
void BuildLossTable(const G4ParticleDefinition& aParticleType);
// build the dE/dx tables due to the ionisation, for every materials.
// (restricted stopping power, Bethe-Bloch formula)
void BuildLambdaTable(const G4ParticleDefinition& aParticleType);
// build mean free path tables for the delta rays production.
// the tables are built for every materials.
G4bool StorePhysicsTable(G4ParticleDefinition* ,
const G4String& directory, G4bool);
// store eLoss and MeanFreePath tables into an external file
// specified by 'directory' (must exist before invokation)
G4bool RetrievePhysicsTable(G4ParticleDefinition* ,
const G4String& directory, G4bool);
// retrieve eLoss and MeanFreePath tables from an external file
// specified by 'directory'
virtual void PrintInfoDefinition();
G4double GetMeanFreePath(
const G4Track& track,
// Print few lines of informations about the process: validity range,
// origine ..etc..
// Invoked by BuildPhysicsTable().
G4double GetMeanFreePath(const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition ) ;
G4ForceCondition* condition );
// It returns the MeanFreePath of the process for the current track :
// (energy, material)
// The previousStepSize and G4ForceCondition* are not used.
// This function overloads a virtual function of the base class.
// It is invoked by the ProcessManager of the Particle.
G4VParticleChange *PostStepDoIt(const G4Track& track,
const G4Step& Step ) ;
const G4Step& Step );
// It computes the final state of the process (at end of step),
// returned as a ParticleChange object.
// This function overloads a virtual function of the base class.
// It is invoked by the ProcessManager of the Particle.
protected:
virtual G4double ComputeMicroscopicCrossSection(
protected: // with description
virtual G4double ComputeRestrictedMeandEdx(
const G4ParticleDefinition& aParticleType,
G4double KineticEnergy,
G4double AtomicNumber);
const G4Material* material,
G4double DeltaThreshold);
// computes restricted mean dE/dx in Geant4 internal units.
virtual G4double ComputeCrossSectionPerAtom(
const G4ParticleDefinition& aParticleType,
G4double KineticEnergy,
G4double AtomicNumber,
G4double DeltaThreshold);
// computes total cross section per atom in Geant4 internal units.
protected:
G4PhysicsTable* theMeanFreePathTable;
private:
// hide assignment operator
// hide assignment operator
G4hIonisation & operator=(const G4hIonisation &right);
G4hIonisation(const G4hIonisation&);
private:
// private data members ...............................
// G4PhysicsTable* theMeanFreePathTable;
static G4double LowerBoundLambda; // bining for lambda table
static G4double UpperBoundLambda;
static G4int NbinLambda;
G4double LowestKineticEnergy; // binning for dE/dx table
G4double HighestKineticEnergy;
G4int TotBin;
G4double Tmincut; // min energy of d-rays
// particles , cuts in kinetic energy ........
const G4Electron* theElectron;
const G4Proton* theProton;
const G4AntiProton* theAntiProton;
const G4double* DeltaCutInKineticEnergy ;
G4double DeltaCutInKineticEnergyNow ;
static G4double Tmincut ;
static G4double LowerBoundLambda ; // bining for lambda table
static G4double UpperBoundLambda ;
static G4int NbinLambda ;
G4double LowestKineticEnergy,HighestKineticEnergy ;
G4int TotBin ;
public:
static void SetLowerBoundLambda(G4double val) {LowerBoundLambda = val;};
static void SetUpperBoundLambda(G4double val) {UpperBoundLambda = val;};
static void SetNbinLambda(G4int n) {NbinLambda = n;};
static G4double GetLowerBoundLambda() { return LowerBoundLambda;};
static G4double GetUpperBoundLambda() { return UpperBoundLambda;};
static G4int GetNbinLambda() {return NbinLambda;};
public: // with description
static void SetLowerBoundLambda(G4double val);
static void SetUpperBoundLambda(G4double val);
static void SetNbinLambda(G4int n);
// set the parameters of the mean free path table.
static G4double GetLowerBoundLambda();
static G4double GetUpperBoundLambda();
static G4int GetNbinLambda();
// get the parameters of the mean free path table.
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4hIonisation.icc"
#endif
@@ -21,55 +21,48 @@
// ********************************************************************
//
//
// $Id: G4hIonisation.icc,v 1.3.4.2 2001/06/28 20:19:49 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4hIonisation.icc,v 1.7 2001/11/09 13:56:28 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// ---------------------------------------------------------------
// GEANT 4 class inlined methods file
//------------------ G4hIonisation physics process -----------------------------
// by Laszlo Urban, 30 May 1997
//------------------------------------------------------------------------------
//
// ------------ G4hIonisation physics process ------------
// by Laszlo Urban, 30 May 1997
// ***************************************************************
// It is the first implementation of the NEW IONISATION PROCESS.
// It calculates the ionisation of charged hadrons.
// ***************************************************************
// 24/09/97: corrected by L.Urban
// 20/11/97: correction on MeanFreePath for KineticEnergy > HighestLimit
// ---------------------------------------------------------------
// 14-08-01: 'cleanup' of GetMeanFreePath (mma)
//
//------------------------------------------------------------------------------
inline G4double G4hIonisation::GetMeanFreePath(
const G4Track& trackData,
G4double previousStepSize,
G4ForceCondition* condition)
{
const G4DynamicParticle* aParticle ;
G4Material* aMaterial ;
G4double MeanFreePath;
G4bool isOutRange ;
*condition = NotForced ;
aParticle = trackData.GetDynamicParticle() ;
aMaterial = trackData.GetMaterial() ;
G4double KineticEnergy = aParticle->GetKineticEnergy() ;
if(KineticEnergy < LowestKineticEnergy)
MeanFreePath = DBL_MAX;
else {
if(KineticEnergy > HighestKineticEnergy)
KineticEnergy = HighestKineticEnergy;
MeanFreePath = ((*theMeanFreePathTable)(aMaterial->GetIndex()))->
GetValue(KineticEnergy,isOutRange) ;
}
return MeanFreePath ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4bool G4hIonisation::IsApplicable(
const G4ParticleDefinition& particle)
{
return(particle.GetPDGCharge() != 0.);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4hIonisation::GetMeanFreePath(const G4Track& track, G4double,
G4ForceCondition*)
{
G4double KineticEnergy = track.GetDynamicParticle()->GetKineticEnergy();
G4Material* aMaterial = track.GetMaterial();
G4double MeanFreePath;
G4bool isOut;
if (KineticEnergy > HighestKineticEnergy) KineticEnergy = HighestKineticEnergy;
if (KineticEnergy > LowestKineticEnergy)
MeanFreePath = ((*theMeanFreePathTable)(aMaterial->GetIndex()))->
GetValue(KineticEnergy, isOut);
else MeanFreePath = DBL_MAX;
return MeanFreePath;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......