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

#include <G4NistElementBuilder.hh>

Public Member Functions

 G4NistElementBuilder (G4int vb)
 
 ~G4NistElementBuilder ()
 
G4ElementFindElement (G4int Z) const
 
G4ElementFindOrBuildElement (G4int Z, G4bool buildIsotopes=true)
 
G4ElementFindOrBuildElement (const G4String &symb, G4bool buildIsotopes=true)
 
void PrintElement (G4int Z) const
 
const std::vector< G4String > & GetElementNames () 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
 
G4double GetIsotopeAbundance (G4int Z, G4int N) const
 
G4int GetNistFirstIsotopeN (G4int Z) const
 
G4int GetNumberOfNistIsotopes (G4int Z) const
 
G4int GetMaxNumElements () const
 
void SetVerbose (G4int)
 

Detailed Description

Definition at line 68 of file G4NistElementBuilder.hh.

Constructor & Destructor Documentation

G4NistElementBuilder::G4NistElementBuilder ( G4int  vb)
explicit

Definition at line 65 of file G4NistElementBuilder.cc.

65  :
66  verbose(vb)
67 {
68  nFirstIsotope[0] = 0;
69  nIsotopes[0] = 0;
70  relAbundance[0] = 0.0;
71  Initialise();
72  for(G4int i=0; i<maxNumElements; ++i) {elmIndex[i] = -1;}
73 }
int G4int
Definition: G4Types.hh:78
const G4int maxNumElements
G4NistElementBuilder::~G4NistElementBuilder ( )

Definition at line 77 of file G4NistElementBuilder.cc.

78 {}

Member Function Documentation

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

Definition at line 252 of file G4NistElementBuilder.hh.

253 {
254  const G4ElementTable* theElementTable = G4Element::GetElementTable();
255  return (Z > 0 && Z < maxNumElements && elmIndex[Z] >= 0) ?
256  (*theElementTable)[elmIndex[Z]] : nullptr;
257 }
const G4int maxNumElements
std::vector< G4Element * > G4ElementTable
static G4ElementTable * GetElementTable()
Definition: G4Element.cc:398

Here is the call graph for this function:

Here is the caller graph for this function:

G4Element * G4NistElementBuilder::FindOrBuildElement ( G4int  Z,
G4bool  buildIsotopes = true 
)

Definition at line 102 of file G4NistElementBuilder.cc.

103 {
104  G4Element* anElement = FindElement(Z);
105  if(anElement == nullptr && Z > 0 && Z < maxNumElements) {
106  anElement = BuildElement(Z);
107  if(anElement) { elmIndex[Z] = anElement->GetIndex(); }
108  }
109  return anElement;
110 }
const G4int maxNumElements
G4Element * FindElement(G4int Z) const
size_t GetIndex() const
Definition: G4Element.hh:182

Here is the call graph for this function:

Here is the caller graph for this function:

G4Element * G4NistElementBuilder::FindOrBuildElement ( const G4String symb,
G4bool  buildIsotopes = true 
)

Definition at line 116 of file G4NistElementBuilder.cc.

117 {
118  G4Element* elm = nullptr;
119  const G4ElementTable* theElementTable = G4Element::GetElementTable();
120  size_t nelm = theElementTable->size();
121  for(size_t i=0; i<nelm; ++i) {
122  if(symb == ((*theElementTable)[i])->GetSymbol()) {
123  elm = (*theElementTable)[i];
124  break;
125  }
126  }
127  if(nullptr == elm) {
128  for(G4int Z = 1; Z<maxNumElements; ++Z) {
129  if(symb == elmSymbol[Z]) {
130  elm = BuildElement(Z);
131  break;
132  }
133  }
134  }
135  return elm;
136 }
int G4int
Definition: G4Types.hh:78
const G4int maxNumElements
std::vector< G4Element * > G4ElementTable
static G4ElementTable * GetElementTable()
Definition: G4Element.cc:398

Here is the call graph for this function:

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

Definition at line 179 of file G4NistElementBuilder.hh.

180 {
181  G4double mass = 0.0;
182  if(Z > 0 && Z < maxNumElements) {
183  G4int i = N - nFirstIsotope[Z];
184  if(i >= 0 && i <nIsotopes[Z]) {
185  mass = massIsotopes[i + idxIsotopes[Z]] +
186  Z*CLHEP::electron_mass_c2 - bindingEnergy[Z];
187  }
188  }
189  return mass;
190 }
const int N
Definition: mixmax.h:43
int G4int
Definition: G4Types.hh:78
const G4int maxNumElements
static constexpr double electron_mass_c2
double G4double
Definition: G4Types.hh:76

Here is the caller graph for this function:

G4double G4NistElementBuilder::GetAtomicMassAmu ( const G4String symb) const

Definition at line 92 of file G4NistElementBuilder.cc.

93 {
95  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
96  do {--Z;} while( Z>0 && elmSymbol[Z] != name);
97  return GetAtomicMassAmu(Z);
98 }
const XML_Char * name
Definition: expat.h:151
G4double GetAtomicMassAmu(const G4String &symb) const
int G4int
Definition: G4Types.hh:78
const G4int maxNumElements

Here is the caller graph for this function:

