Import Geant4 0.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-01 15:25:35 +02:00
parent 54d6b71f95
commit b97f8d0df7
3237 changed files with 807095 additions and 0 deletions
File diff suppressed because it is too large Load Diff
+201
View File
@@ -0,0 +1,201 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Element.hh,v 2.8 1998/11/16 17:26:43 maire Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ------------------- class G4Element -------------------
//
// Torre Wenaus, November 1995
//
// An element is a chemical element either directly defined in terms of
// its charactaristics: its name, symbol,
// Z (effective atomic number)
// N (effective number of nucleons)
// A (effective mass of a mole)
// or in terms of a collection of constituent isotopes with specified
// relative abundance (i.e. fraction of nb of atomes per volume).
//
// Quantities, with physical meaning or not, which are constant in a given
// element are computed and stored here as Derived data members.
//
// The class contains as a private static member the table of defined
// elements (an ordered vector of elements).
//
// Elements can be assembled singly or in mixtures into materials used
// in volume definitions via the G4Material class.
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
// 09-07-96, new data members added by L.Urban
// 17-01-97, aesthetic rearrangement, M.Maire
// 20-01-97, Tsai formula for the rad length, M.Maire
// 21-01-97, remove mixture flag, M.Maire
// 24-01-97, new data member: fTaul
// new method: ComputeIonisationPara, M.Maire
// 20-03-97, corrected initialization of pointers, M.Maire
// 27-06-97, new function GetIsotope(int), M.Maire
// 24-02-98, fWeightVector becomes fRelativeAbundanceVector
// 27-04-98, atomic shell stuff, V. Grichine
// 09-07-98, Ionisation parameters removed from the class, M.Maire
// 04-08-98, new method GetElement(elementName), M.Maire
// 16-11-98, Subshell -> Shell, mma
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
#ifndef G4ELEMENT_HH
#define G4ELEMENT_HH
#include "G4ios.hh"
#include <rw/tpvector.h>
#include <rw/tpordvec.h>
#include "globals.hh"
#include "G4Isotope.hh"
#include "G4AtomicShells.hh"
#include "G4IonisParamElm.hh"
typedef RWTPtrVector<G4Isotope> G4IsotopeVector;
class G4Element; //forward declaration
typedef RWTPtrOrderedVector<G4Element> G4ElementTable;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
class G4Element
{
public:
//
// 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
~G4Element();
//
// retrieval methods
//
G4String GetName() const {return fName;};
G4String GetSymbol() const {return fSymbol;};
G4double GetZ() const {return fZeff;};
G4double GetN() const {return fNeff;};
G4double GetA() const {return fAeff;};
G4int GetNbOfAtomicShells() const {return fNbOfAtomicShells;};
G4double GetAtomicShell(G4int) const;
G4IsotopeVector* GetIsotopeVector() const {return theIsotopeVector;};
size_t GetNumberOfIsotopes() const {return fNumberOfIsotopes;};
G4double* GetRelativeAbundanceVector() const {return fRelativeAbundanceVector;};
const G4Isotope* GetIsotope(G4int iso) const {return (*theIsotopeVector)[iso];};
static
const G4ElementTable* GetElementTable() {return &theElementTable;};
static
size_t GetNumberOfElements() {return theElementTable.length();};
size_t GetIndex() const {return fIndexInTable;};
static G4Element* GetElement(G4String name);
G4double GetfCoulomb() const {return fCoulomb;};
G4double GetfRadTsai() const {return fRadTsai;};
G4IonisParamElm* GetIonisation() const {return fIonisation;};
friend
ostream& operator<<(ostream&, G4Element*);
friend
ostream& operator<<(ostream&, G4Element&);
friend
ostream& operator<<(ostream&, G4ElementTable);
G4int operator==(const G4Element&) const;
G4int operator!=(const G4Element&) const;
private:
G4Element(G4Element &right);
const G4Element & operator=(const G4Element &right);
private:
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
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
//
// 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
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
inline
G4Element* G4Element::GetElement(G4String elementName)
{
// search the element by its name
for (G4int J=0 ; J<theElementTable.length() ; J++)
{
if(theElementTable[J]->GetName() == elementName)
return theElementTable[J];
}
G4cerr << " Warning from GetElement(name). The element: " << elementName
<< " does not exist in the ElementTable. Return NULL pointer \n";
return NULL;
}
#endif
+27
View File
@@ -0,0 +1,27 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ElementTable.hh,v 2.3 1998/07/12 03:00:29 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// ---------------- G4ElementTable ----------------
// History:
// First implementation: Torre Wenaus, November 1995
// ------------------------------------------------------------
#ifndef G4ELEMENTTABLE_HH
#define G4ELEMENTTABLE_HH
#include "G4Element.hh"
#endif
+27
View File
@@ -0,0 +1,27 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ElementVector.hh,v 2.3 1998/07/12 03:00:30 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// ---------------- G4ElementVector ----------------
// History:
// First implementation: Torre Wenaus, November 1995
// ------------------------------------------------------------
#ifndef G4ELEMENTVECTOR_HH
#define G4ELEMENTVECTOR_HH
#include "G4Material.hh"
#endif
@@ -0,0 +1,79 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4IonisParamElm.hh,v 2.3 1998/07/13 17:13:50 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ------------------- class G4IonisParamElm -------------------
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
// 09-07-98, data moved from G4Element. M.Maire
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
#ifndef G4IonisParamElm_HH
#define G4IonisParamElm_HH
#include "G4ios.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
class G4IonisParamElm
{
public:
G4IonisParamElm(G4double Z);
~G4IonisParamElm();
// retrieval methods
G4double GetZ() const {return fZ;};
G4double GetZ3() const {return fZ3;};
G4double GetZZ3() const {return fZZ3;};
G4double GetlogZ3() const {return flogZ3;};
G4double GetTau0() const {return fTau0;};
G4double GetTaul() const {return fTaul;};
G4double GetAlow() const {return fAlow;};
G4double GetBlow() const {return fBlow;};
G4double GetClow() const {return fClow;};
G4double GetMeanExcitationEnergy() const {return fMeanExcitationEnergy;};
G4double* GetShellCorrectionVector() const {return fShellCorrectionVector;};
G4int operator==(const G4IonisParamElm&) const;
G4int operator!=(const G4IonisParamElm&) const;
private:
G4IonisParamElm(G4IonisParamElm &right);
const G4IonisParamElm & operator=(const G4IonisParamElm &right);
private:
//
// data members
//
G4double fZ; // effective Z
G4double fZ3; // pow (Z,1/3)
G4double fZZ3; // pow (Z(Z+1),1/3)
G4double flogZ3; // log(Z)/3
// ------ ionisation loss ---------------------------------
G4double fTau0 ; // 0.1*pow(Z,1/3)*MeV/proton_mass_c2
G4double fTaul ; // 2*MeV/proton mass
G4double fBetheBlochLow; // Bethe-Bloch at fTaul*particle mass
G4double fAlow,fBlow,fClow; // parameters for the low energy ion.loss
G4double fMeanExcitationEnergy; // 16*pow(Z,0.9)*eV
G4double* fShellCorrectionVector; // shell correction coefficients
};
#endif
+106
View File
@@ -0,0 +1,106 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4IonisParamMat.hh,v 2.3 1998/07/13 17:13:51 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
// 09-07-98, data moved from G4Material, M.Maire
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
#ifndef G4IonisParamMat_HH
#define G4IonisParamMat_HH
#include "G4ios.hh"
#include "globals.hh"
class G4Material; // forward declaration
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
class G4IonisParamMat
{
public:
G4IonisParamMat(G4Material*);
~G4IonisParamMat();
//
// retrieval methods
//
G4double GetMeanExcitationEnergy() const {return fMeanExcitationEnergy;};
G4double GetLogMeanExcEnergy() const {return fLogMeanExcEnergy;};
G4double* GetShellCorrectionVector() const {return fShellCorrectionVector;};
G4double GetTaul() const {return fTaul;};
G4double GetCdensity() const {return fCdensity;};
G4double GetMdensity() const {return fMdensity;};
G4double GetAdensity() const {return fAdensity;};
G4double GetX0density() const {return fX0density;};
G4double GetX1density() const {return fX1density;};
G4double GetF1fluct() const {return fF1fluct;};
G4double GetF2fluct() const {return fF2fluct;};
G4double GetEnergy1fluct() const {return fEnergy1fluct;};
G4double GetLogEnergy1fluct() const {return fLogEnergy1fluct;};
G4double GetEnergy2fluct() const {return fEnergy2fluct;};
G4double GetLogEnergy2fluct() const {return fLogEnergy2fluct;};
G4double GetEnergy0fluct() const {return fEnergy0fluct;};
G4double GetRateionexcfluct() const {return fRateionexcfluct;};
G4int operator==(const G4IonisParamMat&) const;
G4int operator!=(const G4IonisParamMat&) const;
private:
G4IonisParamMat(const G4IonisParamMat&);
const G4IonisParamMat& operator=(const G4IonisParamMat&);
// Compute mean parameters : ExcitationEnergy,Shell corretion vector ...
void ComputeMeanParameters();
// Compute parameters for the density effect
void ComputeDensityEffect();
// Compute parameters for the energy fluctuation model
void ComputeFluctModel();
private:
//
// data members
//
G4Material* fMaterial; // this material
// parameters for energy loss calculation
G4double fMeanExcitationEnergy; //
G4double fLogMeanExcEnergy; //
G4double* fShellCorrectionVector; // shell correction coefficients
G4double fTaul; // lower limit of Bethe-Bloch formula
// parameters of the density correction....
G4double fCdensity; // mat.constant
G4double fMdensity; // exponent
G4double fAdensity; //
G4double fX0density; //
G4double fX1density; //
// parameters of the energy fluctuation model
G4double fF1fluct;
G4double fF2fluct;
G4double fEnergy1fluct;
G4double fLogEnergy1fluct;
G4double fEnergy2fluct;
G4double fLogEnergy2fluct;
G4double fEnergy0fluct;
G4double fRateionexcfluct;
};
#endif
+123
View File
@@ -0,0 +1,123 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Isotope.hh,v 2.5 1998/08/05 10:30:28 maire Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
//
// ----------------- class G4Isotope ------------------
//
// Torre Wenaus, November 1995
//
// An isotope is a chemical isotope defined by its name,
// Z (atomic number),
// N (number of nucleons),
// A (mass of a mole).
//
// The class contains as a private static member the table of defined
// isotopes (an ordered vector of isotopes).
//
// Isotopes can be assembled into elements via the G4Element class.
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
// 17-01-97, aesthetic rearrangement, M.Maire
// 04-08-98, new method GetIsotope(isotopeName), M.Maire
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
#ifndef G4ISOTOPE_HH
#define G4ISOTOPE_HH
#include "G4ios.hh"
#include <rw/tpordvec.h>
#include "globals.hh"
class G4Isotope;
typedef RWTPtrOrderedVector<G4Isotope> G4IsotopeTable;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
class G4Isotope
{
public:
// Make an isotope
G4Isotope(const G4String& name, //its name
G4int z, //atomic number
G4int n, //number of nucleons
G4double a); //mass of mole
~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);
static
const G4IsotopeTable* GetIsotopeTable() {return &theIsotopeTable;};
static size_t GetNumberOfIsotopes() {return theIsotopeTable.length();};
friend
ostream& operator<<(ostream&, G4Isotope*);
friend
ostream& operator<<(ostream&, G4Isotope&);
friend
ostream& operator<<(ostream&, G4IsotopeTable);
G4int operator==(const G4Isotope &right) const;
G4int operator!=(const G4Isotope &right) const;
private:
G4Isotope(G4Isotope &right);
G4Isotope & operator=(const G4Isotope &right);
private:
G4String fName; // name of the Isotope
G4int fZ; // atomic number
G4int fN; // number of nucleons
G4double fA; // mass of a mole
static
G4IsotopeTable theIsotopeTable;
size_t fIndexInTable; // index in the Isotope Table
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
inline
G4Isotope* G4Isotope::GetIsotope(G4String isotopeName)
{
// search the isotope by its name
for (G4int J=0 ; J<theIsotopeTable.length() ; J++)
{
if(theIsotopeTable[J]->GetName() == isotopeName)
return theIsotopeTable[J];
}
G4cerr << " Warning from GetIsotope(name). The isotope: " << isotopeName
<< " does not exist in the IsotopeTable. Return NULL pointer \n";
return NULL;
}
#endif
+27
View File
@@ -0,0 +1,27 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4IsotopeVector.hh,v 2.3 1998/07/12 03:00:33 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// ---------------- G4IsotopeVector ----------------
// History:
// First implementation: Torre Wenaus, November 1995
// ------------------------------------------------------------
#ifndef G4ISOTOPEVECTOR_HH
#define G4ISOTOPEVECTOR_HH
#include "G4Element.hh"
#endif
+115
View File
@@ -0,0 +1,115 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4MPVEntry.hh,v 2.1 1998/07/13 17:13:55 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
////////////////////////////////////////////////////////////////////////
// G4MPVEntry Class Definition
////////////////////////////////////////////////////////////////////////
//
// File: G4MPVEntry.hh
// Description: A G4MPVEntry is an MaterialPropertyVector Entry.
// One Material Property Vector contains many MPVEntries
// Version: 1.0
// Created: 1996-02-08
// Author: Juliet Armstrong
// Updated: 1997-03-25 by Peter Gumplinger
// > cosmetics (only)
// mail: gum@triumf.ca
//
////////////////////////////////////////////////////////////////////////
#ifndef G4MPVEntry_h
#define G4MPVEntry_h 1
/////////////
// Includes
/////////////
#include "G4ios.hh"
#include "globals.hh"
/////////////////////
// Class Definition
/////////////////////
class G4MPVEntry {
public:
//////////////
// Operators
//////////////G4MPVEntry.hh
// Well defined semantics for these operators
// required by RWTPtrSortedVector
G4bool operator <(const G4MPVEntry &right) const;
G4bool operator ==(const G4MPVEntry &right) const;
G4MPVEntry& operator =(const G4MPVEntry &right);
///////////////////////////////
// Constructor and Destructor
///////////////////////////////
G4MPVEntry(G4double aPhotonMomentum, G4double aPropertyValue);
G4MPVEntry(const G4MPVEntry &right);
~G4MPVEntry();
////////////
// Methods
////////////
G4double GetPhotonMomentum();
G4double GetProperty();
//////////
// Tests
//////////
void DumpEntry();
private:
/////////////////////////
// Private Data members
/////////////////////////
G4double thePhotonMomentum;
G4double theProperty;
};
////////////////////
// Inline methods
////////////////////
// GetPhotonMomentum
// -----------------
//
inline
G4double G4MPVEntry::GetPhotonMomentum()
{
return thePhotonMomentum;
}
// GetProperty
// -----------
//
inline
G4double G4MPVEntry::GetProperty()
{
return theProperty;
}
#endif /* G4MPVEntry_h */
+283
View File
@@ -0,0 +1,283 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Material.hh,v 2.10 1998/11/30 13:56:57 maire Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ------------------- class G4Material ---------------------
//
// Torre Wenaus, November 1995
//
// Materials defined via the G4Material class are used to define the
// composition of Geant volumes.
// a Material is always made of Elements. It can be defined directly
// from scratch (defined by a single element), specifying :
// its name,
// density,
// state informations,
// and Z,A of the underlying Element.
// or in terms of a collection of constituent Elements with specified weights
// (composition specified either by fractional mass or atom counts).
//
// Quantities, with physical meaning or not, which are constant in a given
// material are computed and stored here as Derived data members.
// The class contains as a private static member the table of defined
// materials (an ordered vector of materials).
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
// 10-07-96, new data members added by L.Urban
// 12-12-96, new data members added by L.Urban
// 20-01-97, aesthetic rearrangement. RadLength calculation modified
// Data members Zeff and Aeff REMOVED (i.e. passed to the Elements).
// (local definition of Zeff in DensityEffect and FluctModel...)
// Vacuum defined as a G4State. Mixture flag removed, M.Maire
// 29-01-97, State=Vacuum automatically set density=0 in the contructors.
// Subsequent protections have been put in the calculation of
// MeanExcEnergy, ShellCorrectionVector, DensityEffect, M.Maire
// 20-03-97, corrected initialization of pointers, M.Maire
// 10-06-97, new data member added by V.Grichine (fSandiaPhotoAbsCof)
// 27-06-97, new function GetElement(int), M.Maire
// 24-02-98, fFractionVector become fMassFractionVector
// 28-05-98, kState=kVacuum removed:
// The vacuum is an ordinary gas vith very low density, M.Maire
// 12-06-98, new method AddMaterial() allowing mixture of materials, M.Maire
// 09-07-98, Ionisation parameters removed from the class, M.Maire
// 04-08-98, new method GetMaterial(materialName), M.Maire
// 05-10-98, change name: NumDensity -> NbOfAtomsPerVolume
// 18-11-98, SandiaTable interface modified.
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
#ifndef G4MATERIAL_HH
#define G4MATERIAL_HH
#include "G4ios.hh"
#include <rw/tpvector.h>
#include <rw/tpordvec.h>
#include "globals.hh"
#include "G4Element.hh"
#include "G4MaterialPropertiesTable.hh"
#include "G4IonisParamMat.hh"
#include "G4SandiaTable.hh"
typedef RWTPtrVector<G4Element> G4ElementVector;
class G4Material; //forward declaration
typedef RWTPtrOrderedVector<G4Material> G4MaterialTable;
enum G4State { kStateUndefined, kStateSolid, kStateLiquid, kStateGas };
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
class G4Material
{
public:
//
// 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 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
//
// 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
void AddMaterial(G4Material* material, //the material
G4double fraction); //fraction of mass
~G4Material();
//
// retrieval methods
//
G4String GetName() const {return fName;};
G4double GetDensity() const {return fDensity;};
G4State GetState() const {return fState;};
G4double GetTemperature() const {return fTemp;};
G4double GetPressure() const {return fPressure;};
const
G4ElementVector* GetElementVector() const {return theElementVector;};
size_t GetNumberOfElements() const {return fNumberOfElements;};
const G4double* GetFractionVector() const {return fMassFractionVector;};
const G4int* GetAtomsVector() const {return fAtomsVector;};
const
G4Element* GetElement(G4int iel) const {return (*theElementVector)[iel];};
void SetMaterialPropertiesTable(G4MaterialPropertiesTable* anMPT)
{fMaterialPropertiesTable = anMPT;};
G4MaterialPropertiesTable* GetMaterialPropertiesTable() const
{return fMaterialPropertiesTable;};
static
const G4MaterialTable* GetMaterialTable() {return &theMaterialTable;};
static
size_t GetNumberOfMaterials() {return theMaterialTable.length();};
size_t GetIndex() const {return fIndexInTable;};
static G4Material* GetMaterial(G4String name);
const
G4double* GetVecNbOfAtomsPerVolume() const {return VecNbOfAtomsPerVolume;};
G4double GetTotNbOfAtomsPerVolume() const {return TotNbOfAtomsPerVolume;};
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;};
G4double GetRadlen() const {return fRadlen;};
G4IonisParamMat* GetIonisation() const {return fIonisation;};
G4SandiaTable* GetSandiaTable() const {return fSandiaTable;};
G4double GetZ() const;
G4double GetA() const;
friend
ostream& operator<<(ostream&, G4Material*);
friend
ostream& operator<<(ostream&, G4Material&);
friend
ostream& operator<<(ostream&, G4MaterialTable);
G4int operator==(const G4Material&) const;
G4int operator!=(const G4Material&) const;
private:
G4Material(const G4Material&);
const G4Material& operator=(const G4Material&);
void InitializePointers();
// Header routine for all derived quantities
void ComputeDerivedQuantities();
// Compute Radiation length
void ComputeRadiationLength();
private:
//
// Basic data members ( To define a material)
//
G4String fName; // Material name
G4double fDensity; // Material density
G4State fState; // Material state (defaults to undefined,
// determined internally based on density)
G4double fTemp; // Temperature (defaults to STP)
G4double fPressure; // Pressure (defaults to STP)
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
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
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
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 (G4int J=0 ; J<theMaterialTable.length() ; J++)
{
if(theMaterialTable[J]->GetName() == materialName)
return theMaterialTable[J];
}
G4cerr << " Warning from GetMaterial(name). The material: " << materialName
<< " does not exist in the MaterialTable. Return NULL pointer \n";
return NULL;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
inline
G4double G4Material::GetZ() const
{
if (fNumberOfElements > 1) {
G4cerr << "WARNING in GetZ. The material: " << fName << " is a mixture." << endl;
G4Exception ( " the Atomic number is not well defined." );
}
return (*theElementVector)(0)->GetZ();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
inline
G4double G4Material::GetA() const
{
if (fNumberOfElements > 1) {
G4cerr << "WARNING in GetA. The material: " << fName << " is a mixture." << endl;
G4Exception ( " the Atomic mass is not well defined." );
}
return (*theElementVector)(0)->GetA();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
#endif
@@ -0,0 +1,107 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4MaterialPropertiesTable.hh,v 2.0 1998/07/02 17:19:40 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
////////////////////////////////////////////////////////////////////////
// G4MaterialPropertiesTable Definition
////////////////////////////////////////////////////////////////////////
//
// File: G4MaterialPropertiesTable.hh
// Description: An Material properties table is a hash table, with
// key = property name, and value = G4MaterialPropertyVector
// Version: 1.0
// Created: 1996-02-08
// Author: Juliet Armstrong
// Updated: 1997-03-25 by Peter Gumplinger
// > cosmetics (only)
// mail: gum@triumf.ca
//
////////////////////////////////////////////////////////////////////////
#ifndef G4MaterialPropertiesTable_h
#define G4MaterialPropertiesTable_h 1
/////////////
// Includes
/////////////
#include <math.h>
#include <rw/tphdict.h>
#include <rw/cstring.h>
#include "globals.hh"
#include "G4MaterialPropertyVector.hh"
#define RefractionIndex "RINDEX"
// unsigned hashString(const G4String &str);
/////////////////////
// Class Definition
/////////////////////
class G4MaterialPropertiesTable {
public:
//////////////
// Operators
//////////////
G4MaterialPropertiesTable&
operator =(const G4MaterialPropertiesTable &right);
////////////////
// Constructor
////////////////
G4MaterialPropertiesTable();
G4MaterialPropertiesTable(const G4MaterialPropertiesTable &right);
///////////////
// Destructor
///////////////
~G4MaterialPropertiesTable();
////////////
// Methods
////////////
void AddProperty(char *key,
G4double *PhotonMomenta,
G4double *PropertyValues,
G4int NumEntries);
void AddProperty(char *key, G4MaterialPropertyVector *opv);
void RemoveProperty(char *key);
G4MaterialPropertyVector* GetProperty(char *key);
void AddEntry(char *key, G4double aPhotonMomentum,
G4double aPropertyValue);
void RemoveEntry(char *key, G4double aPhotonMomentum);
void DumpTable();
private:
/////////////////////////
// Private Data members
/////////////////////////
RWTPtrHashDictionary<G4String, G4MaterialPropertyVector> MPT;
RWTPtrHashDictionaryIterator<G4String, G4MaterialPropertyVector>
MPTiterator;
};
#endif /* G4MaterialPropertiesTable_h */
@@ -0,0 +1,157 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4MaterialPropertyVector.hh,v 2.0 1998/07/02 17:19:42 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
////////////////////////////////////////////////////////////////////////
// G4MaterialPropertyVector Class Definition
////////////////////////////////////////////////////////////////////////
//
// File: G4MaterialPropertyVector.hh
//
// Description: A one-to-one mapping from Photon Momentum to some
// optical property
// Version: 1.0
// Created: 1996-02-08
// Author: Juliet Armstrong
// Updated: 1997-03-25 by Peter Gumplinger
// > value.h -> templates.hh
// mail: gum@triumf.ca
//
////////////////////////////////////////////////////////////////////////
#ifndef G4MaterialPropertyVector_h
#define G4MaterialPropertyVector_h 1
/////////////
// Includes
/////////////
#include <rw/tpsrtvec.h>
#include <rw/cstring.h>
#include "G4MPVEntry.hh"
/////////////////////
// Class Definition
/////////////////////
class G4MaterialPropertyVector {
public:
//////////////
// Operators
//////////////
G4bool operator ++();
G4MaterialPropertyVector&
operator =(const G4MaterialPropertyVector &right);
/////////////////
// Constructors
/////////////////
G4MaterialPropertyVector() : MPV(0)
{
CurrentEntry = -1;
NumEntries = 0;
};
G4MaterialPropertyVector(G4double *PhotonMomenta,
G4double *PropertyValues,
G4int NumElements);
G4MaterialPropertyVector(const G4MaterialPropertyVector &right);
///////////////
// Destructor
///////////////
~G4MaterialPropertyVector();
////////////
// Methods
////////////
void ResetIterator();
void AddElement(G4double aPhotonMomentum,
G4double aPropertyValue);
void RemoveElement(G4double aPhotonMomentum);
G4double GetProperty(G4double aPhotonMomentum) const;
G4double GetPhotonMomentum(G4double aProperty) const;
// for use with G4MaterialPropertyVector iterator:
// return property (or Photon momentum) at current point
// of iterator
G4double GetProperty() const;
G4double GetPhotonMomentum() const;
G4double GetMaxProperty() const;
G4double GetMinProperty() const;
G4double GetMaxPhotonMomentum() const;
G4double GetMinPhotonMomentum() const;
//////////
// Tests
//////////
void DumpVector();
private:
/////////////////////
// Helper Functions
/////////////////////
G4MPVEntry GetEntry(G4int i) const;
void GetAdjacentBins(G4double aPhotonMomentum,
G4int *left,G4int *right) const;
/////////////////////////
// Private Data Members
/////////////////////////
RWTPtrSortedVector<G4MPVEntry> MPV;
G4int NumEntries;
G4int CurrentEntry;
};
///////////////////
// Inline methods
///////////////////
inline
G4double G4MaterialPropertyVector::GetMaxProperty() const
{
return MPV.last()->GetProperty();
}
inline
G4double G4MaterialPropertyVector::GetMinProperty() const
{
return MPV.first()->GetProperty();
}
inline
G4double G4MaterialPropertyVector::GetMaxPhotonMomentum() const
{
return MPV.last()->GetPhotonMomentum();
}
inline
G4double G4MaterialPropertyVector::GetMinPhotonMomentum() const
{
return MPV.first()->GetPhotonMomentum();
}
#endif /* G4MaterialPropertyVector_h */
+27
View File
@@ -0,0 +1,27 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4MaterialTable.hh,v 2.3 1998/07/12 03:00:35 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// ---------------- G4MaterialTable ----------------
// History:
// First implementation: Torre Wenaus, November 1995
// ------------------------------------------------------------
#ifndef G4MATERIALTABLE_HH
#define G4MATERIALTABLE_HH
#include "G4Material.hh"
#endif
@@ -0,0 +1,159 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpticalSurface.hh,v 2.0 1998/07/02 17:19:46 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
////////////////////////////////////////////////////////////////////////
// G4OpticalSurface Definition
////////////////////////////////////////////////////////////////////////
//
// File: G4OpticalSurface.hh
// Description: A optical surface class for use in G4OpBoundaryProcess
// Version: 2.0
// Created: 1997-06-26
// Author: Peter Gumplinger
// mail: gum@triumf.ca
//
// Cvs version:
////////////////////////////////////////////////////////////////////////
#ifndef G4OpticalSurface_h
#define G4OpticalSurface_h 1
/////////////
// Includes
/////////////
#include "globals.hh"
#include "templates.hh"
enum G4OpticalSurfaceFinish
{
polished, // smooth perfectly polished surface
polishedfrontpainted, // smooth top-layer (front) paint
polishedbackpainted, // same is 'polished' but with a back-paint
ground, // rough surface
groundfrontpainted, // rough top-layer (front) paint
groundbackpainted // same as 'ground' but with a back-paint
};
enum G4OpticalSurfaceType
{
dielectric_metal, // dielectric-metal interface
dielectric_dielectric // dielectric-dielectric interface
};
enum G4OpticalSurfaceModel
{
glisur, // original GEANT3 model
unified // UNIFIED model
};
class G4MaterialPropertiesTable;
/////////////////////
// Class Definition
/////////////////////
class G4OpticalSurface
{
public:
//////////////
// Operators
//////////////
G4OpticalSurface(const G4OpticalSurface &right);
const G4OpticalSurface & operator=(const G4OpticalSurface &right);
G4int operator==(const G4OpticalSurface &right) const;
G4int operator!=(const G4OpticalSurface &right) const;
public:
////////////////////////////////
// Constructors and Destructor
////////////////////////////////
G4OpticalSurface(const G4String& name,
G4OpticalSurfaceModel model = glisur,
G4OpticalSurfaceFinish finish = polished,
G4OpticalSurfaceType type = dielectric_dielectric,
G4double value = 1.0);
~G4OpticalSurface();
////////////
// Methods
////////////
public:
// public methods
G4String GetName() const { return theName; };
void SetName(const G4String& name){theName = name;};
// set/get the surface type
G4OpticalSurfaceType GetType() const {return theType;};
void SetType(const G4OpticalSurfaceType type){theType = type;};
// set/get the surface finish
G4OpticalSurfaceFinish GetFinish() const {return theFinish;};
void SetFinish(const G4OpticalSurfaceFinish finish)
{theFinish = finish;};
// set/get the surface model to be followed (glisur || unified)
G4OpticalSurfaceModel GetModel() const {return theModel;};
void SetModel(const G4OpticalSurfaceModel model)
{theModel = model;};
G4double GetSigmaAlpha() const {return sigma_alpha;};
void SetSigmaAlpha(const G4double s_a)
{sigma_alpha = s_a;};
G4double GetPolish() const {return polish;};
void SetPolish(const G4double plsh) {polish=plsh;};
void SetMaterialPropertiesTable(G4MaterialPropertiesTable *anMPT)
{ theMaterialPropertiesTable = anMPT;};
G4MaterialPropertiesTable* GetMaterialPropertiesTable() const
{ return theMaterialPropertiesTable;};
void DumpInfo() const;
private:
// ------------------
// Basic data members ( To define an optical surface)
// ------------------
G4String theName; // Surface name
G4OpticalSurfaceModel theModel; // Surface model
G4OpticalSurfaceFinish theFinish; // Surface finish
G4OpticalSurfaceType theType; // Surface type
G4double sigma_alpha; // The sigma of micro-facet polar angle
G4double polish; // Polish parameter in glisur model
G4MaterialPropertiesTable* theMaterialPropertiesTable;
};
////////////////////
// Inline methods
////////////////////
#endif /* G4OpticalSurface_h */
+138
View File
@@ -0,0 +1,138 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4SandiaTable.hh,v 2.2 1998/12/10 11:43:35 maire Exp $
// GEANT4 tag $Name: geant4-00 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//
// 18.11.98 simplified public interface; new methods for materials. mma
// 10.06.97 created. V. Grichine
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
#ifndef G4SANDIATABLE_HH
#define G4SANDIATABLE_HH
#include "G4OrderedTable.hh"
#include "G4ios.hh"
#include "globals.hh"
#include <assert.h>
class G4Material;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
class G4SandiaTable
{
public:
G4SandiaTable(G4Material*);
~G4SandiaTable();
static G4int GetNbOfIntervals (G4int Z);
static G4double GetSandiaCofPerAtom(G4int Z, G4int, G4int);
static G4double* GetSandiaCofPerAtom(G4int Z, G4double energy);
static G4double GetIonizationPot (G4int Z);
static G4double GetZtoA (G4int Z);
G4int GetMatNbOfIntervals() {return fMatNbOfIntervals;};
G4double GetSandiaCofForMaterial(G4int,G4int);
G4double* GetSandiaCofForMaterial(G4double energy);
private:
void ComputeMatSandiaMatrix();
private:
static const G4double fSandiaTable[981][5];
static const G4int fNbOfIntervals[101];
static G4int fCumulInterval[101];
static const G4double fZtoAratio[101];
static const G4double fIonizationPotentials[101];
static G4double fSandiaCofPerAtom[4];
G4Material* fMaterial;
G4int fMatNbOfIntervals;
G4OrderedTable* fMatSandiaMatrix;
};
//....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/(fZtoAratio[Z]*Avogadro*mole);
return fSandiaTable[row][j]*AoverAvo*cm2*pow(keV,(int)j);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
inline
G4double* G4SandiaTable::GetSandiaCofPerAtom(G4int Z, G4double energy)
{
assert (Z > 0);
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 >= fIonizationPotentials[Z]*eV)
{
G4double AoverAvo = Z/(fZtoAratio[Z]*Avogadro*mole);
fSandiaCofPerAtom[0]=fSandiaTable[row][1]*AoverAvo*cm2*keV;
fSandiaCofPerAtom[1]=fSandiaTable[row][2]*AoverAvo*cm2*keV*keV;
fSandiaCofPerAtom[2]=fSandiaTable[row][3]*AoverAvo*cm2*keV*keV*keV;
fSandiaCofPerAtom[3]=fSandiaTable[row][4]*AoverAvo*cm2*keV*keV*keV*keV;
}
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....
#endif
File diff suppressed because it is too large Load Diff