Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4NistManager Class Reference

#include <G4NistManager.hh>

Public Member Functions

 ~G4NistManager ()
 
G4ElementGetElement (size_t index) const
 
G4ElementFindElement (G4int Z) const
 
G4ElementFindOrBuildElement (G4int Z, G4bool isotopes=true)
 
G4ElementFindOrBuildElement (const G4String &symb, G4bool isotopes=true)
 
size_t GetNumberOfElements () const
 
G4int GetZ (const G4String &symb) const
 
G4double GetAtomicMassAmu (const G4String &symb) const
 
G4double GetAtomicMassAmu (G4int Z) const
 
G4double GetIsotopeMass (G4int Z, G4int N) const
 
G4double GetAtomicMass (G4int Z, G4int N) const
 
G4double GetTotalElectronBindingEnergy (G4int Z) const
 
G4int GetNistFirstIsotopeN (G4int Z) const
 
G4int GetNumberOfNistIsotopes (G4int Z) const
 
G4double GetIsotopeAbundance (G4int Z, G4int N) const
 
void PrintElement (G4int Z) const
 
void PrintElement (const G4String &) const
 
void PrintG4Element (const G4String &) const
 
const std::vector< G4String > & GetNistElementNames () const
 
G4double GetMeanIonisationEnergy (G4int Z) const
 
G4double GetNominalDensity (G4int Z) const
 
G4MaterialGetMaterial (size_t index) const
 
G4MaterialFindMaterial (const G4String &name) const
 
G4MaterialFindOrBuildMaterial (const G4String &name, G4bool isotopes=true, G4bool warning=false)
 
G4MaterialFindSimpleMaterial (G4int Z) const
 
G4MaterialFindOrBuildSimpleMaterial (G4int Z, G4bool warning=false)
 
G4MaterialBuildMaterialWithNewDensity (const G4String &name, const G4String &basename, G4double density=0.0, G4double temp=NTP_Temperature, G4double pres=CLHEP::STP_Pressure)
 
G4MaterialConstructNewMaterial (const G4String &name, const std::vector< G4String > &elm, const std::vector< G4int > &nbAtoms, G4double dens, G4bool isotopes=true, G4State state=kStateSolid, G4double temp=NTP_Temperature, G4double pressure=CLHEP::STP_Pressure)
 
G4MaterialConstructNewMaterial (const G4String &name, const std::vector< G4String > &elm, const std::vector< G4double > &weight, G4double dens, G4bool isotopes=true, G4State state=kStateSolid, G4double temp=NTP_Temperature, G4double pressure=CLHEP::STP_Pressure)
 
G4MaterialConstructNewGasMaterial (const G4String &name, const G4String &nameNist, G4double temp, G4double pres, G4bool isotopes=true)
 
G4MaterialConstructNewIdealGasMaterial (const G4String &name, const std::vector< G4String > &elm, const std::vector< G4int > &nbAtoms, G4bool isotopes=true, G4double temp=NTP_Temperature, G4double pressure=CLHEP::STP_Pressure)
 
size_t GetNumberOfMaterials () const
 
G4int GetVerbose () const
 
void SetVerbose (G4int)
 
void PrintG4Material (const G4String &) const
 
void ListMaterials (const G4String &) const
 
const std::vector< G4String > & GetNistMaterialNames () const
 
G4double GetZ13 (G4double Z) const
 
G4double GetZ13 (G4int Z) const
 
G4double GetA27 (G4int Z) const
 
G4double GetLOGZ (G4int Z) const
 
G4double GetLOGAMU (G4int Z) const
 

Static Public Member Functions

static G4NistManagerInstance ()
 

Detailed Description

Definition at line 82 of file G4NistManager.hh.

Constructor & Destructor Documentation

G4NistManager::~G4NistManager ( )

Definition at line 79 of file G4NistManager.cc.

