Import Geant4 1.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:28:20 +02:00
parent aaa409b6ee
commit ca1c8cb059
2995 changed files with 106830 additions and 299600 deletions
@@ -1,5 +1,5 @@
// 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,
@@ -1,5 +1,5 @@
// 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,
@@ -1,5 +1,5 @@
// 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,
@@ -1,5 +1,5 @@
// 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,
@@ -1,5 +1,5 @@
// 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,
@@ -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: G4LowEnergyBremsstrahlung.cc,v 1.13 1999/07/06 14:35:47 aforti Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4LowEnergyBremsstrahlung.cc,v 1.17.2.1 1999/12/07 20:50:23 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// --------------------------------------------------------------
@@ -19,6 +19,9 @@
// 2nd December 1995, G.Cosmo
// ------------ G4LowEnergyBremsstrahlung physics process --------
// by Michel Maire, 24 July 1996
// ------------ G4LowEnergyBremsstrahlung: low energy modifications --------
// by Alessandra Forti, March 1999
//
// **************************************************************
// 26-09-96 : extension of the total crosssection above 100 GeV, M.Maire
// 1-10-96 : new type G4OrderedTable; ComputePartialSumSigma(), M.Maire
@@ -28,6 +31,11 @@
// 20-03-97 : new energy loss+ionisation+brems scheme, L.Urban
// 07-04-98 : remove 'tracking cut' of the diffracted particle, MMa
// 13-08-98 : new methods SetBining() PrintInfo()
// Added Livermore data table construction methods A. Forti
// Modified BuildMeanFreePath to read new data tables A. Forti
// Modified PostStepDoIt to insert sampling with with EEDL data A. Forti
// Added SelectRandomAtom A. Forti
// Added map of the elements A. Forti
// --------------------------------------------------------------
// This Class Header
@@ -104,13 +112,14 @@ void G4LowEnergyBremsstrahlung::SetPhysicsTableBining(G4double lowE, G4double hi
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
// SET CUT FOR LOW ENERGY SECONDARY PHOTONS A. FORTI
void G4LowEnergyBremsstrahlung::SetCutForLowEnSecPhotons(G4double cut){
CutForLowEnergySecondaryPhotons = cut;
}
// METHOD BELOW FROM STANDARD E_M PROCESSES CODE
void G4LowEnergyBremsstrahlung::BuildPhysicsTable(const G4ParticleDefinition& aParticleType)
// just call BuildLossTable+BuildLambdaTable
{
BuildLossTable(aParticleType) ;
@@ -126,20 +135,21 @@ void G4LowEnergyBremsstrahlung::BuildPhysicsTable(const G4ParticleDefinition& aP
CounterOfPositronProcess++;
}
BuildZVec();
BuildCrossSectionTable() ;
BuildMeanFreePathTable() ;
BuildDEDXTable (aParticleType) ;
BuildZVec();
// smpling energy formula coefficient
BuildATable();
BuildBTable();
BuildCrossSectionTable() ;
BuildMeanFreePathTable() ;
BuildDEDXTable (aParticleType) ;
// energy sampling formula coefficient
BuildATable();
BuildBTable();
// if(&aParticleType==G4Electron::Electron())
// PrintInfoDefinition();
//}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
// CONSTRUCT THE CROSS SECTION TABLE FOR THE ELEMENTS MAPPED IN ZNUMVEC.
void G4LowEnergyBremsstrahlung::BuildCrossSectionTable(){
if (theCrossSectionTable) {
@@ -161,6 +171,7 @@ void G4LowEnergyBremsstrahlung::BuildCrossSectionTable(){
}//end for on atoms
}
// CONSTRUCT THE TABLE OF THE FIRST PARAMETER OF THE SAMPLING FORMULA
void G4LowEnergyBremsstrahlung::BuildATable(){
if (ATable) {
@@ -172,6 +183,8 @@ void G4LowEnergyBremsstrahlung::BuildATable(){
}
// CONSTRUCT THE TABLE OF THE PARAMETERS OF THE FORMULA OF THE
// SECOND PARAMETER OF THE SAMPLING FORMULA
void G4LowEnergyBremsstrahlung::BuildBTable(){
if (BTable) {
@@ -183,6 +196,8 @@ void G4LowEnergyBremsstrahlung::BuildBTable(){
}
// Vector mapping the existing elements in the material table
// needed at initialization time to load only the necessary data
void G4LowEnergyBremsstrahlung::BuildZVec(){
const G4MaterialTable* theMaterialTable=G4Material::GetMaterialTable();
@@ -217,9 +232,13 @@ void G4LowEnergyBremsstrahlung::BuildZVec(){
}
}
// Build table for energy loss due to soft brems
// tables are built for *MATERIALS* already in the standard processes
// to be changed when the new energy loss will be calculated.
//
// // METHOD BELOW FROM STANDARD E_M PROCESSES LEFT BUT AT THE MOMENT NOT USED
//
void G4LowEnergyBremsstrahlung::BuildLossTable(const G4ParticleDefinition& aParticleType)
// Build table for energy loss due to soft brems
// tables are built for *MATERIALS*
{
G4double KineticEnergy,TotalEnergy,bremloss,Z,x,
losslim,loss,rate,natom,Cut;
@@ -327,6 +346,7 @@ void G4LowEnergyBremsstrahlung::BuildLossTable(const G4ParticleDefinition& aPart
const G4double LPMconstant = fine_structure_const*electron_mass_c2*
electron_mass_c2/(8.*pi*hbarc) ;
const G4double kmin = 1.*eV ;
const G4double klim = 1.*keV ;
@@ -395,7 +415,9 @@ void G4LowEnergyBremsstrahlung::BuildLossTable(const G4ParticleDefinition& aPart
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//
// METHOD BELOW FROM STANDARD E_M PROCESSES CODE LEFT BUT AT THE MOMENT NOT USED
//
G4double G4LowEnergyBremsstrahlung::ComputeXYPolynomial(G4double x, G4double y,
G4int xSize, G4int ySize,
const G4double coeff[])
@@ -403,7 +425,7 @@ G4double G4LowEnergyBremsstrahlung::ComputeXYPolynomial(G4double x, G4double y,
// Computes the polynomial (1 y y^2 ...) * matrix * (1 x x^2 ...) .
// xSize and ySize are the dimensions of the matrix,
// coeff containts the elements, stored row-wise.
G4double* a= new G4double[xSize];
G4int i, j;
@@ -423,12 +445,15 @@ G4double G4LowEnergyBremsstrahlung::ComputeXYPolynomial(G4double x, G4double y,
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//
// METHOD BELOW FROM STANDARD E_M PROCESSES CODE LEFT BUT AT THE MOMENT NOT USED
//
G4double G4LowEnergyBremsstrahlung::ComputeBremLoss(G4double Z,G4double natom,
G4double T,G4double Cut,G4double x)
// compute loss due to soft brems
// 'Migdal' version , this is the default in GEANT3
{
const G4double beta=0.99,ksi=2.51,ve=0.00004 ;
const G4double corrfac = classic_electr_radius*electron_Compton_length*electron_Compton_length/pi ;
@@ -500,6 +525,10 @@ G4double G4LowEnergyBremsstrahlung::ComputeBremLoss(G4double Z,G4double natom,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//
// METHOD BELOW FROM STANDARD E_M PROCESSES LEFT BUT AT THE MOMENT NOT USED
//
G4double G4LowEnergyBremsstrahlung::ComputePositronCorrFactorLoss(
G4double Z,G4double KineticEnergy,G4double GammaCut)
@@ -523,10 +552,15 @@ G4double G4LowEnergyBremsstrahlung::ComputePositronCorrFactorLoss(
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//
// METHOD BELOW FROM STANDARD E_M PROCESSES CODE MODIFIED TO USE
// LIVERMORE DATA (using log-log interpolation as reported in stepanek paper)
//
void G4LowEnergyBremsstrahlung::BuildMeanFreePathTable()
// Build mean free path tables for the gamma emission by e- or e+.
// tables are Build for MATERIALS.
// tables are Build for MATERIALS. see GENERAL part of processes in GEANT4
// manual
{
G4double FixedEnergy = (LowestKineticEnergy + HighestKineticEnergy)/2.;
@@ -588,11 +622,16 @@ void G4LowEnergyBremsstrahlung::BuildMeanFreePathTable()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//
// METHOD BELOW FROM STANDARD E_M PROCESSES CODE MODIFIED TO USE
// LIVERMORE DATA (using log-log interpolation as reported in stepanek paper)
//
void G4LowEnergyBremsstrahlung::ComputePartialSumSigma(G4double KineticEnergy,
const G4Material* aMaterial)
// Build the table of cross section per element. The table is built for MATERIALS.
// This table is used by DoIt to select randomly an element in the material.
{
G4int Imate = aMaterial->GetIndex();
G4int NbOfElements = aMaterial->GetNumberOfElements();
@@ -623,26 +662,18 @@ void G4LowEnergyBremsstrahlung::ComputePartialSumSigma(G4double KineticEnergy,
G4VParticleChange* G4LowEnergyBremsstrahlung::PostStepDoIt(const G4Track& trackData,
const G4Step& stepData){
//
// The emitted gamma energy is sampled using a parametrized formula from L. Urban.
// This parametrization is derived from :
// cross-section values of Seltzer and Berger for electron energies 1 keV - 10 GeV,
// screened Bethe Heilter differential cross section above 10 GeV,
// Migdal corrections in both case.
// Seltzer & Berger: Nim B 12:95 (1985)
// Nelson, Hirayama & Rogers: Technical report 265 SLAC (1985)
// Migdal: Phys Rev 103:1811 (1956); Messel & Crawford: Pergamon Press (1970)
// This parametrization is derived from :
// Migdal corrections (dielectric suppression).
// Migdal: Phys Rev 103:1811 (1956); Messel & Crawford: Pergamon Press (1970)
// MIGDAL constant and LPM effect LEFT FROM STANDARD PROCESS
//
// A modified version of the random number techniques of Butcher & Messel is used
// (Nuc Phys 20(1960),15).
//
// GEANT4 internal units.
//
const G4double MigdalConstant = classic_electr_radius
*electron_Compton_length
*electron_Compton_length/pi;
const G4double LPMconstant = fine_structure_const*electron_mass_c2*
electron_mass_c2/(8.*pi*hbarc) ;
@@ -692,10 +723,13 @@ G4VParticleChange* G4LowEnergyBremsstrahlung::PostStepDoIt(const G4Track& trackD
G4double LPMGammaEnergyLimit = TotalEnergysquare/LPMEnergy ;
//
// sample the energy rate of the emitted gamma for electron kinetic energy
// sampling formula: spet(T) = A(T)/E+B(T)
//
// The emitted gamma energy is from EEDL data fitted with A/E+B function.
// Original formula A/E+B+C*E and sampling methods are reported by J. Stepanek
// formula has been modified by A. Forti and S. Giani.
//
// sample the energy of the emitted gamma for electron kinetic energy
//
G4double p1 = 0, p2 = 0;
G4double coeffA = 0, coeffB = 0;
G4int AtomicNum = (G4int) anElement->GetZ();
@@ -715,14 +749,15 @@ G4VParticleChange* G4LowEnergyBremsstrahlung::PostStepDoIt(const G4Track& trackD
G4double R2 = G4UniformRand();
GammaEnergy = ElectKinEn*pow((lowEnergyCut/ElectKinEn),R2);
}
else if(p1 < R1 <= p1+p2){
else if ((p1 < R1) && (R1 <= p1+p2)){
G4double R2 = G4UniformRand();
GammaEnergy = ElectKinEn - R2*(ElectKinEn - lowEnergyCut);
}
// now comes the supression due to the LPM effect I leave it
// now comes the supression due to the LPM effect (gamma production suppression
// due to the multiple scattering of the electron) SEE ABOVE
if(GammaEnergy < LPMGammaEnergyLimit){
G4double S2LPM = LPMEnergy*GammaEnergy/TotalEnergysquare ;
@@ -747,7 +782,6 @@ G4VParticleChange* G4LowEnergyBremsstrahlung::PostStepDoIt(const G4Track& trackD
//**********************//
// angles of the emitted gamma. ( Z - axis along the parent particle)
//
// universal distribution suggested by L. Urban (Geant3 manual (1993) Phys211),
// derived from Tsai distribution (Rev Mod Phys 49,421(1977))
@@ -780,7 +814,7 @@ G4VParticleChange* G4LowEnergyBremsstrahlung::PostStepDoIt(const G4Track& trackD
if(GammaEnergy < GammaEnergyCut){
aParticleChange.SetLocalEnergyDeposit (GammaEnergy);
aParticleChange.SetLocalEnergyDeposit(GammaEnergy);
}
else{
@@ -790,7 +824,7 @@ G4VParticleChange* G4LowEnergyBremsstrahlung::PostStepDoIt(const G4Track& trackD
aParticleChange.SetNumberOfSecondaries(1);
aParticleChange.AddSecondary(aGamma);
aParticleChange.SetLocalEnergyDeposit (0);
aParticleChange.SetLocalEnergyDeposit(0);
}
}
else{
@@ -814,6 +848,7 @@ G4VParticleChange* G4LowEnergyBremsstrahlung::PostStepDoIt(const G4Track& trackD
#ifdef G4VERBOSE
if(verboseLevel > 15){
G4cout<<"LE Bremsstrahlung PostStepDoIt"<<endl;
}
#endif
@@ -821,10 +856,11 @@ G4VParticleChange* G4LowEnergyBremsstrahlung::PostStepDoIt(const G4Track& trackD
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
// METHOD BELOW FROM STANDARD E_M PROCESSES CODE MODIFIED TO USE
// LIVERMORE DATA (using log-log interpolation as reported in stepanek paper)
G4Element* G4LowEnergyBremsstrahlung::SelectRandomAtom(G4Material* aMaterial) const
{
// select randomly 1 element within the material
const G4int Index = aMaterial->GetIndex();
const G4int NumberOfElements = aMaterial->GetNumberOfElements();
@@ -833,8 +869,6 @@ G4Element* G4LowEnergyBremsstrahlung::SelectRandomAtom(G4Material* aMaterial) co
G4double rval = G4UniformRand()*((*PartialSumSigma(Index))(NumberOfElements-1));
for ( G4int i=0; i < NumberOfElements; i++ )
if (rval <= (*PartialSumSigma(Index))(i)) return ((*theElementVector)(i));
// G4cout << " WARNING !!! - The Material '"<< aMaterial->GetName()
// << "' has no elements" << endl;
return (*theElementVector)(0);
}
@@ -842,15 +876,12 @@ G4Element* G4LowEnergyBremsstrahlung::SelectRandomAtom(G4Material* aMaterial) co
void G4LowEnergyBremsstrahlung::PrintInfoDefinition()
{
G4String comments = "Total cross sections from a parametrisation(L.Urban). ";
comments += "Good description from 1 KeV to 100 GeV.\n";
comments += " log scale extrapolation above 100 GeV \n";
comments += " Gamma energy sampled from a parametrised formula.";
G4String comments = "Total cross sections from EEDL database";
comments += "Good description from 1 eV to 100 GeV.\n";
comments += "Gamma energy sampled from a parametrised formula.";
G4cout << endl << GetProcessName() << ": " << comments
<< "\n PhysicsTables from " << G4BestUnit(LowestKineticEnergy,"Energy")
<< " to " << G4BestUnit(HighestKineticEnergy,"Energy")
<< " in " << TotBin << " bins. \n";
G4cout << endl << GetProcessName() << ": " << comments<<endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -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: G4LowEnergyCompton.cc,v 1.12 1999/07/06 15:03:02 aforti Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4LowEnergyCompton.cc,v 1.15.6.1 1999/12/07 20:50:24 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// --------------------------------------------------------------
@@ -19,6 +19,9 @@
// 2nd December 1995, G.Cosmo
// ------------ G4LowEnergyCompton physics process --------
// by Michel Maire, April 1996
// ------------ G4LowEnergyCompton low energy modifications --------
// by Alessandra Forti, October 1998
// **************************************************************
// 28-05-96, DoIt() small change in ElecDirection, by M.Maire
// 10-06-96, simplification in ComputeMicroscopicCrossSection(), by M.Maire
@@ -29,6 +32,11 @@
// 28-03-97, protection in BuildPhysicsTable, M.Maire
// 07-04-98, remove 'tracking cut' of the scattered gamma, MMa
// 04-06-98, in DoIt, secondary production condition: range>min(threshold,safety)
// Added Livermore data table construction methods A. Forti
// Modified BuildMeanFreePath to read new data tables A. Forti
// Modified PostStepDoIt to insert sampling with EPDL97 data A. Forti
// Added SelectRandomAtom A. Forti
// Added map of the elements A. Forti
// --------------------------------------------------------------
// This Class Header
@@ -86,8 +94,6 @@ G4LowEnergyCompton::~G4LowEnergyCompton()
// methods.............................................................................
// to change with other functions like in G4eIonization
void G4LowEnergyCompton::BuildPhysicsTable(const G4ParticleDefinition& GammaType){
BuildZVec();
@@ -102,7 +108,7 @@ void G4LowEnergyCompton::BuildPhysicsTable(const G4ParticleDefinition& GammaType
BuildScatteringFunctionTable();
}
// BUILD THE CS TABLE FOR THE ELEMENTS MAPPED IN ZNUMVEC
void G4LowEnergyCompton::BuildCrossSectionTable(){
if (theCrossSectionTable) {
@@ -123,7 +129,7 @@ void G4LowEnergyCompton::BuildCrossSectionTable(){
}//end for on atoms
}
// BUILD THE SF TABLE FOR THE ELEMENTS MAPPED IN ZNUMVEC
void G4LowEnergyCompton::BuildScatteringFunctionTable(){
if (theScatteringFunctionTable) {
@@ -144,7 +150,7 @@ void G4LowEnergyCompton::BuildScatteringFunctionTable(){
}//end for on atoms
}
// vector mapping the elements in the material table
void G4LowEnergyCompton::BuildZVec(){
const G4MaterialTable* theMaterialTable=G4Material::GetMaterialTable();
@@ -184,6 +190,15 @@ G4VParticleChange* G4LowEnergyCompton::PostStepDoIt(const G4Track& aTrack, const
//
// The scattered gamma energy is sampled according to Klein - Nishina formula.
// And then Accepted or rejected basing of the Scattering Function multiplied by factor
// from Klein - Nishina formula. Expression of the angular distribution as Klein Nishina
// angular and energy distribution and Scattering fuctions is taken from
// D. E. Cullen "A simple model of photon transport" Nucl. Instr. Meth.
// Phys. Res. B 101 (1995). Method of sampling with form factors is different
// data are interpolated while in the article they are fitted.
// Reference to the article is from J. Stepanek New Photon, Positron
// and Electron Interaction Data for GEANT in Energy Range from 1 eV to 10
// TeV (draft).
// The random number techniques of Butcher & Messel are used
// (Nuc Phys 20(1960),15).
// GEANT4 internal units
@@ -247,7 +262,7 @@ G4VParticleChange* G4LowEnergyCompton::PostStepDoIt(const G4Track& aTrack, const
greject = (1. - epsilon*sint2/(1.+ epsilonsq))*ScatteringFunction;
} while(greject < elementZ*G4UniformRand());
} while(greject < G4UniformRand()*elementZ);
G4double cosTeta = 1. - onecost , sinTeta = sqrt (sint2);
G4double Phi = twopi * G4UniformRand() ;
@@ -305,7 +320,8 @@ G4VParticleChange* G4LowEnergyCompton::PostStepDoIt(const G4Track& aTrack, const
return G4VDiscreteProcess::PostStepDoIt( aTrack, aStep);
}
// used log-log interpolation instead of linear interpolation to build the MFP
// as reported in the stepanek paper
void G4LowEnergyCompton::BuildMeanFreePathTable(){
if (theMeanFreePathTable) {
@@ -359,7 +375,8 @@ void G4LowEnergyCompton::BuildMeanFreePathTable(){
}
}
// METHOD BELOW FROM STANDARD E_M PROCESSES CODE MODIFIED TO USE
// LIVERMORE DATA (using log-log interpolation as reported in stepanek paper)
G4Element* G4LowEnergyCompton::SelectRandomAtom(const G4DynamicParticle* aDynamicGamma,
G4Material* aMaterial){
// select randomly 1 element within the material
@@ -370,7 +387,7 @@ G4Element* G4LowEnergyCompton::SelectRandomAtom(const G4DynamicParticle* aDynami
if (NumberOfElements == 1) return (*theElementVector)(0);
const G4double* theAtomNumDensityVector = aMaterial->GetAtomicNumDensityVector();
//GetMeanFreePath
G4double PartialSumSigma = 0.;
G4double rval = 0;
@@ -397,8 +414,6 @@ G4Element* G4LowEnergyCompton::SelectRandomAtom(const G4DynamicParticle* aDynami
if(rval <= PartialSumSigma) return ((*theElementVector)(i));
}
// G4cout << " WARNING !!! - The Material '"<< aMaterial->GetName()
// << "' has no elements" << endl;
return (*theElementVector)(0);
}
@@ -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: G4LowEnergyGammaConversion.cc,v 1.9 1999/06/28 15:46:00 aforti Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4LowEnergyGammaConversion.cc,v 1.9.8.1 1999/12/07 20:50:24 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// --------------------------------------------------------------
File diff suppressed because it is too large Load Diff
@@ -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: G4LowEnergyPhotoElectric.cc,v 1.16 1999/07/06 15:03:03 aforti Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4LowEnergyPhotoElectric.cc,v 1.21.2.1 1999/12/07 20:50:25 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// --------------------------------------------------------------
@@ -19,6 +19,8 @@
// 2nd December 1995, G.Cosmo
// ------------ G4LowEnergyPhotoElectric physics process --------
// by Michel Maire, April 1996
// ------------ G4LowEnergyPhotoelctric: low energy modifications --------
// by Alessandra Forti, October 1998
// **************************************************************
// 12-06-96, Added SelectRandomAtom() method, by M.Maire
// 21-06-96, SetCuts implementation, M.Maire
@@ -28,6 +30,14 @@
// 13-03-97, adapted for the new physics scheme, M.Maire
// 28-03-97, protection in BuildPhysicsTable, M.Maire
// 04-06-98, in DoIt, secondary production condition: range>min(threshold,safety)
// Added Livermore data table construction methods A. Forti
// Modified BuildMeanFreePath to read new data tables A. Forti
// Added EnergySampling method A. Forti
// Modified PostStepDoIt to insert sampling with EPDL97 data A. Forti
// Added SelectRandomAtom A. Forti
// Added map of the elements A. Forti
// 07-09-99, if no e- emitted: edep=photon energy, mma
//
// --------------------------------------------------------------
// This Class Header
@@ -37,7 +47,10 @@
#include "G4EnergyLossTables.hh"
#include "G4Electron.hh"
typedef RWTPtrOrderedVector<G4DynamicParticle> G4ParticleVector;
typedef G4RWTPtrOrderedVector<G4DynamicParticle> G4ParticleVector;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// constructor
G4LowEnergyPhotoElectric::G4LowEnergyPhotoElectric(const G4String& processName)
@@ -60,13 +73,14 @@ G4LowEnergyPhotoElectric::G4LowEnergyPhotoElectric(const G4String& processName)
G4cout << "HighestEnergy: " << HighestEnergyLimit/MeV << "MeV " << endl;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// destructor
G4LowEnergyPhotoElectric::~G4LowEnergyPhotoElectric()
{
if (theCrossSectionTable) {
// theCrossSectionTable->clearAndDestroy();
delete theCrossSectionTable;
}
@@ -105,13 +119,15 @@ G4LowEnergyPhotoElectric::~G4LowEnergyPhotoElectric()
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// methods.............................................................................
void G4LowEnergyPhotoElectric::SetCutForLowEnSecPhotons(G4double cut){
CutForLowEnergySecondaryPhotons = cut;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4LowEnergyPhotoElectric::BuildPhysicsTable(const G4ParticleDefinition& PhotonType)
// Build microscopic cross section table and mean free path table
@@ -128,16 +144,16 @@ void G4LowEnergyPhotoElectric::BuildPhysicsTable(const G4ParticleDefinition& Pho
BuildBindingEnergyTable();
BuildFluorTransitionTable();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// CONSTRUCT THE CROSS SECTION TABLE FOR THE ELEMENTS MAPPED IN ZNUMVEC USING EPDL DATA
void G4LowEnergyPhotoElectric::BuildCrossSectionTable(){
if (theCrossSectionTable) {
//theCrossSectionTable->clearAndDestroy();
delete theCrossSectionTable;
}
@@ -155,6 +171,9 @@ void G4LowEnergyPhotoElectric::BuildCrossSectionTable(){
}//end for on atoms
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// CONSTRUCT THE SUBSHELL CS TABLE FOR THE ELEMENTS MAPPED IN ZNUMVEC USING EPDL DATA
void G4LowEnergyPhotoElectric::BuildShellCrossSectionTable(){
if (allAtomShellCrossSec) {
@@ -175,8 +194,10 @@ void G4LowEnergyPhotoElectric::BuildShellCrossSectionTable(){
}//end for on atoms
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// CONSTRUCT THE BE TABLE FOR THE ELEMENTS MAPPED IN ZNUMVEC USING EADL DATA
void G4LowEnergyPhotoElectric::BuildBindingEnergyTable(){
if (theBindingEnergyTable) {
@@ -187,8 +208,10 @@ void G4LowEnergyPhotoElectric::BuildBindingEnergyTable(){
G4int dataNum = 2;
theBindingEnergyTable = util.BuildSecondLevelTables(0,dataNum,"fluor/binding");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// CONSTRUCT THE FTP TABLE FOR THE ELEMENTS MAPPED IN ZNUMVEC USING EADL DATA
void G4LowEnergyPhotoElectric::BuildFluorTransitionTable(){
if (theFluorTransitionTable) {
@@ -213,8 +236,11 @@ void G4LowEnergyPhotoElectric::BuildFluorTransitionTable(){
}//end for on atoms
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//
// vector mapping the elements of the material table
//
void G4LowEnergyPhotoElectric::BuildZVec(){
const G4MaterialTable* theMaterialTable=G4Material::GetMaterialTable();
@@ -249,6 +275,11 @@ void G4LowEnergyPhotoElectric::BuildZVec(){
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Compute total cross section from subshell integrated cross section: needed for
// selection of the first subshell ionized.
G4double G4LowEnergyPhotoElectric::ComputeCrossSection(const G4double AtomIndex,
const G4double IncEnergy){
// calculates the microscopic cross section from subshell cross sections
@@ -282,6 +313,8 @@ G4double G4LowEnergyPhotoElectric::ComputeCrossSection(const G4double AtomIndex,
return TotalCrossSection ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4LowEnergyPhotoElectric::BuildMeanFreePathTable(){
if (theMeanFreePathTable) {
@@ -301,7 +334,10 @@ void G4LowEnergyPhotoElectric::BuildMeanFreePathTable(){
for ( G4int J = 0 ; J < NumbOfMaterials; J++ ) { // For each material
//create physics vector then fill it ....
// WARNING!!! below 50 ev cross section lower limit depend on the element
// WARNING: Lower limit of total cross sections in the data is the binding energy
// of the relative subshell. MeanFreePath table require a common lowest limit.
// This LowestEnergyLimit is at the moment fixed at 250 ev.
ptrVector = new G4PhysicsLogVector(LowestEnergyLimit, HighestEnergyLimit, NumbBinTable);
material = (*theMaterialTable)(J);
@@ -313,8 +349,7 @@ void G4LowEnergyPhotoElectric::BuildMeanFreePathTable(){
LowEdgeEnergy = ptrVector->GetLowEdgeEnergy(i);
const G4double BigPath= DBL_MAX;
G4double SIGMA = 0 ;
G4double SIGMA = 0;
for ( G4int k=0 ; k < material->GetNumberOfElements() ; k++ ){
// For each element
@@ -323,11 +358,11 @@ void G4LowEnergyPhotoElectric::BuildMeanFreePathTable(){
= (*theCrossSectionTable)[ZNumVec->index(AtomIndex)];
G4double interCrsSec = util.DataLogInterpolation(LowEdgeEnergy, (*(*oneAtomCS)[0]), (*(*oneAtomCS)[1]))*barn;
//DataLogInterpolation(LowEdgeEnergy, tableIndex, theCrossSectionTable)*barn;
SIGMA += theAtomNumDensityVector[k]*interCrsSec;
}
Value = SIGMA<=0.0 ? BigPath : 1./SIGMA ;
Value = SIGMA > DBL_MIN ? 1./SIGMA : DBL_MAX ;
ptrVector->PutValue( i , Value ) ;
}
@@ -336,10 +371,15 @@ void G4LowEnergyPhotoElectric::BuildMeanFreePathTable(){
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VParticleChange* G4LowEnergyPhotoElectric::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep){
// Fluorescence (as reported by stepanek):
// J. Stepanek " A program to determine the radiation spectra due to a single atomic
// subshell ionisation by a particle or due to deexcitation or decay of radionuclides",
// Comp. Phys. Comm. 1206 pp 1-1-9 (1997)
//
// incoming particle initialization
aParticleChange.Initialize(aTrack);
@@ -361,15 +401,19 @@ G4VParticleChange* G4LowEnergyPhotoElectric::PostStepDoIt(const G4Track& aTrack,
// select randomly one element constituing the material.
G4Element* anElement = SelectRandomAtom(aDynamicPhoton, aMaterial);
// PAY ATTENTION TO THE MEANING OF THIS NUMBER
// PAY ATTENTION TO THE MEANING OF THIS NUMBER!!! SelectRandomAtom requires to use AtomNum
// the BindingEnergyTable requires AtomNum-1
G4int AtomNum = (G4int) anElement->GetZ();
// Select the subshell WARNING!!!!
// First Ionised subshell is chosen basing on subshell integrated cross section EPDL97
// using the partial sum method.
// Select the subshell WARNING!!!!: it returns the subshell index in the table.
G4int subShellIndex = SelectRandomShell(AtomNum, PhotonEnergy);
G4FirstLevel* theBindEnVec = (*theBindingEnergyTable)[AtomNum-1];
G4int thePrimaryShell = (G4int) (*(*theBindEnVec)[0])[subShellIndex];
G4double BindingEn = (*(*theBindEnVec)[1])[subShellIndex];
G4double BindingEn = ((*(*theBindEnVec)[1])[subShellIndex])*MeV;
if(thePrimShVec.length() != 0){
@@ -385,12 +429,12 @@ G4VParticleChange* G4LowEnergyPhotoElectric::PostStepDoIt(const G4Track& aTrack,
G4int elecInd = 0;
// primary outcoming electron
G4double ElecKineEnergy = (PhotonEnergy - BindingEn)*MeV;
G4double ElecKineEnergy = (PhotonEnergy - BindingEn);
G4double theEnergyDeposit = (PhotonEnergy - ElecKineEnergy)*MeV;
G4double theEnergyDeposit = BindingEn;
if (G4EnergyLossTables::GetRange(G4Electron::Electron(),ElecKineEnergy,aMaterial)
>= min(G4Electron::GetCuts(), aStep.GetPostStepPoint()->GetSafety()) ){
>= min(G4Electron::GetCuts(), aStep.GetPostStepPoint()->GetSafety())){
// the electron is created in the direction of the incident photon ...
@@ -441,28 +485,27 @@ G4VParticleChange* G4LowEnergyPhotoElectric::PostStepDoIt(const G4Track& aTrack,
thePrimaryShell = (G4int) fluorPar[0];
if(fluorPar[2] >= CutForLowEnergySecondaryPhotons){
if(fluorPar[2]*MeV >= CutForLowEnergySecondaryPhotons){
theEnergyDeposit -= fluorPar[2]*MeV;
newPart = new G4DynamicParticle (G4Gamma::Gamma(),
newPartDirection,
fluorPar[2]) ;
fluorPar[2]*MeV);
photvec.append(newPart);
}
}
else{
G4int k = 0;
while(thePrimaryShell != (*(*theBindEnVec)[0])[k]) k++;
G4double lastTransEnergy = (*(*theBindEnVec)[1])[k];
G4double lastTransEnergy = ((*(*theBindEnVec)[1])[k])*MeV;
thePrimaryShell = (G4int) fluorPar[0];
if(fluorPar[2] >= CutForLowEnergySecondaryPhotons){
if(fluorPar[2]*MeV >= CutForLowEnergySecondaryPhotons){
theEnergyDeposit -= lastTransEnergy*MeV;
theEnergyDeposit -= lastTransEnergy;
newPart = new G4DynamicParticle (G4Gamma::Gamma(),
newPartDirection,
@@ -502,8 +545,7 @@ G4VParticleChange* G4LowEnergyPhotoElectric::PostStepDoIt(const G4Track& aTrack,
} // END OF CUTS
else{
ElecKineEnergy = 0. ;
theEnergyDeposit = PhotonEnergy;
aParticleChange.SetNumberOfSecondaries(0) ;
}
@@ -511,24 +553,20 @@ G4VParticleChange* G4LowEnergyPhotoElectric::PostStepDoIt(const G4Track& aTrack,
aParticleChange.SetMomentumChange( 0., 0., 0. );
aParticleChange.SetEnergyChange( 0. );
if(theEnergyDeposit < 0){
theEnergyDeposit = 0;
}
if (theEnergyDeposit < 0) theEnergyDeposit = 0;
aParticleChange.SetLocalEnergyDeposit(theEnergyDeposit);
aParticleChange.SetStatusChange( fStopAndKill );
aParticleChange.SetLocalEnergyDeposit(theEnergyDeposit) ;
aParticleChange.SetStatusChange( fStopAndKill ) ;
#ifdef G4VERBOSE
if(verboseLevel > 15){
G4cout<<"LE PhotoElectric PostStepDoIt"<<endl;
}
#endif
// Reset NbOfInteractionLengthLeft and return aParticleChange
return G4VDiscreteProcess::PostStepDoIt( aTrack, aStep );
}
G4int G4LowEnergyPhotoElectric::SelectRandomShell(const G4int AtomIndex, const G4double IncEnergy){
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4int G4LowEnergyPhotoElectric::SelectRandomShell(const G4int AtomIndex,
const G4double IncEnergy)
{
G4double partialSum = 0;
G4double totalSum = ComputeCrossSection(AtomIndex,IncEnergy);
@@ -561,9 +599,12 @@ G4int G4LowEnergyPhotoElectric::SelectRandomShell(const G4int AtomIndex, const G
return 0;
}
G4Element*
G4LowEnergyPhotoElectric::SelectRandomAtom(const G4DynamicParticle* aDynamicPhoton, G4Material* aMaterial){
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4Element*
G4LowEnergyPhotoElectric::SelectRandomAtom(const G4DynamicParticle* aDynamicPhoton,
G4Material* aMaterial)
{
// select randomly 1 element within the material
G4double GammaEnergy = aDynamicPhoton->GetKineticEnergy();
const G4int NumberOfElements = aMaterial->GetNumberOfElements();
@@ -592,7 +633,6 @@ G4LowEnergyPhotoElectric::SelectRandomAtom(const G4DynamicParticle* aDynamicPhot
= (*theCrossSectionTable)[ZNumVec->index(AtomIndex)];
crossSection = util.DataLogInterpolation(GammaEnergy, (*(*oneAtomCS)[0]), (*(*oneAtomCS)[1]))*barn;
//DataLogInterpolation(GammaEnergy, tableIndex, theCrossSectionTable)*barn;
}
PartialSumSigma += theAtomNumDensityVector[i] * crossSection;
@@ -600,20 +640,25 @@ G4LowEnergyPhotoElectric::SelectRandomAtom(const G4DynamicParticle* aDynamicPhot
if (rval <= PartialSumSigma) return ((*theElementVector)(i));
}
// G4cout << " WARNING !!! - The Material '"<< aMaterial->GetName()
// << "' has no elements" << endl;
return (*theElementVector)(0);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//
// Select a random transition with the transition probabilities and the partial sum
// method using EADL data (A. Forti)
//
G4bool G4LowEnergyPhotoElectric::SelectRandomTransition(G4int thePrimShell,
G4double* TransParam,
const oneAtomTable* TransitionTable){
G4int SubShellCol = 0, ProbCol = 1, EnergyCol = 2;
//transitionTable means for one atom not for one shell
// transitionTable contains all the transition probabilities of one atom:
// loop on subshell is inside the method.
// too check when the subshell are finished
// when the last subshell is reached CollIsFull becomes FALSE.
G4bool ColIsFull = TRUE;
G4int ShellNum = 0;
G4double TotalSum = 0;
@@ -630,9 +675,10 @@ G4bool G4LowEnergyPhotoElectric::SelectRandomTransition(G4int thePrimShell,
ShellNum++;
}
// if(ShellNum <= maxNumOfShells) {
//TransProb start from 1 because the first element of the list is the primary shall id number
// TransProb is the index of the loop and of the table of transition. it starts from 1
// because the first element of the data table is the primary shell id number and not a
// transition probability: it must not be added to TotalSum.
G4int TransProb = 1;
for(TransProb = 1; TransProb < (*(*TransitionTable)[ShellNum])[ProbCol]->length(); TransProb++){
@@ -657,16 +703,6 @@ G4bool G4LowEnergyPhotoElectric::SelectRandomTransition(G4int thePrimShell,
TransProb++;
}
//if(TransProb == (*(*TransitionTable)[ShellNum])[ProbCol]->length()-1) {
//ColIsFull = FALSE;
//}
//}
//else{
// ColIsFull = FALSE;
//}
}
else{
@@ -676,6 +712,7 @@ G4bool G4LowEnergyPhotoElectric::SelectRandomTransition(G4int thePrimShell,
return ColIsFull;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -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: G4LowEnergyRayleigh.cc,v 1.10 1999/07/06 15:03:04 aforti Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4LowEnergyRayleigh.cc,v 1.13.6.1 1999/12/07 20:50:26 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// --------------------------------------------------------------
@@ -18,17 +18,13 @@
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// ------------ G4LowEnergyRayleigh physics process --------
// by Michel Maire, April 1996
// by Alessandra Forti, November 1998
// **************************************************************
// 28-05-96, DoIt() small change in ElecDirection, by M.Maire
// 10-06-96, simplification in ComputeMicroscopicCrossSection(), by M.Maire
// 21-06-96, SetCuts implementation, M.Maire
// 13-09-96, small changes in DoIt for better efficiency. Thanks to P.Urban
// 06-01-97, crossection table + meanfreepath table, M.Maire
// 05-03-97, new Physics scheme, M.Maire
// 28-03-97, protection in BuildPhysicsTable, M.Maire
// 07-04-98, remove 'tracking cut' of the scattered gamma, MMa
// 04-06-98, in DoIt, secondary production condition: range>min(threshold,safety)
// Added Livermore data table construction methods A. Forti
// Added BuildMeanFreePath A. Forti
// Added PostStepDoIt A. Forti
// Added SelectRandomAtom A. Forti
// Added map of the elements A.Forti
// --------------------------------------------------------------
// This Class Header
@@ -99,7 +95,7 @@ void G4LowEnergyRayleigh::BuildPhysicsTable(const G4ParticleDefinition& GammaTyp
// build the scattering function table
BuildFormFactorTable();
}
// CONSTRUCT THE CS TABLE FOR THE ELEMENTS MAPPED IN ZNUMVEC USING EPDL97 DATA
void G4LowEnergyRayleigh::BuildCrossSectionTable(){
if (theCrossSectionTable) {
@@ -120,7 +116,7 @@ void G4LowEnergyRayleigh::BuildCrossSectionTable(){
}//end for on atoms
}
// BUILD THE FF TABLE FOR THE ELEMENTS MAPPED IN ZNUMVEC USING EPDL97 DATA
void G4LowEnergyRayleigh::BuildFormFactorTable(){
if (theFormFactorTable) {
@@ -141,7 +137,7 @@ void G4LowEnergyRayleigh::BuildFormFactorTable(){
}//end for on atoms
}
// vector mapping the elements in the material table
void G4LowEnergyRayleigh::BuildZVec(){
const G4MaterialTable* theMaterialTable=G4Material::GetMaterialTable();
@@ -179,17 +175,22 @@ void G4LowEnergyRayleigh::BuildZVec(){
G4VParticleChange* G4LowEnergyRayleigh::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep){
//
// The scattered gamma energy is sampled according to Form Factors and
// then accepted or rejected based on Rayleigh distribution.
// The random number techniques of Butcher & Messel are used
// (Nuc Phys 20(1960),15). GEANT4 internal units
//
// The scattered gamma energy is sampled according to Form Factors
// multiplied by the Rayleigh distribution with a pure rejection technique.
// EGS4 W.R. Nelson et al. The EGS4 Code System. SLAC-Report-265 , December 1985
// Expression of the angular distribution as Rayleigh distribution and Form factors
// is taken from D. E. Cullen "A simple model of photon transport" Nucl. Instr. Meth.
// Phys. Res. B 101 (1995). Method of sampling with form factors is different.
// Reference to the article is from J. Stepanek New Photon, Positron
// and Electron Interaction Data for GEANT in Energy Range from 1 eV to 10
// TeV (draft).
aParticleChange.Initialize(aTrack);
// Dynamic particle quantities
const G4DynamicParticle* aDynamicGamma = aTrack.GetDynamicParticle();
G4double GammaEnergy0 = aDynamicGamma->GetKineticEnergy();
if(GammaEnergy0 <= LowestEnergyLimit){
aParticleChange.SetStatusChange(fStopAndKill);
@@ -207,7 +208,7 @@ G4VParticleChange* G4LowEnergyRayleigh::PostStepDoIt(const G4Track& aTrack, cons
const G4int numOfElem = aMaterial->GetNumberOfElements();
G4Element* theElement = SelectRandomAtom(aDynamicGamma, aMaterial);
// sample the energy rate of the scattered gamma
// sample the energy of the scattered gamma
G4double wlGamma = h_Planck*c_light/GammaEnergy0;
G4int elementZ = (G4int) theElement->GetZ();
@@ -228,14 +229,13 @@ G4VParticleChange* G4LowEnergyRayleigh::PostStepDoIt(const G4Track& aTrack, cons
DataFormFactor = util.DataLogInterpolation(x, (*(*oneAtomFF)[0]),
(*(*oneAtomFF)[1]))/cm;
RandomFormFactor = G4UniformRand()*elementZ*elementZ;
RandomFormFactor = G4UniformRand()*elementZ;
Theta = Theta_Half*2;
cosTheta = cos(Theta);
sinTheta = sin(Theta);
greject = cosTheta*cosTheta*DataFormFactor;
G4double sqr_rayl = 1+cosTheta*cosTheta;
greject = sqr_rayl*DataFormFactor*DataFormFactor;
}while( greject < RandomFormFactor);
@@ -252,15 +252,18 @@ G4VParticleChange* G4LowEnergyRayleigh::PostStepDoIt(const G4Track& aTrack, cons
aParticleChange.SetMomentumChange(GammaDirection1);
aParticleChange.SetNumberOfSecondaries(0);
#ifdef G4VERBOSE
if(verboseLevel > 15){
G4cout<<"LE Rayleigh PostStepDoIt"<<endl;
}
#endif
return G4VDiscreteProcess::PostStepDoIt( aTrack, aStep);
}
// used log-log interpolation instead of linear interpolation to build the MFP
void G4LowEnergyRayleigh::BuildMeanFreePathTable(){
if (theMeanFreePathTable) {
@@ -317,9 +320,11 @@ void G4LowEnergyRayleigh::BuildMeanFreePathTable(){
}
}
// METHOD BELOW FROM STANDARD E_M PROCESSES CODE MODIFIED TO USE
// LIVERMORE DATA (using log-log interpolation as reported in stepanek paper)
G4Element* G4LowEnergyRayleigh::SelectRandomAtom(const G4DynamicParticle* aDynamicGamma,
G4Material* aMaterial) {
// select randomly 1 element within the material
G4double GammaEnergy = aDynamicGamma->GetKineticEnergy();
const G4int NumberOfElements = aMaterial->GetNumberOfElements();
@@ -352,8 +357,7 @@ G4Element* G4LowEnergyRayleigh::SelectRandomAtom(const G4DynamicParticle* aDynam
PartialSumSigma += theAtomNumDensityVector[i] * crossSection;
if(rval <= PartialSumSigma) return ((*theElementVector)(i));
}
// G4cout << " WARNING !!! - The Material '"<< aMaterial->GetName()
// << "' has no elements" << endl;
return (*theElementVector)(0);
}
@@ -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: G4LowEnergyUtilities.cc,v 1.1 1999/06/28 15:46:05 aforti Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4LowEnergyUtilities.cc,v 1.2.6.1 1999/12/07 20:50:26 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// --------------------------------------------------------------
@@ -210,3 +210,10 @@ G4FirstLevel* G4LowEnergyUtilities::BuildFirstLevelTables(const G4int TableInd,
return oneAtomPar;
}
@@ -1,5 +1,5 @@
// 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,
@@ -1,5 +1,5 @@
// 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,
@@ -1,5 +1,5 @@
// 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,
@@ -1,5 +1,5 @@
// 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,
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,600 @@
// This code implementation is the intellectual property of
// 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.
//
// -------------------------------------------------------------
// GEANT 4 class implementation file
//
// For information related to this code contact:
// CERN, IT Division, ASD group
// History: based on object model of
// 2nd December 1995, G.Cosmo
// ---------- G4ionLowEnergyIonisation physics process -----
// by Vladimir Ivanchenko, 6 September 1999
// was made on the base of G4hLowEnergyIonisation class
// ************************************************************
// It is the extention of the ionisation process for the slow
// charged ions.
// ************************************************************
// 6 September 1999 V.Ivanchenko create
// 30 September 1999 V.Ivanchenko minor upgrade
// ------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G4ionLowEnergyIonisation.hh"
#include "G4UnitsTable.hh"
#include "G4EnergyLossTables.hh"
#include "G4ParticleDefinition.hh"
#include "G4Proton.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4ionLowEnergyIonisation::G4ionLowEnergyIonisation(const G4String& processName)
: G4hLowEnergyIonisation(processName),
theIon (G4Proton::Proton())
{
LowestKineticEnergy = 10.*eV ;
HighestKineticEnergy = 100.*TeV ;
TotBin = 200 ;
MassRatio = 1.0 ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4ionLowEnergyIonisation::~G4ionLowEnergyIonisation()
{
if (theMeanFreePathTable) {
theMeanFreePathTable->clearAndDestroy();
delete theMeanFreePathTable;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4ionLowEnergyIonisation::SetIonDefinition(G4ParticleDefinition* theIonType)
{
theIon = theIonType ;
MassRatio = proton_mass_c2/(theIonType->GetPDGMass()) ;
Charge = (theIonType->GetPDGCharge())/eplus ;
cout << "New ion with Q = " << Charge << "; MassR = " << MassRatio << endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4ionLowEnergyIonisation::GetLowEnergyForParametrisation(const G4Material* material)
{
// The low limit of paramerisation of ionisation energy from:
// J.F.Ziegler, J.P. Biersack, U. Littmark
// The Stopping and Range of Ions in Matter,
// Vol.1, Pergamon Press, 1985
// Below this limit the free electron gas model is used
// hadrons or ions with charge +-1
if(Charge < 1.5) return ParamLowEnergy/MassRatio ;
// helium or ions with charge = +2
if(Charge < 2.5) return ParamLowEnergy ;
// get elements in the actual material,
const G4ElementVector* theElementVector = material->GetElementVector() ;
const G4double* theAtomicNumDensityVector = material->GetAtomicNumDensityVector() ;
const G4int NumberOfElements = material->GetNumberOfElements() ;
G4double Z = 0.0, Norm = 0.0 ;
// only 1 element in the material
if( 1 == NumberOfElements ) {
Z = material->GetZ() ;
// loop for the elements in the material
// to find out average value of Z
} else {
for (G4int iel=0; iel<NumberOfElements; iel++)
{
const G4Element* element = (*theElementVector)(iel) ;
G4double Z2 = element->GetZ() ;
const G4double W2 = theAtomicNumDensityVector[iel] ;
Norm += W2 ;
Z += Z2 * W2 ;
}
Z /= Norm ;
}
G4double E1 = 3.25 * keV ;
G4double E2 = 25.0 * keV / pow(Z, 0.667) ;
E1 = max (E1, E2) ;
return max(ParamLowEnergy, E1) / MassRatio ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4ionLowEnergyIonisation::GetConstraints(const G4DynamicParticle *aParticle,
G4Material *aMaterial)
{
// returns the Step limit
// dRoverRange is the max. allowed relative range loss in one step
// it calculates dEdx and the range as well....
G4double KineticEnergy,StepLimit;
G4bool isOut ;
Charge = aParticle->GetDefinition()->GetPDGCharge()/eplus ;
KineticEnergy = aParticle->GetKineticEnergy();
G4double massratio=proton_mass_c2/
aParticle->GetDefinition()->GetPDGMass() ;
G4double Tscaled= KineticEnergy*massratio ;
G4double ChargeSquare = GetIonEffChargeSquare(aMaterial,KineticEnergy,Charge) ;
if(Charge>0.)
{
fRangeNow = G4EnergyLossTables::GetRange( theProton,
Tscaled,aMaterial) ;
fdEdx = G4EnergyLossTables::GetDEDX( theProton,
Tscaled,aMaterial) ;
}
else
{
fRangeNow = G4EnergyLossTables::GetRange( theAntiProton,
Tscaled,aMaterial) ;
fdEdx = G4EnergyLossTables::GetDEDX( theAntiProton,
Tscaled,aMaterial) ;
}
fdEdx *= ChargeSquare ;
fRangeNow /= (ChargeSquare*massratio) ;
// compute the (random) Step limit ..............
if(fRangeNow > finalRange)
{
StepLimit = (c1lim*fRangeNow+c2lim+c3lim/fRangeNow) ;
// randomise this value
if(rndmStepFlag) StepLimit =
finalRange+(StepLimit-finalRange)*G4UniformRand() ;
if(StepLimit > fRangeNow) StepLimit = fRangeNow ;
}
else StepLimit = fRangeNow ;
return StepLimit ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4VParticleChange* G4ionLowEnergyIonisation::AlongStepDoIt(
const G4Track& trackData,const G4Step& stepData)
// compute the energy loss after a step
{
const G4DynamicParticle* aParticle;
G4Material* aMaterial;
G4double finalT,Step,MeanLoss ;
aParticleChange.Initialize(trackData) ;
aMaterial = trackData.GetMaterial() ;
// get the actual (true) Step length from stepData
Step = stepData.GetStepLength() ;
aParticle = trackData.GetDynamicParticle() ;
G4int index = aMaterial->GetIndex() ;
G4double E = aParticle->GetKineticEnergy() ;
G4double ParticleCharge = aParticle->GetDefinition()->GetPDGCharge() ;
G4double ChargeSquare = GetIonEffChargeSquare(aMaterial, E, ParticleCharge) ;
if(E < MinKineticEnergy) MeanLoss = E ;
else
{
if(Step >= fRangeNow ) MeanLoss = E ;
else if(( E > HighestKineticEnergy)||( E <= LowestKineticEnergy))
MeanLoss = Step*fdEdx ;
else
{
if(Step>linLossLimit*fRangeNow)
{
G4double massratio=proton_mass_c2/
aParticle->GetDefinition()->GetPDGMass() ;
G4double rscaled= fRangeNow*massratio*ChargeSquare ;
G4double sscaled= Step *massratio*ChargeSquare ;
if(Charge>0.)
{
MeanLoss = G4EnergyLossTables::GetPreciseEnergyFromRange(
theProton,
rscaled ,aMaterial) -
G4EnergyLossTables::GetPreciseEnergyFromRange(
theProton,
rscaled-sscaled,aMaterial) ;
}
else
{
MeanLoss = G4EnergyLossTables::GetPreciseEnergyFromRange(
theAntiProton,
rscaled ,aMaterial) -
G4EnergyLossTables::GetPreciseEnergyFromRange(
theAntiProton,
rscaled-sscaled,aMaterial) ;
}
MeanLoss /= (massratio*ChargeSquare) ;
}
else MeanLoss = Step*fdEdx ;
}
}
finalT = E - MeanLoss ;
if(finalT < MinKineticEnergy) finalT = 0. ;
// now the loss with fluctuation
if((EnlossFlucFlag) && (finalT > 0.) && (finalT < E)&&(E > LowestKineticEnergy))
{
MeanLoss /= ChargeSquare ;
finalT = E-GetLossWithFluct(aParticle,aMaterial,MeanLoss)*ChargeSquare ;
if (finalT < 0.) finalT = E-MeanLoss ;
}
// kill the particle if the kinetic energy <= 0
if (finalT <= 0. )
{
finalT = 0.;
if(aParticle->GetDefinition()->GetParticleName() == "proton")
aParticleChange.SetStatusChange(fStopAndKill);
else
aParticleChange.SetStatusChange(fStopButAlive);
}
aParticleChange.SetEnergyChange( finalT ) ;
aParticleChange.SetLocalEnergyDeposit(E-finalT) ;
return &aParticleChange ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4ionLowEnergyIonisation::GetIonParametrisedLoss(const G4Material* material,
const G4double KinEnergy,
const G4double DeltaRayCutNow)
{
// Inicialisation
G4double Se = 0.0 ;
G4double Sn = 0.0 ;
G4double ionloss = 0.0 ;
G4double ion125 = 0.0 ;
G4double ExpStopPower125 = 0.0 ;
G4double ReducedKinEnergy = KinEnergy * MassRatio ;
G4double ChargeSquare = GetIonEffChargeSquare(material, KinEnergy, Charge) ;
G4double Z1 = Charge ;
G4double A1 = ProtonMassAMU / MassRatio ;
// First of all check tables for specific materials for ICRU_49 parametrisation
G4int molecIndex = (MolecIsInICRU_R49p(material))+1;
if ((molecIndex > 0) && (DEDXtable == "ICRU_R49p")) {
G4double NbOfAtomsPerVolume = material->GetTotNbOfAtomsPerVolume();
ionloss = GetStoppingPowerICRU_R49p(molecIndex, ReducedKinEnergy, "Mol")
* NbOfAtomsPerVolume * ZieglerFactor * ChargeSquare ;
// Second - check the table for chemical factors
} else {
G4double ExpStopPower125 = MolecIsInZiegler1988(material);
}
// get elements in the actual material,
const G4ElementVector* theElementVector = material->GetElementVector() ;
const G4double* theAtomicNumDensityVector = material->GetAtomicNumDensityVector() ;
const G4int NumberOfElements = material->GetNumberOfElements() ;
// loop for the elements in the material
// calculation based on Bragg's rule
for (G4int iel=0; iel<NumberOfElements; iel++)
{
const G4Element* element = (*theElementVector)(iel) ;
G4double Z2 = element->GetZ() ;
G4double A2 = element->GetA()*mole/g ;
G4int iz = int(Z2) ;
if( iz <= 0 ) iz = 1 ;
if( iz > 92 ) iz = 92 ;
// Electronic Stopping Power
// Choose the parametrisation using the table name
// The "Ziegler1977H" table
if(DEDXtable == "Ziegler1977H") {
Se = GetStoppingPower1977H(iz, ReducedKinEnergy)
* theAtomicNumDensityVector[iel]*ZieglerFactor ;
// Chemical factor calculation
if(ExpStopPower125 > 0.0){
ion125 += GetStoppingPower1977H(iz, 125.0*keV)
* theAtomicNumDensityVector[iel]*ZieglerFactor ;
}
// Nuclear Stopping Power
if(nStopping) {
Sn += GetStoppingPower1977n(Z1, Z2, A1, A2, KinEnergy)
* theAtomicNumDensityVector[iel]*ZieglerFactor ;
}
// The "Ziegler1977He" table
} else if(DEDXtable == "Ziegler1977He") {
G4double HeKinEnergy = ReducedKinEnergy*HeMassAMU/ProtonMassAMU ;
Se = GetStoppingPower1977He(iz, HeKinEnergy)
* theAtomicNumDensityVector[iel]*ZieglerFactor
/ GetHeEffChargeSquare(iz, HeKinEnergy) ;
// Chemical factor calculation
if(ExpStopPower125 > 0.0){
ion125 += GetStoppingPower1977H(iz, 125.0*keV)
* theAtomicNumDensityVector[iel]*ZieglerFactor ;
}
// Nuclear Stopping Power
if(nStopping) {
Sn += GetStoppingPower1977n(Z1, Z2, A1, A2, KinEnergy)
* theAtomicNumDensityVector[iel]*ZieglerFactor ;
}
// The "ICRU_R49p" table
} else if(DEDXtable == "ICRU_R49p") {
// The material is not in the list of materials
if(molecIndex < 0) {
Se = GetStoppingPowerICRU_R49p(iz, ReducedKinEnergy, "Ele")
* theAtomicNumDensityVector[iel]*ZieglerFactor ;
}
// Chemical factor calculation
if(ExpStopPower125 > 0.0){
ion125 += GetStoppingPowerICRU_R49p(iz, 125.0*keV, "Ele")
* theAtomicNumDensityVector[iel]*ZieglerFactor ;
}
// Nuclear Stopping Power
if(nStopping) {
Sn += GetStoppingPowerMoliere(Z1, Z2, A1, A2, KinEnergy)
* theAtomicNumDensityVector[iel]*ZieglerFactor ;
}
// The "ICRU_R49He" table
} else if(DEDXtable == "ICRU_R49He") {
G4double HeKinEnergy = ReducedKinEnergy*HeMassAMU/ProtonMassAMU ;
Se = GetStoppingPowerICRU_R49He(iz, HeKinEnergy)
* theAtomicNumDensityVector[iel]*ZieglerFactor
/ GetHeEffChargeSquare(iz, HeKinEnergy) ;
// Chemical factor calculation
if(ExpStopPower125 > 0.0){
ion125 += GetStoppingPowerICRU_R49p(iz, 125.0*keV, "Ele")
* theAtomicNumDensityVector[iel]*ZieglerFactor ;
}
// Nuclear Stopping Power
if(nStopping) {
Sn += GetStoppingPower1985n(Z1, Z2, A1, A2, KinEnergy)
* theAtomicNumDensityVector[iel]*ZieglerFactor ;
}
// The G4 beta version model
} else if(DEDXtable == "UrbanModel") {
Se = theAtomicNumDensityVector[iel]*GetUrbanModel(element, ReducedKinEnergy) ;
// Chemical factor calculation
if(ExpStopPower125 > 0.0){
ion125 += theAtomicNumDensityVector[iel]*GetUrbanModel(element, 125.0*keV) ;
}
}
ionloss += Se * ChargeSquare ;
}
// Chemical factor is taken into account
if(ExpStopPower125 > 0.0) {
ionloss *= GetChemicalFactor(ExpStopPower125, ReducedKinEnergy, ion125) ;
}
// Correction due to delta-electrons energy loss.
// Bethe-Bloch formulae was used.
if(DEDXtable != "UrbanModel") {
ionloss -= GetDeltaRaysEnergy(material, ReducedKinEnergy, DeltaRayCutNow)
* ChargeSquare ;
}
// Nuclear Stopping Power
if(nStopping) ionloss += Sn ;
if ( ionloss <= 0.) ionloss = 0. ;
return ionloss;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4ionLowEnergyIonisation::GetIonBetheBlochLoss(const G4Material* material,
const G4double KinEnergy,
const G4double DeltaRayCutNow)
{
G4double ionloss ;
G4double taul = material->GetIonisation()->GetTaul() ;
G4double tau = MassRatio*KinEnergy/proton_mass_c2 ; // tau is relative energy
G4double ChargeSquare = GetIonEffChargeSquare(material, KinEnergy, Charge) ;
if ( tau < taul ) {
// low energy part , parametrised L.Urban energy loss formulae
const G4ElementVector* theElementVector=
material->GetElementVector() ;
const G4double* theAtomicNumDensityVector=
material->GetAtomicNumDensityVector() ;
const G4int NumberOfElements=
material->GetNumberOfElements() ;
ionloss = 0. ;
// loop for the elements in the material
for (G4int iel=0; iel<NumberOfElements; iel++)
{
const G4Element* element = (*theElementVector)(iel) ;
ionloss += GetUrbanModel(element, KinEnergy*MassRatio) * theAtomicNumDensityVector[iel] ;
}
} else {
// Standard Bethe-Bloch formulae
// some local variables
G4double gamma,bg2,beta2,Tmax,rcut,x,delta,sh ;
G4double ElectronDensity = material->GetElectronDensity();
G4double Eexc = material->GetIonisation()->GetMeanExcitationEnergy();
G4double Eexc2 = Eexc*Eexc ;
G4double Cden = material->GetIonisation()->GetCdensity();
G4double Mden = material->GetIonisation()->GetMdensity();
G4double Aden = material->GetIonisation()->GetAdensity();
G4double X0den = material->GetIonisation()->GetX0density();
G4double X1den = material->GetIonisation()->GetX1density();
G4double* ShellCorrectionVector;
ShellCorrectionVector = material->GetIonisation()->
GetShellCorrectionVector();
gamma = tau + 1.0 ;
bg2 = tau*(tau+2.0) ;
beta2 = bg2/(gamma*gamma) ;
Tmax = 2.*electron_mass_c2*bg2/(1.+2.*gamma*RateMass+RateMass*RateMass) ;
if ( DeltaRayCutNow < Tmax)
rcut = DeltaRayCutNow/Tmax ;
else
rcut = 1.;
ionloss = log(2.*electron_mass_c2*bg2*Tmax/Eexc2)+log(rcut)-(1.+rcut)*beta2 ;
// density correction
x = log(bg2)/twoln10 ;
if ( x < X0den )
delta = 0. ;
else
{
delta = twoln10*x - Cden ;
if ( x < X1den )
delta += Aden*pow((X1den-x),Mden) ;
}
// shell correction
if ( bg2 > bg2lim ) {
sh = 0. ;
x = 1. ;
for (G4int k=0; k<=2; k++) {
x *= bg2 ;
sh += ShellCorrectionVector[k]/x;
}
} else {
sh = 0. ;
x = 1. ;
for (G4int k=0; k<=2; k++) {
x *= bg2lim ;
sh += ShellCorrectionVector[k]/x;
}
sh *= log(tau/taul)/log(taulim/taul) ;
}
// now you can compute the total ionisation loss
ionloss -= delta + sh ;
ionloss *= Factor*ElectronDensity*ChargeSquare/beta2 ;
}
if ( ionloss <= 0.) ionloss = 0. ;
return ionloss;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4ionLowEnergyIonisation::GetIonLossWithFluct(const G4DynamicParticle* aParticle,
G4Material* aMaterial,
G4double MeanLoss)
// calculate actual loss from the mean loss
// The model used to get the fluctuation is the same as in Glandz in Geant3.
{
G4double ChargeSquare = Charge*Charge ;
G4double loss = GetLossWithFluct(aParticle, aMaterial, MeanLoss/ChargeSquare) * ChargeSquare ;
return loss ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4ionLowEnergyIonisation::PrintInfoDefinition()
{
G4String comments = " Knock-on electron cross sections . ";
comments += "\n Good description above the mean excitation energy.\n";
comments += " delta ray energy sampled from differential Xsection.";
G4cout << endl << GetProcessName() << ": " << comments
<< "\n PhysicsTables from " << G4BestUnit(LowestKineticEnergy,
"Energy")
<< " to " << G4BestUnit(HighestKineticEnergy,"Energy")
<< " in " << TotBin << " bins."
<< "\n Low energy losses approximation is taken from " << DEDXtable
<< "\n from " << G4BestUnit(ParamLowEnergy,"Energy")
<< " to " << G4BestUnit(ParamHighEnergy,"Energy") << "." << endl ;
if(nStopping) {
G4cout << " Simulation of nuclear stopping is switched on. \n" << endl ;
}
}