Import Geant4 9.1.0 source tree
This commit is contained in:
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SandiaTable.hh,v 1.14 2006/06/29 19:12:33 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// $Id: G4SandiaTable.hh,v 1.21 2007/10/02 10:13:33 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
|
||||
// class description
|
||||
//
|
||||
@@ -38,12 +38,12 @@
|
||||
//
|
||||
// History:
|
||||
//
|
||||
// 05.03.04 V.Grichine, new methods for old sorting algorithm for PAI model
|
||||
// 03.04.01 fnulcof[4] added; returned if energy < emin
|
||||
// 10.06.97 created. V. Grichine
|
||||
// 18.11.98 simplified public interface; new methods for materials. mma
|
||||
// 30.01.01 major bug in the computation of AoverAvo and in the units (/g!)
|
||||
// in GetSandiaCofPerAtom(). mma
|
||||
// 18.11.98 simplified public interface; new methods for materials. mma
|
||||
// 10.06.97 created. V. Grichine
|
||||
// 03.04.01 fnulcof[4] added; returned if energy < emin
|
||||
// 05.03.04 V.Grichine, new methods for old sorting algorithm for PAI model
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
|
||||
|
||||
@@ -57,108 +57,113 @@
|
||||
|
||||
class G4Material;
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
|
||||
|
||||
class G4SandiaTable
|
||||
{
|
||||
public: // with description
|
||||
|
||||
G4SandiaTable(G4int);
|
||||
G4SandiaTable(G4Material*);
|
||||
|
||||
G4SandiaTable(G4Material*);
|
||||
|
||||
~G4SandiaTable();
|
||||
~G4SandiaTable();
|
||||
|
||||
//main computation per atom:
|
||||
static G4double* GetSandiaCofPerAtom(G4int Z, G4double energy);
|
||||
static G4double GetZtoA (G4int Z);
|
||||
|
||||
//per volume of a material:
|
||||
inline G4int GetMatNbOfIntervals();
|
||||
inline G4double GetSandiaCofForMaterial(G4int,G4int);
|
||||
inline G4double* GetSandiaCofForMaterial(G4double energy);
|
||||
inline G4double GetSandiaMatTable(G4int,G4int);
|
||||
|
||||
inline G4double GetSandiaCofForMaterialPAI(G4int,G4int);
|
||||
inline G4double* GetSandiaCofForMaterialPAI(G4double energy);
|
||||
inline G4double GetSandiaMatTablePAI(G4int,G4int);
|
||||
inline G4OrderedTable* GetSandiaMatrixPAI();
|
||||
|
||||
//per atom of an Element:
|
||||
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);
|
||||
|
||||
//per volume of a material:
|
||||
G4int GetMatNbOfIntervals() {return fMatNbOfIntervals;};
|
||||
G4double GetSandiaCofForMaterial(G4int,G4int);
|
||||
G4double* GetSandiaCofForMaterial(G4double energy);
|
||||
|
||||
public: // without description
|
||||
|
||||
G4SandiaTable(__void__&);
|
||||
// Fake default constructor for usage restricted to direct object
|
||||
// persistency for clients requiring preallocation of memory for
|
||||
// persistifiable objects.
|
||||
G4SandiaTable(__void__&);
|
||||
// Fake default constructor for usage restricted to direct object
|
||||
// persistency for clients requiring preallocation of memory for
|
||||
// persistifiable objects.
|
||||
|
||||
private:
|
||||
|
||||
void ComputeMatSandiaMatrix();
|
||||
|
||||
private:
|
||||
void ComputeMatSandiaMatrix();
|
||||
void ComputeMatSandiaMatrixPAI();
|
||||
|
||||
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];
|
||||
// methods per atom
|
||||
inline G4int GetNbOfIntervals (G4int Z);
|
||||
inline G4double GetSandiaCofPerAtom(G4int Z, G4int, G4int);
|
||||
inline G4double GetIonizationPot (G4int Z);
|
||||
|
||||
// static members of the class
|
||||
static const G4int fNumberOfElements;
|
||||
static const G4int fIntervalLimit;
|
||||
static const G4int fNumberOfIntervals;
|
||||
|
||||
static const G4double fSandiaTable[981][5];
|
||||
static const G4int fNbOfIntervals[101];
|
||||
static const G4double fZtoAratio[101];
|
||||
static const G4double fIonizationPotentials[101];
|
||||
static const G4double funitc[4];
|
||||
|
||||
static G4double fSandiaCofPerAtom[4];
|
||||
|
||||
G4Material* fMaterial;
|
||||
G4int fMatNbOfIntervals;
|
||||
G4OrderedTable* fMatSandiaMatrix;
|
||||
|
||||
G4double fnulcof[4];
|
||||
static G4int fCumulInterval[101];
|
||||
static G4double fSandiaCofPerAtom[4];
|
||||
|
||||
// members of the class
|
||||
G4Material* fMaterial;
|
||||
G4int fMatNbOfIntervals;
|
||||
G4OrderedTable* fMatSandiaMatrix;
|
||||
G4OrderedTable* fMatSandiaMatrixPAI;
|
||||
|
||||
G4double fnulcof[4];
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Methods for PAI model
|
||||
// Methods for old implementation of PAI model
|
||||
// Will be removed for the next major release
|
||||
|
||||
public: // without description
|
||||
|
||||
G4SandiaTable(G4int);
|
||||
|
||||
inline void SandiaSwap( G4double** da,
|
||||
G4int i,
|
||||
G4int j );
|
||||
inline void SandiaSwap( G4double** da,
|
||||
G4int i,
|
||||
G4int j );
|
||||
|
||||
void SandiaSort( G4double** da,
|
||||
G4int sz );
|
||||
void SandiaSort( G4double** da,
|
||||
G4int sz );
|
||||
|
||||
G4int SandiaIntervals( G4int Z[],
|
||||
G4int el );
|
||||
G4int SandiaIntervals( G4int Z[],
|
||||
G4int el );
|
||||
|
||||
G4int SandiaMixing( G4int Z[],
|
||||
const G4double fractionW[],
|
||||
G4int el,
|
||||
G4int mi );
|
||||
G4int SandiaMixing( G4int Z[],
|
||||
const G4double fractionW[],
|
||||
G4int el,
|
||||
G4int mi );
|
||||
|
||||
inline G4double GetPhotoAbsorpCof(G4int i , G4int j) const;
|
||||
inline G4double GetPhotoAbsorpCof(G4int i , G4int j) const;
|
||||
|
||||
inline G4int GetMaxInterval() const { return fMaxInterval;};
|
||||
inline G4int GetMaxInterval() const;
|
||||
|
||||
G4OrderedTable* GetSandiaMatTable() const {return fMatSandiaMatrix;};
|
||||
inline G4double GetSandiaMatTable(G4int,G4int) const;
|
||||
inline G4double** GetPointerToCof();
|
||||
|
||||
private:
|
||||
|
||||
void ComputeMatTable();
|
||||
|
||||
void ComputeMatTable();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// data members for PAI model
|
||||
|
||||
private:
|
||||
static const G4int fNumberOfElements ;
|
||||
static const G4int fIntervalLimit ;
|
||||
static const G4int fNumberOfIntervals ;
|
||||
|
||||
// G4double fPhotoAbsorptionCof[101][5] ; // SandiaTable for mixture
|
||||
G4double** fPhotoAbsorptionCof ; // SandiaTable for mixture
|
||||
|
||||
G4double** fPhotoAbsorptionCof ; // SandiaTable for mixture
|
||||
|
||||
// G4OrderedTable*
|
||||
G4int fMaxInterval ;
|
||||
G4int fMaxInterval ;
|
||||
|
||||
//
|
||||
//
|
||||
@@ -166,14 +171,156 @@ private:
|
||||
|
||||
};
|
||||
|
||||
// Inline methods
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
|
||||
|
||||
inline G4int
|
||||
G4SandiaTable::GetMatNbOfIntervals()
|
||||
{
|
||||
return fMatNbOfIntervals;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
|
||||
|
||||
inline G4int
|
||||
G4SandiaTable::GetNbOfIntervals(G4int Z)
|
||||
{
|
||||
// assert (Z>0 && Z<101);
|
||||
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;
|
||||
G4double x = fSandiaTable[row][0]*keV;
|
||||
if (j > 0) {
|
||||
x = Z*amu/fZtoAratio[Z]*
|
||||
(fSandiaTable[row][j]*cm2*std::pow(keV,G4double(j))/g);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
|
||||
|
||||
inline G4double
|
||||
G4SandiaTable::GetSandiaCofForMaterial(G4int interval, G4int j)
|
||||
{
|
||||
assert (interval>=0 && interval<fMatNbOfIntervals && j>=0 && j<5);
|
||||
return ((*(*fMatSandiaMatrix)[interval])[j]);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
|
||||
|
||||
inline G4double*
|
||||
G4SandiaTable::GetSandiaCofForMaterial(G4double energy)
|
||||
{
|
||||
G4double* x = fnulcof;
|
||||
if (energy >= (*(*fMatSandiaMatrix)[0])[0]) {
|
||||
|
||||
G4int interval = fMatNbOfIntervals - 1;
|
||||
while ((interval>0)&&(energy<(*(*fMatSandiaMatrix)[interval])[0]))
|
||||
{interval--;}
|
||||
x = &((*(*fMatSandiaMatrix)[interval])[1]);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
|
||||
|
||||
inline G4double
|
||||
G4SandiaTable::GetSandiaMatTable(G4int interval, G4int j)
|
||||
{
|
||||
assert (interval >= 0 && interval < fMaxInterval && j >= 0 && j < 5 );
|
||||
G4double unitCof ;
|
||||
if(j == 0) unitCof = keV ;
|
||||
else unitCof = (cm2/g)*std::pow(keV,(G4double)j);
|
||||
return ( (*(*fMatSandiaMatrix)[interval])[j] )*unitCof;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
|
||||
|
||||
inline G4double
|
||||
G4SandiaTable::GetSandiaCofForMaterialPAI(G4int interval, G4int j)
|
||||
{
|
||||
assert (interval>=0 && interval<fMatNbOfIntervals && j>=0 && j<5);
|
||||
if(!fMatSandiaMatrixPAI) ComputeMatSandiaMatrixPAI();
|
||||
return ((*(*fMatSandiaMatrixPAI)[interval])[j]);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
|
||||
|
||||
inline G4double*
|
||||
G4SandiaTable::GetSandiaCofForMaterialPAI(G4double energy)
|
||||
{
|
||||
if(!fMatSandiaMatrixPAI) ComputeMatSandiaMatrixPAI();
|
||||
G4double* x = fnulcof;
|
||||
if (energy >= (*(*fMatSandiaMatrixPAI)[0])[0]) {
|
||||
|
||||
G4int interval = fMatNbOfIntervals - 1;
|
||||
while ((interval>0)&&(energy<(*(*fMatSandiaMatrixPAI)[interval])[0]))
|
||||
{interval--;}
|
||||
x = &((*(*fMatSandiaMatrixPAI)[interval])[1]);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
|
||||
|
||||
inline G4double
|
||||
G4SandiaTable::GetSandiaMatTablePAI(G4int interval, G4int j)
|
||||
{
|
||||
assert (interval >= 0 && interval < fMaxInterval && j >= 0 && j < 5 );
|
||||
if(!fMatSandiaMatrixPAI) ComputeMatSandiaMatrixPAI();
|
||||
G4double unitCof ;
|
||||
if(j == 0) unitCof = keV ;
|
||||
else unitCof = (cm2/g)*std::pow(keV,(G4double)j);
|
||||
return ( (*(*fMatSandiaMatrixPAI)[interval])[j] )*unitCof;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
|
||||
|
||||
inline G4double
|
||||
G4SandiaTable::GetIonizationPot(G4int Z)
|
||||
{
|
||||
return fIonizationPotentials[Z]*eV;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
|
||||
|
||||
inline G4OrderedTable*
|
||||
G4SandiaTable::GetSandiaMatrixPAI()
|
||||
{
|
||||
if(!fMatSandiaMatrixPAI) ComputeMatSandiaMatrixPAI();
|
||||
return fMatSandiaMatrixPAI;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Inline methods for PAI model
|
||||
// Inline methods for PAI model, will be removed in next major release
|
||||
|
||||
inline
|
||||
void
|
||||
inline G4int
|
||||
G4SandiaTable::GetMaxInterval() const {
|
||||
return fMaxInterval;
|
||||
}
|
||||
|
||||
inline G4double**
|
||||
G4SandiaTable::GetPointerToCof()
|
||||
{
|
||||
if(!fPhotoAbsorptionCof) ComputeMatTable();
|
||||
return fPhotoAbsorptionCof;
|
||||
}
|
||||
|
||||
inline void
|
||||
G4SandiaTable::SandiaSwap( G4double** da ,
|
||||
G4int i,
|
||||
G4int j )
|
||||
@@ -183,31 +330,14 @@ G4SandiaTable::SandiaSwap( G4double** da ,
|
||||
da[j][0] = tmp ;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
inline
|
||||
G4double G4SandiaTable::GetPhotoAbsorpCof(G4int i, G4int j) const
|
||||
{
|
||||
G4double unitCof ;
|
||||
if(j == 0) unitCof = keV ;
|
||||
else unitCof = (cm2/g)*std::pow(keV,(G4double)j) ;
|
||||
G4double unitCof ;
|
||||
if(j == 0) unitCof = keV ;
|
||||
else unitCof = (cm2/g)*std::pow(keV,(G4double)j) ;
|
||||
|
||||
return fPhotoAbsorptionCof[i][j]*unitCof ;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
inline G4double G4SandiaTable::GetSandiaMatTable(G4int interval, G4int j) const
|
||||
{
|
||||
assert (interval >= 0 && interval < fMaxInterval && j >= 0 && j < 5 );
|
||||
G4double unitCof ;
|
||||
if(j == 0) unitCof = keV ;
|
||||
else unitCof = (cm2/g)*std::pow(keV,(G4double)j);
|
||||
return ( (*(*fMatSandiaMatrix)[interval])[j] )*unitCof;
|
||||
return fPhotoAbsorptionCof[i][j]*unitCof ;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user