80 {
81  // G4cout << "NistManager: start material destruction" << G4endl;
82  const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
83  size_t nmat = theMaterialTable->size();
84  size_t i;
85  for(i=0; i<nmat; i++) {
86  if((*theMaterialTable)[i]) { delete (*theMaterialTable)[i]; }
87  }
88  // G4cout << "NistManager: start element destruction" << G4endl;
89  const G4ElementTable* theElementTable = G4Element::GetElementTable();
90  size_t nelm = theElementTable->size();
91  for(i=0; i<nelm; i++) {
92  if((*theElementTable)[i]) { delete (*theElementTable)[i]; }
93  }
94  // G4cout << "NistManager: start isotope destruction" << G4endl;
95  const G4IsotopeTable* theIsotopeTable = G4Isotope::GetIsotopeTable();
96  size_t niso = theIsotopeTable->size();
97  for(i=0; i<niso; i++) {
98  if((*theIsotopeTable)[i]) { delete (*theIsotopeTable)[i]; }
99  }
100  // G4cout << "NistManager: end isotope destruction" << G4endl;
101  delete messenger;
102  delete matBuilder;
103  delete elmBuilder;
104  // G4cout << "NistManager: end destruction" << G4endl;
105 }
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:587
std::vector< G4Material * > G4MaterialTable
static const G4IsotopeTable * GetIsotopeTable()
Definition: G4Isotope.cc:182
std::vector< G4Isotope * > G4IsotopeTable
Definition: G4Isotope.hh:67
std::vector< G4Element * > G4ElementTable
static G4ElementTable * GetElementTable()
Definition: G4Element.cc:398

Here is the call graph for this function:

Member Function Documentation

G4Material * G4NistManager::BuildMaterialWithNewDensity ( const G4String name,
const G4String basename,
G4double  density = 0.0,
G4double  temp = NTP_Temperature,
G4double  pres = CLHEP::STP_Pressure 
)

Definition at line 110 of file G4NistManager.cc.

115 {
116  G4Material* bmat = FindOrBuildMaterial(name);
117  if(bmat) {
118  G4cout << "G4NistManager::BuildMaterialWithNewDensity ERROR: " << G4endl;
119  G4cout << " New material <" << name << "> cannot be built because material"
120  << " with the same name already exist" << G4endl;
121  G4Exception("G4NistManager::BuildMaterialWithNewDensity()", "mat101",
122  FatalException, "Wrong material name");
123  return 0;
124  }
125  bmat = FindOrBuildMaterial(basename);
126  if(!bmat) {
127  G4cout << "G4NistManager::BuildMaterialWithNewDensity ERROR: " << G4endl;
128  G4cout << " New material <" << name << "> cannot be built because "
129  << G4endl;
130  G4cout << " base material <" << basename << "> does not exist" << G4endl;
131  G4Exception("G4NistManager::BuildMaterialWithNewDensity()", "mat102",
132  FatalException, "Wrong material name");
133  return 0;
134  }
135  G4double dens = density;
136  G4double temp = temperature;
137  G4double pres = pressure;
138  if(dens == 0.0) {
139  dens = bmat->GetDensity();
140  temp = bmat->GetTemperature();
141  pres = bmat->GetPressure();
142  }
143  G4Material* mat = new G4Material(name, dens, bmat, bmat->GetState(),
144  temp, pres);
145  return mat;
146 }
G4double GetPressure() const
Definition: G4Material.hh:183
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
G4double GetDensity() const
Definition: G4Material.hh:180
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4double GetTemperature() const
Definition: G4Material.hh:182
#define G4endl
Definition: G4ios.hh:61
G4State GetState() const
Definition: G4Material.hh:181
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

G4Material * G4NistManager::ConstructNewGasMaterial ( const G4String name,
const G4String nameNist,
G4double  temp,
G4double  pres,
G4bool  isotopes = true 
)
inline

Definition at line 531 of file G4NistManager.hh.

536 {
537  return matBuilder->ConstructNewGasMaterial(name,nameNist,
538  temp,pres,isotopes);
539 }
G4Material * ConstructNewGasMaterial(const G4String &name, const G4String &nameDB, G4double temp, G4double pres, G4bool isotopes=true)

Here is the call graph for this function:

G4Material * G4NistManager::ConstructNewIdealGasMaterial ( const G4String name,
const std::vector< G4String > &  elm,
const std::vector< G4int > &  nbAtoms,
G4bool  isotopes = true,
G4double  temp = NTP_Temperature,
G4double  pressure = CLHEP::STP_Pressure 
)
inline

Definition at line 543 of file G4NistManager.hh.

550 {
551  return
552  matBuilder->ConstructNewIdealGasMaterial(name,elm,nbAtoms,isotopes,T,P);
553 }
static double P[]
G4Material * ConstructNewIdealGasMaterial(const G4String &name, const std::vector< G4String > &elm, const std::vector< G4int > &nbAtoms, G4bool isotopes=true, G4double temp=NTP_Temperature, G4double pressure=CLHEP::STP_Pressure)

Here is the call graph for this function:

G4Material * G4NistManager::ConstructNewMaterial ( const G4String name,
const std::vector< G4String > &  elm,
const std::vector< G4int > &  nbAtoms,
G4double  dens,
G4bool  isotopes = true,
G4State  state = kStateSolid,
G4double  temp = NTP_Temperature,
G4double  pressure = CLHEP::STP_Pressure 
)
inline

