Import Geant4 3.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:03:00 +02:00
parent cfcb558cfe
commit 137e303ecc
2843 changed files with 37082 additions and 38426 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4AtomicShells.cc,v 1.2 1999/12/15 14:50:50 gunter Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
+85 -67
View File
@@ -5,27 +5,24 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Element.cc,v 1.3 1999/12/15 14:50:51 gunter Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4Element.cc,v 1.4 2001/03/12 17:48:48 maire Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ------------ class G4Element ------------
//
// Torre Wenaus, November 1995
//
//
// 26-06-96, Code uses operators (+=, *=, ++, -> etc.) correctly, P. Urban
// 09-07-96, new data members added by L.Urban
// 17-01-97, aesthetic rearrangement, M.Maire
// 20-01-97, Compute Tsai's formula for the rad length, M.Maire
// 21-01-97, remove mixture flag, M.Maire
// 24-01-97, ComputeIonisationParameters().
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
// 26-06-96: Code uses operators (+=, *=, ++, -> etc.) correctly, P. Urban
// 09-07-96: new data members added by L.Urban
// 17-01-97: aesthetic rearrangement, M.Maire
// 20-01-97: Compute Tsai's formula for the rad length, M.Maire
// 21-01-97: remove mixture flag, M.Maire
// 24-01-97: ComputeIonisationParameters().
// new data member: fTaul, M.Maire
// 29-01-97, Forbidden to create Element with Z<1 or N<Z, M.Maire
// 20-03-97, corrected initialization of pointers, M.Maire
// 28-04-98, atomic subshell binding energies stuff, V. Grichine
// 09-07-98, Ionisation parameters removed from the class, M.Maire
// 16-11-98, name Subshell -> Shell; GetBindingEnergy(), mma
// 29-01-97: Forbidden to create Element with Z<1 or N<Z, M.Maire
// 20-03-97: corrected initialization of pointers, M.Maire
// 28-04-98: atomic subshell binding energies stuff, V. Grichine
// 09-07-98: Ionisation parameters removed from the class, M.Maire
// 16-11-98: name Subshell -> Shell; GetBindingEnergy() (mma)
// 09-03-01: assignement operator revised (mma)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
@@ -162,51 +159,6 @@ G4Element::~G4Element()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4Element::G4Element(G4Element &right)
{
*this = right;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
const G4Element& G4Element::operator=(const G4Element& right)
{
if (this != &right)
{
fName = right.fName;
fSymbol = right.fSymbol;
fZeff = right.fZeff;
fNeff = right.fNeff;
fAeff = right.fAeff;
fNbOfAtomicShells = right.fNbOfAtomicShells;
fAtomicShells = right.fAtomicShells;
fNumberOfIsotopes = right.fNumberOfIsotopes;
theIsotopeVector = right.theIsotopeVector;
fRelativeAbundanceVector = right.fRelativeAbundanceVector;
fIndexInTable = right.fIndexInTable;
fCoulomb = right.fCoulomb;
fRadTsai = right.fRadTsai;
fIonisation = right.fIonisation;
}
return *this;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4int G4Element::operator==(const G4Element &right) const
{
return (this == (G4Element *) &right);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4int G4Element::operator!=(const G4Element &right) const
{
return (this != (G4Element *) &right);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
void G4Element::ComputeDerivedQuantities()
{
// some basic functions of the atomic number
@@ -215,7 +167,8 @@ void G4Element::ComputeDerivedQuantities()
ComputeCoulombFactor();
ComputeLradTsaiFactor();
// parameters for energy loss by ionisation
// parameters for energy loss by ionisation
if (fIonisation) delete fIonisation;
fIonisation = new G4IonisParamElm(fZeff);
}
@@ -266,6 +219,70 @@ G4double G4Element::GetAtomicShell(G4int i) const
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4Element::G4Element(G4Element& right)
{
InitializePointers();
*this = right;
// Store this new element in table and set the index
theElementTable.insert(this);
fIndexInTable = theElementTable.index(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
const G4Element& G4Element::operator=(const G4Element& right)
{
if (this != &right)
{
fName = right.fName;
fSymbol = right.fSymbol;
fZeff = right.fZeff;
fNeff = right.fNeff;
fAeff = right.fAeff;
if (fAtomicShells) delete [] fAtomicShells;
fNbOfAtomicShells = right.fNbOfAtomicShells;
fAtomicShells = new G4double[fNbOfAtomicShells];
for (G4int i=0;i<fNbOfAtomicShells;i++)
fAtomicShells[i] = right.fAtomicShells[i];
if (theIsotopeVector) delete theIsotopeVector;
if (fRelativeAbundanceVector) delete [] fRelativeAbundanceVector;
fNumberOfIsotopes = right.fNumberOfIsotopes;
if (fNumberOfIsotopes > 0)
{
theIsotopeVector = new G4IsotopeVector(fNumberOfIsotopes);
fRelativeAbundanceVector = new G4double[fNumberOfIsotopes];
for (G4int i=0;i<fNumberOfIsotopes;i++)
{
(*theIsotopeVector)[i] = (*right.theIsotopeVector)[i];
fRelativeAbundanceVector[i] = right.fRelativeAbundanceVector[i];
}
}
ComputeDerivedQuantities();
fIndexInTable = right.fIndexInTable;
}
return *this;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4int G4Element::operator==(const G4Element& right) const
{
return (this == (G4Element*) &right);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4int G4Element::operator!=(const G4Element& right) const
{
return (this != (G4Element*) &right);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4std::ostream& operator<<(G4std::ostream& flux, G4Element* element)
{
long mode = flux.setf(G4std::ios::fixed,G4std::ios::floatfield);
@@ -307,5 +324,6 @@ G4std::ostream& operator<<(G4std::ostream& flux, G4ElementTable ElementTable)
<< G4endl << G4endl;
return flux;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
+41 -11
View File
@@ -5,14 +5,15 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4IonisParamElm.cc,v 1.3 1999/12/15 14:50:51 gunter Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4IonisParamElm.cc,v 1.6 2001/03/12 17:48:48 maire Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ------------ class G4IonisParamElm ------------
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//
// 08-03-01, correct handling of fShellCorrectionVector. M.Maire
// 22-11-00, tabulation of ionisation potential from
// the ICRU Report N#37. V.Ivanchenko
// 09-07-98, data moved from G4Element. M.Maire
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
@@ -32,8 +33,29 @@ G4IonisParamElm::G4IonisParamElm(G4double Z)
fZZ3 = pow(fZ*(fZ+1.), 1./3.);
flogZ3 = log(fZ)/3.;
// parameters for energy loss by ionisation
fMeanExcitationEnergy = 16.*pow(fZ,0.9)*eV;
// Parameters for energy loss by ionisation
// Mean excitation energy
// from "Stopping Powers for Electrons and Positrons"
// ICRU Report N#37, 1984 (energy in eV)
static double exc[100] = {
21.8, 20.9, 13.3, 15.9, 15.2, 13.0, 11.7, 11.9, 11.5, 13.7,
13.6, 13.0, 12.8, 12.4, 11.5, 11.3, 10.2, 10.4, 10.0, 9.6,
10.3, 10.6, 10.7, 10.7, 10.9, 11.0, 11.0, 11.1, 11.1, 11.0,
10.8, 10.4, 10.5, 10.2, 9.8, 9.8, 9.8, 9.6, 9.7, 9.8,
10.2, 10.1, 10.0, 10.0, 10.0, 10.2, 10.0, 9.8, 10.0, 9.8,
9.5, 9.3, 9.3, 8.9, 8.9, 8.8, 8.8, 8.8, 9.1, 9.1,
9.2, 9.3, 9.2, 9.2, 9.4, 9.5, 9.7, 9.7, 9.8, 9.8,
9.8, 9.8, 9.8, 9.8, 9.8, 9.8, 9.8, 10.1, 10.0, 10.0,
10.0, 10.0, 9.9, 9.9, 9.7, 9.2, 9.5, 9.4, 9.4, 9.4,
9.6, 9.7, 9.7, 9.8, 9.8, 9.8, 9.8, 9.9, 9.9, 9.9 };
G4int iz = (G4int)Z - 1 ;
if(0 > iz) iz = 0;
if(98 < iz) iz = 98 ;
fMeanExcitationEnergy =
fZ * (exc[iz] + (fZ - (G4double)(iz))*(exc[iz+1] - exc[iz])) * eV ;
fTau0 = 0.1*fZ3*MeV/proton_mass_c2;
fTaul = 2.*MeV/proton_mass_c2;
@@ -61,13 +83,15 @@ G4IonisParamElm::G4IonisParamElm(G4double Z)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4IonisParamElm::~G4IonisParamElm()
{ }
{
if (fShellCorrectionVector) delete [] fShellCorrectionVector;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4IonisParamElm::G4IonisParamElm(G4IonisParamElm& right)
{
*this = right;
*this = right;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
@@ -87,21 +111,27 @@ const G4IonisParamElm& G4IonisParamElm::operator=(const G4IonisParamElm& right)
fBlow = right.fBlow;
fClow = right.fClow;
fMeanExcitationEnergy = right.fMeanExcitationEnergy;
fShellCorrectionVector = right.fShellCorrectionVector;
if (fShellCorrectionVector) delete [] fShellCorrectionVector;
fShellCorrectionVector = new G4double[3];
fShellCorrectionVector[0] = right.fShellCorrectionVector[0];
fShellCorrectionVector[1] = right.fShellCorrectionVector[1];
fShellCorrectionVector[2] = right.fShellCorrectionVector[2];
}
return *this;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4int G4IonisParamElm::operator==(const G4IonisParamElm &right) const
G4int G4IonisParamElm::operator==(const G4IonisParamElm& right) const
{
return (this == (G4IonisParamElm *) &right);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4int G4IonisParamElm::operator!=(const G4IonisParamElm &right) const
G4int G4IonisParamElm::operator!=(const G4IonisParamElm& right) const
{
return (this != (G4IonisParamElm *) &right);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
+37 -30
View File
@@ -5,12 +5,14 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4IonisParamMat.cc,v 1.3 1999/12/15 14:50:51 gunter Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4IonisParamMat.cc,v 1.6 2001/03/12 17:48:48 maire Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
// 08-02-01, fShellCorrectionVector correctly handled (mma)
// 16-01-01, bug corrected in ComputeDensityEffect() E100eV (L.Urban)
// 18-07-98, bug corrected in ComputeDensityEffect() for gas
// 09-07-98, data moved from G4Material, M.Maire
@@ -46,7 +48,6 @@ void G4IonisParamMat::ComputeMeanParameters()
fLogMeanExcEnergy /= fMaterial->GetTotNbOfElectPerVolume();
fMeanExcitationEnergy = exp(fLogMeanExcEnergy);
fShellCorrectionVector = new G4double[3];
for (G4int j=0; j<=2; j++)
@@ -84,12 +85,12 @@ void G4IonisParamMat::ComputeDensityEffect()
if ((State == kStateSolid)||(State == kStateLiquid)) {
const G4double E100keV = 100.*keV;
const G4double E100eV = 100.*eV;
const G4double ClimiS[] = {3.681 , 5.215 };
const G4double X0valS[] = {1.0 , 1.5 };
const G4double X1valS[] = {2.0 , 3.0 };
if(fMeanExcitationEnergy < E100keV) icase = 0 ;
if(fMeanExcitationEnergy < E100eV) icase = 0 ;
else icase = 1 ;
if(fCdensity < ClimiS[icase]) fX0density = 0.2;
@@ -176,13 +177,15 @@ void G4IonisParamMat::ComputeFluctModel()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4IonisParamMat::~G4IonisParamMat()
{ }
{
if (fShellCorrectionVector) delete [] fShellCorrectionVector;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4IonisParamMat::G4IonisParamMat(const G4IonisParamMat &right)
G4IonisParamMat::G4IonisParamMat(const G4IonisParamMat& right)
{
*this = right;
*this = right;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
@@ -191,40 +194,44 @@ const G4IonisParamMat& G4IonisParamMat::operator=(const G4IonisParamMat& right)
{
if (this != &right)
{
fMaterial = right.fMaterial;
fMeanExcitationEnergy = right.fMeanExcitationEnergy;
fLogMeanExcEnergy = right.fLogMeanExcEnergy;
fShellCorrectionVector = right.fShellCorrectionVector;
fTaul = right.fTaul;
fCdensity = right.fCdensity;
fMdensity = right.fMdensity;
fAdensity = right.fAdensity;
fX0density = right.fX0density;
fX1density = right.fX1density;
fF1fluct = right.fF1fluct;
fF2fluct = right.fF2fluct;
fEnergy1fluct = right.fEnergy1fluct;
fLogEnergy1fluct = right.fLogEnergy1fluct;
fEnergy2fluct = right.fEnergy2fluct;
fLogEnergy2fluct = right.fLogEnergy2fluct;
fEnergy0fluct = right.fEnergy0fluct;
fRateionexcfluct = right.fRateionexcfluct;
fMaterial = right.fMaterial;
fMeanExcitationEnergy = right.fMeanExcitationEnergy;
fLogMeanExcEnergy = right.fLogMeanExcEnergy;
if (fShellCorrectionVector) delete [] fShellCorrectionVector;
fShellCorrectionVector = new G4double[3];
fShellCorrectionVector[0] = right.fShellCorrectionVector[0];
fShellCorrectionVector[1] = right.fShellCorrectionVector[1];
fShellCorrectionVector[2] = right.fShellCorrectionVector[2];
fTaul = right.fTaul;
fCdensity = right.fCdensity;
fMdensity = right.fMdensity;
fAdensity = right.fAdensity;
fX0density = right.fX0density;
fX1density = right.fX1density;
fF1fluct = right.fF1fluct;
fF2fluct = right.fF2fluct;
fEnergy1fluct = right.fEnergy1fluct;
fLogEnergy1fluct = right.fLogEnergy1fluct;
fEnergy2fluct = right.fEnergy2fluct;
fLogEnergy2fluct = right.fLogEnergy2fluct;
fEnergy0fluct = right.fEnergy0fluct;
fRateionexcfluct = right.fRateionexcfluct;
}
return *this;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4int G4IonisParamMat::operator==(const G4IonisParamMat &right) const
G4int G4IonisParamMat::operator==(const G4IonisParamMat& right) const
{
return (this == (G4IonisParamMat *) &right);
return (this == (G4IonisParamMat*) &right);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4int G4IonisParamMat::operator!=(const G4IonisParamMat &right) const
G4int G4IonisParamMat::operator!=(const G4IonisParamMat& right) const
{
return (this != (G4IonisParamMat *) &right);
return (this != (G4IonisParamMat*) &right);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
+15 -21
View File
@@ -5,24 +5,13 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Isotope.cc,v 1.2 1999/12/15 14:50:51 gunter Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
// For information related to this code contact:
// CERN, CN Division, ASD Group
//
// ---------- class G4Isotope ---------
//
// Torre Wenaus, November 1995
// $Id: G4Isotope.cc,v 1.3 2001/03/12 17:48:49 maire Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
// 26-06-96, Code uses operators (+=, *=, ++, -> etc.) correctly, P. Urban
// 29-01-97, Forbidden to create Isotope with Z<1 or N<Z, M.Maire
// 29-01-97: Forbidden to create Isotope with Z<1 or N<Z, M.Maire
// 26-06-96: Code uses operators (+=, *=, ++, -> etc.) correctly, P. Urban
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
@@ -53,14 +42,18 @@ G4Isotope::~G4Isotope() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4Isotope::G4Isotope(G4Isotope &right)
G4Isotope::G4Isotope(G4Isotope& right)
{
*this = right;
*this = right;
//insert this new isotope in table
theIsotopeTable.insert(this);
fIndexInTable = theIsotopeTable.index(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4Isotope & G4Isotope::operator=(const G4Isotope &right)
G4Isotope & G4Isotope::operator=(const G4Isotope& right)
{
if (this != &right)
{
@@ -68,8 +61,7 @@ G4Isotope & G4Isotope::operator=(const G4Isotope &right)
fZ = right.fZ;
fN = right.fZ;
fA = right.fA;
theIsotopeTable = right.theIsotopeTable;
fIndexInTable = right.fIndexInTable;
fIndexInTable = theIsotopeTable.index(this);
}
return *this;
}
@@ -125,4 +117,6 @@ G4std::ostream& operator<<(G4std::ostream& flux, G4IsotopeTable IsotopeTable)
for (G4int i=0; i<IsotopeTable.length(); i++) flux << IsotopeTable[i] << G4endl;
return flux;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4MPVEntry.cc,v 1.5 1999/12/15 14:50:51 gunter Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
////////////////////////////////////////////////////////////////////////
+70 -21
View File
@@ -5,13 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Material.cc,v 1.6 1999/12/15 14:50:51 gunter Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// ---------- class G4Material ----------
//
// Torre Wenaus, November 1995
// $Id: G4Material.cc,v 1.8 2001/03/12 17:48:49 maire Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//
@@ -35,6 +30,9 @@
// 18-11-98, new interface to SandiaTable
// 19-01-99 enlarge tolerance on test of coherence of gas conditions
// 19-07-99, Constructors with chemicalFormula added by V.Ivanchenko
// 16-01-01, Nuclear interaction length, M.Maire
// 12-03-01, G4bool fImplicitElement;
// copy constructor and assignement operator revised (mma)
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
@@ -73,7 +71,8 @@ G4Material::G4Material(const G4String& name, G4double z,
// Initialize theElementVector allocating one
// element corresponding to this material
maxNbComponents = fNumberOfComponents = fNumberOfElements = 1;
maxNbComponents = fNumberOfComponents = fNumberOfElements = 1;
fImplicitElement = true;
theElementVector = new G4ElementVector(1);
theElementVector[0] = new G4Element(name, " ", z, a);
fMassFractionVector = new G4double[1];
@@ -121,6 +120,7 @@ G4Material::G4Material(const G4String& name, G4double density, G4int nComponents
maxNbComponents = nComponents;
fNumberOfComponents = fNumberOfElements = 0;
fImplicitElement = false;
theElementVector = new G4ElementVector(maxNbComponents);
if (fState == kStateUndefined)
@@ -157,7 +157,8 @@ G4Material::G4Material(const G4String& name, const G4String& chFormula,
// Initialize theElementVector allocating one
// element corresponding to this material
maxNbComponents = fNumberOfComponents = fNumberOfElements = 1;
maxNbComponents = fNumberOfComponents = fNumberOfElements = 1;
fImplicitElement = true;
theElementVector = new G4ElementVector(1);
theElementVector[0] = new G4Element(name, " ", z, a);
fMassFractionVector = new G4double[1];
@@ -206,6 +207,7 @@ G4Material::G4Material(const G4String& name, const G4String& chFormula,
maxNbComponents = nComponents;
fNumberOfComponents = fNumberOfElements = 0;
fImplicitElement = false;
theElementVector = new G4ElementVector(maxNbComponents);
if (fState == kStateUndefined)
@@ -381,6 +383,7 @@ void G4Material::ComputeDerivedQuantities()
// Atoms density vector, Electrons density
G4double Zi, Ai;
TotNbOfAtomsPerVolume = 0.;
if (VecNbOfAtomsPerVolume) delete [] VecNbOfAtomsPerVolume;
VecNbOfAtomsPerVolume = new G4double[fNumberOfElements];
TotNbOfElectPerVolume = 0.;
for (G4int i=0;i<fNumberOfElements;i++) {
@@ -407,8 +410,11 @@ void G4Material::ComputeDerivedQuantities()
}
ComputeRadiationLength();
ComputeNuclearInterLength();
if (fIonisation) delete fIonisation;
fIonisation = new G4IonisParamMat(this);
if (fSandiaTable) delete fSandiaTable;
fSandiaTable = new G4SandiaTable(this);
}
@@ -425,6 +431,20 @@ void G4Material::ComputeRadiationLength()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
void G4Material::ComputeNuclearInterLength()
{
const G4double lambda0 = 35*g/cm2;
G4double NILinv = 0.0;
for (G4int i=0;i<fNumberOfElements;i++) {
NILinv +=
VecNbOfAtomsPerVolume[i]*pow(((*theElementVector)[i]->GetN()),2./3.);
}
NILinv *= amu/lambda0;
fNuclInterLen = (NILinv <= 0.0 ? DBL_MAX : 1./NILinv);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
void G4Material::InitializePointers()
{
theElementVector = NULL;
@@ -441,6 +461,7 @@ void G4Material::InitializePointers()
G4Material::~G4Material()
{
if (fImplicitElement) delete ((*theElementVector)[0]);
if (theElementVector) delete theElementVector;
if (fMassFractionVector) delete [] fMassFractionVector;
if (fAtomsVector) delete [] fAtomsVector;
@@ -453,7 +474,12 @@ G4Material::~G4Material()
G4Material::G4Material(const G4Material& right)
{
InitializePointers();
*this = right;
// Store this new material in the table of Materials
theMaterialTable.insert(this);
fIndexInTable = theMaterialTable.index(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
@@ -468,20 +494,43 @@ const G4Material& G4Material::operator=(const G4Material& right)
fState = right.fState;
fTemp = right.fTemp;
fPressure = right.fPressure;
if (fImplicitElement) delete ((*theElementVector)[0]);
if (theElementVector) delete theElementVector;
if (fMassFractionVector) delete [] fMassFractionVector;
if (fAtomsVector) delete [] fAtomsVector;
maxNbComponents = right.maxNbComponents;
fNumberOfComponents = right.fNumberOfComponents;
fNumberOfElements = right.fNumberOfElements;
theElementVector = right.theElementVector;
fMassFractionVector = right.fMassFractionVector;
fAtomsVector = right.fAtomsVector;
fNumberOfElements = right.fNumberOfElements;
fImplicitElement = right.fImplicitElement;
if (fImplicitElement) {
G4double z = (*right.theElementVector)[0]->GetZ();
G4double a = (*right.theElementVector)[0]->GetA();
theElementVector = new G4ElementVector(1);
theElementVector[0] = new G4Element(fName," ",z,a);
fMassFractionVector = new G4double[1];
fMassFractionVector[0] = 1.;
} else {
theElementVector = new G4ElementVector(fNumberOfElements);
fMassFractionVector = new G4double[fNumberOfElements];
for (G4int i=0; i<fNumberOfElements; i++) {
(*theElementVector)[i]= (*right.theElementVector)[i];
fMassFractionVector[i]= right.fMassFractionVector[i];
}
}
if (right.fAtomsVector) {
fAtomsVector = new G4int[fNumberOfElements];
for (G4int i=0; i<fNumberOfElements; i++)
fAtomsVector[i] = right.fAtomsVector[i];
}
fMaterialPropertiesTable = right.fMaterialPropertiesTable;
fIndexInTable = right.fIndexInTable;
VecNbOfAtomsPerVolume = right.VecNbOfAtomsPerVolume;
TotNbOfAtomsPerVolume = right.TotNbOfAtomsPerVolume;
TotNbOfElectPerVolume = right.TotNbOfElectPerVolume;
fRadlen = right.fRadlen;
fIonisation = right.fIonisation;
fSandiaTable = right.fSandiaTable;
ComputeDerivedQuantities();
fIndexInTable = right.fIndexInTable;
}
return *this;
}
@@ -518,7 +567,7 @@ G4std::ostream& operator<<(G4std::ostream& flux, G4Material* material)
<< (material->fPressure)/atmosphere << " atm"
<< " RadLength: " << G4std::setw(7) << G4std::setprecision(3)
<< G4BestUnit(material->fRadlen,"Length");
for (G4int i=0; i<material->fNumberOfElements; i++)
flux
<< "\n ---> " << (*(material->theElementVector))[i]
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4MaterialPropertiesTable.cc,v 1.9 2000/03/03 10:21:02 maire Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
////////////////////////////////////////////////////////////////////////
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4MaterialPropertyVector.cc,v 1.5 1999/12/15 14:50:51 gunter Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
////////////////////////////////////////////////////////////////////////
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpticalSurface.cc,v 1.4 1999/12/15 14:50:51 gunter Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
////////////////////////////////////////////////////////////////////////
+85 -46
View File
@@ -5,11 +5,15 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4SandiaTable.cc,v 1.6 2000/08/03 14:28:31 grichine Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4SandiaTable.cc,v 1.10 2001/04/03 12:32:54 maire Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//
// 03.04.01 fnulcof returned if energy < emin
// 22.02.01 GetsandiaCofForMaterial(energy) return 0 below lowest interval mma
// 16.02.01 adapted for STL. mma
// 31.01.01 redesign of ComputeMatSandiaMatrix(). mma
// 18.11.98 simplified public interface; new methods for materials. mma
// 10.06.97 created. V. Grichine
//
@@ -31,6 +35,8 @@ G4SandiaTable::G4SandiaTable(G4int matIndex)
fPhotoAbsorptionCof = 0 ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4SandiaTable::G4SandiaTable(G4Material* material)
:fMaterial(material)
{
@@ -41,17 +47,21 @@ G4SandiaTable::G4SandiaTable(G4Material* material)
fCumulInterval[Z] = fCumulInterval[Z-1] + fNbOfIntervals[Z];
//compute macroscopic Sandia coefs for a material
ComputeMatSandiaMatrix();
ComputeMatSandiaMatrix();
//initialisation of fnulcof
fnulcof[0] = fnulcof[1] = fnulcof[2] = fnulcof[3] = 0.;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4SandiaTable::~G4SandiaTable()
{
if(fMatSandiaMatrix) delete fMatSandiaMatrix ;
if(fMatSandiaMatrix) delete fMatSandiaMatrix;
if(fPhotoAbsorptionCof)
{
for(G4int i = 0 ; i < fMaxInterval ; i++) delete[] fPhotoAbsorptionCof[i] ;
for(G4int i = 0 ; i < fMaxInterval ; i++) delete[] fPhotoAbsorptionCof[i];
delete fPhotoAbsorptionCof ;
}
}
@@ -65,58 +75,85 @@ void G4SandiaTable::ComputeMatSandiaMatrix()
const G4ElementVector* ElementVector = fMaterial->GetElementVector();
G4int* Z = new G4int[NbElm]; //Atomic number
//determine the total number of energy-intervals for this material
fMatNbOfIntervals = 0;
//
//determine the maximum number of energy-intervals for this material
//
G4int MaxIntervals = 0;
G4int elm;
for (elm=0; elm<NbElm; elm++)
{ Z[elm] = (int)(*ElementVector)(elm)->GetZ();
fMatNbOfIntervals += fNbOfIntervals[Z[elm]];
MaxIntervals += fNbOfIntervals[Z[elm]];
}
//create the sandia matrix for this material
fMatSandiaMatrix = new G4OrderedTable(fMatNbOfIntervals);
G4int interval;
for (interval=0; interval<fMatNbOfIntervals; interval++)
(*fMatSandiaMatrix)(interval) = new G4ValVector(5);
//copy the Energy bins (take care of the Ionization Potential)
G4double Ebin;
interval=0;
//
//copy the Energy bins in a tmp1 array
//(take care of the Ionization Potential of each element)
//
G4double* tmp1 = new G4double[MaxIntervals];
G4double IonizationPot;
G4int interval1=0;
for (elm=0; elm<NbElm; elm++)
for (G4int row=fCumulInterval[Z[elm]-1];row<fCumulInterval[Z[elm]];row++)
{ Ebin = fSandiaTable[row][0]*keV;
if ((row==fCumulInterval[Z[elm]-1])&&(GetIonizationPot(Z[elm])<Ebin))
Ebin = GetIonizationPot(Z[elm]);
(*(*fMatSandiaMatrix)(interval++))(0) = Ebin;
}
//sort the energies in increasing values
G4double tmp;
for (G4int i1=0; i1<fMatNbOfIntervals; i1++)
for (G4int i2=i1+1; i2<fMatNbOfIntervals; i2++)
{if ((*(*fMatSandiaMatrix)(i1))(0) > (*(*fMatSandiaMatrix)(i2))(0))
{
tmp = (*(*fMatSandiaMatrix)(i1))(0);
(*(*fMatSandiaMatrix)(i1))(0) = (*(*fMatSandiaMatrix)(i2))(0);
(*(*fMatSandiaMatrix)(i2))(0) = tmp;
}
}
{ IonizationPot = GetIonizationPot(Z[elm]);
for (G4int row=fCumulInterval[Z[elm]-1];row<fCumulInterval[Z[elm]];row++)
tmp1[interval1++] = G4std::max(fSandiaTable[row][0]*keV,IonizationPot);
}
//
//sort the energies in strickly increasing values in a tmp2 array
//(eliminate redondances)
//
G4double* tmp2 = new G4double[MaxIntervals];
G4double Emin;
G4int interval2 = 0;
do {
Emin = DBL_MAX;
for (G4int i1=0; i1<MaxIntervals; i1++)
if (tmp1[i1] < Emin) Emin = tmp1[i1]; //find the minimum
if (Emin < DBL_MAX) tmp2[interval2++] = Emin; //copy Emin in tmp2
for (G4int j1=0; j1<MaxIntervals; j1++)
if (tmp1[j1] <= Emin) tmp1[j1] = DBL_MAX; //eliminate from tmp1
} while (Emin < DBL_MAX);
//
//create the sandia matrix for this material
//
fMatSandiaMatrix = new G4OrderedTable();
G4int interval;
for (interval=0; interval<interval2; interval++)
fMatSandiaMatrix->push_back(new G4DataVector(5));
//
//ready to compute the Sandia coefs for the material
//
const G4double* NbOfAtomsPerVolume = fMaterial->GetVecNbOfAtomsPerVolume();
for (interval=0; interval<fMatNbOfIntervals; interval++)
const G4double prec = 1.e-03*eV;
G4double coef, oldsum(0.), newsum(0.);
fMatNbOfIntervals = 0;
for (interval=0; interval<interval2; interval++)
{
Ebin = (*(*fMatSandiaMatrix)(interval))(0);
Emin = (*(*fMatSandiaMatrix)[fMatNbOfIntervals])[0] = tmp2[interval];
for (G4int k=1; k<5; k++)(*(*fMatSandiaMatrix)[fMatNbOfIntervals])[k]=0.;
newsum = 0.;
for (elm=0; elm<NbElm; elm++)
{
GetSandiaCofPerAtom(Z[elm], Ebin);
GetSandiaCofPerAtom(Z[elm], Emin+prec);
for (G4int j=1; j<5; j++)
(*(*fMatSandiaMatrix)(interval))(j) += NbOfAtomsPerVolume[elm]*
fSandiaCofPerAtom[j-1];
}
{
coef = NbOfAtomsPerVolume[elm]*fSandiaCofPerAtom[j-1];
(*(*fMatSandiaMatrix)[fMatNbOfIntervals])[j] += coef;
newsum += abs(coef);
}
}
//check for null or redondant intervals
if (newsum != oldsum) { oldsum = newsum; fMatNbOfIntervals++;}
}
delete [] Z;
delete Z; delete tmp1; delete tmp2;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
@@ -124,16 +161,18 @@ void G4SandiaTable::ComputeMatSandiaMatrix()
G4double G4SandiaTable::GetSandiaCofForMaterial(G4int interval, G4int j)
{
assert (interval>=0 && interval<fMatNbOfIntervals && j>=0 && j<5);
return ((*(*fMatSandiaMatrix)(interval))(j));
return ((*(*fMatSandiaMatrix)[interval])[j]);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4double* G4SandiaTable::GetSandiaCofForMaterial(G4double energy)
{
if (energy < (*(*fMatSandiaMatrix)[0])[0]) return fnulcof;
G4int interval = fMatNbOfIntervals - 1;
while ((interval>0)&&(energy<(*(*fMatSandiaMatrix)(interval))(0))) interval--;
return &((*(*fMatSandiaMatrix)(interval))(1));
while ((interval>0)&&(energy<(*(*fMatSandiaMatrix)[interval])[0])) interval--;
return &((*(*fMatSandiaMatrix)[interval])[1]);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....