Import Geant4 1.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:34:16 +02:00
parent ca1c8cb059
commit 103bda00c8
2654 changed files with 29719 additions and 20203 deletions
@@ -1,177 +0,0 @@
// 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 file
//
// For information related to this code contact:
// CERN, IT Division, ASD group
// CERN, Geneva, Switzerland
//
// File name: G4Epdl89File
//
// Author: Alessandra Forti (Alessandra.Forti@cern.ch)
//
// Creation date: 2 February 1999
//
// Modifications:
//
// -------------------------------------------------------------------
// This Class Header
#include "G4Epdl89File.hh"
//C++ Headers
#include "CLHEP/String/Strings.h"
// Constructors
G4Epdl89File::G4Epdl89File(const G4String& filename, G4int* paramVec):
G4VDataFile(filename),
_flags(paramVec)
{
SetBufferSize(80);
}
// Destructor
G4Epdl89File::~G4Epdl89File()
{
}
G4bool G4Epdl89File::FindTheElement(G4int numZ){
G4double llength = LineLength();
G4bool elementFound = FALSE;
HepString flag(GetBuf());
if(numZ){
if(llength == 70){
}
}
return elementFound;
}
G4bool G4Epdl89File::FindTheProcess(){
G4double llength = LineLength();
G4bool tableFound = FALSE;
if(llength == 68){
HepString flag(GetBuf());
if(_flags[0] == flag(0,2).toInt()){
if(_flags[1] == flag(2,3).toInt()){
if(_flags[2] == flag(5,3).toInt()){
G4int subsh;
G4int Xi3 = flag(31,1).toInt();
if(Xi3 == 0){
subsh = flag(22,1).toInt();
}
else if(Xi3 == 1){
subsh = (flag(22,1) + flag(24,1)).toInt();
}
if(_flags[3] == subsh){
tableFound = TRUE;
}
}
}
}
}
return tableFound;
}
G4bool G4Epdl89File::FindOneElemProc(G4int& subsh){
G4double llength = LineLength();
G4bool tableFound = FALSE;
if(llength == 68){
HepString flag(GetBuf());
if(_flags[0] == flag(0,2).toInt()){
if(_flags[1] == flag(2,3).toInt()){
if(_flags[2] == flag(5,3).toInt()){
G4int Xi3 = flag(31,1).toInt();
if(Xi3 == 0){
subsh = flag(22,1).toInt();
}
else if(Xi3 == 1){
subsh = (flag(22,1) + flag(24,1)).toInt();
}
tableFound = TRUE;
}
}
}
}
return tableFound;
}
void G4Epdl89File::GetDataValues(G4Data& valList){
char* token = 0;
G4int i = 0;
do{
if(i == 0){
token = strtok(GetBuf()," ");
}
else{
token = strtok(NULL," ");
}
if(token) {
valList.append(GetOneData(token));
}
i++;
}while(token);
}
G4double G4Epdl89File::GetOneData(const char* token){
HepString parts;
G4double floatTok = 0;
if(token){
parts = token;
floatTok = parts.toFloat();
}
return floatTok;
}
@@ -1,188 +0,0 @@
// 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 file
//
// For information related to this code contact:
// CERN, IT Division, ASD group
// CERN, Geneva, Switzerland
//
// File name: G4Epdl97File
//
// Author: Alessandra Forti (Alessandra.Forti@cern.ch)
//
// Creation date: 2 February 1999
//
// Modifications:
//
// -------------------------------------------------------------------
// This Class Header
#include "G4Epdl97File.hh"
//C++ Headers
#include "CLHEP/String/Strings.h"
// Constructors
G4Epdl97File::G4Epdl97File(const G4String& filename, G4int* paramVec):
G4VDataFile(filename),
_flags(paramVec)
{
SetBufferSize(74);
}
// Destructor
G4Epdl97File::~G4Epdl97File()
{
}
G4bool G4Epdl97File::FindTheElement(G4int numZ){
G4double llength = LineLength();
G4bool elementFound = FALSE;
HepString flag(GetBuf());
if(numZ){
if(llength == 70){
}
}
return elementFound;
}
G4bool G4Epdl97File::FindTheProcess(){
G4double llength = LineLength();
G4bool tableFound = FALSE;
HepString flag(GetBuf());
if(llength == 68 || llength == 69){
if(_flags[0] == flag(0,2).toInt()){
if(_flags[1] == flag(2,3).toInt()){
if(_flags[2] == flag(5,3).toInt()){
G4int subsh;
G4int Xi3 = flag(31,1).toInt();
if(Xi3 == 0){
subsh = flag(22,1).toInt();
}
else if(Xi3 == 1){
subsh = (flag(22,1) + flag(24,1)).toInt();
}
if(_flags[3] == subsh){
tableFound = TRUE;
}
}
}
}
}
return tableFound;
}
G4bool G4Epdl97File::FindOneElemProc(G4int& subsh){
G4double llength = LineLength();
G4bool tableFound = FALSE;
if(llength == 68){
HepString flag(GetBuf());
if(_flags[0] == flag(0,2).toInt()){
if(_flags[1] == flag(2,3).toInt()){
if(_flags[2] == flag(5,3).toInt()){
G4int Xi3 = flag(31,1).toInt();
if(Xi3 == 0){
subsh = flag(22,1).toInt();
}
else if(Xi3 == 1){
subsh = (flag(22,1) + flag(24,1)).toInt();
}
tableFound = TRUE;
}
}
}
}
return tableFound;
}
G4int* G4Epdl97File::GetTheProcFlags(){ return _flags; }
void G4Epdl97File::GetDataValues(G4Data& valList){
char* token = 0;
G4int i = 0;
do{
if(i == 0){
token = strtok(GetBuf()," ");
}
else{
token = strtok(NULL," ");
}
if(token) {
valList.append(GetOneData(token));
}
i++;
}while(token);
}
G4double G4Epdl97File::GetOneData(const char* token){
HepString parts, tot;
G4double floatTok = 0;
if(token){
parts = token;
if(parts(8,1) == "-" || parts(8,1) == "+"){
tot = parts(0,8) + "E" + parts(8,2);
}
else{
tot = parts(0,7) + "E" + parts(7,3);
}
floatTok = tot.toFloat();
}
return floatTok;
}
@@ -1,337 +0,0 @@
// 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 file
//
// For information related to this code contact:
// CERN, IT Division, ASD group
// CERN, Geneva, Switzerland
//
// File name: G4EpdlTables
//
// Author: Alessandra Forti (Alessandra.Forti@cern.ch)
//
// Creation date: 2 February 1999
//
// Modifications:
//
// -------------------------------------------------------------------
// This class header
#include "G4EpdlTables.hh"
// Other Class Headers
#include "G4VDataFile.hh"
#include "G4DataVector.hh"
#include "G4PhysicsFreeVector.hh"
#include "CLHEP/String/Strings.h"
// C++ Headers
#include <iostream.h>
#include <fstream.h>
// Constructors
G4EpdlTables::G4EpdlTables(G4VDataFile& DFile):
G4VTables(),
datfile(DFile)
{
theDataTable1 = 0;
theDataTable2 = 0;
theDataTable3 = 0;
// allElementList = 0;
}
// Destructor
G4EpdlTables::~G4EpdlTables()
{
}
// Member Functions
void G4EpdlTables::FillDataTable() {
// line counters
G4int numTable = 0;
// variables to flag 68 characters lines
G4bool lineMatch = FALSE;
// list of data vectors to be filled
G4FirstLevel vecList;
G4int numBin = 100;
if(theDataTable1){
theDataTable1->clearAndDestroy(); delete theDataTable1;
}
if(theDataTable2){
theDataTable2->clearAndDestroy(); delete theDataTable2;
}
if(theDataTable3){
theDataTable3->clearAndDestroy(); delete theDataTable3;
}
theDataTable1 = new G4PhysicsTable(numBin);
theDataTable2 = new G4PhysicsTable(numBin);
theDataTable3 = new G4PhysicsTable(numBin);
//open input file
datfile.OpenFile();
// loop on the stream
for(;;){
datfile.Eof();
datfile.GetLine();
// lines counters
G4int llength = datfile.LineLength();
if(llength == 0) break;
if(llength == 70){
HepString AtomicNum(datfile.GetBuf());
G4int numAtom = AtomicNum(0,3).toInt();
}
// search for the process flags line
if(llength == 68 || llength == 69) {
lineMatch = datfile.FindTheProcess();
continue;
}
G4double lvl;
if(llength < 68){
if(lineMatch == TRUE){
//list of values in one line
G4Data values;
datfile.GetDataValues(values);
lvl = values.length();
if(!vecList.entries()){
for(G4int k = 0; k < lvl; k++){
vecList.insert(new G4Data);
}
}
for(G4int h = 0; h < lvl; h++){
vecList[h]->append(values[h]);
}
// Clear the temporary list
values.clear();
}
}
if(llength == 72 || llength == 73){
// build the G4PhysicsTables
if(lineMatch == TRUE){
if(lvl >= 1){
G4PhysicsFreeVector* freevec;
freevec = new G4PhysicsFreeVector(*vecList[0],*vecList[1]);
theDataTable1->insertAt(numTable, freevec);
if(lvl == 3){
freevec = new G4PhysicsFreeVector(*vecList[0],*vecList[2]);
theDataTable2->insertAt(numTable, freevec);
}
if(lvl == 4){
freevec = new G4PhysicsFreeVector(*vecList[0],*vecList[2]);
theDataTable2->insertAt(numTable, freevec);
freevec = new G4PhysicsFreeVector(*vecList[0],*vecList[3]);
theDataTable3->insertAt(numTable, freevec);
}
}
numTable++;
lineMatch = FALSE;
vecList.clearAndDestroy();
if(numTable == 99){
break;
}
}
}
}// end for(;;)
if(theDataTable1->length() == 0){
delete theDataTable1;
}
if(theDataTable2->length() == 0){
delete theDataTable2;
}
if(theDataTable3->length() == 0){
delete theDataTable3;
}
} // end FillDataTable
//G4SecondLevel* G4EpdlTables::GetGlobalList(){
//return new G4SecondLevel((*allElementList));
//////}
G4SecondLevel* G4EpdlTables::FillTheTable(G4int numEl) {
// line counters
G4int numTable = 0;
// variables to flag 68 characters lines
G4bool lineMatch = FALSE;
// list of data vectors to be filled
G4FirstLevel* vecList = new G4FirstLevel();
// if(allElementList){
//delete allElementList;
//}
G4SecondLevel* allElementList = new G4SecondLevel();
//open input file
datfile.OpenFile();
// loop on the stream
G4int subSh = 0;
for(;;){
datfile.Eof();
datfile.GetLine();
// lines counters
G4int llength = datfile.LineLength();
if(llength == 0) break;
G4int numAtom;
if(llength == 70){
HepString AtomicNum(datfile.GetBuf());
numAtom = AtomicNum(0,3).toInt();
}
// search for the process flags line
if(llength == 68 || llength == 69) {
if(numEl){
if(numEl != numAtom){
continue;
}
else{
lineMatch = datfile.FindOneElemProc(subSh);
}
}
else{
lineMatch = datfile.FindTheProcess();
}
continue;
}
G4double lvl;
if(llength < 68){
if(lineMatch == TRUE){
//list of values in one line
G4Data values;
datfile.GetDataValues(values);
lvl = values.length();
if(!vecList->entries()){
for(G4int k = 0; k < lvl; k++){
vecList->insert(new G4Data);
}
}
for(G4int h = 0; h < lvl; h++){
(*vecList)[h]->insert(values[h]);
}
// Clear the temporary list
values.clear();
}
}
if(llength == 72 || llength == 73){
// build the G4PhysicsTables
if(lineMatch == TRUE){
allElementList->insert(vecList);
numTable++;
lineMatch = FALSE;
vecList = new G4FirstLevel();
if(numTable == 99){
break;
}
}
}
}// end for(;;)
return allElementList;
} // end FillDataTable
@@ -5,8 +5,9 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LowEnergyBremsstrahlung.cc,v 1.17.2.1 1999/12/07 20:50:23 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4LowEnergyBremsstrahlung.cc,v 1.21 2000/02/18 12:34:30 lefebure Exp $
// $Id: G4LowEnergyBremsstrahlung.cc,v 1.21 2000/02/18 12:34:30 lefebure Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// --------------------------------------------------------------
@@ -15,22 +16,14 @@
//
// For information related to this code contact:
// CERN, IT Division, ASD group
// History: first implementation, based on object model of
// 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
// 16-10-96 : DoIt() call to the non static GetEnergyCuts(), L.Urban
// 13-12-96 : Sign corrected in grejmax and greject
// error definition of screenvar, L.Urban
// 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()
// 17.02.2000 Veronique Lefebure
// - correct bug : the gamma energy was not deposited when the gamma was
// not produced when its energy was < CutForLowEnergySecondaryPhotons
//
// 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
@@ -356,7 +349,7 @@ void G4LowEnergyBremsstrahlung::BuildLossTable(const G4ParticleDefinition& aPart
if(LPMGammaEnergyLimit > klim)
{
G4double kmax = min(Cut,LPMGammaEnergyLimit) ;
G4double kmax = G4std::min(Cut,LPMGammaEnergyLimit) ;
G4double floss = 0. ;
G4int nmax = 1000 ;
@@ -844,12 +837,13 @@ G4VParticleChange* G4LowEnergyBremsstrahlung::PostStepDoIt(const G4Track& trackD
else{
aParticleChange.SetNumberOfSecondaries(0);
aParticleChange.SetLocalEnergyDeposit(GammaEnergy);
}
#ifdef G4VERBOSE
if(verboseLevel > 15){
G4cout<<"LE Bremsstrahlung PostStepDoIt"<<endl;
G4cout<<"LE Bremsstrahlung PostStepDoIt"<<G4endl;
}
#endif
return G4VContinuousDiscreteProcess::PostStepDoIt(trackData,stepData);
@@ -877,10 +871,11 @@ G4Element* G4LowEnergyBremsstrahlung::SelectRandomAtom(G4Material* aMaterial) co
void G4LowEnergyBremsstrahlung::PrintInfoDefinition()
{
G4String comments = "Total cross sections from EEDL database";
comments += "Good description from 1 eV to 100 GeV.\n";
comments += "\n At present it can be used for electrons only ";
comments += "Good description from 250 eV to 100 GeV.\n";
comments += "Gamma energy sampled from a parametrised formula.";
G4cout << endl << GetProcessName() << ": " << comments<<endl;
G4cout << G4endl << GetProcessName() << ": " << comments<<G4endl;
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LowEnergyCompton.cc,v 1.15.6.1 1999/12/07 20:50:24 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4LowEnergyCompton.cc,v 1.17 2000/01/26 09:50:00 lefebure Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// --------------------------------------------------------------
@@ -15,23 +15,9 @@
//
// For information related to this code contact:
// CERN, IT Division, ASD group
// History: first implementation, based on object model of
// 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
// 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
// Modified BuildMeanFreePath to read new data tables A. Forti
// Modified PostStepDoIt to insert sampling with EPDL97 data A. Forti
@@ -59,9 +45,9 @@ G4LowEnergyCompton::G4LowEnergyCompton(const G4String& processName)
NumbBinTable(200)
{
if (verboseLevel>0) {
G4cout << GetProcessName() << " is created "<< endl;
G4cout << GetProcessName() << " is created "<< G4endl;
G4cout << "LowestEnergy: " << LowestEnergyLimit/keV << "keV ";
G4cout << "HighestEnergy: " << HighestEnergyLimit/TeV << "TeV " << endl;
G4cout << "HighestEnergy: " << HighestEnergyLimit/TeV << "TeV " << G4endl;
}
}
@@ -294,7 +280,7 @@ G4VParticleChange* G4LowEnergyCompton::PostStepDoIt(const G4Track& aTrack, const
G4double ElecKineEnergy = GammaEnergy0 - GammaEnergy1 ;
if (G4EnergyLossTables::GetRange(G4Electron::Electron(), ElecKineEnergy, aMaterial)
>= min(G4Electron::GetCuts(), aStep.GetPostStepPoint()->GetSafety())){
>= G4std::min(G4Electron::GetCuts(), aStep.GetPostStepPoint()->GetSafety())){
G4double ElecMomentum = sqrt(ElecKineEnergy*(ElecKineEnergy+2.*electron_mass_c2));
G4ThreeVector ElecDirection((GammaEnergy0*GammaDirection0 -
@@ -314,7 +300,7 @@ G4VParticleChange* G4LowEnergyCompton::PostStepDoIt(const G4Track& aTrack, const
}
#ifdef G4VERBOSE
if(verboseLevel > 0){
G4cout<<"LE Compton Effect PostStepDoIt"<<endl;
G4cout<<"LE Compton Effect PostStepDoIt"<<G4endl;
}
#endif
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LowEnergyGammaConversion.cc,v 1.9.8.1 1999/12/07 20:50:24 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4LowEnergyGammaConversion.cc,v 1.11 2000/01/26 09:50:00 lefebure Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// --------------------------------------------------------------
@@ -15,28 +15,9 @@
//
// For information related to this code contact:
// CERN, IT Division, ASD group
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// ------------ G4LowEnergyGammaConversion physics process --------
// by Michel Maire, 24 May 1996
// by A.Forti 1999/03/02
// **************************************************************
// 11-06-96, Added SelectRandomAtom() method, M.Maire
// 21-06-96, SetCuts implementation, M.Maire
// 24-06-96, simplification in ComputeMicroscopicCrossSection, M.Maire
// 24-06-96, in DoIt : change the particleType stuff, M.Maire
// 25-06-96, modification in the generation of the teta angle, M.Maire
// 16-09-96, minors optimisations in DoIt. Thanks to P.Urban
// dynamical array PartialSumSigma
// 13-12-96, fast sampling of epsil below 2 MeV, L.Urban
// 14-01-97, crossection table + meanfreepath table.
// PartialSumSigma removed, M.Maire
// 14-01-97, in DoIt the positron is always created, even with Ekine=0,
// for further annihilation, M.Maire
// 14-03-97, new Physics scheme for geant4alpha, M.Maire
// 28-03-97, protection in BuildPhysicsTable, M.Maire
// 19-06-97, correction in ComputeMicroscopicCrossSection, L.Urban
// 04-06-98, in DoIt, secondary production condition: range>min(threshold,safety)
// --------------------------------------------------------------
// This Class Header
#include "G4LowEnergyGammaConversion.hh"
@@ -58,9 +39,9 @@ G4LowEnergyGammaConversion::G4LowEnergyGammaConversion(const G4String& processNa
NumbBinTable(200)
{
if (verboseLevel>0) {
G4cout << GetProcessName() << " is created "<< endl;
G4cout << GetProcessName() << " is created "<< G4endl;
G4cout << "LowestEnergy: " << LowestEnergyLimit/keV << "keV ";
G4cout << "HighestEnergy: " << HighestEnergyLimit/GeV << "GeV " << endl;
G4cout << "HighestEnergy: " << HighestEnergyLimit/GeV << "GeV " << G4endl;
}
}
@@ -196,11 +177,11 @@ G4VParticleChange* G4LowEnergyGammaConversion::PostStepDoIt(const G4Track& aTrac
// limits of the screening variable
G4double screenfac = 136.*epsil0/(anElement->GetIonisation()->GetZ3()) ;
G4double screenmax = exp ((42.24 - FZ)/8.368) - 0.952 ;
G4double screenmin = min(4.*screenfac,screenmax) ;
G4double screenmin = G4std::min(4.*screenfac,screenmax) ;
// limits of the energy sampling
G4double epsil1 = 0.5 - 0.5*sqrt(1. - screenmin/screenmax) ;
G4double epsilmin = max(epsil0,epsil1) , epsilrange = 0.5 - epsilmin ;
G4double epsilmin = G4std::max(epsil0,epsil1) , epsilrange = 0.5 - epsilmin ;
//
// sample the energy rate of the created electron (or positron)
@@ -209,7 +190,7 @@ G4VParticleChange* G4LowEnergyGammaConversion::PostStepDoIt(const G4Track& aTrac
G4double screenvar, greject ;
G4double F10 = ScreenFunction1(screenmin) - FZ , F20 = ScreenFunction2(screenmin) - FZ;
G4double NormF1 = max(F10*epsilrange*epsilrange,0.) , NormF2 = max(1.5*F20,0.);
G4double NormF1 = G4std::max(F10*epsilrange*epsilrange,0.) , NormF2 = G4std::max(1.5*F20,0.);
do {
if ( NormF1/(NormF1+NormF2) > G4UniformRand() ){
@@ -272,10 +253,10 @@ G4VParticleChange* G4LowEnergyGammaConversion::PostStepDoIt(const G4Track& aTrac
G4double LocalEnerDeposit = 0. ;
aParticleChange.SetNumberOfSecondaries(2) ;
G4double ElectKineEnergy = max(0.,ElectTotEnergy - electron_mass_c2) ;
G4double ElectKineEnergy = G4std::max(0.,ElectTotEnergy - electron_mass_c2) ;
if (G4EnergyLossTables::GetRange(G4Electron::Electron(), ElectKineEnergy, aMaterial)
>= min(G4Electron::GetCuts(), aStep.GetPostStepPoint()->GetSafety()) ){
>= G4std::min(G4Electron::GetCuts(), aStep.GetPostStepPoint()->GetSafety()) ){
G4ThreeVector ElectDirection ( dirx, diry, dirz );
ElectDirection.rotateUz(GammaDirection);
@@ -292,10 +273,10 @@ G4VParticleChange* G4LowEnergyGammaConversion::PostStepDoIt(const G4Track& aTrac
// the e+ is always created (even with Ekine=0) for further annihilation.
G4double PositKineEnergy = max(0.,PositTotEnergy - electron_mass_c2) ;
G4double PositKineEnergy = G4std::max(0.,PositTotEnergy - electron_mass_c2) ;
if (G4EnergyLossTables::GetRange(G4Positron::Positron(),PositKineEnergy,aMaterial)
< min(G4Positron::GetCuts(), aStep.GetPostStepPoint()->GetSafety()) ){
< G4std::min(G4Positron::GetCuts(), aStep.GetPostStepPoint()->GetSafety()) ){
LocalEnerDeposit += PositKineEnergy ;
PositKineEnergy = 0. ;
@@ -320,7 +301,7 @@ G4VParticleChange* G4LowEnergyGammaConversion::PostStepDoIt(const G4Track& aTrac
aParticleChange.SetStatusChange( fStopAndKill ) ;
#ifdef G4VERBOSE
if(verboseLevel > 15){
G4cout<<"LE Gamma Conversion PostStepDoIt"<<endl;
G4cout<<"LE Gamma Conversion PostStepDoIt"<<G4endl;
}
#endif
// Reset NbOfInteractionLengthLeft and return aParticleChange
@@ -417,7 +398,7 @@ G4Element* G4LowEnergyGammaConversion::SelectRandomAtom(const G4DynamicParticle*
if(rval <= PartialSumSigma) return ((*theElementVector)(i));
}
// G4cout << " WARNING !!! - The Material '"<< aMaterial->GetName()
// << "' has no elements" << endl;
// << "' has no elements" << G4endl;
return (*theElementVector)(0);
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LowEnergyIonisation.cc,v 1.25.2.1 1999/12/07 20:50:25 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4LowEnergyIonisation.cc,v 1.29 2000/02/18 12:39:18 lefebure Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// -------------------------------------------------------------
@@ -14,13 +14,21 @@
//
// For information related to this code contact:
// CERN, IT Division, ASD group
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// ------------ G4LowEnergyIonisation physics process --------
// by Michel Maire, April 1996
// ---------- G4LowEnergyIonisation low energy modifications -----------
// by Alessandra Forti May 1999
// **************************************************************
// 17.02.2000 Veronique Lefebure
// - 5 bugs corrected:
// *in Fluorescence, 2 bugs affecting
// . localEnergyDeposition and
// . number of emitted photons that was then always 1 less
// *in EnergySampling method:
// . expon = Parms[13]+1; (instead of uncorrect -1)
// . rejection /= Parms[6];(instead of uncorrect Parms[7])
// . Parms[6] is apparently corrupted in the data file (often = 0)
// -->Compute normalisation into local variable rejectionMax
// and use rejectionMax in stead of Parms[6]
//
// Added Livermore data table construction methods A. Forti
// Modified BuildMeanFreePath to read new data tables A. Forti
// Added EnergySampling method A. Forti
@@ -37,7 +45,7 @@
#include "G4EnergyLossTables.hh"
#include "G4Gamma.hh"
#include "G4UnitsTable.hh"
#include <fstream.h>
#include "g4std/fstream"
typedef G4RWTPtrOrderedVector<G4DynamicParticle> G4ParticleVector;
@@ -210,7 +218,7 @@ void G4LowEnergyIonisation::BuildLossTable(const G4ParticleDefinition& aParticle
if (&aParticleType==G4Electron::Electron())
{
Tmax = LowEdgeEnergy/2.;
d = min(ParticleCutInKineticEnergy[J], Tmax)/ParticleMass;
d = G4std::min(ParticleCutInKineticEnergy[J], Tmax)/ParticleMass;
ionloss = log(2.*(tau+2.)/Eexcm2)-1.-beta2
+ log((tau-d)*d)+tau/(tau-d)
+ (0.5*d*d+(2.*tau+1.)*log(1.-d/tau))/gamma2;
@@ -218,7 +226,7 @@ void G4LowEnergyIonisation::BuildLossTable(const G4ParticleDefinition& aParticle
else //positron
{
Tmax = LowEdgeEnergy ;
d = min(ParticleCutInKineticEnergy[J], Tmax)/ParticleMass;
d = G4std::min(ParticleCutInKineticEnergy[J], Tmax)/ParticleMass;
d2=d*d/2.; d3=d*d*d/3.; d4=d*d*d*d/4.;
y=1./(1.+gamma);
ionloss = log(2.*(tau+2.)/Eexcm2)+log(tau*d)
@@ -434,7 +442,7 @@ G4VParticleChange* G4LowEnergyIonisation::PostStepDoIt( const G4Track& trackData
aParticleChange.SetEnergyChange(0.);
if(KineticEnergy < 0.)
G4cout << " 1. negative deposit:" << KineticEnergy/eV << endl;
G4cout << " 1. negative deposit:" << KineticEnergy/eV << G4endl;
aParticleChange.SetLocalEnergyDeposit(KineticEnergy);
return G4VContinuousDiscreteProcess::PostStepDoIt(trackData,stepData);
@@ -459,7 +467,7 @@ G4VParticleChange* G4LowEnergyIonisation::PostStepDoIt( const G4Track& trackData
if(KineticEnergy <= BindingEn)
{
G4cout << " Tkin=" << KineticEnergy/eV << " Ebind=" << BindingEn/eV
<< " selection of subshell ???????" << endl;
<< " selection of subshell ???????" << G4endl;
return G4VContinuousDiscreteProcess::PostStepDoIt(trackData,stepData);
}
@@ -485,7 +493,7 @@ G4VParticleChange* G4LowEnergyIonisation::PostStepDoIt( const G4Track& trackData
if(finalKineticEnergy < 0.){
G4cout << "Tkin=" << KineticEnergy/eV << " Tdel=" << DeltaKineticEnergy/eV
<< " BindingEn=" << BindingEn/eV << " ***********" << endl;
<< " BindingEn=" << BindingEn/eV << " ***********" << G4endl;
}
// deposit energy if delta energy is below cut
@@ -497,7 +505,7 @@ G4VParticleChange* G4LowEnergyIonisation::PostStepDoIt( const G4Track& trackData
if((DeltaKineticEnergy+BindingEn) < 0.){
G4cout << " 2. negative deposit:" << (DeltaKineticEnergy+BindingEn)/eV << endl;
G4cout << " 2. negative deposit:" << (DeltaKineticEnergy+BindingEn)/eV << G4endl;
}
aParticleChange.SetLocalEnergyDeposit(DeltaKineticEnergy+BindingEn);
@@ -509,7 +517,7 @@ G4VParticleChange* G4LowEnergyIonisation::PostStepDoIt( const G4Track& trackData
if(KineticEnergy < 0.){
G4cout << " 3. negative deposit:" << KineticEnergy/eV << endl;
G4cout << " 3. negative deposit:" << KineticEnergy/eV << G4endl;
}
aParticleChange.SetLocalEnergyDeposit(KineticEnergy);
@@ -636,10 +644,10 @@ G4VParticleChange* G4LowEnergyIonisation::PostStepDoIt( const G4Track& trackData
if(ThereAreShells != FALSE){
thePrimaryShell = (G4int) fluorPar[0];
theEnergyDeposit -= fluorPar[2]*MeV;
if(fluorPar[2] >= CutForLowEnergySecondaryPhotons){
theEnergyDeposit -= fluorPar[2]*MeV;
newPart = new G4DynamicParticle (G4Gamma::Gamma(),
newPartDirection,
fluorPar[2]);
@@ -658,7 +666,7 @@ G4VParticleChange* G4LowEnergyIonisation::PostStepDoIt( const G4Track& trackData
G4double lastTransEnergy = (*(*theBindEnVec)[1])[k];
thePrimaryShell = (G4int) fluorPar[0];
if(fluorPar[2] >= CutForLowEnergySecondaryPhotons){
if(lastTransEnergy >= CutForLowEnergySecondaryPhotons){
theEnergyDeposit -= lastTransEnergy*MeV;
@@ -703,7 +711,7 @@ G4VParticleChange* G4LowEnergyIonisation::PostStepDoIt( const G4Track& trackData
aParticleChange.SetMomentumChange(finalPx,finalPy,finalPz);
aParticleChange.SetEnergyChange(finalKineticEnergy);
if(theEnergyDeposit < 0.)
G4cout << " 4. negative deposit:" << theEnergyDeposit/eV << endl;
G4cout << " 4. negative deposit:" << theEnergyDeposit/eV << G4endl;
aParticleChange.SetLocalEnergyDeposit (theEnergyDeposit);
}
else
@@ -711,8 +719,8 @@ G4VParticleChange* G4LowEnergyIonisation::PostStepDoIt( const G4Track& trackData
theEnergyDeposit += finalKineticEnergy ;
if(theEnergyDeposit < 0.)
{
G4cout << " 5. negative deposit:" << theEnergyDeposit/eV << endl;
G4cout << " finalKineticEnergy=" << finalKineticEnergy/eV << endl;
G4cout << " 5. negative deposit:" << theEnergyDeposit/eV << G4endl;
G4cout << " finalKineticEnergy=" << finalKineticEnergy/eV << G4endl;
}
aParticleChange.SetLocalEnergyDeposit (theEnergyDeposit);
@@ -982,8 +990,8 @@ G4double G4LowEnergyIonisation::EnergySampling(const G4int AtomicNumber,
G4double aa=1./low ;
G4double bb=1./high ;
G4double saa = aa, sbb = bb;
G4double llow = low*low;
G4double s1 = 0. ;
G4double llow = low;
G4double rejectionMax = 0. ;
for (G4int ii = 1; ii < 7; ii++){
@@ -997,7 +1005,7 @@ G4double G4LowEnergyIonisation::EnergySampling(const G4int AtomicNumber,
//
//function itself at the minimum value (0.1*eV)
//
s1 += Parms[ii-1]/llow;
rejectionMax += Parms[ii-1]/llow;
llow *= low ;
}
@@ -1014,7 +1022,7 @@ G4double G4LowEnergyIonisation::EnergySampling(const G4int AtomicNumber,
// Second Function: B1*energy**B2
//
G4double expon = Parms[13]-1;
G4double expon = Parms[13]+1;
// area2: integral of the normalized second function
area2 = (Parms[12]/expon)*(pow(sndCut,expon)-pow(fstCut,expon));
@@ -1103,7 +1111,8 @@ G4double G4LowEnergyIonisation::EnergySampling(const G4int AtomicNumber,
rejection = Parms[0]/arg+Parms[1]/pow(arg,2)+Parms[2]/pow(arg,3)+
Parms[3]/pow(arg,4)+Parms[4]/pow(arg,5)+Parms[5]/pow(arg,6);
rejection /= Parms[7];
//rejection /= Parms[6];
rejection /= rejectionMax;
}while(rejection < G4UniformRand());
}
@@ -1111,7 +1120,7 @@ G4double G4LowEnergyIonisation::EnergySampling(const G4int AtomicNumber,
else if(rand1 > area1 && rand1 <= areaDue){
//Sampling from the second function only 9 subshells
G4double expon = Parms[13]-1;
G4double expon = Parms[13]+1;
G4double norm = (pow(sndCut,expon)-pow(fstCut,expon));
G4double sum = norm*G4UniformRand()+pow(fstCut,expon);
G4double exponInv = 1/expon;
@@ -1152,8 +1161,9 @@ void G4LowEnergyIonisation::PrintInfoDefinition()
{
G4String comments = "First version of low energy ionisation code,";
comments += "\n At present it can be used for electrons only ";
comments += "\n To be used as a **PURE DISCRETE** process for now";
comments += " in the energy range [250 eV,100 GeV]";
G4cout << endl << GetProcessName() << ": " << comments << endl;
G4cout << G4endl << GetProcessName() << ": " << comments << G4endl;
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LowEnergyPhotoElectric.cc,v 1.21.2.1 1999/12/07 20:50:25 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4LowEnergyPhotoElectric.cc,v 1.24 2000/02/18 10:27:53 lefebure Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// --------------------------------------------------------------
@@ -15,21 +15,15 @@
//
// For information related to this code contact:
// CERN, IT Division, ASD group
// History: first implementation, based on object model of
// 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
// 17-09-96, PartialSumSigma(i)
// split of ComputeBindingEnergy, M.Maire
// 08-01-97, crossection table + meanfreepath table, M.Maire
// 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)
// 17.02.2000 Veronique Lefebure
// - bugs corrected in fluorescence simulation:
// . when final use of binding energy: no photon was ever created
// . no Fluorescence was simulated when the photo-electron energy
// was below production threshold.
//
// Added Livermore data table construction methods A. Forti
// Modified BuildMeanFreePath to read new data tables A. Forti
// Added EnergySampling method A. Forti
@@ -68,9 +62,9 @@ G4LowEnergyPhotoElectric::G4LowEnergyPhotoElectric(const G4String& processName)
NumbBinTable(200)
{
if (verboseLevel>0) {
G4cout << GetProcessName() << " is created "<< endl;
G4cout << GetProcessName() << " is created "<< G4endl;
G4cout << "LowestEnergy: " << LowestEnergyLimit/keV << "keV ";
G4cout << "HighestEnergy: " << HighestEnergyLimit/MeV << "MeV " << endl;
G4cout << "HighestEnergy: " << HighestEnergyLimit/MeV << "MeV " << G4endl;
}
}
@@ -434,13 +428,18 @@ G4VParticleChange* G4LowEnergyPhotoElectric::PostStepDoIt(const G4Track& aTrack,
G4double theEnergyDeposit = BindingEn;
if (G4EnergyLossTables::GetRange(G4Electron::Electron(),ElecKineEnergy,aMaterial)
>= min(G4Electron::GetCuts(), aStep.GetPostStepPoint()->GetSafety())){
>= G4std::min(G4Electron::GetCuts(), aStep.GetPostStepPoint()->GetSafety())){
// the electron is created in the direction of the incident photon ...
G4DynamicParticle* aElectron = new G4DynamicParticle (G4Electron::Electron(),
PhotonDirection, ElecKineEnergy) ;
elecvec.append(aElectron);
} // END OF CUTS
else{
theEnergyDeposit += ElecKineEnergy;
}
// load the transition probability table for the element
// theTable[i][j][k]
@@ -503,7 +502,7 @@ G4VParticleChange* G4LowEnergyPhotoElectric::PostStepDoIt(const G4Track& aTrack,
G4double lastTransEnergy = ((*(*theBindEnVec)[1])[k])*MeV;
thePrimaryShell = (G4int) fluorPar[0];
if(fluorPar[2]*MeV >= CutForLowEnergySecondaryPhotons){
if(lastTransEnergy >= CutForLowEnergySecondaryPhotons){
theEnergyDeposit -= lastTransEnergy;
@@ -542,12 +541,6 @@ G4VParticleChange* G4LowEnergyPhotoElectric::PostStepDoIt(const G4Track& aTrack,
theEnergyDeposit = 0;
}
} // END OF CUTS
else{
theEnergyDeposit = PhotonEnergy;
aParticleChange.SetNumberOfSecondaries(0) ;
}
// Kill the incident photon
aParticleChange.SetMomentumChange( 0., 0., 0. );
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LowEnergyRayleigh.cc,v 1.13.6.1 1999/12/07 20:50:26 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4LowEnergyRayleigh.cc,v 1.15 2000/01/26 09:50:01 lefebure Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// --------------------------------------------------------------
@@ -15,8 +15,6 @@
//
// For information related to this code contact:
// CERN, IT Division, ASD group
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// ------------ G4LowEnergyRayleigh physics process --------
// by Alessandra Forti, November 1998
// **************************************************************
@@ -47,9 +45,9 @@ G4LowEnergyRayleigh::G4LowEnergyRayleigh(const G4String& processName)
NumbBinTable(200)
{
if (verboseLevel>0) {
G4cout << GetProcessName() << " is created "<< endl;
G4cout << GetProcessName() << " is created "<< G4endl;
G4cout << "LowestEnergy: " << LowestEnergyLimit/keV << "keV ";
G4cout << "HighestEnergy: " << HighestEnergyLimit/TeV << "TeV " << endl;
G4cout << "HighestEnergy: " << HighestEnergyLimit/TeV << "TeV " << G4endl;
}
}
@@ -257,7 +255,7 @@ G4VParticleChange* G4LowEnergyRayleigh::PostStepDoIt(const G4Track& aTrack, cons
if(verboseLevel > 15){
G4cout<<"LE Rayleigh PostStepDoIt"<<endl;
G4cout<<"LE Rayleigh PostStepDoIt"<<G4endl;
}
#endif
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LowEnergyUtilities.cc,v 1.2.6.1 1999/12/07 20:50:26 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
// $Id: G4LowEnergyUtilities.cc,v 1.4 2000/01/26 09:50:01 lefebure Exp $
// GEANT4 tag $Name: geant4-01-01 $
//
//
// --------------------------------------------------------------
@@ -15,20 +15,9 @@
//
// For information related to this code contact:
// CERN, IT Division, ASD group
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// ------------ G4LowEnergyUtilities physics process --------
// by Michel Maire, April 1996
// by A.Forti 1999/03/02
// **************************************************************
// 12-06-96, Added SelectRandomAtom() method, by M.Maire
// 21-06-96, SetCuts implementation, M.Maire
// 17-09-96, PartialSumSigma(i)
// split of ComputeBindingEnergy, M.Maire
// 08-01-97, crossection table + meanfreepath table, M.Maire
// 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)
// --------------------------------------------------------------
// This Class Header
#include "G4LowEnergyUtilities.hh"
@@ -37,7 +26,7 @@
#include "G4DynamicParticle.hh"
#include "G4Material.hh"
#include "CLHEP/String/Strings.h"
#include <fstream.h>
#include "g4std/fstream"
G4LowEnergyUtilities::G4LowEnergyUtilities()
{}
@@ -69,8 +58,8 @@ G4SecondLevel* G4LowEnergyUtilities::BuildSecondLevelTables(const G4int TableInd
HepString path_string(path);
HepString dir_file = path_string + "/" + name;
ifstream file(dir_file);
filebuf* lsdp = file.rdbuf();
G4std::ifstream file(dir_file);
G4std::filebuf* lsdp = file.rdbuf();
if(!lsdp->is_open()){
@@ -164,8 +153,8 @@ G4FirstLevel* G4LowEnergyUtilities::BuildFirstLevelTables(const G4int TableInd,
HepString path_string(path);
HepString dir_file = path_string + "/" + name;
ifstream file(dir_file);
filebuf* lsdp = file.rdbuf();
G4std::ifstream file(dir_file);
G4std::filebuf* lsdp = file.rdbuf();
if(!lsdp->is_open()){
@@ -1,134 +0,0 @@
// 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 file
//
// For information related to this code contact:
// CERN, IT Division, ASD group
// CERN, Geneva, Switzerland
//
// File name: G4VDataFile
//
// Author: Alessandra Forti (Alessandra.Forti@cern.ch)
//
// Creation date: 2 February 1999
//
// Modifications:
//
// -------------------------------------------------------------------
// This Class Header
#include "G4VDataFile.hh"
// Other Class Headers
// C++ Headers
#include <iostream.h>
#include <fstream.h>
#include <string.h>
// Constructors
G4VDataFile::G4VDataFile(const G4String& dataFile):
_filename(dataFile)
{
}
// Destructor
G4VDataFile::~G4VDataFile()
{
if(buf){
delete [] buf;
}
}
// Member Functions
void G4VDataFile::OpenFile(){
// open the stream
char* path = getenv("G4LEDATA");
if(!path){
G4Exception("G4LEDATA environment variable not set");
}
G4String path_string(path);
G4String dir_file = path_string + "/" + _filename;
_istr.open(dir_file.data(), ios::in | ios::nocreate);
filebuf* lsdp = _istr.rdbuf();
if(!lsdp->is_open()){
G4String excep = "Error!!!! data file: " + dir_file + " NOT found";
G4Exception(excep);
}
}
void G4VDataFile::CloseFile(){
_istr.close();
}
void G4VDataFile::Eof(){
if(_istr.eof()) {
_istr.close();
}
}
streampos G4VDataFile::TellPos(){
return _istr.tellg();
}
G4bool G4VDataFile::IsOpen(){
return TRUE;//_istr.is_open();
}
void G4VDataFile::SeekPos(streampos pos){
_istr.seekg(pos);
}
void G4VDataFile::SetBufferSize(G4int sz){
_bufSize = sz;
buf = new char[_bufSize+1];
}
void G4VDataFile::GetLine(){
_istr.getline(buf, _bufSize);
if(strlen(buf) >= _bufSize){
G4String excep = "Error!!!! G4VDataFile::GetLine() buffer out of boundaries";
G4Exception(excep);
}
}
G4int G4VDataFile::LineLength(){
return strlen(buf);
}
char* G4VDataFile::GetBuf(){
return buf;
}
@@ -1,46 +0,0 @@
// 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 file
//
// For information related to this code contact:
// CERN, IT Division, ASD group
// CERN, Geneva, Switzerland
//
// File name: G4VTables
//
// Author: Alessandra Forti (Alessandra.Forti@cern.ch)
//
// Creation date: 2 February 1999
//
// Modifications:
//
// -------------------------------------------------------------------
// This Class Header
#include "G4VTables.hh"
// Constructors
G4VTables::G4VTables()
{
}
// Destructor
G4VTables::~G4VTables()
{
}
@@ -22,16 +22,17 @@
// ************************************************************
// 28 July 1999 V.Ivanchenko cleen up
// 17 August 1999 G.Mancinelli added ICRU parametrisations for protons
// 20 August 1999 G.Mancinelli added ICRU tables for alpha (not functional
// yet)
// 20 August 1999 G.Mancinelli added ICRU tables for alpha
// 31 August 1999 V.Ivanchenko update and cleen up
// 30 Sept. 1999 V.Ivanchenko minor upgrade
// 19 Jan. 2000 V.Ivanchenko minor changing in Barkas corrections
// --------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G4hLowEnergyIonisation.hh"
#include "G4UnitsTable.hh"
#include "G4EnergyLossTables.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -78,15 +79,15 @@ void G4hLowEnergyIonisation::SetStoppingPowerTableName(const G4String& dedxTable
{
if(dedxTable == "Ziegler1977H") {
DEDXtable = "Ziegler1977H";
ParamHighEnergy = 2.*MeV;
ParamHighEnergy = 2.0*MeV;
} else if(dedxTable == "Ziegler1977He") {
DEDXtable = "Ziegler1977He";
ParamHighEnergy = 2.*MeV;
ParamHighEnergy = 2.0*MeV;
} else if(dedxTable == "ICRU_R49p") {
DEDXtable = "ICRU_R49p";
ParamHighEnergy = 2.*MeV;
ParamHighEnergy = 2.0*MeV;
// set at 2 MeV. The ICRU report affirm their parametrisations are
// valid up to 1 MeV for protons. They have used Ziegler-like
@@ -98,23 +99,23 @@ void G4hLowEnergyIonisation::SetStoppingPowerTableName(const G4String& dedxTable
// up to 2 MeV (better boundary conditions there wrt 1 MeV) and
// Bethe-Bloch for higher values (applying continuity constraint)
ParamHighEnergy = 2.*MeV;
ParamHighEnergy = 2.0*MeV;
} else if(dedxTable == "ICRU_R49He") {
DEDXtable = "ICRU_R49He";
ParamHighEnergy = 2.*MeV;
ParamHighEnergy = 2.0*MeV;
} else if(dedxTable == "ICRU_R49PowersHe") {
DEDXtable = "ICRU_R49PowersHe";
ParamHighEnergy = 2.*MeV;
ParamHighEnergy = 2.0*MeV;
} else if(dedxTable == "UrbanModel") {
DEDXtable = "UrbanModel";
ParamHighEnergy = 2.*MeV;
ParamHighEnergy = 2.0*MeV;
} else {
G4cout << "G4hLowEnergyIonisation Warning: There is no table with the name ="
<< dedxTable;
<< dedxTable << G4endl;
}
}
@@ -137,7 +138,6 @@ void G4hLowEnergyIonisation::SetNuclearStoppingOff()
void G4hLowEnergyIonisation::SetAntiProtonStoppingOn()
{
pbarStop = true ;
LowestKineticEnergy = 500.*keV;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -153,7 +153,7 @@ void G4hLowEnergyIonisation::BuildLossTable(const G4ParticleDefinition& aParticl
{
// Tables for different hadrons will be different because of
// small difference in Tmax connected with RateMass
RateMass = electron_mass_c2 / (aParticleType.GetPDGMass()) ;
// RateMass = electron_mass_c2 / (aParticleType.GetPDGMass()) ;
// cuts for electron ....................
DeltaCutInKineticEnergy = theElectron->GetCutsInEnergy() ;
@@ -186,29 +186,20 @@ void G4hLowEnergyIonisation::BuildLossTable(const G4ParticleDefinition& aParticl
// get material parameters needed for the energy loss calculation
const G4Material* material= (*theMaterialTable)[J];
G4Material* material= (*theMaterialTable)[J];
// get electron cut in kin. energy for the material
DeltaCutInKineticEnergyNow = DeltaCutInKineticEnergy[J] ;
// get particle mass
const G4double PartMass = aParticleType.GetPDGMass()/MeV;
// get particle charge
const G4double PartCharge = aParticleType.GetPDGCharge();
// define constants A and B for this material
paramA = GetParametrisedLoss(material, ParamLowEnergy,
DeltaCutInKineticEnergyNow,
PartMass, PartCharge)/sqrt(ParamLowEnergy) ;
DeltaCutInKineticEnergyNow)
/sqrt(ParamLowEnergy) ;
ionloss = GetParametrisedLoss(material, ParamHighEnergy,
DeltaCutInKineticEnergyNow,
PartMass, PartCharge) ;
DeltaCutInKineticEnergyNow) ;
ionlossBB = GetBetheBlochLoss(material, ParamHighEnergy,
DeltaCutInKineticEnergyNow) ;
@@ -220,6 +211,9 @@ void G4hLowEnergyIonisation::BuildLossTable(const G4ParticleDefinition& aParticl
for (G4int i = 0 ; i < TotBin ; i++)
{
LowEdgeEnergy = aVector->GetLowEdgeEnergy(i) ;
ionloss = GetParametrisedLoss(material, LowEdgeEnergy,
DeltaCutInKineticEnergyNow) ;
if ( LowEdgeEnergy < ParamHighEnergy ) {
// low energy part , parametrised energy loss formulae
@@ -232,8 +226,7 @@ void G4hLowEnergyIonisation::BuildLossTable(const G4ParticleDefinition& aParticl
} else {
// Parametrisation for intermediate energy range
ionloss = GetParametrisedLoss(material, LowEdgeEnergy,
DeltaCutInKineticEnergyNow,
PartMass, PartCharge) ;
DeltaCutInKineticEnergyNow) ;
}
} else {
@@ -251,6 +244,62 @@ void G4hLowEnergyIonisation::BuildLossTable(const G4ParticleDefinition& aParticl
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4hLowEnergyIonisation::GetPreciseDEDX (G4Material* aMaterial,
const G4double KinEnergy,
const G4ParticleDefinition* aParticleType)
{
// Calculation for different hadrons will be different because of
// small difference in Tmax connected with RateMass
// RateMass = electron_mass_c2 / (aParticleType.GetPDGMass()) ;
G4double ionloss, ionlossBB ;
G4double paramA, paramB, dedx ;
ParticleMass = aParticleType->GetPDGMass() ;
Charge = aParticleType->GetPDGCharge()/eplus ;
MassRatio = proton_mass_c2/ParticleMass ;
G4double Tscaled = KinEnergy*MassRatio ;
G4double ChargeSquare = GetIonEffChargeSquare(aMaterial,KinEnergy,Charge) ;
if(Tscaled > ParamHighEnergy) {
if(Charge>0.) {
dedx = G4EnergyLossTables::GetPreciseDEDX( theProton,Tscaled,aMaterial)
* ChargeSquare ;
} else {
dedx = G4EnergyLossTables::GetPreciseDEDX( theAntiProton,Tscaled,aMaterial)
* ChargeSquare ;
}
} else {
DeltaCutInKineticEnergyNow = DeltaCutInKineticEnergy[(aMaterial->GetIndex())] ;
if ( Tscaled < ParamLowEnergy ) {
// define constants A for this material
paramA = GetParametrisedLoss(aMaterial, ParamLowEnergy,
DeltaCutInKineticEnergyNow)/sqrt(ParamLowEnergy) ;
// The model of free electron gas
ionloss = GetFreeElectronGasLoss(paramA, Tscaled) ;
} else {
// Parametrisation for intermediate energy range
ionloss = GetParametrisedLoss(aMaterial, Tscaled,
DeltaCutInKineticEnergyNow) ;
}
ionloss *= ChargeSquare ;
}
return ionloss ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -264,6 +313,7 @@ void G4hLowEnergyIonisation::SetPhysicsTableBining(G4double lowE, G4double highE
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4hLowEnergyIonisation::BuildPhysicsTable(const G4ParticleDefinition& aParticleType)
// just call BuildLossTable+BuildLambdaTable
{
ParticleMass = aParticleType.GetPDGMass() ;
@@ -316,7 +366,10 @@ void G4hLowEnergyIonisation::BuildLambdaTable(const G4ParticleDefinition& aParti
const G4MaterialTable* theMaterialTable=
G4Material::GetMaterialTable();
ParticleMass = aParticleType.GetPDGMass() ;
//Particle properties
//ParticleMass = aParticleType.GetPDGMass() ;
//G4double Charge = aParticle.GetPDGCharge()/eplus ;
//create table
@@ -364,12 +417,13 @@ void G4hLowEnergyIonisation::BuildLambdaTable(const G4ParticleDefinition& aParti
for ( G4int i = 0 ; i < TotBin ; i++ )
{
LowEdgeEnergy = aVector->GetLowEdgeEnergy(i) ;
G4double ChargeSquare = GetIonEffChargeSquare(material,LowEdgeEnergy,Charge) ;
sigma = 0. ;
sigma = 0.0 ;
for (G4int iel=0; iel<NumberOfElements; iel++ )
{
sigma += theAtomicNumDensityVector[iel]*
sigma += theAtomicNumDensityVector[iel]*ChargeSquare*
ComputeMicroscopicCrossSection(aParticleType,
LowEdgeEnergy,
(*theElementVector)(iel)->GetZ() ) ;
@@ -439,13 +493,211 @@ G4double G4hLowEnergyIonisation::ComputeMicroscopicCrossSection(
*TotalCrossSection/betasquare;
}
else
TotalCrossSection= 0. ;
TotalCrossSection= 0.0 ;
return TotalCrossSection ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4hLowEnergyIonisation::GetConstraints(const G4DynamicParticle *aParticle,
G4Material *aMaterial)
{
// returns the Step limit
// it calculates dEdx and the range as well
// based on Effective charge approach
G4double KineticEnergy,StepLimit ;
G4bool isOut ;
theParticle = aParticle->GetDefinition() ;
MassRatio = proton_mass_c2/(theParticle->GetPDGMass()) ;
Charge = (theParticle->GetPDGCharge())/eplus ;
KineticEnergy = aParticle->GetKineticEnergy() ;
// Scale the kinetic energy
G4double Tscaled= KineticEnergy*MassRatio ;
G4double ChargeSquare = GetIonEffChargeSquare(aMaterial,KineticEnergy,Charge) ;
G4double dx, s ;
if(Charge>0.) {
fdEdx = G4EnergyLossTables::GetDEDX( theProton, Tscaled, aMaterial)
* ChargeSquare ;
fRangeNow = G4EnergyLossTables::GetRange( theProton, Tscaled, aMaterial) ;
s = fRangeNow ;
if(Tscaled < ParamHighEnergy) {
// For Bragg's peak the limit in range is estimated
// in order to be inside linLossLimit on each step
fdEdx = GetPreciseDEDX (aMaterial, KineticEnergy, theParticle) ;
dx = G4EnergyLossTables::GetRange( theProton,
ParamHighEnergy, aMaterial) * linLossLimit ;
fRangeNow = G4std::min (fRangeNow, dx) ;
}
// Antiprotons and negative hadrons
} else {
fdEdx = G4EnergyLossTables::GetDEDX( theAntiProton, Tscaled, aMaterial)
* ChargeSquare ;
fRangeNow = G4EnergyLossTables::GetRange( theAntiProton, Tscaled, aMaterial) ;
if(Tscaled < ParamHighEnergy) {
// For Bragg's peak the limit in range is estimated
// in order to be inside linLossLimit on each step
fdEdx = GetPreciseDEDX (aMaterial, KineticEnergy, theParticle) ;
dx = G4EnergyLossTables::GetRange( theAntiProton,
ParamHighEnergy, aMaterial) * linLossLimit ;
fRangeNow = G4std::min (fRangeNow, dx) ;
}
}
//
fRangeNow /= (ChargeSquare*MassRatio) ;
StepLimit = fRangeNow ;
// compute the (random) Step limit ..............
if(fRangeNow > finalRange) {
if(Tscaled > ParamHighEnergy ) {
StepLimit = (c1lim*fRangeNow+c2lim+c3lim/fRangeNow) ;
// randomise this value
if(rndmStepFlag) StepLimit =
finalRange+(StepLimit-finalRange)*G4UniformRand() ;
if(StepLimit > fRangeNow) StepLimit = fRangeNow ;
}
}
return StepLimit ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4VParticleChange* G4hLowEnergyIonisation::AlongStepDoIt(
const G4Track& trackData, const G4Step& stepData)
{
// compute the energy loss after a step
const G4DynamicParticle* aParticle;
G4Material* aMaterial;
G4double finalT = 0.0 ;
aParticleChange.Initialize(trackData) ;
aMaterial = trackData.GetMaterial() ;
// get the actual (true) Step length from stepData
const G4double Step = stepData.GetStepLength() ;
aParticle = trackData.GetDynamicParticle() ;
G4int index = aMaterial->GetIndex() ;
G4double E = aParticle->GetKineticEnergy() ;
if( (aParticle->GetDefinition()) != theParticle ) {
theParticle = aParticle->GetDefinition() ;
MassRatio = proton_mass_c2/(theParticle->GetPDGMass()) ;
Charge = (theParticle->GetPDGCharge())/eplus ;
}
G4double Tscaled= E*MassRatio ;
G4double ChargeSquare = Charge*Charge ;
G4double Eloss = 0.0 ;
G4double Nloss = 0.0 ;
if(E < MinKineticEnergy) Eloss = E ;
else if(( E > HighestKineticEnergy)||( E <= LowestKineticEnergy))
Eloss = Step*fdEdx ;
else if(Tscaled < ParamHighEnergy) {
// Nuclear Stopping Power
if(nStopping) {
Nloss = GetNuclearDEDX(aMaterial, E, theParticle) ;
}
G4double E1 = E - Step*(fdEdx + Nloss) ;
if(0.0 < E1) {
Eloss = (fdEdx + GetPreciseDEDX (aMaterial, E1, theParticle))*Step*0.5 ;
if(nStopping) {
Nloss = (Nloss + GetNuclearDEDX (aMaterial, E1, theParticle))*Step*0.5 ;
}
} else Eloss = E ;
} else if(Step >= fRangeNow ) Eloss = E ;
else {
if(Step>linLossLimit*fRangeNow) {
G4double rscaled= fRangeNow*MassRatio*ChargeSquare ;
G4double sscaled= Step *MassRatio*ChargeSquare ;
if(Charge>0.)
{
Eloss = G4EnergyLossTables::GetPreciseEnergyFromRange(
theProton,
rscaled ,aMaterial) -
G4EnergyLossTables::GetPreciseEnergyFromRange(
theProton,
rscaled-sscaled,aMaterial) ;
}
else
{
Eloss = G4EnergyLossTables::GetPreciseEnergyFromRange(
theAntiProton,
rscaled ,aMaterial) -
G4EnergyLossTables::GetPreciseEnergyFromRange(
theAntiProton,
rscaled-sscaled,aMaterial) ;
}
Eloss /= (MassRatio*ChargeSquare) ;
} else Eloss = Step*fdEdx ;
}
finalT = E - Eloss - Nloss;
if(finalT > MinKineticEnergy) {
// now the electron loss with fluctuation
if((EnlossFlucFlag) && (finalT < E) && (E > LowestKineticEnergy)) {
Eloss = GetLossWithFluct(aParticle,aMaterial,Eloss/ChargeSquare)
* ChargeSquare ;
// if(nStopping) {
// Nloss = GetNuclearLossWithFluct(theParticle,aMaterial,Nloss) ;
// }
finalT = E - Eloss - Nloss ;
}
}
// kill the particle if the kinetic energy <= 0
if (finalT <= 0.0 )
{
finalT = 0.0 ;
if(theParticle->GetParticleName() == "proton")
aParticleChange.SetStatusChange(fStopAndKill);
else
aParticleChange.SetStatusChange(fStopButAlive);
}
aParticleChange.SetEnergyChange( finalT ) ;
aParticleChange.SetLocalEnergyDeposit(E-finalT) ;
return &aParticleChange ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4VParticleChange* G4hLowEnergyIonisation::PostStepDoIt(const G4Track& trackData,
const G4Step& stepData)
{
@@ -586,11 +838,10 @@ G4VParticleChange* G4hLowEnergyIonisation::PostStepDoIt(const G4Track& trackData
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4hLowEnergyIonisation::GetParametrisedLoss(const G4Material* material,
G4double G4hLowEnergyIonisation::GetParametrisedLoss(G4Material* material,
const G4double KinEnergy,
const G4double DeltaRayCutNow,
const G4double PartMass,
const G4double PartCharge)
const G4double DeltaRayCutNow)
{
G4double ionloss, ion, ionloss125, ion125;
@@ -600,7 +851,7 @@ G4double G4hLowEnergyIonisation::GetParametrisedLoss(const G4Material* material,
// First of all check tables for specific materials for ICRU_49 parametrisation
// Ziegler parametrisation in ICRU49
if ( DEDXtable == "ICRU_R49p" && PartCharge > 0) {
if ( DEDXtable == "ICRU_R49p" ) {
molecIndex = (MolecIsInICRU_R49p(material))+1;
@@ -612,7 +863,7 @@ G4double G4hLowEnergyIonisation::GetParametrisedLoss(const G4Material* material,
}
// Powers parametrisation in ICRU49
if ( DEDXtable == "ICRU_R49PowersHe"&& PartCharge > 0 ) {
if ( DEDXtable == "ICRU_R49PowersHe" ) {
molecIndex = (MolecIsInICRU_R49PowersHe(material))+1;
if ( molecIndex > 0 ) {
@@ -643,9 +894,7 @@ G4double G4hLowEnergyIonisation::GetParametrisedLoss(const G4Material* material,
for (G4int iel=0; iel<NumberOfElements; iel++)
{
const G4Element* element = (*theElementVector)(iel) ;
G4double A1 = ProtonMassAMU ;
G4double Z2 = element->GetZ() ;
G4double A2 = element->GetA()*mole/g ;
G4int iz = int(Z2) ;
if( iz <= 0 ) iz = 1 ;
if( iz > 92 ) iz = 92 ;
@@ -664,12 +913,6 @@ G4double G4hLowEnergyIonisation::GetParametrisedLoss(const G4Material* material,
ion125 *= theAtomicNumDensityVector[iel]*ZieglerFactor ;
}
// Nuclear Stopping Power
if(nStopping) {
G4double ionn = GetStoppingPower1977n(1.0, Z2, A1, A2, KinEnergy)
* (theAtomicNumDensityVector[iel])*ZieglerFactor ;
ion += ionn ;
}
// The "Ziegler1977He" table
} else if(DEDXtable == "Ziegler1977He") {
G4double HeKinEnergy = KinEnergy*HeMassAMU/ProtonMassAMU ;
@@ -682,12 +925,6 @@ G4double G4hLowEnergyIonisation::GetParametrisedLoss(const G4Material* material,
ion125 = GetStoppingPower1977H(iz, 125.0*keV) ;
ion125 *= theAtomicNumDensityVector[iel]*ZieglerFactor ;
}
// Nuclear Stopping Power
if(nStopping) {
G4double ionn = GetStoppingPower1977n(1.0, Z2, A1, A2, KinEnergy) ;
ion += ionn*theAtomicNumDensityVector[iel]*ZieglerFactor ;
}
// The "ICRU_R49p" table
} else if(DEDXtable == "ICRU_R49p") {
@@ -700,12 +937,6 @@ G4double G4hLowEnergyIonisation::GetParametrisedLoss(const G4Material* material,
ion125 *= theAtomicNumDensityVector[iel]*ZieglerFactor ;
}
// Nuclear Stopping Power
if(nStopping) {
G4double ionn = GetStoppingPowerMoliere(1.0, Z2, A1, A2, KinEnergy) ;
ion += ionn*theAtomicNumDensityVector[iel]*ZieglerFactor ;
}
// The "ICRU_R49He" table
} else if(DEDXtable == "ICRU_R49He") {
G4double HeKinEnergy = KinEnergy*HeMassAMU/ProtonMassAMU ;
@@ -718,12 +949,6 @@ G4double G4hLowEnergyIonisation::GetParametrisedLoss(const G4Material* material,
ion125 = GetStoppingPowerICRU_R49p(iz, 125.0*keV, "Ele") ;
ion125 *= theAtomicNumDensityVector[iel]*ZieglerFactor ;
}
// Nuclear Stopping Power
if(nStopping) {
G4double ionn = GetStoppingPower1985n(1.0, Z2, A1, A2, KinEnergy) ;
ion += ionn*theAtomicNumDensityVector[iel]*ZieglerFactor ;
}
// The G4 beta version model
} else if(DEDXtable == "UrbanModel") {
@@ -734,7 +959,7 @@ G4double G4hLowEnergyIonisation::GetParametrisedLoss(const G4Material* material,
ion125 = theAtomicNumDensityVector[iel]*GetUrbanModel(element, 125.0*keV) ;
}
}
ionloss += ion ;
ionloss125 += ion125 ;
@@ -754,21 +979,66 @@ G4double G4hLowEnergyIonisation::GetParametrisedLoss(const G4Material* material,
ionloss -= GetDeltaRaysEnergy(material, KinEnergy, DeltaRayCutNow) ;
}
// Correction term for the Barkas effect applied if pbarStop = true
G4double BarkasTerm=0;
if(PartCharge == -1 && pbarStop) BarkasTerm = ComputeBarkasTerm( material, KinEnergy, PartMass);
//if(PartCharge <= -2 && pbarStop) BarkasTerm = sqrt( GetIonEffChargeSquare( material, KinEnergy, PartCharge))
// * ComputeBarkasTerm ( material, KinEnergy, PartMass);
ionloss += BarkasTerm;
if ( ionloss <= 0.) ionloss = 0. ;
// Correction term for the Barkas effect applied if pbarStop = true
// and only for negative charged particles
// Barkas term is taken into account in Ziegler/ICRU tables,
// so for antiprotons a correction term must be multiplied by factor 2
if( (-0.5 > Charge) && pbarStop) {
ionloss += ComputeBarkasTerm( material, KinEnergy ) * (Charge - 1.0) ;
}
if ( ionloss <= 0.0) ionloss = 0.0 ;
return ionloss;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4hLowEnergyIonisation::GetNuclearDEDX(G4Material* material,
const G4double KinEnergy,
const G4ParticleDefinition* aParticleType)
{
G4double ionloss = 0.0 ;
// Now cycle over elements - calculation based on Bragg's rule
// get elements in the actual material,
const G4ElementVector* theElementVector = material->GetElementVector() ;
const G4double* theAtomicNumDensityVector = material->GetAtomicNumDensityVector() ;
const G4int NumberOfElements = material->GetNumberOfElements() ;
MassRatio = proton_mass_c2/(aParticleType->GetPDGMass()) ;
Charge = (aParticleType->GetPDGCharge())/eplus ;
G4double A1 = ProtonMassAMU/MassRatio ;
// loop for the elements in the material
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 ;
// Choose the parametrisation using the table name
// The "Ziegler1977H" table
if(DEDXtable == "Ziegler1977H") {
ionloss = GetStoppingPower1977n(Charge, Z2, A1, A2, KinEnergy)
* theAtomicNumDensityVector[iel]*ZieglerFactor ;
// The "ICRU_R49p" table
// } else if(DEDXtable == "ICRU_R49p") {
} else {
ionloss = GetStoppingPowerMoliere(Charge, Z2, A1, A2, KinEnergy)
* theAtomicNumDensityVector[iel]*ZieglerFactor ;
}
}
return ionloss;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//Function to compute the Barkas term from:
@@ -778,56 +1048,72 @@ G4double G4hLowEnergyIonisation::GetParametrisedLoss(const G4Material* material,
// Physical review B Vol.5 No.7 1 April 1972 pagg. 2393-2397
//
G4double G4hLowEnergyIonisation::ComputeBarkasTerm(const G4Material* material,
const G4double KinEnergy,
const G4double PartMass )
const G4double KinEnergy)
{
static double FTable[47][2]={ 0.02,21.5, 0.03,20.0, 0.04,18.0, 0.05,15.6,
0.06,15.0, 0.07,14.0, 0.08,13.5, 0.09,13,
0.1,12.2, 0.2, 9.25, 0.3, 7, 0.4, 6, 0.5, 4.5,
0.6, 3.5, 0.7, 3, 0.8, 2.5, 0.9, 2,
1, 1.7, 1.2, 1.2, 1.3, 1, 1.4, 0.86, 1.5, 0.7,
0.1,12.2, 0.2, 9.25, 0.3, 7.0, 0.4, 6.0, 0.5, 4.5,
0.6, 3.5, 0.7, 3.0, 0.8, 2.5, 0.9, 2.0,
1.0, 1.7, 1.2, 1.2, 1.3, 1.0, 1.4, 0.86, 1.5, 0.7,
1.6, 0.61, 1.7, 0.52, 1.8, 0.5, 1.9, 0.43,
2, 0.42, 2.1, 0.3, 2.4, 0.2,
3, 0.13, 3.08, 0.1, 3.1, 0.09, 3.3, 0.08,
3.5, 0.07, 3.8, 0.06,
4, 0.051, 4.1, 0.04, 4.8, 0.03,
5, 0.024, 5.1, 0.02,
6, 0.013, 6.5, 0.01,
7, 0.009, 7.1, 0.008,
8, 0.006, 9, 0.0032,
10, 0.0025};
2.0, 0.42, 2.1, 0.3, 2.4, 0.2,
3.0, 0.13, 3.08, 0.1, 3.1, 0.09, 3.3, 0.08,
3.5, 0.07, 3.8, 0.06,
4.0, 0.051, 4.1, 0.04, 4.8, 0.03,
5.0, 0.024, 5.1, 0.02,
6.0, 0.013, 6.5, 0.01,
7.0, 0.009, 7.1, 0.008,
8.0, 0.006, 9.0, 0.0032,
10.0, 0.0025};
// Internal variable for Kinetic Energy
// in order to keep Barkas correction to be constant below 500 keV
G4double KineticEnergy = KinEnergy;
if( 500*keV > KineticEnergy ) KineticEnergy = 500*keV;
// Information on particle and material
G4double BarkasTerm=0;
G4double AMaterial=0;
G4double ZMaterial=0;
G4double BarkasTerm=0.0;
G4double AMaterial=0.0;
G4double ZMaterial=0.0;
G4double RoMaterial = material->GetDensity()/6.2415063631e18;
const G4ElementVector* theElementVector = material->GetElementVector();
G4int i=0;
for (i = 0; i<material->GetNumberOfElements(); ++i)
{
for (i = 0; i<material->GetNumberOfElements(); ++i) {
AMaterial = (*theElementVector)(i)->GetA()*mole/g;
ZMaterial = (*theElementVector)(i)->GetZ();
G4double Beta = sqrt( (2*KinEnergy) / PartMass );
G4double X = ( (137*Beta) * (137*Beta) ) / ZMaterial;
G4double Beta = sqrt( 2.0*KineticEnergy / proton_mass_c2 );
G4double X = ( (137.0*Beta) * (137.0*Beta) ) / ZMaterial;
// Variables to compute L_1
G4double Eta0Chi = 0.8;
G4double EtaChi = Eta0Chi * ( 1 + 6.02*pow( ZMaterial,-1.19 ) );
G4double W = ( EtaChi * pow( ZMaterial,1./6 ) ) / sqrt(X);
G4double FunctionOfW = 0;
for(int IndexOfFTable=0;IndexOfFTable<47;IndexOfFTable++){
if(W<FTable[IndexOfFTable][0]){
FunctionOfW =( FTable[IndexOfFTable][1] + FTable[IndexOfFTable-1][1] ) /2;
break;}
}
G4double BarkasCoeffLbyARB = FunctionOfW / ( sqrt(ZMaterial) * pow(X,3./2) );
BarkasTerm += 2 * BarkasCoeffLbyARB * ( 0.030708 * ZMaterial * RoMaterial )
G4double EtaChi = Eta0Chi * ( 1.0 + 6.02*pow( ZMaterial,-1.19 ) );
G4double W = ( EtaChi * pow( ZMaterial,1.0/6.0 ) ) / sqrt(X);
G4double FunctionOfW = 0.0;
for(int IndexOfFTable=0; IndexOfFTable<47; IndexOfFTable++) {
if(W<FTable[IndexOfFTable][0]) {
if(0 == IndexOfFTable) {
FunctionOfW = FTable[0][1] ;
}
else if(46 == IndexOfFTable) {
FunctionOfW = FTable[46][1] ;
}
else {
FunctionOfW =( FTable[IndexOfFTable][1] + FTable[IndexOfFTable-1][1] ) /2.0;
}
break;
}
}
G4double BarkasCoeffLbyARB = FunctionOfW / ( sqrt(ZMaterial) * pow(X,1.5) );
BarkasTerm += BarkasCoeffLbyARB * ( 0.030708 * ZMaterial * RoMaterial )
/ ( AMaterial*Beta*Beta );
}
return -BarkasTerm;
}
return BarkasTerm;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -998,6 +1284,12 @@ G4double G4hLowEnergyIonisation::GetBetheBlochLoss(const G4Material* material,
ionloss -= delta + sh ;
ionloss *= Factor*ElectronDensity/beta2 ;
}
// Barkas correction term is switch on
if( pbarStop) {
ionloss += ComputeBarkasTerm( material, KinEnergy ) * Charge ;
}
if ( ionloss <= 0.) ionloss = 0. ;
return ionloss;
@@ -2015,7 +2307,7 @@ G4double G4hLowEnergyIonisation::MolecIsInZiegler1988(const G4Material* material
// If the meterial is in the table then the Stopping Power at 125 keV exist
// In that case the return value ExpStopPower125 > 0
G4int ExpStopPower125 = -1.0;
G4double ExpStopPower125 = -1.0;
const G4String chFormula = material->GetChemicalFormula() ;
if (" " == chFormula ) return ExpStopPower125 ;
@@ -2141,7 +2433,7 @@ G4double G4hLowEnergyIonisation::GetHeEffChargeSquare(const G4int iz,
static G4double C[6] = {0.2865, 0.1266, -0.001429,
0.02402,-0.01135, 0.001475} ;
G4double E = log( max( 1.0, HeKinEnergy/(keV*HeMassAMU) ) ) ;
G4double E = log( G4std::max( 1.0, HeKinEnergy/(keV*HeMassAMU) ) ) ;
G4double x = C[0] ;
G4double y = 1.0 ;
for (G4int i=1; i<6; i++) {
@@ -2241,7 +2533,7 @@ G4double G4hLowEnergyIonisation::GetIonEffChargeSquare(const G4Material* aMateri
// Helium ion case
if( IonCharge < 2.5 ) {
G4double E = log( max( 1.0, KinEnergy / (keV*HeMassAMU) ) ) ;
G4double E = log( G4std::max( 1.0, KinEnergy / (keV*HeMassAMU) ) ) ;
G4double x = C[0] ;
G4double y = 1.0 ;
for (G4int i=1; i<6; i++) {
@@ -2273,7 +2565,7 @@ G4double G4hLowEnergyIonisation::GetIonEffChargeSquare(const G4Material* aMateri
G4double q = 1.0 - exp( 0.803*y3 - 1.3167*y3*y3 - 0.38157*y - 0.008983*y*y ) ;
if( q < 0.0 ) q = 0.0 ;
Q = 7.6 - log(max(1.0, ReducedEnergy/keV)) ;
Q = 7.6 - log(G4std::max(1.0, ReducedEnergy/keV)) ;
Q = 1.0 + ( 0.18 + 0.0015 * Z ) * exp( -Q*Q )/ (IonCharge*IonCharge) ;
// Screen length according to
@@ -2297,26 +2589,18 @@ void G4hLowEnergyIonisation::PrintInfoDefinition()
comments += "\n Good description above the mean excitation energy.\n";
comments += " delta ray energy sampled from differential Xsection.";
G4cout << G4endl << GetProcessName() << ": " << comments
<< "\n PhysicsTables from " << LowestKineticEnergy / eV << " eV "
<< " to " << HighestKineticEnergy / TeV << " TeV "
<< " in " << TotBin << " bins."
<< "\n Low energy losses approximation is taken from " << DEDXtable
<< "\n from " << ParamLowEnergy / keV << " keV "
<< " to " << ParamHighEnergy / MeV << " MeV " << "." << G4endl ;
if(pbarStop){
G4cout << endl << GetProcessName() << ": " << comments
<< "\n PhysicsTables from " << LowestKineticEnergy / eV << " eV "
<< " to " << HighestKineticEnergy / TeV << " TeV "
<< " in " << TotBin << " bins."
<< "\n Low energy losses approximation is taken from " << DEDXtable
<< "\n from " << ParamLowEnergy / keV << " keV "
<< " to " << ParamHighEnergy / MeV << " MeV " << "." << endl ;
} else {
G4cout << endl << GetProcessName() << ": " << comments
<< "\n PhysicsTables from " << LowestKineticEnergy / eV << " eV "
<< " to " << HighestKineticEnergy / TeV << " TeV "
<< " in " << TotBin << " bins."
<< "\n Low energy losses approximation is taken from " << DEDXtable
<< "\n from " << ParamLowEnergy / keV << " keV "
<< " to " << ParamHighEnergy / MeV << " MeV " << "." << endl
<< "\n Energy loss for antiproton now available only from 100 keV.";
G4cout << " Parametrization of the Barkas effect is switched on." << G4endl ;
}
if(nStopping) {
G4cout << " Simulation of nuclear stopping is switched on. \n" << endl ;
G4cout << " Simulation of nuclear stopping is switched on." << G4endl ;
}
}
@@ -21,6 +21,7 @@
// ************************************************************
// 6 September 1999 V.Ivanchenko create
// 30 September 1999 V.Ivanchenko minor upgrade
// 20 January 2000 V.Ivanchenko minor bag fixed
// ------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -34,8 +35,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4ionLowEnergyIonisation::G4ionLowEnergyIonisation(const G4String& processName)
: G4hLowEnergyIonisation(processName),
theIon (G4Proton::Proton())
: G4hLowEnergyIonisation(processName)
{
LowestKineticEnergy = 10.*eV ;
HighestKineticEnergy = 100.*TeV ;
@@ -47,20 +47,16 @@ G4ionLowEnergyIonisation::G4ionLowEnergyIonisation(const G4String& processName)
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;
theParticle = theIonType ;
MassRatio = proton_mass_c2/(theParticle->GetPDGMass()) ;
Charge = (theParticle->GetPDGCharge())/eplus ;
G4cout << "New ion with Q = " << Charge << "; MassR = " << MassRatio << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -105,418 +101,9 @@ G4double G4ionLowEnergyIonisation::GetLowEnergyForParametrisation(const G4Materi
}
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;
E1 = G4std::max (E1, E2) ;
E1 = G4std::max(ParamLowEnergy, E1) / MassRatio ;
return E1 ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -543,16 +130,16 @@ void G4ionLowEnergyIonisation::PrintInfoDefinition()
comments += "\n Good description above the mean excitation energy.\n";
comments += " delta ray energy sampled from differential Xsection.";
G4cout << endl << GetProcessName() << ": " << comments
G4cout << G4endl << 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 ;
<< " to " << G4BestUnit(ParamHighEnergy,"Energy") << "." << G4endl ;
if(nStopping) {
G4cout << " Simulation of nuclear stopping is switched on. \n" << endl ;
G4cout << " Simulation of nuclear stopping is switched on. \n" << G4endl ;
}
}