Definition at line 499 of file G4NistManager.hh.

509 {
510  return
511  matBuilder->ConstructNewMaterial(name,elm,nbAtoms,dens,isotopes,state,T,P);
512 }
G4Material * ConstructNewMaterial(const G4String &name, const std::vector< G4String > &elm, const std::vector< G4int > &nbAtoms, G4double dens, G4bool isotopes=true, G4State state=kStateSolid, G4double temp=NTP_Temperature, G4double pressure=CLHEP::STP_Pressure)
static double P[]

Here is the call graph for this function:

G4Material * G4NistManager::ConstructNewMaterial ( const G4String name,
const std::vector< G4String > &  elm,
const std::vector< G4double > &  weight,
G4double  dens,
G4bool  isotopes = true,
G4State  state = kStateSolid,
G4double  temp = NTP_Temperature,
G4double  pressure = CLHEP::STP_Pressure 
)
inline

Definition at line 516 of file G4NistManager.hh.

525 {
526  return matBuilder->ConstructNewMaterial(name,elm,w,dens,isotopes,state,T,P);
527 }
G4Material * ConstructNewMaterial(const G4String &name, const std::vector< G4String > &elm, const std::vector< G4int > &nbAtoms, G4double dens, G4bool isotopes=true, G4State state=kStateSolid, G4double temp=NTP_Temperature, G4double pressure=CLHEP::STP_Pressure)
static double P[]

Here is the call graph for this function:

G4Element * G4NistManager::FindElement ( G4int  Z) const
inline

Definition at line 321 of file G4NistManager.hh.

322 {
323  return elmBuilder->FindElement(Z);
324 }
G4Element * FindElement(G4int Z) const

Here is the call graph for this function:

G4Material * G4NistManager::FindMaterial ( const G4String name) const
inline

Definition at line 466 of file G4NistManager.hh.

467 {
468  return matBuilder->FindMaterial(name);
469 }
G4Material * FindMaterial(const G4String &name) const

Here is the call graph for this function:

G4Element * G4NistManager::FindOrBuildElement ( G4int  Z,
G4bool  isotopes = true 
)
inline

Definition at line 329 of file G4NistManager.hh.

330 {
331  return elmBuilder->FindOrBuildElement(Z, isotopes);
332 }
G4Element * FindOrBuildElement(G4int Z, G4bool buildIsotopes=true)

Here is the call graph for this function:

Here is the caller graph for this function:

G4Element * G4NistManager::FindOrBuildElement ( const G4String symb,
G4bool  isotopes = true 
)
inline

Definition at line 337 of file G4NistManager.hh.

339 {
340  return elmBuilder->FindOrBuildElement(symb, isotopes);
341 }
G4Element * FindOrBuildElement(G4int Z, G4bool buildIsotopes=true)

Here is the call graph for this function:

G4Material * G4NistManager::FindOrBuildMaterial ( const G4String name,
G4bool  isotopes = true,
G4bool  warning = false 
)
inline

Definition at line 474 of file G4NistManager.hh.

477 {
478  return matBuilder->FindOrBuildMaterial(name, isotopes, warning);
479 }
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=true)

Here is the call graph for this function:

Here is the caller graph for this function:

G4Material * G4NistManager::FindOrBuildSimpleMaterial ( G4int  Z,
G4bool  warning = false 
)
inline

Definition at line 492 of file G4NistManager.hh.

493 {
494  return matBuilder->FindOrBuildSimpleMaterial(Z, warning);
495 }
G4Material * FindOrBuildSimpleMaterial(G4int Z, G4bool warning)

Here is the call graph for this function:

G4Material * G4NistManager::FindSimpleMaterial ( G4int  Z) const
inline

Definition at line 484 of file G4NistManager.hh.

485 {
486  return matBuilder->FindSimpleMaterial(Z);
487 }
G4Material * FindSimpleMaterial(G4int Z) const

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4NistManager::GetA27 ( G4int  Z) const
inline

Definition at line 586 of file G4NistManager.hh.

587 {
588  return (0 <= Z && Z < 101) ? POWERA27[Z] : 0.0;
589 }

Here is the caller graph for this function:

G4double G4NistManager::GetAtomicMass ( G4int  Z,
G4int  N 
) const
inline

Definition at line 382 of file G4NistManager.hh.

383 {
384  return elmBuilder->GetAtomicMass(Z, N);
385 }
const int N
Definition: mixmax.h:43
G4double GetAtomicMass(G4int Z, G4int N) const

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4NistManager::GetAtomicMassAmu ( const G4String symb) const
inline

