Import Geant4 5.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:57:27 +02:00
parent 330b82b769
commit 37fff30d2e
5733 changed files with 263867 additions and 74574 deletions
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4AtomicShells.cc,v 1.3 2001/07/11 10:01:27 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4Element.cc,v 1.15 2002/02/26 17:34:34 maire Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+7 -7
View File
@@ -21,12 +21,13 @@
// ********************************************************************
//
//
// $Id: G4IonisParamElm.cc,v 1.7 2001/07/11 10:01:27 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4IonisParamElm.cc,v 1.8 2002/10/17 09:00:29 vnivanch Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//
// 17-10-02, Fix excitation energy interpolation. V.Ivanchenko
// 08-03-01, correct handling of fShellCorrectionVector. M.Maire
// 22-11-00, tabulation of ionisation potential from
// the ICRU Report N#37. V.Ivanchenko
@@ -66,11 +67,10 @@ G4IonisParamElm::G4IonisParamElm(G4double Z)
10.0, 10.0, 9.9, 9.9, 9.7, 9.2, 9.5, 9.4, 9.4, 9.4,
9.6, 9.7, 9.7, 9.8, 9.8, 9.8, 9.8, 9.9, 9.9, 9.9 };
G4int iz = (G4int)Z - 1 ;
if(0 > iz) iz = 0;
if(98 < iz) iz = 98 ;
fMeanExcitationEnergy =
fZ * (exc[iz] + (fZ - (G4double)(iz))*(exc[iz+1] - exc[iz])) * eV ;
G4int iz = (G4int)Z - 1 ;
if(0 > iz) iz = 0;
else if(99 < iz) iz = 99 ;
fMeanExcitationEnergy = fZ * exc[iz] * eV ;
fTau0 = 0.1*fZ3*MeV/proton_mass_c2;
+95 -6
View File
@@ -21,12 +21,13 @@
// ********************************************************************
//
//
// $Id: G4IonisParamMat.cc,v 1.9 2001/09/13 08:57:46 maire Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4IonisParamMat.cc,v 1.10 2002/10/29 16:17:05 vnivanch Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
// 28-10-02, add setMeanExcitationEnergy (V.Ivanchenko)
// 08-02-01, fShellCorrectionVector correctly handled (mma)
// 16-01-01, bug corrected in ComputeDensityEffect() E100eV (L.Urban)
// 18-07-98, bug corrected in ComputeDensityEffect() for gas
@@ -54,16 +55,21 @@ void G4IonisParamMat::ComputeMeanParameters()
// compute mean excitation energy and shell correction vector
fTaul = (*(fMaterial->GetElementVector()))[0]->GetIonisation()->GetTaul();
fMeanExcitationEnergy = 0.;
fLogMeanExcEnergy = 0.;
for (size_t i=0; i < fMaterial->GetNumberOfElements(); i++)
for (size_t i=0; i < fMaterial->GetNumberOfElements(); i++) {
fLogMeanExcEnergy += (fMaterial->GetVecNbOfAtomsPerVolume())[i]
*((*(fMaterial->GetElementVector()))[i]->GetZ())
*log((*(fMaterial->GetElementVector()))[i]->GetIonisation()
->GetMeanExcitationEnergy());
*((*(fMaterial->GetElementVector()))[i]->GetZ())
*log((*(fMaterial->GetElementVector()))[i]->GetIonisation()
->GetMeanExcitationEnergy());
}
fLogMeanExcEnergy /= fMaterial->GetTotNbOfElectPerVolume();
fMeanExcitationEnergy = exp(fLogMeanExcEnergy);
fShellCorrectionVector = new G4double[3];
for (G4int j=0; j<=2; j++)
@@ -192,6 +198,89 @@ void G4IonisParamMat::ComputeFluctModel()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
void G4IonisParamMat::SetMeanExcitationEnergy(G4double value)
{
if(value == fMeanExcitationEnergy || value <= 0.0) return;
if(fMeanExcitationEnergy > 0.0) {
G4cout << "G4Material: Mean excitation energy is changed for " << fMaterial->GetName()
<< " Iold= " << fMeanExcitationEnergy/eV
<< "eV; Inew= " << value/eV << " eV;"
<< G4endl;
}
fMeanExcitationEnergy = value;
fLogMeanExcEnergy = log(value);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4double G4IonisParamMat::FindMeanExcitationEnergy(const G4String& chFormula)
{
// The data on mean excitation energy for compaunds
// from "Stopping Powers for Electrons and Positrons"
// ICRU Report N#37, 1984 (energy in eV)
const size_t numberOfMolecula = 79 ;
static G4String name[numberOfMolecula] = {
// gas
"NH_3", "C_4H_10", "CO_2", "C_2H_6", "C_7H_16",
"C_6H_14", "CH_4", "NO", "N_2O", "C_8H_18",
"C_5H_12", "C_3H_8", "H_2O-Gas",
// liquid
"C_3H_6O", "C_6H_5NH_2", "C_6H_6", "C_4H_9OH", "CCl_4",
"C_6H_5Cl", "CHCl_3", "C_6H_12", "C_6H_4Cl_2", "C_4Cl_2H_8O",
"C_2Cl_2H_4", "(C_2H_5)_2O", "C_2H_5OH", "C_3H_5(OH)_3","C_7H_16",
"C_6H_14", "CH_3OH", "C_6H_5NO_2","C_5H_12", "C_3H_7OH",
"C_5H_5N", "C_8H_8", "C_2Cl_4", "C_7H_8", "C_2Cl_3H",
"H_2O", "C_8H_10"
//solid
"C_5H_5N_5", "C_5H_5N_5O", "(C_6H_11NO)-nylon", "C_25H_52",
"(C_2H_4)-Polyethylene", "(C_5H_8O-2)-Polymethil_Methacrylate",
"(C_8H_8)-Polystyrene", "A-150-tissue", "Al_2O_3", "CaF_2",
"LiF", "Photo_Emulsion", "(C_2F_4)-Teflon", "SiO_2"
} ;
static G4double meanExcitation[numberOfMolecula] = {
53.7, 48.3, 85.0, 45.4, 49.2,
49.1, 41.7, 87.8, 84.9, 49.5,
48.2, 47.1, 71.6,
64.2, 66.2, 63.4, 59.9, 166.3,
89.1, 156.0, 56.4, 106.5, 103.3,
111.9, 60.0, 62.9, 72.6, 54.4,
54.0, 67.6, 75.8, 53.6, 61.1,
66.2, 64.0, 159.2, 62.5, 148.1,
75.0, 61.8,
71.4, 75.0, 63.9, 48.3, 57.4,
74.0, 68.7, 65.1, 145.2, 166.,
94.0, 331.0, 99.1, 139.2
} ;
G4double x = fMeanExcitationEnergy;
for(size_t i=0; i<numberOfMolecula; i++) {
if(chFormula == name[i]) {
x = meanExcitation[i]*eV;
break;
}
}
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4IonisParamMat::~G4IonisParamMat()
{
if (fShellCorrectionVector) delete [] fShellCorrectionVector;
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4Isotope.cc,v 1.12 2002/02/26 17:34:34 maire Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4MPVEntry.cc,v 1.6 2001/07/11 10:01:28 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
//
////////////////////////////////////////////////////////////////////////
+3 -59
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Material.cc,v 1.21 2002/05/06 15:37:55 maire Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4Material.cc,v 1.22 2002/08/06 15:14:29 maire Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//
@@ -55,6 +55,7 @@
// 26-02-02, fIndexInTable renewed
// 16-04-02, G4Exception put in constructor with chemical formula
// 06-05-02, remove the check of the ideal gas state equation
// 06-08-02, remove constructors with chemical formula (mma)
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -157,38 +158,6 @@ G4Material::G4Material(const G4String& name, G4double density,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Constructor to create a material with chemical formula from scratch
G4Material::G4Material(const G4String& name, const G4String& chFormula,
G4double z, G4double a, G4double density,
G4State state, G4double temp, G4double pressure)
:fName(name),fChemicalFormula(chFormula)
{
G4Exception
("---> from G4Material constructor with chemical formula."
" This constructor is depreciated.\n"
" Use material->SetChemicalFormula(const G4String&)");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Constructor to create a material with chemical formula from a List
// of constituents (elements and/or materials) added with AddElement
// or AddMaterial
G4Material::G4Material(const G4String& name, const G4String& chFormula,
G4double density, G4int nComponents,
G4State state, G4double temp, G4double pressure)
:fName(name),fChemicalFormula(chFormula)
{
G4Exception
("---> from G4Material constructor with chemical formula."
" This constructor is depreciated.\n"
" Use material->SetChemicalFormula(const G4String&)");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// AddElement -- composition by atom count
void G4Material::AddElement(G4Element* element, G4int nAtoms)
@@ -371,31 +340,6 @@ void G4Material::ComputeDerivedQuantities()
TotNbOfAtomsPerVolume += VecNbOfAtomsPerVolume[i];
TotNbOfElectPerVolume += VecNbOfAtomsPerVolume[i]*Zi;
}
/// //for gas, check coherence of the state conditions
/// if (fState == kStateGas) {
/// G4int nbAtomsPerMolecule = 1;
/// if (fAtomsVector) {
/// nbAtomsPerMolecule = 0;
/// for (size_t j=0;j<fNumberOfElements;j++)
/// nbAtomsPerMolecule += fAtomsVector[j];
/// }
/// G4double NbOfMoleculesPerVolume = TotNbOfAtomsPerVolume/nbAtomsPerMolecule;
///
/// G4double ratio = NbOfMoleculesPerVolume*k_Boltzmann*fTemp/fPressure;
/// if ((ratio<0.1)||(ratio>10.)) {
/// G4cerr << "--warning from G4Material-- The state conditions of the gas: "
/// << fName << " are not consistent."
/// << "\n density = " << fDensity/(mg/cm3) << " mg/cm3"
/// << "\t pressure = " << fPressure/atmosphere << " atmosphere"
/// << "\t temperature = " << fTemp/kelvin << " kelvin"
/// << "\n rho*(T/P) would be of the order of: "
/// << (fDensity/(NbOfMoleculesPerVolume*k_Boltzmann))
/// /((mg/cm3)*(kelvin/atmosphere))
/// << " (mg/cm3)*(kelvin/atmosphere)."
/// " The energy loss calculation maybe be affected \n";
/// }
/// }
ComputeRadiationLength();
ComputeNuclearInterLength();
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4MaterialPropertiesTable.cc,v 1.12 2001/10/17 07:59:54 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4MaterialPropertiesTable.cc,v 1.13 2002/11/07 02:30:29 gum Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//
////////////////////////////////////////////////////////////////////////
@@ -33,7 +33,8 @@
// Version: 1.0
// Created: 1996-02-08
// Author: Juliet Armstrong
// Updated: 1999-11-05 Migration from G4RWTPtrHashDictionary to STL
// Updated: 2002-11-05 add named material constants by P. Gumplinger
// 1999-11-05 Migration from G4RWTPtrHashDictionary to STL
// by John Allison
// 1997-03-26 by Peter Gumplinger
// > cosmetics (only)
@@ -44,93 +45,47 @@
#include "globals.hh"
#include "G4MaterialPropertiesTable.hh"
//////////////
// Operators
//////////////
/**************
G4MaterialPropertiesTable&
G4MaterialPropertiesTable::operator =(const G4MaterialPropertiesTable& right)
{
if (this == &right) return *this;
// clear any current contents of MPT
MPT.clearAndDestroy();
// want to make an actual copy -- not a shallow copy which is
// the default for RWTPrtHashDictionary's assignment operator
G4RWTPtrHashDictionary<G4String, G4MaterialPropertyVector>
rightMPT(right.MPT);
G4RWTPtrHashDictionaryIterator<G4String, G4MaterialPropertyVector>
rightIterator(rightMPT);
rightIterator.reset();
while (++rightIterator) {
G4MaterialPropertyVector *newProp =
new G4MaterialPropertyVector(*(rightIterator.value()));
G4String *newKey =
new G4String(*(rightIterator.key()));
MPT.insertKeyAndValue(newKey, newProp);
}
return *this;
}
**********/
/////////////////
// Constructors
/////////////////
G4MaterialPropertiesTable::G4MaterialPropertiesTable() {}
/*********
G4MaterialPropertiesTable::G4MaterialPropertiesTable
(const G4MaterialPropertiesTable &right) :
MPT(hashString), MPTiterator(MPT)
{
// want to make an actual copy -- not a shallow copy which is
// the default for RWTPrtHashDictionary's assignment operator
G4RWTPtrHashDictionary<G4String, G4MaterialPropertyVector>
rightMPT(right.MPT);
G4RWTPtrHashDictionaryIterator<G4String, G4MaterialPropertyVector>
rightIterator(rightMPT);
rightIterator.reset();
while (++rightIterator) {
G4MaterialPropertyVector *newProp =
new G4MaterialPropertyVector(*(rightIterator.value()));
G4String *newKey =
new G4String(*(rightIterator.key()));
MPT.insertKeyAndValue(newKey, newProp);
}
}
*******/
////////////////
// Destructors
////////////////
G4MaterialPropertiesTable::~G4MaterialPropertiesTable()
{
// MPT.clearAndDestroy();
MPTiterator i;
for (i = MPT.begin(); i != MPT.end(); ++i) {
delete (*i).second;
}
MPT.clear();
MPTiterator i;
for (i = MPT.begin(); i != MPT.end(); ++i) {
delete (*i).second;
}
MPT.clear();
MPTC.clear();
}
////////////
// Methods
////////////
void G4MaterialPropertiesTable::AddConstProperty(const char *key,
G4double PropertyValue)
{
// Provides a way of adding a constant property to the Mataerial Properties
// Table given a key
MPTC [G4String(key)] = PropertyValue;
}
void G4MaterialPropertiesTable::AddProperty(const char *key,
G4double *PhotonMomenta,
G4double *PropertyValues,
G4int NumEntries)
{
// Privides a way of adding a property to the Material Properties
// Table given a pair of numbers and a key
G4MaterialPropertyVector *mpv =
new G4MaterialPropertyVector(PhotonMomenta,
PropertyValues,
@@ -147,19 +102,46 @@ void G4MaterialPropertiesTable::AddProperty(const char *key,
MPT [G4String(key)] = mpv;
}
void G4MaterialPropertiesTable::RemoveConstProperty(const char *key)
{
MPTC.erase(G4String(key));
}
void G4MaterialPropertiesTable::RemoveProperty(const char *key)
{
MPT.erase(G4String(key));
}
G4double G4MaterialPropertiesTable::GetConstProperty(const char *key)
{
// Returns the constant material property corresponding to a key
MPTCiterator j;
j = MPTC.find(G4String(key));
if ( j != MPTC.end() ) {
return j->second;
}
else {
G4Exception("G4MaterialPropertiesTable::GetConstProperty ==> "
"Constant Material Property not found.");
return G4double(0.0);
}
}
G4MaterialPropertyVector* G4MaterialPropertiesTable::GetProperty(const char *key)
{
return MPT [G4String(key)];
// Returns a Material Property Vector corresponding to a key
return MPT [G4String(key)];
}
void G4MaterialPropertiesTable::AddEntry(const char *key,
G4double aPhotonMomentum,
G4double aPropertyValue)
// Allows to add an entry pair directly to the Material Property Vector
// given a key
{
G4MaterialPropertyVector *targetVector=MPT [G4String(key)];
if (targetVector != 0) {
@@ -174,6 +156,9 @@ void G4MaterialPropertiesTable::AddEntry(const char *key,
void G4MaterialPropertiesTable::RemoveEntry(const char *key,
G4double aPhotonMomentum)
{
// Allows to remove an entry pair directly from the Material Property Vector
// given a key
G4MaterialPropertyVector *targetVector=MPT [G4String(key)];
if (targetVector) {
targetVector->RemoveElement(aPhotonMomentum);
@@ -195,4 +180,15 @@ void G4MaterialPropertiesTable::DumpTable()
G4cout << "NULL Material Property Vector Pointer." << G4endl;
}
}
MPTCiterator j;
for (j = MPTC.begin(); j != MPTC.end(); ++j) {
G4cout << j->first << G4endl;
if ( j->second != 0 ) {
G4cout << j->second << G4endl;
}
else {
G4cout << "No Material Constant Property." << G4endl;
}
}
}
@@ -22,7 +22,7 @@
//
//
// $Id: G4MaterialPropertyVector.cc,v 1.13 2002/01/22 15:23:58 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
//
////////////////////////////////////////////////////////////////////////
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4OpticalSurface.cc,v 1.7 2001/10/17 07:59:54 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
//
////////////////////////////////////////////////////////////////////////
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4SandiaTable.cc,v 1.14 2001/10/17 07:59:54 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//