Import Geant4 4.0.0 source tree
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user