Definition at line 359 of file G4NistManager.hh.

360 {
361  return elmBuilder->GetAtomicMassAmu(symb);
362 }
G4double GetAtomicMassAmu(const G4String &symb) const

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4NistManager::GetAtomicMassAmu ( G4int  Z) const
inline

Definition at line 366 of file G4NistManager.hh.

367 {
368  return elmBuilder->GetAtomicMassAmu(Z);
369 }
G4double GetAtomicMassAmu(const G4String &symb) const

Here is the call graph for this function:

G4Element * G4NistManager::GetElement ( size_t  index) const
inline

Definition at line 312 of file G4NistManager.hh.

313 {
314  const G4ElementTable* theElementTable = G4Element::GetElementTable();
315  return (index < theElementTable->size()) ? (*theElementTable)[index] : nullptr;
316 }
std::vector< G4Element * > G4ElementTable
static G4ElementTable * GetElementTable()
Definition: G4Element.cc:398

Here is the call graph for this function:

G4double G4NistManager::GetIsotopeAbundance ( G4int  Z,
G4int  N 
) const
inline

Definition at line 398 of file G4NistManager.hh.

399 {
400  return elmBuilder->GetIsotopeAbundance(Z, N);
401 }
const int N
Definition: mixmax.h:43
G4double GetIsotopeAbundance(G4int Z, G4int N) const

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4NistManager::GetIsotopeMass ( G4int  Z,
G4int  N 
) const
inline

Definition at line 374 of file G4NistManager.hh.

375 {
376  return elmBuilder->GetIsotopeMass(Z, N);
377 }
const int N
Definition: mixmax.h:43
G4double GetIsotopeMass(G4int Z, G4int N) const

Here is the call graph for this function:

G4double G4NistManager::GetLOGAMU ( G4int  Z) const
inline

Definition at line 600 of file G4NistManager.hh.

601 {
602  return (0 <= Z && Z < 101) ? LOGAZ[Z] : 0.0;
603 }
G4double G4NistManager::GetLOGZ ( G4int  Z) const
inline

Definition at line 593 of file G4NistManager.hh.

594 {
595  return g4pow->logZ(Z);
596 }
G4double logZ(G4int Z) const
Definition: G4Pow.hh:166

Here is the call graph for this function:

Here is the caller graph for this function:

G4Material * G4NistManager::GetMaterial ( size_t  index) const
inline

Definition at line 450 of file G4NistManager.hh.

451 {
452  const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
453  return (index < theMaterialTable->size()) ? (*theMaterialTable)[index] : nullptr;
454 }
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:587
std::vector< G4Material * > G4MaterialTable

Here is the call graph for this function:

G4double G4NistManager::GetMeanIonisationEnergy ( G4int  Z) const
inline

Definition at line 429 of file G4NistManager.hh.

430 {
431  return matBuilder->GetMeanIonisationEnergy(Z);
432 }
G4double GetMeanIonisationEnergy(G4int index) const

Here is the call graph for this function:

Here is the caller graph for this function:

const std::vector< G4String > & G4NistManager::GetNistElementNames ( ) const
inline

Definition at line 422 of file G4NistManager.hh.

423 {
424  return elmBuilder->GetElementNames();
425 }
const std::vector< G4String > & GetElementNames() const

Here is the call graph for this function:

Here is the caller graph for this function:

G4int G4NistManager::GetNistFirstIsotopeN ( G4int  Z) const
inline

Definition at line 406 of file G4NistManager.hh.

407 {
408  return elmBuilder->GetNistFirstIsotopeN(Z);
409 }
G4int GetNistFirstIsotopeN(G4int Z) const

Here is the call graph for this function:

Here is the caller graph for this function:

const std::vector< G4String > & G4NistManager::GetNistMaterialNames ( ) const
inline

Definition at line 565 of file G4NistManager.hh.

566 {
567  return matBuilder->GetMaterialNames();
568 }
const std::vector< G4String > & GetMaterialNames() const

Here is the call graph for this function:

G4double G4NistManager::GetNominalDensity ( G4int  Z) const
inline

Definition at line 436 of file G4NistManager.hh.

437 {
438  return matBuilder->GetNominalDensity(Z);
439 }
G4double GetNominalDensity(G4int index) const

Here is the call graph for this function:

size_t G4NistManager::GetNumberOfElements ( ) const
inline

Definition at line 345 of file G4NistManager.hh.

346 {
347  return nElements;
348 }
size_t G4NistManager::GetNumberOfMaterials ( ) const
inline

Definition at line 305 of file G4NistManager.hh.

