Ignore:
Timestamp:
Sep 10, 2008, 5:40:37 PM (16 years ago)
Author:
garnier
Message:

geant4.8.2 beta

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/materials/include/G4NistManager.hh

    r822 r850  
    2424// ********************************************************************
    2525//
    26 // $Id: G4NistManager.hh,v 1.17 2007/12/11 13:32:08 gcosmo Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4NistManager.hh,v 1.23 2008/08/07 10:15:16 vnivanch Exp $
     27// GEANT4 tag $Name: HEAD $
    2828//
    2929//
     
    8484  ~G4NistManager();
    8585
    86   // Elements
     86  // Get G4Element by index
    8787  //
    8888  inline G4Element* GetElement(size_t index);
    8989 
    9090  // Find or build G4Element by atomic number
     91  //
    9192  inline G4Element* FindOrBuildElement(G4int Z, G4bool isotopes=true);
    9293 
    9394  // Find or build G4Element by symbol
     95  //
    9496  inline G4Element* FindOrBuildElement(const G4String& symb,
    9597                                       G4bool isotopes=true);
    9698
    97   inline size_t   GetNumberOfElements() const;
    98   inline G4int    GetZ(const G4String& symb) const;
    99 
    100   // Mass in amu
     99  // Get number of elements
     100  //
     101  inline size_t GetNumberOfElements() const;
     102
     103  // Get atomic number by element symbol
     104  //
     105  inline G4int GetZ(const G4String& symb) const;
     106
     107  // Get the mass of the element in amu for the natuaral isotope composition
     108  // with electron shell
     109  //
    101110  inline G4double GetAtomicMassAmu(G4int Z) const;
    102111
    103   // Mass in Geant4 units
     112  // Get mass of the isotope in Geant4 units without electron shell
     113  //
    104114  inline G4double GetIsotopeMass(G4int Z, G4int N) const;
     115
     116  // Get mass of the isotope in Geant4 units with electron shell
     117  //
    105118  inline G4double GetAtomicMass(G4int Z, G4int N) const;
    106119
    107   // Number of isotopes
    108   inline G4int    GetNistFirstIsotopeN(G4int Z) const;
    109   inline G4int    GetNumberOfNistIsotopes(G4int Z) const;
    110 
     120  // Get total ionisation energy of an atom
     121  //
     122  inline G4double GetTotalElectronBindingEnergy(G4int Z) const;
     123
     124  // Get N for the first natural isotope
     125  //
     126  inline G4int GetNistFirstIsotopeN(G4int Z) const;
     127
     128  // Get number of natural isotopes
     129  //
     130  inline G4int GetNumberOfNistIsotopes(G4int Z) const;
     131
     132  // Get natural isotope abandance
     133  //
    111134  inline G4double GetIsotopeAbundance(G4int Z, G4int N) const;
    112135
     136  // Print element by Z
     137  //
    113138  inline void PrintElement(G4int Z); 
    114139
     140  // Print element from internal DB by symbol, if "all" - print all elements
     141  //
    115142  void PrintElement(const G4String&);   
     143
     144  // Print G4Element by name, if "all" - print all G4Elements
     145  //
    116146  void PrintG4Element(const G4String&); 
    117147
     148  // Access to the vector of Geant4 predefined element names
     149  //
    118150  inline const std::vector<G4String>& GetNistElementNames() const;
    119151
    120   // Materials
     152  // Get G4Material by index
    121153  //
    122154  inline G4Material* GetMaterial(size_t index);
    123155 
    124   // Find or build a G4Material by name, from the dataBase
     156  // Find or build a G4Material by name, from the Geant4 dataBase
    125157  //
    126158  inline G4Material* FindOrBuildMaterial(const G4String& name,
     
    128160                                         G4bool warning=false);
    129161 
    130   // construct a G4Material from scratch by atome count
     162  // Construct a G4Material from scratch by atome count
    131163  //
    132164  inline G4Material* ConstructNewMaterial(
     
    140172                                  G4double  pressure = STP_Pressure);
    141173                                     
    142   // construct a G4Material from scratch by fraction mass
     174  // Construct a G4Material from scratch by fraction mass
    143175  //
    144176  inline G4Material* ConstructNewMaterial(
     
    152184                                  G4double  pressure = STP_Pressure);
    153185
    154   // construct a gas G4Material from scratch by atome count
     186  // Construct a gas G4Material from scratch by atome count
    155187  //
    156188  inline G4Material* ConstructNewGasMaterial(const G4String& name,
     
    160192                                             G4bool isotopes=true);
    161193
     194  // Get number of G4Materials
     195  //
    162196  inline size_t GetNumberOfMaterials();
    163197 
     
    166200  void SetVerbose(G4int);
    167201
     202  // Print G4Material by name
     203  //
    168204  void PrintG4Material(const G4String&);
    169205
     206  // Print predefined Geant4 materials:
     207  // "simple" - only pure materials in basic state (Z = 1, ..., 98)
     208  // "compound" - NIST compounds
     209  // "hep" - HEP materials and compounds
     210  // "all" - all
     211  //
    170212  inline void ListMaterials(const G4String&);
    171213
     214  // Access to the list of names of Geant4 predefined materials
     215  //
    172216  inline const std::vector<G4String>& GetNistMaterialNames() const;
    173217
    174   G4double GetZ13(G4double Z);
    175 
    176   G4double GetLOGA(G4double A);
     218  // Fast computation of Z^1/3
     219  //
     220  inline G4double GetZ13(G4double Z);
     221  inline G4double GetZ13(G4int Z);
     222
     223  // Fast computation of A^0.27 for natuaral abandances
     224  //
     225  inline G4double GetA27(G4int Z);
     226
     227  // Fast computation of log(A)
     228  //
     229  inline G4double GetLOGA(G4double A);
     230  inline G4double GetLOGZ(G4int Z);
     231
     232  // Fast computation of log(A) for natuaral abandances
     233  //
     234  inline G4double GetLOGA(G4int Z);
    177235
    178236private:
     
    181239  static G4NistManager* instance;
    182240
    183   static G4double POWERZ13[256];
    184   static G4double LOGA[256];
     241  G4double POWERZ13[256];
     242  G4double LOGA[256];
     243  G4double POWERA27[101];
     244  G4double LOGAZ[101];
    185245 
    186246  std::vector<G4Element*>   elements;
     
    201261//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    202262
    203 inline
    204 size_t G4NistManager::GetNumberOfMaterials()
     263inline size_t G4NistManager::GetNumberOfMaterials()
    205264{
    206265  return nMaterials;
     
    209268//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    210269
    211 inline
    212 G4Element* G4NistManager::GetElement(size_t index)
     270inline G4Element* G4NistManager::GetElement(size_t index)
    213271{
    214272  G4Element* elm = 0;
     
    237295//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    238296
    239 inline
    240 size_t G4NistManager::GetNumberOfElements() const
     297inline size_t G4NistManager::GetNumberOfElements() const
    241298{
    242299  return nElements;
     
    245302//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    246303
    247 inline
    248 G4int G4NistManager::GetZ(const G4String& symb) const
     304inline G4int G4NistManager::GetZ(const G4String& symb) const
    249305{
    250306  return elmBuilder->GetZ(symb);
     
    253309//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    254310
    255 inline
    256 G4double G4NistManager::GetAtomicMassAmu(G4int Z) const
     311inline G4double G4NistManager::GetAtomicMassAmu(G4int Z) const
    257312{
    258313  return elmBuilder->GetA(Z);
     
    278333
    279334inline
     335G4double G4NistManager::GetTotalElectronBindingEnergy(G4int Z) const
     336{
     337  return elmBuilder->GetTotalElectronBindingEnergy(Z);
     338}
     339
     340//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     341
     342inline
    280343G4double G4NistManager::GetIsotopeAbundance(G4int Z, G4int N) const
    281344{
     
    309372//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    310373
    311 inline
    312 void G4NistManager::PrintElement(G4int Z)
     374inline void G4NistManager::PrintElement(G4int Z)
    313375{
    314376  elmBuilder->PrintElement(Z);
     
    317379//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    318380
    319 inline
    320 G4Material* G4NistManager::GetMaterial(size_t index)
     381inline G4Material* G4NistManager::GetMaterial(size_t index)
    321382{
    322383  const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
     
    328389//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    329390
    330 inline
    331 G4int G4NistManager::GetVerbose()
     391inline G4int G4NistManager::GetVerbose()
    332392{
    333393  return verbose;
     
    346406//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    347407
    348 inline
    349 G4Material* G4NistManager::ConstructNewMaterial(
     408inline G4Material* G4NistManager::ConstructNewMaterial(
    350409                                      const G4String& name,
    351410                                      const std::vector<G4String>& elm,
     
    364423//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    365424
    366 inline
    367 G4Material* G4NistManager::ConstructNewMaterial(
     425inline G4Material* G4NistManager::ConstructNewMaterial(
    368426                                      const G4String& name,
    369427                                      const std::vector<G4String>& elm,
     
    380438//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    381439
    382 inline
    383 G4Material* G4NistManager::ConstructNewGasMaterial(
     440inline G4Material* G4NistManager::ConstructNewGasMaterial(
    384441                                      const G4String& name,
    385442                                      const G4String& nameNist,
     
    393450//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    394451
    395 inline
    396 void G4NistManager::ListMaterials(const G4String& list)
     452inline void G4NistManager::ListMaterials(const G4String& list)
    397453{
    398454  matBuilder->ListMaterials(list);
     
    409465//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    410466
     467inline G4double G4NistManager::GetZ13(G4double Z)
     468{
     469  G4int iz = G4int(Z);
     470  G4double x = (Z - G4double(iz))/(3.0*Z);
     471  if(iz > 255) iz = 255;
     472  else if(iz < 0) iz = 0;
     473  return POWERZ13[iz]*(1.0 + x);
     474}
     475
     476//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     477
     478inline G4double G4NistManager::GetZ13(G4int Z)
     479{
     480  return POWERZ13[Z];
     481}
     482
     483//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     484
     485inline G4double G4NistManager::GetA27(G4int Z)
     486{
     487  G4double res = 0.0;
     488  if(Z < 101) res = POWERA27[Z];
     489  return res;
     490}
     491
     492//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     493
     494inline G4double G4NistManager::GetLOGZ(G4int Z)
     495{
     496  G4double res = 0.0;
     497  if(Z < 256) res = LOGA[Z];
     498  return res;
     499}
     500
     501//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     502
     503inline G4double G4NistManager::GetLOGA(G4double A)
     504{
     505  G4int ia = G4int(A);
     506  G4double x = (A - G4double(ia))/A;
     507  if(ia > 255) ia = 255;
     508  else if(ia < 0) ia = 0;
     509  return LOGA[ia] + x*(1.0 - 0.5*x);
     510}
     511
     512//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     513
     514inline G4double G4NistManager::GetLOGA(G4int Z)
     515{
     516  G4double res = 0.0;
     517  if(Z < 101) res = LOGAZ[Z];
     518  return res;
     519}
     520
     521//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     522
    411523#endif
    412524
Note: See TracChangeset for help on using the changeset viewer.