Import Geant4 8.3.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.78 2006/10/17 15:15:46 vnivanch Exp $
|
||||
$Id: History,v 1.80 2007/01/10 18:54:30 vnivanch Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,12 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
10-07-01 V.Ivanchenko (materials-V08-02-00)
|
||||
- G4Material - fill fAtomVector in the case, when material is built
|
||||
from Element mass fractions
|
||||
- G4NistMaterialBuilder - add liquids O2 and N2
|
||||
- G4NistElementBuilder - add protection Z<=101
|
||||
|
||||
27-06-06 V.Ivanchenko (materials-V08-01-01)
|
||||
- Add methods to access vector of names of NIST elements and materials
|
||||
(ILC requirement)
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4NistElementBuilder.hh,v 1.10 2006/10/17 15:15:46 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4NistElementBuilder.hh,v 1.11 2007/01/10 18:53:45 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
|
||||
#ifndef G4NistElementBuilder_h
|
||||
#define G4NistElementBuilder_h 1
|
||||
@@ -113,6 +113,7 @@ private:
|
||||
G4double sigMass [maxAbundance];
|
||||
G4double relAbundance [maxAbundance];
|
||||
|
||||
G4int limitNumElements; // protection
|
||||
G4int index;
|
||||
G4int verbose;
|
||||
G4bool first;
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Material.cc,v 1.34 2006/06/29 19:12:51 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4Material.cc,v 1.35 2007/01/10 12:00:29 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//
|
||||
@@ -62,6 +62,7 @@
|
||||
// 22-01-04, proper STL handling of theElementVector (Hisaya)
|
||||
// 30-03-05, warning in GetMaterial(materialName)
|
||||
// 09-03-06, minor change of printout (V.Ivanchenko)
|
||||
// 10-01-07, compute fAtomVector in the case of mass fraction (V.Ivanchenko)
|
||||
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -228,15 +229,17 @@ void G4Material::AddElement(G4Element* element, G4int nAtoms)
|
||||
void G4Material::AddElement(G4Element* element, G4double fraction)
|
||||
{
|
||||
// if fAtomsVector is non-NULL, complain. Apples and oranges. $$$
|
||||
/*
|
||||
if (fAtomsVector) {
|
||||
G4cerr << "This material is already being defined via elements by"
|
||||
<< "atoms." << G4endl;
|
||||
G4Exception ("You are mixing apples and oranges ...");
|
||||
}
|
||||
|
||||
*/
|
||||
// initialization
|
||||
if (fNumberOfComponents == 0) {
|
||||
fMassFractionVector = new G4double[100];
|
||||
fMassFractionVector = new G4double[50];
|
||||
fAtomsVector = new G4int [50];
|
||||
}
|
||||
|
||||
// filling ...
|
||||
@@ -258,15 +261,26 @@ void G4Material::AddElement(G4Element* element, G4double fraction)
|
||||
|
||||
// filled.
|
||||
if (G4int(fNumberOfComponents) == maxNbComponents) {
|
||||
|
||||
size_t i=0;
|
||||
G4double Zmol(0.), Amol(0.);
|
||||
// check sum of weights -- OK?
|
||||
G4double wtSum(0.0);
|
||||
for (size_t i=0;i<fNumberOfElements;i++) {wtSum += fMassFractionVector[i];}
|
||||
for (i=0;i<fNumberOfElements;i++) {
|
||||
wtSum += fMassFractionVector[i];
|
||||
Zmol += fMassFractionVector[i]*(*theElementVector)[i]->GetZ();
|
||||
Amol += fMassFractionVector[i]*(*theElementVector)[i]->GetA();
|
||||
}
|
||||
if (std::abs(1.-wtSum) > perThousand) {
|
||||
G4cerr << "WARNING !! - Fractional masses do not sum to 1 : "
|
||||
"the Delta is > 0.001"
|
||||
"(the weights are NOT renormalized; the results may be wrong)"
|
||||
<< G4endl;
|
||||
}
|
||||
for (i=0;i<fNumberOfElements;i++) {
|
||||
fAtomsVector[i] =
|
||||
G4int(fMassFractionVector[i]*Amol/(*theElementVector)[i]->GetA()+0.5);
|
||||
}
|
||||
|
||||
ComputeDerivedQuantities();
|
||||
|
||||
@@ -282,16 +296,18 @@ void G4Material::AddElement(G4Element* element, G4double fraction)
|
||||
|
||||
void G4Material::AddMaterial(G4Material* material, G4double fraction)
|
||||
{
|
||||
/*
|
||||
// if fAtomsVector is non-NULL, complain. Apples and oranges. $$$
|
||||
if (fAtomsVector) {
|
||||
G4cerr << "This material is already being defined via elements by"
|
||||
"atoms." << G4endl;
|
||||
G4Exception ("You are mixing apples and oranges ...");
|
||||
}
|
||||
|
||||
*/
|
||||
// initialization
|
||||
if (fNumberOfComponents == 0) {
|
||||
fMassFractionVector = new G4double[100];
|
||||
fMassFractionVector = new G4double[50];
|
||||
fAtomsVector = new G4int [50];
|
||||
}
|
||||
|
||||
// filling ...
|
||||
@@ -319,16 +335,25 @@ void G4Material::AddMaterial(G4Material* material, G4double fraction)
|
||||
|
||||
// filled.
|
||||
if (G4int(fNumberOfComponents) == maxNbComponents) {
|
||||
size_t i=0;
|
||||
G4double Zmol(0.), Amol(0.);
|
||||
// check sum of weights -- OK?
|
||||
G4double wtSum(0.0);
|
||||
for (size_t i=0;i<fNumberOfElements;i++)
|
||||
{ wtSum += fMassFractionVector[i]; }
|
||||
for (i=0;i<fNumberOfElements;i++) {
|
||||
wtSum += fMassFractionVector[i];
|
||||
Zmol += fMassFractionVector[i]*(*theElementVector)[i]->GetZ();
|
||||
Amol += fMassFractionVector[i]*(*theElementVector)[i]->GetA();
|
||||
}
|
||||
if (std::abs(1.-wtSum) > perThousand) {
|
||||
G4cerr << "WARNING !! - Fractional masses do not sum to 1 : "
|
||||
"the Delta is > 0.001"
|
||||
"(the weights are NOT renormalized; the results may be wrong)"
|
||||
<< G4endl;
|
||||
}
|
||||
for (i=0;i<fNumberOfElements;i++) {
|
||||
fAtomsVector[i] =
|
||||
G4int(fMassFractionVector[i]*Amol/(*theElementVector)[i]->GetA()+0.5);
|
||||
}
|
||||
|
||||
ComputeDerivedQuantities();
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4NistElementBuilder.cc,v 1.11 2006/10/17 15:15:46 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4NistElementBuilder.cc,v 1.13 2007/01/10 18:58:52 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -41,6 +41,7 @@
|
||||
// 11.05.2006 Do not subtract mass of atomic electrons from NIST mass (VI)
|
||||
// 17.10.2006 Add natiral abandances flag to element and
|
||||
// use G4 units for isotope mass vector (VI)
|
||||
// 10.01.2006 Add protection agains Z>101 (VI)
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -61,6 +62,8 @@ G4NistElementBuilder::G4NistElementBuilder(G4int vb):
|
||||
verbose(vb), first(true)
|
||||
{
|
||||
Initialise();
|
||||
// Atomic shells are defined only for 101 elements
|
||||
limitNumElements = 101;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -81,7 +84,7 @@ G4Element* G4NistElementBuilder::FindOrBuildElement(const G4String& symb,
|
||||
}
|
||||
G4int Z = 0;
|
||||
G4Element* elm = 0;
|
||||
do {Z++;} while (Z<maxNumElements && !(symb == elmSymbol[Z]));
|
||||
do {Z++;} while (Z<limitNumElements && !(symb == elmSymbol[Z]));
|
||||
if(Z<maxNumElements) elm = FindOrBuildElement(Z, buildIsotopes);
|
||||
return elm;
|
||||
}
|
||||
@@ -113,11 +116,12 @@ G4Element* G4NistElementBuilder::FindOrBuildElement(G4int Z,
|
||||
return anElement;
|
||||
}
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4Element* G4NistElementBuilder::BuildElement(G4int Z, G4bool buildIsotopes)
|
||||
{
|
||||
G4Element* theElement = 0;
|
||||
if(Z<1 || Z>limitNumElements) return theElement;
|
||||
G4double Zeff = (G4double)Z;
|
||||
G4double Aeff = atomicMass[Z];
|
||||
if (verbose > 1) {
|
||||
@@ -127,7 +131,6 @@ G4Element* G4NistElementBuilder::BuildElement(G4int Z, G4bool buildIsotopes)
|
||||
if(buildIsotopes) G4cout << " with natural isotope composition" << G4endl;
|
||||
else G4cout << " isotopes are not built" << G4endl;
|
||||
}
|
||||
G4Element* theElement = 0;
|
||||
|
||||
//build Element with its Isotopes
|
||||
//
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4NistMaterialBuilder.cc,v 1.14 2006/06/29 19:13:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4NistMaterialBuilder.cc,v 1.15 2007/01/10 12:25:56 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
@@ -1680,6 +1680,8 @@ void G4NistMaterialBuilder::NistCompoundMaterials()
|
||||
void G4NistMaterialBuilder::HepAndNuclearMaterials()
|
||||
{
|
||||
AddMaterial("G4_lH2", 0.0708, 1, 21.8, 1, kStateLiquid);
|
||||
AddMaterial("G4_lN2", 0.807, 7, 82., 1, kStateLiquid);
|
||||
AddMaterial("G4_lO2", 1.141, 8, 95., 1, kStateLiquid);
|
||||
AddMaterial("G4_lAr", 1.396 , 18, 188. , 1, kStateLiquid);
|
||||
AddMaterial("G4_lKr", 2.418 , 36, 352. , 1, kStateLiquid);
|
||||
AddMaterial("G4_lXe", 2.953 , 54, 482. , 1, kStateLiquid);
|
||||
|
||||
Reference in New Issue
Block a user