Import Geant4 6.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:56:29 +02:00
parent 1d812b78b1
commit e083ffb441
1415 changed files with 111223 additions and 21207 deletions
+9 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.47 2004/02/03 13:45:29 vnivanch Exp $
$Id: History,v 1.49 2004/05/17 13:42:24 gcosmo Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,14 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
13.05.04 P.Gumplinger - materials-V06-01-01
Added new utility method ConstPropertyExists(const char * key)
returning true/false according to the existance of the 'key' in
the table G4MaterialPropertiesTable.
05.03.04 V.Grichine - materials-V06-01-00
new methods for old sorting algorithm for PAI model
03.02.04 V.Ivant - materials-V06-00-01
Fix problem of destructor of G4SandiaTable
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4MaterialPropertiesTable.hh,v 1.12 2003/06/16 16:56:19 gunter Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// $Id: G4MaterialPropertiesTable.hh,v 1.15 2004/05/17 13:42:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
////////////////////////////////////////////////////////////////////////
@@ -115,6 +115,9 @@ public: // With description
G4double GetConstProperty(const char *key);
// Get the constant property from the table corresponding to the key-name
G4bool ConstPropertyExists(const char *key);
// Return true if a const property 'key' exists.
G4MaterialPropertyVector* GetProperty(const char *key);
// Get the property from the table corresponding to the key-name.
+32 -21
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4SandiaTable.hh,v 1.10 2001/10/17 07:59:52 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// $Id: G4SandiaTable.hh,v 1.11 2004/03/08 16:35:16 grichine Exp $
// GEANT4 tag $Name: geant4-06-02 $
// class description
//
@@ -33,6 +33,9 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//
// 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
// 30.01.01 major bug in the computation of AoverAvo and in the units (/g!)
// in GetSandiaCofPerAtom(). mma
@@ -51,6 +54,7 @@
class G4Material;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
class G4SandiaTable
@@ -59,6 +63,8 @@ public: // with description
G4SandiaTable(G4int);
G4SandiaTable(G4Material*);
~G4SandiaTable();
//per atom of an Element:
@@ -101,25 +107,32 @@ private:
public: // without description
inline void SandiaSwap( G4double** da,
inline void SandiaSwap( G4double** da,
G4int i,
G4int j );
void SandiaSort( G4double** da,
void SandiaSort( G4double** da,
G4int sz );
G4int SandiaIntervals( G4int Z[],
G4int SandiaIntervals( G4int Z[],
G4int el );
G4int SandiaMixing( G4int Z[],
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 ;
inline G4int GetMaxInterval() const { return fMaxInterval;};
G4OrderedTable* GetSandiaMatTable() const {return fMatSandiaMatrix;};
inline G4double GetSandiaMatTable(G4int,G4int) const;
private:
void ComputeMatTable();
//////////////////////////////////////////////////////////////////////////
@@ -168,26 +181,24 @@ G4SandiaTable::SandiaSwap( G4double** da ,
inline
G4double G4SandiaTable::GetPhotoAbsorpCof(G4int i, G4int j) const
{
G4double unitCof ;
if(j == 0)
{
unitCof = keV ;
}
else
{
unitCof = (cm2/g)*pow(keV,(G4double)j) ;
}
G4double unitCof ;
if(j == 0) unitCof = keV ;
else unitCof = (cm2/g)*pow(keV,(G4double)j) ;
return fPhotoAbsorptionCof[i][j]*unitCof ;
}
/////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
//
//
inline
G4int G4SandiaTable::GetMaxInterval() const
inline G4double G4SandiaTable::GetSandiaMatTable(G4int interval, G4int j) const
{
return fMaxInterval ;
assert (interval >= 0 && interval < fMaxInterval && j >= 0 && j < 5 );
G4double unitCof ;
if(j == 0) unitCof = keV ;
else unitCof = (cm2/g)*pow(keV,(G4double)j);
return ( (*(*fMatSandiaMatrix)[interval])[j] )*unitCof;
}
//
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4MaterialPropertiesTable.cc,v 1.13 2002/11/07 02:30:29 gum Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// $Id: G4MaterialPropertiesTable.cc,v 1.15 2004/05/17 13:39:25 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
////////////////////////////////////////////////////////////////////////
@@ -128,6 +128,20 @@ G4double G4MaterialPropertiesTable::GetConstProperty(const char *key)
}
}
G4bool G4MaterialPropertiesTable::ConstPropertyExists(const char *key)
{
// Return true if a const property 'key' exists
MPTCiterator j;
j = MPTC.find(G4String(key));
if ( j != MPTC.end() ) {
return true;
}
else {
return false;
}
}
G4MaterialPropertyVector* G4MaterialPropertiesTable::GetProperty(const char *key)
{
// Returns a Material Property Vector corresponding to a key
+216 -3
View File
@@ -21,11 +21,12 @@
// ********************************************************************
//
//
// $Id: G4SandiaTable.cc,v 1.17 2004/02/03 11:09:17 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4SandiaTable.cc,v 1.19 2004/04/14 10:19:06 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//
// 05.03.04 New methods for old sorting algorithm for PAI model. V.Grichine
// 03.02.04 Update distructor V.Ivanchenko
// 10.07.01 Migration to STL. M. Verderi.
// 03.04.01 fnulcof returned if energy < emin
@@ -41,16 +42,30 @@
#include "G4SandiaTable.hh"
#include "G4StaticSandiaData.hh"
#include "G4Material.hh"
#include "G4MaterialTable.hh"
G4int G4SandiaTable::fCumulInterval[101];
G4double G4SandiaTable::fSandiaCofPerAtom[4];
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4SandiaTable::G4SandiaTable(G4int)
G4SandiaTable::G4SandiaTable(G4int matIndex)
{
fMatSandiaMatrix = 0 ;
fPhotoAbsorptionCof = 0 ;
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
size_t numberOfMat = G4Material::GetNumberOfMaterials();
if ( matIndex >= 0 && matIndex < G4int(numberOfMat) )
{
fMaterial = (*theMaterialTable)[matIndex];
}
else
{
G4Exception("G4SandiaTable::G4SandiaTable(G4int matIndex): wrong matIndex ");
}
ComputeMatTable();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
@@ -396,6 +411,204 @@ G4SandiaTable::SandiaMixing( G4int Z[],
return mi ;
}
////////////////////////////////////////////////////////////////////////////
//
// Sandia interval and mixing calculations for materialCutsCouple constructor
//
void G4SandiaTable::ComputeMatTable()
{
G4int MaxIntervals = 0;
G4int elm, c, i, j, jj, k, kk, k1, k2, c1, n1;
const G4int noElm = fMaterial->GetNumberOfElements();
const G4ElementVector* ElementVector = fMaterial->GetElementVector();
G4int* Z = new G4int[noElm]; //Atomic number
for (elm = 0; elm<noElm; elm++)
{
Z[elm] = (int)(*ElementVector)[elm]->GetZ();
MaxIntervals += fNbOfIntervals[Z[elm]];
}
fMaxInterval = 0 ;
for(i = 0; i < noElm; i++) fMaxInterval += fNbOfIntervals[Z[i]] ;
fMaxInterval += 2 ;
// G4cout<<"fMaxInterval = "<<fMaxInterval<<G4endl ;
fPhotoAbsorptionCof = new G4double* [fMaxInterval] ;
for(i = 0 ; i < fMaxInterval ; i++)
{
fPhotoAbsorptionCof[i] = new G4double[5] ;
}
// for(c = 0 ; c < fIntervalLimit ; c++) // just in case
for(c = 0 ; c < fMaxInterval ; c++) // just in case
{
fPhotoAbsorptionCof[c][0] = 0. ;
}
c = 1 ;
for(i = 0 ; i < noElm ; i++)
{
G4double I1 = fIonizationPotentials[Z[i]]*keV ; // First ionization
n1 = 1 ; // potential in keV
for(j = 1 ; j < Z[i] ; j++)
{
n1 += fNbOfIntervals[j] ;
}
G4int n2 = n1 + fNbOfIntervals[Z[i]] ;
for(k1 = n1 ; k1 < n2 ; k1++)
{
if(I1 > fSandiaTable[k1][0])
{
continue ; // no ionization for energies smaller than I1 (first
} // ionisation potential)
break ;
}
G4int flag = 0 ;
for(c1 = 1 ; c1 < c ; c1++)
{
if(fPhotoAbsorptionCof[c1][0] == I1) // this value already has existed
{
flag = 1 ;
break ;
}
}
if(flag == 0)
{
fPhotoAbsorptionCof[c][0] = I1 ;
c++ ;
}
for(k2 = k1 ; k2 < n2 ; k2++)
{
flag = 0 ;
for(c1 = 1 ; c1 < c ; c1++)
{
if(fPhotoAbsorptionCof[c1][0] == fSandiaTable[k2][0])
{
flag = 1 ;
break ;
}
}
if(flag == 0)
{
fPhotoAbsorptionCof[c][0] = fSandiaTable[k2][0] ;
c++ ;
}
}
} // end for(i)
SandiaSort(fPhotoAbsorptionCof,c) ;
fMaxInterval = c ;
// G4int
// G4SandiaTable::SandiaMixing( G4int Z[],
const G4double* fractionW = fMaterial->GetFractionVector();
// G4int el,
// G4int mi )
for(i = 0 ; i < fMaxInterval ; i++)
{
for(j = 1 ; j < 5 ; j++) fPhotoAbsorptionCof[i][j] = 0.;
}
for(i = 0 ; i < noElm; i++)
{
n1 = 1 ;
G4double I1 = fIonizationPotentials[Z[i]]*keV ;
for(j = 1 ; j < Z[i] ; j++)
{
n1 += fNbOfIntervals[j] ;
}
G4int n2 = n1 + fNbOfIntervals[Z[i]] - 1 ;
for(k = n1 ; k < n2 ; k++)
{
G4double B1 = fSandiaTable[k][0] ;
G4double B2 = fSandiaTable[k+1][0] ;
for(G4int c = 1 ; c < fMaxInterval-1 ; c++)
{
G4double E1 = fPhotoAbsorptionCof[c][0] ;
G4double E2 = fPhotoAbsorptionCof[c+1][0] ;
if(B1 > E1 || B2 < E2 || E1 < I1)
{
continue ;
}
for(j = 1 ; j < 5 ; j++)
{
fPhotoAbsorptionCof[c][j] += fSandiaTable[k][j]*fractionW[i] ;
}
}
}
for(j = 1 ; j < 5 ; j++) // Last interval
{
fPhotoAbsorptionCof[fMaxInterval-1][j] += fSandiaTable[k][j]*fractionW[i] ;
}
} // for(i)
c = 0 ; // Deleting of first intervals where all coefficients = 0
do
{
c++ ;
if( fPhotoAbsorptionCof[c][1] != 0.0 ||
fPhotoAbsorptionCof[c][2] != 0.0 ||
fPhotoAbsorptionCof[c][3] != 0.0 ||
fPhotoAbsorptionCof[c][4] != 0.0 ) continue ;
for(jj = 2 ; jj < fMaxInterval ; jj++)
{
for(kk = 0 ; kk < 5 ; kk++)
{
fPhotoAbsorptionCof[jj-1][kk]= fPhotoAbsorptionCof[jj][kk] ;
}
}
fMaxInterval-- ;
c-- ;
}
while(c < fMaxInterval - 1) ;
// create the sandia matrix for this material
fMatSandiaMatrix = new G4OrderedTable();
for (i = 0; i < fMaxInterval; i++)
{
fMatSandiaMatrix->push_back(new G4DataVector(5,0.));
}
for (i = 0; i < fMaxInterval; i++)
{
for(j = 0 ; j < 5 ; j++)
{
(*(*fMatSandiaMatrix)[i])[j] = fPhotoAbsorptionCof[i+1][j];
}
}
return ;
}
///////////////////////////////////////////////////////////////////////
//
// GetNbOfIntervals