Import Geant4 1.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:28:20 +02:00
parent aaa409b6ee
commit ca1c8cb059
2995 changed files with 106830 additions and 299600 deletions
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the 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: G4AtomicShells.cc,v 1.1 1999/01/07 16:09:43 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4AtomicShells.cc,v 1.1.10.1 1999/12/07 20:49:18 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the 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.cc,v 1.2 1999/04/14 12:49:01 maire Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4Element.cc,v 1.2.8.1 1999/12/07 20:49:19 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// ------------ class G4Element ------------
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the 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.cc,v 1.2 1999/04/14 12:49:01 maire Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4IonisParamElm.cc,v 1.2.8.1 1999/12/07 20:49:19 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// ------------ class G4IonisParamElm ------------
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the 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.cc,v 1.2 1999/04/14 12:49:02 maire Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4IonisParamMat.cc,v 1.2.8.1 1999/12/07 20:49:19 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the 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.cc,v 1.1 1999/01/07 16:09:44 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4Isotope.cc,v 1.1.10.1 1999/12/07 20:49:19 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// --------------------------------------------------------------
+6 -6
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the 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.cc,v 1.2 1999/04/14 12:49:02 maire Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4MPVEntry.cc,v 1.3.2.1 1999/11/11 14:30:15 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
////////////////////////////////////////////////////////////////////////
@@ -35,7 +35,7 @@
// Overload the == operator
// ------------------------
// Well defined == semantics required by RWTPtrSortedVector
// Well defined == semantics required by G4RWTPtrSortedVector
//
G4bool G4MPVEntry::operator ==(const G4MPVEntry &right) const
{
@@ -47,7 +47,7 @@ G4bool G4MPVEntry::operator ==(const G4MPVEntry &right) const
// Overload the < operator
// -----------------------
// Well defined < semantics required by RWTPtrSortedVector
// Well defined < semantics required by G4RWTPtrSortedVector
//
G4bool G4MPVEntry::operator <(const G4MPVEntry &right) const
{
@@ -59,7 +59,7 @@ G4bool G4MPVEntry::operator <(const G4MPVEntry &right) const
// Overload the = operator
// -----------------------
// Well defined = semantics required by RWTPtrSortedVector
// Well defined = semantics required by G4RWTPtrSortedVector
//
G4MPVEntry& G4MPVEntry::operator =(const G4MPVEntry& right)
{
+97 -7
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the 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.cc,v 1.3 1999/04/14 12:49:03 maire Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4Material.cc,v 1.5.8.1 1999/12/07 20:49:20 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// ---------- class G4Material ----------
@@ -34,7 +34,8 @@
// 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
// 19-07-99, Constructors with chemicalFormula added by V.Ivanchenko
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
#include "G4Material.hh"
@@ -56,7 +57,7 @@ G4Material::G4Material(const G4String& name, G4double z,
InitializePointers();
if (density < universe_mean_density)
{ G4cout << "--- Warning from G4Material::G4Material()"
{ G4cerr << "--- Warning from G4Material::G4Material()"
<< " define a material with density=0 is not allowed. \n"
<< " The material " << name << " will be constructed with the"
<< " default minimal density: " << universe_mean_density/(g/cm3)
@@ -68,6 +69,7 @@ G4Material::G4Material(const G4String& name, G4double z,
fState = state;
fTemp = temp;
fPressure = pressure;
fChemicalFormula = " ";
// Initialize theElementVector allocating one
// element corresponding to this material
@@ -103,7 +105,93 @@ G4Material::G4Material(const G4String& name, G4double density, G4int nComponents
InitializePointers();
if (density < universe_mean_density)
{G4cout << "--- Warning from G4Material::G4Material()"
{G4cerr << "--- Warning from G4Material::G4Material()"
<< " define a material with density=0 is not allowed. \n"
<< " The material " << name << " will be constructed with the"
<< " default minimal density: " << universe_mean_density/(g/cm3)
<< "g/cm3" << endl;
density = universe_mean_density;
}
fDensity = density;
fState = state;
fTemp = temp;
fPressure = pressure;
fChemicalFormula = " ";
maxNbComponents = nComponents;
fNumberOfComponents = fNumberOfElements = 0;
theElementVector = new G4ElementVector(maxNbComponents);
if (fState == kStateUndefined)
{
if (fDensity > kGasThreshold) fState = kStateSolid;
else fState = kStateGas;
}
}
//....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)
{
InitializePointers();
if (density < universe_mean_density)
{ G4cerr << "--- Warning from G4Material::G4Material()"
<< " define a material with density=0 is not allowed. \n"
<< " The material " << name << " will be constructed with the"
<< " default minimal density: " << universe_mean_density/(g/cm3)
<< "g/cm3" << endl;
density = universe_mean_density;
}
fDensity = density;
fState = state;
fTemp = temp;
fPressure = pressure;
// Initialize theElementVector allocating one
// element corresponding to this material
maxNbComponents = fNumberOfComponents = fNumberOfElements = 1;
theElementVector = new G4ElementVector(1);
theElementVector[0] = new G4Element(name, " ", z, a);
fMassFractionVector = new G4double[1];
fMassFractionVector[0] = 1. ;
if (fState == kStateUndefined)
{
if (fDensity > kGasThreshold) fState = kStateSolid;
else fState = kStateGas;
}
ComputeDerivedQuantities();
// Store in the table of Materials
theMaterialTable.insert(this);
fIndexInTable = theMaterialTable.index(this);
}
//....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)
{
InitializePointers();
if (density < universe_mean_density)
{G4cerr << "--- Warning from G4Material::G4Material()"
<< " define a material with density=0 is not allowed. \n"
<< " The material " << name << " will be constructed with the"
<< " default minimal density: " << universe_mean_density/(g/cm3)
@@ -307,7 +395,7 @@ void G4Material::ComputeDerivedQuantities()
if (fState == kStateGas) {
G4double ratio = TotNbOfAtomsPerVolume*k_Boltzmann*fTemp/fPressure;
if ((ratio<0.1)||(ratio>10.)) {
G4cout << "---warning from G4Material-- The state conditions of the gas: "
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"
@@ -375,6 +463,7 @@ const G4Material& G4Material::operator=(const G4Material& right)
if (this != &right)
{
fName = right.fName;
fChemicalFormula = right.fChemicalFormula;
fDensity = right.fDensity;
fState = right.fState;
fTemp = right.fTemp;
@@ -420,6 +509,7 @@ ostream& operator<<(ostream& flux, G4Material* material)
flux
<< " Material: " << setw(8) << material->fName
<< " " << material->fChemicalFormula << " "
<< " density: " << setw(6) << setprecision(3)
<< G4BestUnit(material->fDensity,"Volumic Mass")
<< " temperature: " << setw(6) << setprecision(2)
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the 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.cc,v 1.2 1999/04/14 12:49:03 maire Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4MaterialPropertiesTable.cc,v 1.5.2.1 1999/11/11 14:30:15 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
////////////////////////////////////////////////////////////////////////
@@ -17,20 +17,22 @@
// Version: 1.0
// Created: 1996-02-08
// Author: Juliet Armstrong
// Updated: 1997-03-26 by Peter Gumplinger
// Updated: 1999-11-05 Migration from G4RWTPtrHashDictionary to STL
// by John Allison
// 1997-03-26 by Peter Gumplinger
// > cosmetics (only)
// mail: gum@triumf.ca
//
////////////////////////////////////////////////////////////////////////
#include "globals.hh"
#include "G4MaterialPropertiesTable.hh"
unsigned hashString(const G4String &str) { return str.hash(); }
//////////////
// Operators
//////////////
/**************
G4MaterialPropertiesTable&
G4MaterialPropertiesTable::operator =(const G4MaterialPropertiesTable& right)
{
@@ -43,28 +45,29 @@ G4MaterialPropertiesTable::operator =(const G4MaterialPropertiesTable& right)
// want to make an actual copy -- not a shallow copy which is
// the default for RWTPrtHashDictionary's assignment operator
RWTPtrHashDictionary<G4String, G4MaterialPropertyVector>
G4RWTPtrHashDictionary<G4String, G4MaterialPropertyVector>
rightMPT(right.MPT);
RWTPtrHashDictionaryIterator<G4String, G4MaterialPropertyVector>
G4RWTPtrHashDictionaryIterator<G4String, G4MaterialPropertyVector>
rightIterator(rightMPT);
rightIterator.reset();
while (++rightIterator) {
G4MaterialPropertyVector *newProp =
new G4MaterialPropertyVector(*(rightIterator.value()));
RWCString *newKey =
new RWCString(*(rightIterator.key()));
G4String *newKey =
new G4String(*(rightIterator.key()));
MPT.insertKeyAndValue(newKey, newProp);
}
return *this;
}
**********/
/////////////////
// Constructors
/////////////////
G4MaterialPropertiesTable::G4MaterialPropertiesTable() : MPT(hashString),
MPTiterator(MPT) {}
G4MaterialPropertiesTable::G4MaterialPropertiesTable() {}
/*********
G4MaterialPropertiesTable::G4MaterialPropertiesTable
(const G4MaterialPropertiesTable &right) :
MPT(hashString), MPTiterator(MPT)
@@ -72,9 +75,9 @@ G4MaterialPropertiesTable::G4MaterialPropertiesTable
// want to make an actual copy -- not a shallow copy which is
// the default for RWTPrtHashDictionary's assignment operator
RWTPtrHashDictionary<G4String, G4MaterialPropertyVector>
G4RWTPtrHashDictionary<G4String, G4MaterialPropertyVector>
rightMPT(right.MPT);
RWTPtrHashDictionaryIterator<G4String, G4MaterialPropertyVector>
G4RWTPtrHashDictionaryIterator<G4String, G4MaterialPropertyVector>
rightIterator(rightMPT);
rightIterator.reset();
@@ -82,11 +85,12 @@ G4MaterialPropertiesTable::G4MaterialPropertiesTable
while (++rightIterator) {
G4MaterialPropertyVector *newProp =
new G4MaterialPropertyVector(*(rightIterator.value()));
RWCString *newKey =
new RWCString(*(rightIterator.key()));
G4String *newKey =
new G4String(*(rightIterator.key()));
MPT.insertKeyAndValue(newKey, newProp);
}
}
*******/
////////////////
// Destructors
@@ -94,7 +98,12 @@ G4MaterialPropertiesTable::G4MaterialPropertiesTable
G4MaterialPropertiesTable::~G4MaterialPropertiesTable()
{
MPT.clearAndDestroy();
// MPT.clearAndDestroy();
MPTiterator i;
for (i = MPT.begin(); i != MPT.end(); ++i) {
delete (*i).second;
}
MPT.clear();
}
////////////
@@ -110,8 +119,7 @@ void G4MaterialPropertiesTable::AddProperty(char *key,
new G4MaterialPropertyVector(PhotonMomenta,
PropertyValues,
NumEntries);
G4String *newKey = new G4String(key);
MPT.insertKeyAndValue(newKey, mpv);
MPT [G4String(key)] = mpv;
}
void G4MaterialPropertiesTable::AddProperty(char *key,
@@ -120,29 +128,24 @@ void G4MaterialPropertiesTable::AddProperty(char *key,
// Provides a way of adding a property to the Material Properties
// Table given an G4MaterialPropertyVector Reference and a key
G4String *theKey = new G4String(key);
MPT.insertKeyAndValue(theKey, mpv);
MPT [G4String(key)] = mpv;
}
void G4MaterialPropertiesTable::RemoveProperty(char *key)
{
G4String target(key);
MPT.remove(&target);
MPT.erase(G4String(key));
}
G4MaterialPropertyVector* G4MaterialPropertiesTable::GetProperty(char *key)
{
G4String target(key);
return MPT.findValue(&target);
return MPT [G4String(key)];
}
void G4MaterialPropertiesTable::AddEntry(char *key,
G4double aPhotonMomentum,
G4double aPropertyValue)
{
G4String target(key);
G4MaterialPropertyVector *targetVector=MPT.findValue(&target);
G4MaterialPropertyVector *targetVector=MPT [G4String(key)];
if (targetVector != NULL) {
targetVector->AddElement(aPhotonMomentum, aPropertyValue);
}
@@ -152,11 +155,10 @@ void G4MaterialPropertiesTable::AddEntry(char *key,
}
}
void G4MaterialPropertiesTable::RemoveEntry(char *key,
void G4MaterialPropertiesTable::RemoveEntry(char *key,
G4double aPhotonMomentum)
{
G4String target(key);
G4MaterialPropertyVector *targetVector=MPT.findValue(&target);
G4MaterialPropertyVector *targetVector=MPT [G4String(key)];
if (targetVector) {
targetVector->RemoveElement(aPhotonMomentum);
}
@@ -167,9 +169,9 @@ void G4MaterialPropertiesTable::RemoveEntry(char *key,
}
void G4MaterialPropertiesTable::DumpTable()
{
MPTiterator.reset();
while(++MPTiterator) {
G4cout << *MPTiterator.key() << endl;
MPTiterator.value()->DumpVector();
}
MPTiterator i;
for (i = MPT.begin(); i != MPT.end(); ++i) {
G4cout << *(*i).first << endl;
(*i).second->DumpVector();
}
}
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the 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.cc,v 1.2 1999/04/14 12:49:04 maire Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4MaterialPropertyVector.cc,v 1.3.2.1 1999/11/11 14:30:16 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
////////////////////////////////////////////////////////////////////////
@@ -60,7 +60,7 @@ G4MaterialPropertyVector::operator =(const G4MaterialPropertyVector& right)
MPV.clearAndDestroy();
// create an actual copy (instead of the shallow copy that the
// assignment operator defaults to for RWTPtrSortedVector)
// assignment operator defaults to for G4RWTPtrSortedVector)
NumEntries = 0;
CurrentEntry = -1;
@@ -97,7 +97,7 @@ G4MaterialPropertyVector::G4MaterialPropertyVector
(const G4MaterialPropertyVector &right)
{
// create an actual copy (instead of the shallow copy that the
// assignment operator defaults to for RWTPtrSortedVector)
// assignment operator defaults to for G4RWTPtrSortedVector)
NumEntries = 0;
CurrentEntry = -1;
+3 -3
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the 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.cc,v 1.2 1999/04/14 12:49:04 maire Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4OpticalSurface.cc,v 1.3 1999/11/05 21:13:56 gum Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
////////////////////////////////////////////////////////////////////////
+35 -8
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the 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.cc,v 1.2 1999/04/15 14:01:11 grichine Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4SandiaTable.cc,v 1.4.4.1 1999/12/07 20:49:20 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//
@@ -25,7 +25,10 @@ G4double G4SandiaTable::fSandiaCofPerAtom[4];
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4SandiaTable::G4SandiaTable(G4int matIndex){ ; }
G4SandiaTable::G4SandiaTable(G4int matIndex)
{
fMatSandiaMatrix = NULL ;
}
G4SandiaTable::G4SandiaTable(G4Material* material)
:fMaterial(material)
@@ -42,7 +45,10 @@ G4SandiaTable::G4SandiaTable(G4Material* material)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4SandiaTable::~G4SandiaTable()
{ delete fMatSandiaMatrix;}
{
if(fMatSandiaMatrix) delete fMatSandiaMatrix ;
if(fPhotoAbsorptionCof) delete fPhotoAbsorptionCof ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
@@ -138,7 +144,7 @@ G4double* G4SandiaTable::GetSandiaCofForMaterial(G4double energy)
//
void
G4SandiaTable::SandiaSort(G4double da[][5],
G4SandiaTable::SandiaSort(G4double** da ,
G4int sz )
{
for(G4int i = 1 ;i < sz ; i++ )
@@ -162,8 +168,29 @@ G4int
G4SandiaTable::SandiaIntervals(G4int Z[],
G4int el )
{
G4int c,i;
for(c = 0 ; c < fIntervalLimit ; c++) // just in case
G4int c,i ;
fMaxInterval = 0 ;
for(i=0;i<el;i++)
{
fMaxInterval += fNbOfIntervals[Z[i]] ;
}
fMaxInterval += 2 ;
// G4cout<<"fMaxInterval = "<<fMaxInterval<<endl ;
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. ;
}