Import Geant4 4.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:18:25 +02:00
parent 36c080dca6
commit 921d3b1cda
3990 changed files with 185376 additions and 82884 deletions
+2 -2
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4AtomicShells.hh,v 1.3.4.1 2001/06/28 19:10:28 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4AtomicShells.hh,v 1.4 2001/07/11 10:01:24 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// class description
//
+139 -117
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Element.hh,v 1.8.2.1 2001/06/28 19:10:28 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4Element.hh,v 1.15 2001/10/17 14:02:15 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// class description
@@ -45,7 +45,7 @@
// in volume definitions via the G4Material class.
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// 09-07-96, new data members added by L.Urban
// 17-01-97, aesthetic rearrangement, M.Maire
@@ -61,169 +61,191 @@
// 04-08-98, new method GetElement(elementName), M.Maire
// 16-11-98, Subshell -> Shell, mma
// 30-03-01, suppression of the warning message in GetElement
// 17-07-01, migration to STL, M. Verderi
// 13-09-01, stl migration. Suppression of the data member fIndexInTable
// 14-09-01, fCountUse: nb of materials which use this element
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef G4ELEMENT_HH
#define G4ELEMENT_HH
#include "G4ios.hh"
#include "g4rw/tpvector.h"
#include "g4rw/tpordvec.h"
#include "globals.hh"
#include "g4std/vector"
#include "G4ios.hh"
#include "G4Isotope.hh"
#include "G4AtomicShells.hh"
#include "G4IonisParamElm.hh"
#include "G4IsotopeVector.hh"
#include "G4ElementTable.hh"
typedef G4RWTPtrVector<G4Isotope> G4IsotopeVector;
class G4Element; //forward declaration
typedef G4RWTPtrOrderedVector<G4Element> G4ElementTable;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4Element
{
public: // with description
//
// Constructor to Build an element directly; no reference to isotopes
//
G4Element(const G4String& name, //its name
const G4String& symbol, //its symbol
G4double Zeff, //atomic number
G4double Aeff); //mass of mole
//
// Constructor to Build an element from isotopes via AddIsotope
//
G4Element(const G4String& name, //its name
const G4String& symbol, //its symbol
G4int nbIsotopes); //nb of isotopes
//
// Constructor to Build an element directly; no reference to isotopes
//
G4Element(const G4String& name, //its name
const G4String& symbol, //its symbol
G4double Zeff, //atomic number
G4double Aeff); //mass of mole
//
// Constructor to Build an element from isotopes via AddIsotope
//
G4Element(const G4String& name, //its name
const G4String& symbol, //its symbol
G4int nbIsotopes); //nb of isotopes
//
// Add an isotope to the element
//
void AddIsotope(G4Isotope* isotope, //isotope
G4double RelativeAbundance); //fraction of nb of
//atomes per volume
virtual ~G4Element();
//
// Add an isotope to the element
//
void AddIsotope(G4Isotope* isotope, //isotope
G4double RelativeAbundance); //fraction of nb of
//atomes per volume
virtual ~G4Element();
//
// retrieval methods
//
G4String GetName() const {return fName;};
G4String GetSymbol() const {return fSymbol;};
G4double GetZ() const {return fZeff;}; //atomic number
G4double GetN() const {return fNeff;}; //number of nucleons
G4double GetA() const {return fAeff;}; //mass of a mole
//the number of atomic shells in this element:
//
G4int GetNbOfAtomicShells() const {return fNbOfAtomicShells;};
//the binding energy of the shell:
//
G4double GetAtomicShell(G4int) const;
//number of isotopes constituing this element:
//
size_t GetNumberOfIsotopes() const {return fNumberOfIsotopes;};
//
// retrieval methods
//
G4String GetName() const {return fName;};
G4String GetSymbol() const {return fSymbol;};
G4double GetZ() const {return fZeff;}; //atomic number
G4double GetN() const {return fNeff;}; //number of nucleons
G4double GetA() const {return fAeff;}; //mass of a mole
//vector of pointers to isotopes constituing this element:
//
G4IsotopeVector* GetIsotopeVector() const {return theIsotopeVector;};
//the number of atomic shells in this element:
G4int GetNbOfAtomicShells() const {return fNbOfAtomicShells;};
//the binding energy of the shell :
G4double GetAtomicShell(G4int) const;
//vector of relative abundance of each isotope:
//
G4double* GetRelativeAbundanceVector() const
{return fRelativeAbundanceVector;};
//number of isotopes constituing this element:
size_t GetNumberOfIsotopes() const {return fNumberOfIsotopes;};
//vector of pointers to isotopes constituing this element:
G4IsotopeVector* GetIsotopeVector() const {return theIsotopeVector;};
//vector of relative abundance of each isotope:
G4double* GetRelativeAbundanceVector() const {return fRelativeAbundanceVector;};
const G4Isotope* GetIsotope(G4int iso) const {return (*theIsotopeVector)[iso];};
const G4Isotope* GetIsotope(G4int iso) const
{return (*theIsotopeVector)[iso];};
//the (static) Table of Elements:
static const G4ElementTable* GetElementTable() {return &theElementTable;};
static size_t GetNumberOfElements() {return theElementTable.length();};
//the index of this element in the Table:
size_t GetIndex() const {return fIndexInTable;};
//the (static) Table of Elements:
//
static
const G4ElementTable* GetElementTable();
static
size_t GetNumberOfElements();
//the index of this element in the Table:
//
size_t GetIndex() const;
//return pointer to an element, given its name:
static G4Element* GetElement(G4String name);
//return pointer to an element, given its name:
//
static
G4Element* GetElement(G4String name);
//count number of materials which use this element
//
G4int GetCountUse() const {return fCountUse;};
void increaseCountUse() {fCountUse++;};
void decreaseCountUse() {fCountUse--;};
//Coulomb correction factor:
//
G4double GetfCoulomb() const {return fCoulomb;};
//Tsai formula for the radiation length:
//
G4double GetfRadTsai() const {return fRadTsai;};
//Coulomb correction factor:
G4double GetfCoulomb() const {return fCoulomb;};
//pointer to ionisation parameters:
//
G4IonisParamElm* GetIonisation() const {return fIonisation;};
//Tsai formula for the radiation length:
G4double GetfRadTsai() const {return fRadTsai;};
//pointer to ionisation parameters:
G4IonisParamElm* GetIonisation() const {return fIonisation;};
//
// printing methods
//
friend G4std::ostream& operator<<(G4std::ostream&, G4Element*);
friend G4std::ostream& operator<<(G4std::ostream&, G4Element&);
friend G4std::ostream& operator<<(G4std::ostream&, G4ElementTable);
// printing methods
//
friend G4std::ostream& operator<<(G4std::ostream&, G4Element*);
friend G4std::ostream& operator<<(G4std::ostream&, G4Element&);
friend G4std::ostream& operator<<(G4std::ostream&, G4ElementTable);
public: // without description
G4int operator==(const G4Element&) const;
G4int operator!=(const G4Element&) const;
G4int operator==(const G4Element&) const;
G4int operator!=(const G4Element&) const;
private:
G4Element(G4Element&);
const G4Element & operator=(const G4Element&);
G4Element(G4Element&);
const G4Element & operator=(const G4Element&);
private:
void InitializePointers();
void ComputeDerivedQuantities();
void ComputeCoulombFactor();
void ComputeLradTsaiFactor();
void InitializePointers();
void ComputeDerivedQuantities();
void ComputeCoulombFactor();
void ComputeLradTsaiFactor();
private:
//
// Basic data members (which define an Element)
//
G4String fName; // name
G4String fSymbol; // symbol
G4double fZeff; // Effective atomic number
G4double fNeff; // Effective number of nucleons
G4double fAeff; // Effective mass of a mole
G4String fName; // name
G4String fSymbol; // symbol
G4double fZeff; // Effective atomic number
G4double fNeff; // Effective number of nucleons
G4double fAeff; // Effective mass of a mole
G4int fNbOfAtomicShells; // number of atomic shells
G4double* fAtomicShells ; // Pointer to atomic shell binding energies
G4int fNbOfAtomicShells; // number of atomic shells
G4double* fAtomicShells ; // Pointer to atomic shell binding energies
// Isotope vector contains constituent isotopes of the element
size_t fNumberOfIsotopes; // Number of isotopes added to the element
G4IsotopeVector* theIsotopeVector;
G4double* fRelativeAbundanceVector; // Fraction of nb of atomes per volume
// for each constituent
// Set up the static Table of Elements
static G4ElementTable theElementTable;
size_t fIndexInTable; // Position of the element in the table
// Isotope vector contains constituent isotopes of the element
size_t fNumberOfIsotopes; // Number of isotopes added to the element
G4IsotopeVector* theIsotopeVector;
G4double* fRelativeAbundanceVector; // Fraction nb of atomes per volume
// for each constituent
G4int fCountUse; // nb of materials which use this element
// Set up the static Table of Elements
static G4ElementTable theElementTable;
//
// Derived data members (computed from the basic data members)
//
G4double fCoulomb; // Coulomb correction factor
G4double fRadTsai; // Tsai formula for the radiation length
G4IonisParamElm* fIonisation; // Pointer to ionisation parameters
G4double fCoulomb; // Coulomb correction factor
G4double fRadTsai; // Tsai formula for the radiation length
G4IonisParamElm* fIonisation; // Pointer to ionisation parameters
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline
G4Element* G4Element::GetElement(G4String elementName)
size_t G4Element::GetIndex() const
{
// search the element by its name
for (size_t J=0 ; J<theElementTable.length() ; J++)
{
if(theElementTable[J]->GetName() == elementName)
return theElementTable[J];
}
// the element does not exist in the table
return NULL;
// return the index of this Element in theElementTable
//
size_t J=0, Jmax=theElementTable.size();
while ((J<Jmax)&&(theElementTable[J] != this)) J++;
if (J==Jmax) G4Exception("G4Element::GetIndex() Element not in ElementTable");
return J;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
+5 -3
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ElementTable.hh,v 1.2.4.2 2001/06/28 20:18:54 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4ElementTable.hh,v 1.4 2001/10/17 14:02:15 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// ------------------------------------------------------------
@@ -36,6 +36,8 @@
#ifndef G4ELEMENTTABLE_HH
#define G4ELEMENTTABLE_HH
#include "G4Element.hh"
class G4Element;
typedef G4std::vector<G4Element*> G4ElementTable;
#endif
+6 -3
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ElementVector.hh,v 1.2.4.2 2001/06/28 20:18:55 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4ElementVector.hh,v 1.4 2001/10/17 07:59:52 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// ------------------------------------------------------------
@@ -36,6 +36,9 @@
#ifndef G4ELEMENTVECTOR_HH
#define G4ELEMENTVECTOR_HH
#include "G4Material.hh"
#include "g4std/vector"
#include "G4Element.hh"
typedef G4std::vector<G4Element*> G4ElementVector;
#endif
+2 -2
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4IonisParamElm.hh,v 1.5.2.1 2001/06/28 19:10:28 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4IonisParamElm.hh,v 1.6 2001/07/11 10:01:25 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// class description
+2 -2
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4IonisParamMat.hh,v 1.5.2.1 2001/06/28 19:10:28 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4IonisParamMat.hh,v 1.6 2001/07/11 10:01:25 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// class description
+40 -29
View File
@@ -21,10 +21,10 @@
// ********************************************************************
//
//
// $Id: G4Isotope.hh,v 1.7.2.1 2001/06/28 19:10:28 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4Isotope.hh,v 1.13 2001/10/17 07:59:52 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// class description
//
@@ -39,26 +39,27 @@
// Isotopes can be assembled into elements via the G4Element class.
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// 30.03.01: suppression of the warnig message in GetIsotope
// 14.09.01: fCountUse: nb of elements which use this isotope
// 13.09.01: stl migration. Suppression of the data member fIndexInTable
// 30.03.01: suppression of the warning message in GetIsotope
// 04.08.98: new method GetIsotope(isotopeName) (mma)
// 17.01.97: aesthetic rearrangement (mma)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef G4ISOTOPE_HH
#define G4ISOTOPE_HH
#include "G4ios.hh"
#include "g4rw/tpordvec.h"
#include "globals.hh"
#include "G4ios.hh"
#include "g4std/vector"
class G4Isotope;
typedef G4RWTPtrOrderedVector<G4Isotope> G4IsotopeTable;
typedef G4std::vector<G4Isotope*> G4IsotopeTable;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo......
class G4Isotope
{
@@ -70,20 +71,28 @@ class G4Isotope
G4int n, //number of nucleons
G4double a); //mass of mole
virtual ~G4Isotope();
virtual ~G4Isotope();
// Retrieval methods
G4String GetName() const {return fName;};
G4int GetZ() const {return fZ;};
G4int GetN() const {return fN;};
G4double GetA() const {return fA;};
size_t GetIndex() const {return fIndexInTable;};
static G4Isotope* GetIsotope(G4String name);
G4int GetCountUse() const {return fCountUse;};
void increaseCountUse() {fCountUse++;};
void decreaseCountUse() {fCountUse--;};
static
const G4IsotopeTable* GetIsotopeTable() {return &theIsotopeTable;};
static size_t GetNumberOfIsotopes() {return theIsotopeTable.length();};
static
G4Isotope* GetIsotope(G4String name);
static const
G4IsotopeTable* GetIsotopeTable();
static
size_t GetNumberOfIsotopes();
size_t GetIndex() const;
friend
G4std::ostream& operator<<(G4std::ostream&, G4Isotope*);
@@ -110,26 +119,28 @@ class G4Isotope
G4int fZ; // atomic number
G4int fN; // number of nucleons
G4double fA; // mass of a mole
G4int fCountUse; // nb of elements which use this isotope
static
G4IsotopeTable theIsotopeTable;
size_t fIndexInTable; // index in the Isotope Table
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline
G4Isotope* G4Isotope::GetIsotope(G4String isotopeName)
size_t G4Isotope::GetIndex() const
{
// search the isotope by its name
for (size_t J=0 ; J<theIsotopeTable.length() ; J++)
{
if(theIsotopeTable[J]->GetName() == isotopeName)
return theIsotopeTable[J];
}
// the isotope does not exist in the table
return NULL;
// return the index of this isotope in theIsotopeTable
//
size_t J=0, Jmax=theIsotopeTable.size();
while ((J<Jmax)&&(theIsotopeTable[J] != this)) J++;
if (J==Jmax) G4Exception("G4Isotope::GetIndex() Isotope not in IsotopeTable");
return J;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
+6 -3
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4IsotopeVector.hh,v 1.2.4.2 2001/06/28 20:18:55 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4IsotopeVector.hh,v 1.4 2001/10/17 07:59:52 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// ------------------------------------------------------------
@@ -36,6 +36,9 @@
#ifndef G4ISOTOPEVECTOR_HH
#define G4ISOTOPEVECTOR_HH
#include "G4Element.hh"
#include "g4std/vector"
#include "G4Isotope.hh"
typedef G4std::vector<G4Isotope*> G4IsotopeVector;
#endif
+2 -2
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4MPVEntry.hh,v 1.4.4.1 2001/06/28 19:10:29 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4MPVEntry.hh,v 1.5 2001/07/11 10:01:26 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
////////////////////////////////////////////////////////////////////////
+223 -220
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Material.hh,v 1.11.2.1 2001/06/28 19:10:29 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4Material.hh,v 1.19 2001/10/31 12:56:12 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// class description
@@ -46,7 +46,7 @@
// materials (an ordered vector of materials).
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// 10-07-96, new data members added by L.Urban
// 12-12-96, new data members added by L.Urban
@@ -71,288 +71,291 @@
// 19-07-99, new data member (chemicalFormula) added by V.Ivanchenko
// 12-03-01, G4bool fImplicitElement (mma)
// 30-03-01, suppression of the warning message in GetMaterial
// 17-07-01, migration to STL. M. Verderi.
// 14-09-01, Suppression of the data member fIndexInTable
// 31-10-01, new function SetChemicalFormula() (mma)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef G4MATERIAL_HH
#define G4MATERIAL_HH
#include "G4ios.hh"
#include "g4rw/tpvector.h"
#include "g4rw/tpordvec.h"
#include "globals.hh"
#include "G4ios.hh"
#include "g4std/vector"
#include "G4Element.hh"
#include "G4MaterialPropertiesTable.hh"
#include "G4IonisParamMat.hh"
#include "G4SandiaTable.hh"
typedef G4RWTPtrVector<G4Element> G4ElementVector;
class G4Material; //forward declaration
typedef G4RWTPtrOrderedVector<G4Material> G4MaterialTable;
#include "G4ElementVector.hh"
#include "G4MaterialTable.hh"
enum G4State { kStateUndefined, kStateSolid, kStateLiquid, kStateGas };
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4Material
{
public: // with description
//
// Constructor to create a material from scratch.
//
G4Material(const G4String& name, //its name
G4double z, //atomic number
G4double a, //mass of mole
G4double density, //density
G4State state = kStateUndefined, //solid,liqid,gas
G4double temp = STP_Temperature, //temperature
G4double pressure = STP_Pressure); //pressure
//
// Constructor to create a material from scratch.
//
G4Material(const G4String& name, //its name
G4double z, //atomic number
G4double a, //mass of mole
G4double density, //density
G4State state = kStateUndefined, //solid,gas
G4double temp = STP_Temperature, //temperature
G4double pressure = STP_Pressure); //pressure
//
// Constructor to create a material from a combination of elements
// and/or materials subsequently added via AddElement and/or AddMaterial
//
G4Material(const G4String& name, //its name
G4double density, //density
G4int nComponents, //nb of components
G4State state = kStateUndefined, //solid,liquid,gas
G4double temp = STP_Temperature, //temperature
G4double pressure = STP_Pressure); //pressure
//
// Constructor to create a material from a combination of elements
// and/or materials subsequently added via AddElement and/or AddMaterial
//
G4Material(const G4String& name, //its name
G4double density, //density
G4int nComponents, //nbOfComponents
G4State state = kStateUndefined, //solid,gas
G4double temp = STP_Temperature, //temperature
G4double pressure = STP_Pressure); //pressure
//
// Constructor to create a material with chemical formula from scratch.
//
G4Material(const G4String& name, //its name
const G4String& chFormula, //chemical formula
G4double z, //atomic number
G4double a, //mass of mole
G4double density, //density
G4State state = kStateUndefined, //solid,liqid,gas
G4double temp = STP_Temperature, //temperature
G4double pressure = STP_Pressure); //pressure
//
// Constructor to create a material with chemical formula from scratch.
//
G4Material(const G4String& name, //its name
const G4String& chFormula, //chemicalFormul
G4double z, //atomic number
G4double a, //mass of mole
G4double density, //density
G4State state = kStateUndefined, //solid,gas
G4double temp = STP_Temperature, //temperature
G4double pressure = STP_Pressure); //pressure
//
// Constructor to create a material with chemical formula from a
// combination of elements and/or materials subsequently added via
// AddElement and/or AddMaterial
//
G4Material(const G4String& name, //its name
const G4String& chFormula, //chemical formula
G4double density, //density
G4int nComponents, //nb of components
G4State state = kStateUndefined, //solid,liquid,gas
G4double temp = STP_Temperature, //temperature
G4double pressure = STP_Pressure); //pressure
//
// Constructor to create a material with chemical formula from a
// combination of elements and/or materials subsequently added via
// AddElement and/or AddMaterial
//
G4Material(const G4String& name, //its name
const G4String& chFormula, //chemicalFormul
G4double density, //density
G4int nComponents, //nbOfComponents
G4State state = kStateUndefined, //solid,gas
G4double temp = STP_Temperature, //temperature
G4double pressure = STP_Pressure); //pressure
//
// Add an element, giving number of atoms
//
void AddElement(G4Element* element, //the element
G4int nAtoms); //nb of atoms in a molecule
//
// Add an element or material, giving fraction of mass
//
void AddElement (G4Element* element , //the element
G4double fraction); //fraction of mass
//
// Add an element, giving number of atoms
//
void AddElement(G4Element* element, //the element
G4int nAtoms); //nb of atoms in
// a molecule
//
// Add an element or material, giving fraction of mass
//
void AddElement (G4Element* element , //the element
G4double fraction); //fractionOfMass
void AddMaterial(G4Material* material, //the material
G4double fraction); //fraction of mass
void AddMaterial(G4Material* material, //the material
G4double fraction); //fractionOfMass
virtual ~G4Material();
//
// retrieval methods
//
G4String GetName() const {return fName;};
G4String GetChemicalFormula() const {return fChemicalFormula;};
G4double GetDensity() const {return fDensity;};
virtual ~G4Material();
void SetChemicalFormula(const G4String& chF) {fChemicalFormula=chF;};
//
// retrieval methods
//
G4String GetName() const {return fName;};
G4String GetChemicalFormula() const {return fChemicalFormula;};
G4double GetDensity() const {return fDensity;};
G4State GetState() const {return fState;};
G4double GetTemperature() const {return fTemp;};
G4double GetPressure() const {return fPressure;};
G4State GetState() const {return fState;};
G4double GetTemperature() const {return fTemp;};
G4double GetPressure() const {return fPressure;};
//number of elements constituing this material:
size_t GetNumberOfElements() const {return fNumberOfElements;};
//number of elements constituing this material:
size_t GetNumberOfElements() const {return fNumberOfElements;};
//vector of pointers to elements constituing this material:
const
G4ElementVector* GetElementVector() const {return theElementVector;};
//vector of pointers to elements constituing this material:
const
G4ElementVector* GetElementVector() const {return theElementVector;};
//vector of fractional mass of each element:
const G4double* GetFractionVector() const {return fMassFractionVector;};
//vector of fractional mass of each element:
const G4double* GetFractionVector() const {return fMassFractionVector;};
//vector of atom count of each element:
const G4int* GetAtomsVector() const {return fAtomsVector;};
//vector of atom count of each element:
const G4int* GetAtomsVector() const {return fAtomsVector;};
//return a pointer to an element, given its index in the material:
const
G4Element* GetElement(G4int iel) const {return (*theElementVector)[iel];};
//vector of nb of atoms per volume of each element in this material:
const
G4double* GetVecNbOfAtomsPerVolume() const {return VecNbOfAtomsPerVolume;};
//total number of atoms per volume:
G4double GetTotNbOfAtomsPerVolume() const {return TotNbOfAtomsPerVolume;};
//total number of electrons per volume:
G4double GetTotNbOfElectPerVolume() const {return TotNbOfElectPerVolume;};
//return a pointer to an element, given its index in the material:
const
G4Element* GetElement(G4int iel) const {return (*theElementVector)[iel];};
//vector of nb of atoms per volume of each element in this material:
const
G4double* GetVecNbOfAtomsPerVolume() const {return VecNbOfAtomsPerVolume;};
//total number of atoms per volume:
G4double GetTotNbOfAtomsPerVolume() const {return TotNbOfAtomsPerVolume;};
//total number of electrons per volume:
G4double GetTotNbOfElectPerVolume() const {return TotNbOfElectPerVolume;};
//obsolete names (5-10-98) see the 2 functions above
const
G4double* GetAtomicNumDensityVector() const {return VecNbOfAtomsPerVolume;};
G4double GetElectronDensity() const {return TotNbOfElectPerVolume;};
//obsolete names (5-10-98) see the 2 functions above
const
G4double* GetAtomicNumDensityVector() const {return VecNbOfAtomsPerVolume;};
G4double GetElectronDensity() const {return TotNbOfElectPerVolume;};
// Radiation length:
G4double GetRadlen() const {return fRadlen;};
// Radiation length:
G4double GetRadlen() const {return fRadlen;};
// Nuclear interaction length:
G4double GetNuclearInterLength() const {return fNuclInterLen;};
// Nuclear interaction length:
G4double GetNuclearInterLength() const {return fNuclInterLen;};
// ionisation parameters:
G4IonisParamMat* GetIonisation() const {return fIonisation;};
// Sandia table:
G4SandiaTable* GetSandiaTable() const {return fSandiaTable;};
//meaningful only for single material:
G4double GetZ() const;
G4double GetA() const;
//the MaterialPropertiesTable (if any) attached to this material:
void SetMaterialPropertiesTable(G4MaterialPropertiesTable* anMPT)
{fMaterialPropertiesTable = anMPT;};
G4MaterialPropertiesTable* GetMaterialPropertiesTable() const
{return fMaterialPropertiesTable;};
// ionisation parameters:
G4IonisParamMat* GetIonisation() const {return fIonisation;};
// Sandia table:
G4SandiaTable* GetSandiaTable() const {return fSandiaTable;};
//meaningful only for single material:
G4double GetZ() const;
G4double GetA() const;
//the MaterialPropertiesTable (if any) attached to this material:
void SetMaterialPropertiesTable(G4MaterialPropertiesTable* anMPT)
{fMaterialPropertiesTable = anMPT;};
G4MaterialPropertiesTable* GetMaterialPropertiesTable() const
{return fMaterialPropertiesTable;};
//the (static) Table of Materials:
static
const G4MaterialTable* GetMaterialTable() {return &theMaterialTable;};
static
size_t GetNumberOfMaterials() {return theMaterialTable.length();};
//the index of this material in the Table:
size_t GetIndex() const {return fIndexInTable;};
//the (static) Table of Materials:
//
static
const G4MaterialTable* GetMaterialTable();
static
size_t GetNumberOfMaterials();
//the index of this material in the Table:
size_t GetIndex() const;
//return pointer to a material, given its name:
static G4Material* GetMaterial(G4String name);
//
//printing methods
//
friend G4std::ostream& operator<<(G4std::ostream&, G4Material*);
friend G4std::ostream& operator<<(G4std::ostream&, G4Material&);
friend G4std::ostream& operator<<(G4std::ostream&, G4MaterialTable);
//return pointer to a material, given its name:
static G4Material* GetMaterial(G4String name);
//
//printing methods
//
friend G4std::ostream& operator<<(G4std::ostream&, G4Material*);
friend G4std::ostream& operator<<(G4std::ostream&, G4Material&);
friend G4std::ostream& operator<<(G4std::ostream&, G4MaterialTable);
public: // without description
G4int operator==(const G4Material&) const;
G4int operator!=(const G4Material&) const;
G4int operator==(const G4Material&) const;
G4int operator!=(const G4Material&) const;
private:
G4Material(const G4Material&);
const G4Material& operator=(const G4Material&);
G4Material(const G4Material&);
const G4Material& operator=(const G4Material&);
void InitializePointers();
// Header routine for all derived quantities
void ComputeDerivedQuantities();
// Compute Radiation length
void ComputeRadiationLength();
// Compute Nuclear interaction length
void ComputeNuclearInterLength();
private:
//
// Basic data members ( To define a material)
//
G4String fName; // Material name
G4String fChemicalFormula; // Material chemical formula
G4double fDensity; // Material density
void InitializePointers();
G4State fState; // Material state (defaults to undefined,
// determined internally based on density)
G4double fTemp; // Temperature (defaults to STP)
G4double fPressure; // Pressure (defaults to STP)
// Header routine for all derived quantities
void ComputeDerivedQuantities();
G4int maxNbComponents; // total number of components in the material
size_t fNumberOfComponents; // Number of components declared so far
size_t fNumberOfElements; // Number of Elements in the material
G4ElementVector* theElementVector; // vector of constituent Elements
G4bool fImplicitElement; // implicit Element created by this?
G4double* fMassFractionVector; // composition by fractional mass
G4int* fAtomsVector; // composition by atom count
G4MaterialPropertiesTable* fMaterialPropertiesTable;
static
G4MaterialTable theMaterialTable; // the material table
size_t fIndexInTable; // Index of material in the material table
//
// Derived data members (computed from the basic data members)
//
// some general atomic properties
// Compute Radiation length
void ComputeRadiationLength();
// Compute Nuclear interaction length
void ComputeNuclearInterLength();
G4double* VecNbOfAtomsPerVolume; // vector of nb of atoms per volume
G4double TotNbOfAtomsPerVolume; // total nb of atoms per volume
G4double TotNbOfElectPerVolume; // total nb of electrons per volume
G4double fRadlen; // Radiation length
G4double fNuclInterLen; // Nuclear interaction length
G4IonisParamMat* fIonisation; // ionisation parameters
G4SandiaTable* fSandiaTable; // Sandia table
private:
//
// Basic data members ( To define a material)
//
G4String fName; // Material name
G4String fChemicalFormula; // Material chemical formula
G4double fDensity; // Material density
G4State fState; // Material state (determined
// internally based on density)
G4double fTemp; // Temperature (defaults: STP)
G4double fPressure; // Pressure (defaults: STP)
G4int maxNbComponents; // totalNbOfComponentsInTheMaterial
size_t fNumberOfComponents; // Nb of components declared so far
size_t fNumberOfElements; // Nb of Elements in the material
G4ElementVector* theElementVector; // vector of constituent Elements
G4bool fImplicitElement; // implicit Element created by this?
G4double* fMassFractionVector; // composition by fractional mass
G4int* fAtomsVector; // composition by atom count
G4MaterialPropertiesTable* fMaterialPropertiesTable;
static
G4MaterialTable theMaterialTable; // the material table
//
// Derived data members (computed from the basic data members)
//
// some general atomic properties
G4double* VecNbOfAtomsPerVolume; // vector of nb of atoms per volume
G4double TotNbOfAtomsPerVolume; // total nb of atoms per volume
G4double TotNbOfElectPerVolume; // total nb of electrons per volume
G4double fRadlen; // Radiation length
G4double fNuclInterLen; // Nuclear interaction length
G4IonisParamMat* fIonisation; // ionisation parameters
G4SandiaTable* fSandiaTable; // Sandia table
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
inline
G4Material* G4Material::GetMaterial(G4String materialName)
{
// search the material by its name
for (size_t J=0 ; J<theMaterialTable.length() ; J++)
{
if(theMaterialTable[J]->GetName() == materialName)
return theMaterialTable[J];
}
// the material does not exist in the table
return NULL;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline
G4double G4Material::GetZ() const
{
if (fNumberOfElements > 1) {
G4cerr << "WARNING in GetZ. The material: " << fName << " is a mixture." << G4endl;
G4cerr << "WARNING in GetZ. The material: " << fName << " is a mixture."
<< G4endl;
G4Exception ( " the Atomic number is not well defined." );
}
return (*theElementVector)(0)->GetZ();
return (*theElementVector)[0]->GetZ();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline
G4double G4Material::GetA() const
{
if (fNumberOfElements > 1) {
G4cerr << "WARNING in GetA. The material: " << fName << " is a mixture." << G4endl;
G4cerr << "WARNING in GetA. The material: " << fName << " is a mixture."
<< G4endl;
G4Exception ( " the Atomic mass is not well defined." );
}
return (*theElementVector)(0)->GetA();
return (*theElementVector)[0]->GetA();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline
size_t G4Material::GetIndex() const
{
// return the index of this Material in theMaterialTable
//
size_t J=0, Jmax=theMaterialTable.size();
while ((J<Jmax)&&(theMaterialTable[J] != this)) J++;
if (J==Jmax) G4Exception("G4Material::GetIndex() not in MaterialTable");
return J;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4MaterialPropertiesTable.hh,v 1.9.4.1 2001/06/28 19:10:29 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4MaterialPropertiesTable.hh,v 1.10 2001/07/11 10:01:26 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
////////////////////////////////////////////////////////////////////////
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4MaterialPropertyVector.hh,v 1.4.4.1 2001/06/28 19:10:29 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4MaterialPropertyVector.hh,v 1.6 2001/07/17 15:54:39 verderi Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
////////////////////////////////////////////////////////////////////////
@@ -50,9 +50,8 @@
// Includes
/////////////
#include "g4rw/tpsrtvec.h"
#include "g4rw/cstring.h"
#include "G4MPVEntry.hh"
#include "g4std/vector"
// Class Description:
// A one-to-one mapping from Photon Momentum to some optical property.
@@ -156,7 +155,8 @@ private:
// Private Data Members
/////////////////////////
G4RWTPtrSortedVector<G4MPVEntry> MPV;
//G4RWTPtrSortedVector<G4MPVEntry> MPV;
G4std::vector<G4MPVEntry*> MPV;
G4int NumEntries;
G4int CurrentEntry;
};
@@ -168,25 +168,25 @@ private:
inline
G4double G4MaterialPropertyVector::GetMaxProperty() const
{
return MPV.last()->GetProperty();
return MPV.back()->GetProperty();
}
inline
G4double G4MaterialPropertyVector::GetMinProperty() const
{
return MPV.first()->GetProperty();
return MPV.front()->GetProperty();
}
inline
G4double G4MaterialPropertyVector::GetMaxPhotonMomentum() const
{
return MPV.last()->GetPhotonMomentum();
return MPV.back()->GetPhotonMomentum();
}
inline
G4double G4MaterialPropertyVector::GetMinPhotonMomentum() const
{
return MPV.first()->GetPhotonMomentum();
return MPV.front()->GetPhotonMomentum();
}
#endif /* G4MaterialPropertyVector_h */
+5 -3
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4MaterialTable.hh,v 1.2.4.2 2001/06/28 20:18:55 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4MaterialTable.hh,v 1.4 2001/10/17 14:02:16 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// ------------------------------------------------------------
@@ -36,6 +36,8 @@
#ifndef G4MATERIALTABLE_HH
#define G4MATERIALTABLE_HH
#include "G4Material.hh"
class G4Material;
typedef G4std::vector<G4Material*> G4MaterialTable;
#endif
+2 -2
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4OpticalSurface.hh,v 1.4.10.1 2001/06/28 19:10:29 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4OpticalSurface.hh,v 1.5 2001/07/11 10:01:26 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
////////////////////////////////////////////////////////////////////////
+2 -76
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4SandiaTable.hh,v 1.8.2.1 2001/06/28 19:10:29 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4SandiaTable.hh,v 1.10 2001/10/17 07:59:52 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-00 $
// class description
//
@@ -146,80 +146,6 @@ private:
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
// Inline function implementations
inline
G4int G4SandiaTable::GetNbOfIntervals(G4int Z)
{
return fNbOfIntervals[Z];
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
inline
G4double G4SandiaTable::GetSandiaCofPerAtom(G4int Z, G4int interval, G4int j)
{
assert (Z>0 && Z<101 && interval>=0 && interval<fNbOfIntervals[Z]
&& j>=0 && j<5);
G4int row = fCumulInterval[Z-1] + interval;
if (j==0) return fSandiaTable[row][0]*keV;
G4double AoverAvo = Z*amu/fZtoAratio[Z];
return AoverAvo*(fSandiaTable[row][j]*cm2*pow(keV,G4double(j))/g);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
inline
G4double* G4SandiaTable::GetSandiaCofPerAtom(G4int Z, G4double energy)
{
assert (Z > 0);
G4double Emin = fSandiaTable[fCumulInterval[Z-1]][0]*keV;
G4double Iopot = fIonizationPotentials[Z]*eV;
if (Iopot > Emin) Emin = Iopot;
G4int interval = fNbOfIntervals[Z] - 1;
G4int row = fCumulInterval[Z-1] + interval;
while ((interval>0) && (energy<fSandiaTable[row][0]*keV))
row = fCumulInterval[Z-1] + --interval;
if (energy >= Emin)
{
G4double AoverAvo = Z*amu/fZtoAratio[Z];
fSandiaCofPerAtom[0]=AoverAvo*(fSandiaTable[row][1]*cm2*keV/g);
fSandiaCofPerAtom[1]=AoverAvo*(fSandiaTable[row][2]*cm2*keV*keV/g);
fSandiaCofPerAtom[2]=AoverAvo*(fSandiaTable[row][3]*cm2*keV*keV*keV/g);
fSandiaCofPerAtom[3]=AoverAvo*(fSandiaTable[row][4]*cm2*keV*keV*keV*keV/g);
}
else
fSandiaCofPerAtom[0] = fSandiaCofPerAtom[1] = fSandiaCofPerAtom[2] =
fSandiaCofPerAtom[3] = 0.;
return fSandiaCofPerAtom;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
inline
G4double G4SandiaTable::GetIonizationPot(G4int Z)
{
return fIonizationPotentials[Z]*eV;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
inline
G4double G4SandiaTable::GetZtoA(G4int Z)
{
return fZtoAratio[Z];
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
///////////////////////////////////////////////////////////////////////
//
// Inline methods for PAI model
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4StaticSandiaData.hh,v 1.4.4.1 2001/06/28 19:10:29 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4StaticSandiaData.hh,v 1.5 2001/07/11 10:01:26 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....