306 {
307  return nMaterials;
308 }
G4int G4NistManager::GetNumberOfNistIsotopes ( G4int  Z) const
inline

Definition at line 414 of file G4NistManager.hh.

415 {
416  return elmBuilder->GetNumberOfNistIsotopes(Z);
417 }
G4int GetNumberOfNistIsotopes(G4int Z) const

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4NistManager::GetTotalElectronBindingEnergy ( G4int  Z) const
inline

Definition at line 390 of file G4NistManager.hh.

391 {
392  return elmBuilder->GetTotalElectronBindingEnergy(Z);
393 }
G4double GetTotalElectronBindingEnergy(G4int Z) const

Here is the call graph for this function:

G4int G4NistManager::GetVerbose ( ) const
inline

Definition at line 458 of file G4NistManager.hh.

459 {
460  return verbose;
461 }
G4int G4NistManager::GetZ ( const G4String symb) const
inline

Definition at line 352 of file G4NistManager.hh.

353 {
354  return elmBuilder->GetZ(symb);
355 }
G4int GetZ(const G4String &symb) const

Here is the call graph for this function:

G4double G4NistManager::GetZ13 ( G4double  Z) const
inline

Definition at line 572 of file G4NistManager.hh.

573 {
574  return g4pow->A13(A);
575 }
double A(double temperature)
G4double A13(G4double A) const
Definition: G4Pow.hh:132

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4NistManager::GetZ13 ( G4int  Z) const
inline

Definition at line 579 of file G4NistManager.hh.

580 {
581  return g4pow->Z13(Z);
582 }
G4double Z13(G4int Z) const
Definition: G4Pow.hh:127

Here is the call graph for this function:

G4NistManager * G4NistManager::Instance ( )
static

Definition at line 68 of file G4NistManager.cc.

69 {
70  if (instance == nullptr) {
71  static G4NistManager manager;
72  instance = &manager;
73  }
74  return instance;
75 }
void G4NistManager::ListMaterials ( const G4String list) const
inline

Definition at line 557 of file G4NistManager.hh.

558 {
559  matBuilder->ListMaterials(list);
560 }
void ListMaterials(const G4String &) const

Here is the call graph for this function:

Here is the caller graph for this function:

void G4NistManager::PrintElement ( G4int  Z) const
inline

Definition at line 443 of file G4NistManager.hh.

444 {
445  elmBuilder->PrintElement(Z);
446 }
void PrintElement(G4int Z) const

Here is the call graph for this function:

Here is the caller graph for this function:

void G4NistManager::PrintElement ( const G4String symbol) const

Definition at line 150 of file G4NistManager.cc.

151 {
152  if (symbol == "all") { elmBuilder->PrintElement(0); }
153  else { elmBuilder->PrintElement(elmBuilder->GetZ(symbol)); }
154 }
G4int GetZ(const G4String &symb) const
void PrintElement(G4int Z) const

Here is the call graph for this function:

void G4NistManager::PrintG4Element ( const G4String name) const

Definition at line 158 of file G4NistManager.cc.

159 {
160  const G4ElementTable* theElementTable = G4Element::GetElementTable();
161  size_t nelm = theElementTable->size();
162  for(size_t i=0; i<nelm; i++) {
163  G4Element* elm = (*theElementTable)[i];
164  if ( name == elm->GetName() || "all" == name) {
165  G4cout << *elm << G4endl;
166  }
167  }
168 }
const XML_Char * name
Definition: expat.h:151
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
std::vector< G4Element * > G4ElementTable
const G4String & GetName() const
Definition: G4Element.hh:127
static G4ElementTable * GetElementTable()
Definition: G4Element.cc:398

Here is the call graph for this function:

Here is the caller graph for this function:

void G4NistManager::PrintG4Material ( const G4String name) const

Definition at line 172 of file G4NistManager.cc.

173 {
174  const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
175  size_t nmat = theMaterialTable->size();
176  for(size_t i=0; i<nmat; i++) {
177  G4Material* mat = (*theMaterialTable)[i];
178  if ( name == mat->GetName() || "all" == name) {
179  G4cout << *mat << G4endl;
180  }
181  }
182 }
const XML_Char * name
Definition: expat.h:151
const G4String & GetName() const
Definition: G4Material.hh:178
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:587
std::vector< G4Material * > G4MaterialTable
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

void G4NistManager::SetVerbose ( G4int  val)

Definition at line 186 of file G4NistManager.cc.

187 {
188  verbose = val;
189  elmBuilder->SetVerbose(val);
190  matBuilder->SetVerbose(val);
191 }

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: