Import Geant4 0.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:09:25 +02:00
parent b97f8d0df7
commit aaa409b6ee
2922 changed files with 55107 additions and 81674 deletions
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4AtomicShells.cc,v 2.4 1998/11/16 17:26:45 maire Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4AtomicShells.cc,v 1.1 1999/01/07 16:09:43 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
+23 -8
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Element.cc,v 2.7 1998/11/16 17:26:46 maire Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4Element.cc,v 1.2 1999/04/14 12:49:01 maire Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------ class G4Element ------------
@@ -40,6 +40,7 @@ G4ElementTable G4Element::theElementTable;
G4Element::G4Element(const G4String& name, const G4String& symbol,
G4double zeff, G4double aeff)
:fName(name),fSymbol(symbol)
{
if (zeff<1.) G4Exception
(" ERROR! It is not allowed to create an Element with Z < 1" );
@@ -54,8 +55,6 @@ G4Element::G4Element(const G4String& name, const G4String& symbol,
InitializePointers();
fName = name;
fSymbol = symbol;
fZeff = zeff;
fNeff = aeff/(g/mole);
fAeff = aeff;
@@ -81,13 +80,12 @@ G4Element::G4Element(const G4String& name, const G4String& symbol,
// via AddIsotope
G4Element::G4Element(const G4String& name, const G4String& symbol, G4int nIsotopes)
:fName(name),fSymbol(symbol)
{
InitializePointers();
size_t n = size_t(nIsotopes);
fName = name;
fSymbol = symbol;
fNumberOfIsotopes = 0;
theIsotopeVector = new G4IsotopeVector(n);
@@ -171,9 +169,26 @@ G4Element::G4Element(G4Element &right)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
const G4Element & G4Element::operator=(const G4Element &right)
const G4Element& G4Element::operator=(const G4Element& right)
{
return right;
if (this != &right)
{
fName = right.fName;
fSymbol = right.fSymbol;
fZeff = right.fZeff;
fNeff = right.fNeff;
fAeff = right.fAeff;
fNbOfAtomicShells = right.fNbOfAtomicShells;
fAtomicShells = right.fAtomicShells;
fNumberOfIsotopes = right.fNumberOfIsotopes;
theIsotopeVector = right.theIsotopeVector;
fRelativeAbundanceVector = right.fRelativeAbundanceVector;
fIndexInTable = right.fIndexInTable;
fCoulomb = right.fCoulomb;
fRadTsai = right.fRadTsai;
fIonisation = right.fIonisation;
}
return *this;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
+20 -5
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4IonisParamElm.cc,v 2.2 1998/07/12 03:00:39 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4IonisParamElm.cc,v 1.2 1999/04/14 12:49:01 maire Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------ class G4IonisParamElm ------------
@@ -65,16 +65,31 @@ G4IonisParamElm::~G4IonisParamElm()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4IonisParamElm::G4IonisParamElm(G4IonisParamElm &right)
G4IonisParamElm::G4IonisParamElm(G4IonisParamElm& right)
{
*this = right;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
const G4IonisParamElm & G4IonisParamElm::operator=(const G4IonisParamElm &right)
const G4IonisParamElm& G4IonisParamElm::operator=(const G4IonisParamElm& right)
{
return right;
if (this != &right)
{
fZ = right.fZ;
fZ3 = right.fZ3;
fZZ3 = right.fZZ3;
flogZ3 = right.flogZ3;
fTau0 = right.fTau0;
fTaul = right.fTaul;
fBetheBlochLow = right.fBetheBlochLow;
fAlow = right.fAlow;
fBlow = right.fBlow;
fClow = right.fClow;
fMeanExcitationEnergy = right.fMeanExcitationEnergy;
fShellCorrectionVector = right.fShellCorrectionVector;
}
return *this;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
+25 -4
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4IonisParamMat.cc,v 2.5 1998/10/05 14:33:14 maire Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4IonisParamMat.cc,v 1.2 1999/04/14 12:49:02 maire Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
@@ -187,9 +187,30 @@ G4IonisParamMat::G4IonisParamMat(const G4IonisParamMat &right)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
const G4IonisParamMat & G4IonisParamMat::operator=(const G4IonisParamMat &right)
const G4IonisParamMat& G4IonisParamMat::operator=(const G4IonisParamMat& right)
{
return right;
if (this != &right)
{
fMaterial = right.fMaterial;
fMeanExcitationEnergy = right.fMeanExcitationEnergy;
fLogMeanExcEnergy = right.fLogMeanExcEnergy;
fShellCorrectionVector = right.fShellCorrectionVector;
fTaul = right.fTaul;
fCdensity = right.fCdensity;
fMdensity = right.fMdensity;
fAdensity = right.fAdensity;
fX0density = right.fX0density;
fX1density = right.fX1density;
fF1fluct = right.fF1fluct;
fF2fluct = right.fF2fluct;
fEnergy1fluct = right.fEnergy1fluct;
fLogEnergy1fluct = right.fLogEnergy1fluct;
fEnergy2fluct = right.fEnergy2fluct;
fLogEnergy2fluct = right.fLogEnergy2fluct;
fEnergy0fluct = right.fEnergy0fluct;
fRateionexcfluct = right.fRateionexcfluct;
}
return *this;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Isotope.cc,v 2.2 1998/07/12 03:00:41 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4Isotope.cc,v 1.1 1999/01/07 16:09:44 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// --------------------------------------------------------------
+5 -4
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4MPVEntry.cc,v 2.1 1998/07/13 17:14:08 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4MPVEntry.cc,v 1.2 1999/04/14 12:49:02 maire Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
////////////////////////////////////////////////////////////////////////
@@ -61,11 +61,12 @@ G4bool G4MPVEntry::operator <(const G4MPVEntry &right) const
// -----------------------
// Well defined = semantics required by RWTPtrSortedVector
//
G4MPVEntry& G4MPVEntry::operator =(const G4MPVEntry &right)
G4MPVEntry& G4MPVEntry::operator =(const G4MPVEntry& right)
{
if (this == &right) return *this;
thePhotonMomentum = right.thePhotonMomentum;
theProperty = right.theProperty;
return *this;
}
+33 -10
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Material.cc,v 2.7 1998/11/20 15:49:24 maire Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4Material.cc,v 1.3 1999/04/14 12:49:03 maire Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ---------- class G4Material ----------
@@ -33,6 +33,7 @@
// 09-07-98, ionisation parameters removed from the class, M.Maire
// 05-10-98, change names: NumDensity -> NbOfAtomsPerVolume
// 18-11-98, new interface to SandiaTable
// 19-01-99 enlarge tolerance on test of coherence of gas conditions
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
@@ -50,6 +51,7 @@ G4MaterialTable G4Material::theMaterialTable;
G4Material::G4Material(const G4String& name, G4double z,
G4double a, G4double density,
G4State state, G4double temp, G4double pressure)
:fName(name)
{
InitializePointers();
@@ -62,7 +64,6 @@ G4Material::G4Material(const G4String& name, G4double z,
density = universe_mean_density;
}
fName = name;
fDensity = density;
fState = state;
fTemp = temp;
@@ -96,6 +97,7 @@ G4Material::G4Material(const G4String& name, G4double z,
G4Material::G4Material(const G4String& name, G4double density, G4int nComponents,
G4State state, G4double temp, G4double pressure)
:fName(name)
{
InitializePointers();
@@ -109,7 +111,6 @@ G4Material::G4Material(const G4String& name, G4double density, G4int nComponents
density = universe_mean_density;
}
fName = name;
fDensity = density;
fState = state;
fTemp = temp;
@@ -305,7 +306,7 @@ void G4Material::ComputeDerivedQuantities()
//for gas, check coherence of the state conditions
if (fState == kStateGas) {
G4double ratio = TotNbOfAtomsPerVolume*k_Boltzmann*fTemp/fPressure;
if ((ratio<0.5)||(ratio>2.)) {
if ((ratio<0.1)||(ratio>10.)) {
G4cout << "---warning from G4Material-- The state conditions of the gas: "
<< fName << " are not consistent."
<< "\n density = " << fDensity/(mg/cm3) << " mg/cm3"
@@ -362,28 +363,50 @@ G4Material::~G4Material()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4Material::G4Material(const G4Material &right)
G4Material::G4Material(const G4Material& right)
{
*this = right;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
const G4Material & G4Material::operator=(const G4Material &right)
const G4Material& G4Material::operator=(const G4Material& right)
{
return right;
if (this != &right)
{
fName = right.fName;
fDensity = right.fDensity;
fState = right.fState;
fTemp = right.fTemp;
fPressure = right.fPressure;
maxNbComponents = right.maxNbComponents;
fNumberOfComponents = right.fNumberOfComponents;
fNumberOfElements = right.fNumberOfElements;
theElementVector = right.theElementVector;
fMassFractionVector = right.fMassFractionVector;
fAtomsVector = right.fAtomsVector;
fMaterialPropertiesTable = right.fMaterialPropertiesTable;
fIndexInTable = right.fIndexInTable;
VecNbOfAtomsPerVolume = right.VecNbOfAtomsPerVolume;
TotNbOfAtomsPerVolume = right.TotNbOfAtomsPerVolume;
TotNbOfElectPerVolume = right.TotNbOfElectPerVolume;
fRadlen = right.fRadlen;
fIonisation = right.fIonisation;
fSandiaTable = right.fSandiaTable;
}
return *this;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4int G4Material::operator==(const G4Material &right) const
G4int G4Material::operator==(const G4Material& right) const
{
return (this == (G4Material *) &right);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4int G4Material::operator!=(const G4Material &right) const
G4int G4Material::operator!=(const G4Material& right) const
{
return (this != (G4Material *) &right);
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4MaterialPropertiesTable.cc,v 2.1 1998/07/13 17:14:14 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4MaterialPropertiesTable.cc,v 1.2 1999/04/14 12:49:03 maire Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
////////////////////////////////////////////////////////////////////////
@@ -32,8 +32,10 @@ unsigned hashString(const G4String &str) { return str.hash(); }
//////////////
G4MaterialPropertiesTable&
G4MaterialPropertiesTable::operator =(const G4MaterialPropertiesTable &right)
G4MaterialPropertiesTable::operator =(const G4MaterialPropertiesTable& right)
{
if (this == &right) return *this;
// clear any current contents of MPT
MPT.clearAndDestroy();
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4MaterialPropertyVector.cc,v 2.2 1998/07/13 17:14:16 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4MaterialPropertyVector.cc,v 1.2 1999/04/14 12:49:04 maire Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
////////////////////////////////////////////////////////////////////////
@@ -51,8 +51,10 @@ G4bool G4MaterialPropertyVector::operator ++()
// ----------
//
G4MaterialPropertyVector&
G4MaterialPropertyVector::operator =(const G4MaterialPropertyVector &right)
G4MaterialPropertyVector::operator =(const G4MaterialPropertyVector& right)
{
if (this == &right) return *this;
// clear the vector of current contents
MPV.clearAndDestroy();
+15 -5
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpticalSurface.cc,v 2.1 1998/07/13 17:14:17 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4OpticalSurface.cc,v 1.2 1999/04/14 12:49:04 maire Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
////////////////////////////////////////////////////////////////////////
@@ -34,10 +34,20 @@
// Operators
//////////////
const G4OpticalSurface &
G4OpticalSurface::operator=(const G4OpticalSurface &right)
const G4OpticalSurface&
G4OpticalSurface::operator=(const G4OpticalSurface& right)
{
return right;
if (this != &right)
{
theName = right.theName;
theModel = right.theModel;
theFinish = right.theFinish;
theType = right.theType;
sigma_alpha = right.sigma_alpha;
polish = right.polish;
theMaterialPropertiesTable = right.theMaterialPropertiesTable;
}
return *this;
}
/////////////////
+187 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4SandiaTable.cc,v 2.3 1998/12/08 15:12:29 maire Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4SandiaTable.cc,v 1.2 1999/04/15 14:01:11 grichine Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//
@@ -25,6 +25,8 @@ G4double G4SandiaTable::fSandiaCofPerAtom[4];
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4SandiaTable::G4SandiaTable(G4int matIndex){ ; }
G4SandiaTable::G4SandiaTable(G4Material* material)
:fMaterial(material)
{
@@ -123,3 +125,186 @@ G4double* G4SandiaTable::GetSandiaCofForMaterial(G4double energy)
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
//
// Methods for PAI model
///////////////////////////////////////////////////////////////////////
//
// Bubble sorting of left energy interval in SandiaTable in ascening order
//
void
G4SandiaTable::SandiaSort(G4double da[][5],
G4int sz )
{
for(G4int i = 1 ;i < sz ; i++ )
{
for(G4int j = i + 1 ;j < sz ; j++ )
{
if(da[i][0] > da[j][0])
{
SandiaSwap(da,i,j) ;
}
}
}
}
////////////////////////////////////////////////////////////////////////////
//
// SandiaIntervals
//
G4int
G4SandiaTable::SandiaIntervals(G4int Z[],
G4int el )
{
G4int c,i;
for(c = 0 ; c < fIntervalLimit ; c++) // just in case
{
fPhotoAbsorptionCof[c][0] = 0. ;
}
c = 1 ;
for(i = 0 ; i < el ; i++)
{
G4double I1 = fIonizationPotentials[Z[i]]*keV ; // First ionization
G4int n1 = 1 ; // potential in keV
G4int j, c1, k1, k2 ;
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 ;
return c ;
}
///////////////////////////////////////////////////////////////////////
//
// SandiaMixing
//
G4int
G4SandiaTable::SandiaMixing( G4int Z[],
const G4double fractionW[],
G4int el,
G4int mi )
{
G4int i;
for(i = 0 ; i < mi ; i++)
{
for(G4int j = 1 ; j < 5 ; j++) fPhotoAbsorptionCof[i][j] = 0. ;
}
for(i = 0 ; i < el ; i++)
{
G4int n1 = 1 ;
G4int j, k ;
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 < mi-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[mi-1][j] += fSandiaTable[k][j]*fractionW[i] ;
}
} // for(i)
G4int 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(G4int jj = 2 ; jj < mi ; jj++)
{
for(G4int kk = 0 ; kk < 5 ; kk++)
{
fPhotoAbsorptionCof[jj-1][kk]= fPhotoAbsorptionCof[jj][kk] ;
}
}
mi-- ;
c-- ;
}
while(c < mi - 1) ;
return mi ;
}
// G4SandiaTable class -- end of implementation file
//
////////////////////////////////////////////////////////////////////////////