G4double G4NistElementBuilder::GetAtomicMassAmu ( G4int  Z) const
inline

Definition at line 160 of file G4NistElementBuilder.hh.

161 {
162  return (Z>0 && Z<maxNumElements) ? atomicMass[Z] : 0.0;
163 }
const G4int maxNumElements
const std::vector< G4String > & G4NistElementBuilder::GetElementNames ( ) const
inline

Definition at line 231 of file G4NistElementBuilder.hh.

232 {
233  return elmNames;
234 }

Here is the caller graph for this function:

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

Definition at line 204 of file G4NistElementBuilder.hh.

205 {
206  G4double x = 0.0;
207  if(Z > 0 && Z < maxNumElements) {
208  G4int i = N - nFirstIsotope[Z];
209  if(i >= 0 && i <nIsotopes[Z]) { x = relAbundance[i + idxIsotopes[Z]]; }
210  }
211  return x;
212 }
const int N
Definition: mixmax.h:43
int G4int
Definition: G4Types.hh:78
const G4int maxNumElements
double G4double
Definition: G4Types.hh:76

Here is the caller graph for this function:

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

Definition at line 167 of file G4NistElementBuilder.hh.

168 {
169  G4double mass = 0.0;
170  if(Z > 0 && Z < maxNumElements) {
171  G4int i = N - nFirstIsotope[Z];
172  if(i >= 0 && i <nIsotopes[Z]) {mass = massIsotopes[i + idxIsotopes[Z]];}
173  }
174  return mass;
175 }
const int N
Definition: mixmax.h:43
int G4int
Definition: G4Types.hh:78
const G4int maxNumElements
double G4double
Definition: G4Types.hh:76

Here is the caller graph for this function:

G4int G4NistElementBuilder::GetMaxNumElements ( ) const
inline

Definition at line 238 of file G4NistElementBuilder.hh.

239 {
240  return maxNumElements-1;
241 }
const G4int maxNumElements
G4int G4NistElementBuilder::GetNistFirstIsotopeN ( G4int  Z) const
inline

Definition at line 216 of file G4NistElementBuilder.hh.

217 {
218  return (Z > 0 && Z < maxNumElements) ? nFirstIsotope[Z] : 0;
219 }
const G4int maxNumElements

Here is the caller graph for this function:

G4int G4NistElementBuilder::GetNumberOfNistIsotopes ( G4int  Z) const
inline

Definition at line 223 of file G4NistElementBuilder.hh.

224 {
225  return (Z > 0 && Z < maxNumElements) ? nIsotopes[Z] : 0;
226 }
const G4int maxNumElements

Here is the caller graph for this function:

G4double G4NistElementBuilder::GetTotalElectronBindingEnergy ( G4int  Z) const
inline

Definition at line 195 of file G4NistElementBuilder.hh.

196 {
197  return (Z > 0 && Z < maxNumElements) ? bindingEnergy[Z] : 0.0;
198 }
const G4int maxNumElements

Here is the caller graph for this function:

G4int G4NistElementBuilder::GetZ ( const G4String symb) const

Definition at line 82 of file G4NistElementBuilder.cc.

83 {
85  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
86  do {--Z;} while( Z>0 && elmSymbol[Z] != name);
87  return Z;
88 }
const XML_Char * name
Definition: expat.h:151
int G4int
Definition: G4Types.hh:78
const G4int maxNumElements

Here is the caller graph for this function:

void G4NistElementBuilder::PrintElement ( G4int  Z) const

Definition at line 187 of file G4NistElementBuilder.cc.

188 {
189  G4int imin = Z;
190  G4int imax = Z+1;
191  if (Z == 0) {
192  imin = 1;
193  imax = maxNumElements;
194  }
195  if(imax > maxNumElements) { imax = maxNumElements; }
196 
197  for(G4int i=imin; i<imax; ++i) {
198  G4int nc = nIsotopes[i];
199  G4cout << "Nist Element: <" << elmSymbol[i]
200  << "> Z= " << i
201  << " Aeff(amu)= " << atomicMass[i] << " "
202  << nc << " isotopes:"
203  << G4endl;
204  G4int j;
205  G4int idx = idxIsotopes[i];
206  G4int n0 = nFirstIsotope[i];
207  G4cout << " N: ";
208  for(j=0; j<nc; ++j) {G4cout << n0 + j << " ";}
209  G4cout << G4endl;
210  G4cout << " mass(amu): ";
211  for(j=0; j<nc; ++j) {G4cout << GetAtomicMass(i, n0 + j) << " ";}
212  G4cout << G4endl;
213  G4cout << " abundance: ";
214  for(j=0; j<nc; ++j) {G4cout << relAbundance[idx + j] << " ";}
215  G4cout << G4endl;
216  }
217 }
int G4int
Definition: G4Types.hh:78
const G4int maxNumElements
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
static const G4int imax
G4double GetAtomicMass(G4int Z, G4int N) const

Here is the call graph for this function:

Here is the caller graph for this function:

void G4NistElementBuilder::SetVerbose ( G4int  val)
inline

Definition at line 245 of file G4NistElementBuilder.hh.

246 {
247  verbose = val;
248 }

Here is the caller graph for this function:


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