Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 << 25 // >> 26 // $Id: G4NistManager.hh,v 1.23 2008/08/07 10:15:16 vnivanch Exp $ >> 27 // GEANT4 tag $Name: geant4-09-02 $ >> 28 // >> 29 // 26 // ------------------------------------------- 30 // ------------------------------------------------------------------- 27 // 31 // 28 // GEANT4 Class header file 32 // GEANT4 Class header file 29 // 33 // 30 // File name: G4NistManager 34 // File name: G4NistManager 31 // 35 // 32 // Author: Vladimir Ivanchenko 36 // Author: Vladimir Ivanchenko 33 // 37 // 34 // Creation date: 23.12.2004 38 // Creation date: 23.12.2004 35 // 39 // 36 // Modifications: 40 // Modifications: 37 // 27.02.06 V.Ivanchneko add GetAtomicMassAmu 41 // 27.02.06 V.Ivanchneko add GetAtomicMassAmu and ConstructNewGasMaterial 38 // 11.05.06 V.Ivanchneko add warning flag to F 42 // 11.05.06 V.Ivanchneko add warning flag to FindMaterial method 39 // 17.10.06 V.Ivanchneko add methods: GetAtomi 43 // 17.10.06 V.Ivanchneko add methods: GetAtomicMass, GetNistElementNames, 40 // GetNistMaterialNames 44 // GetNistMaterialNames 41 // 02.05.07 V.Ivanchneko add GetNistFirstIsoto << 45 // 02.05.07 V.Ivanchneko add GetNistFirstIsotopeN and GetNumberOfNistIsotopes 42 // 28.07.07 V.Ivanchneko make simple methods i 46 // 28.07.07 V.Ivanchneko make simple methods inline 43 // 28.10.07 V.Ivanchneko add state, T, P to ma 47 // 28.10.07 V.Ivanchneko add state, T, P to maetrial build 44 // 29.04.10 V.Ivanchneko add GetMeanIonisation << 45 // 01.11.10 V.Ivanchneko add G4Pow for fast co << 46 // 09.02.12 P.Gumplinger add ConstructNewIdeal << 47 // 48 // 48 // Class Description: 49 // Class Description: 49 // 50 // 50 // A utility static class 51 // A utility static class 51 // 52 // >> 53 >> 54 // ------------------------------------------------------------------- >> 55 // >> 56 // Class Description: >> 57 // 52 // Element data from the NIST DB on Atomic Wei 58 // Element data from the NIST DB on Atomic Weights and Isotope Compositions 53 // http://physics.nist.gov/PhysRefData/Composi 59 // http://physics.nist.gov/PhysRefData/Compositions/index.html 54 // 60 // 55 // ------------------------------------------- 61 // ------------------------------------------------------------------- >> 62 // 56 63 57 #ifndef G4NistManager_h 64 #ifndef G4NistManager_h 58 #define G4NistManager_h 1 65 #define G4NistManager_h 1 59 66 60 #include "G4ICRU90StoppingData.hh" << 67 #include <vector> >> 68 #include "globals.hh" 61 #include "G4Material.hh" 69 #include "G4Material.hh" 62 #include "G4Element.hh" << 63 #include "G4Isotope.hh" << 64 #include "G4NistElementBuilder.hh" 70 #include "G4NistElementBuilder.hh" 65 #include "G4NistMaterialBuilder.hh" 71 #include "G4NistMaterialBuilder.hh" 66 #include "G4Pow.hh" << 67 #include "globals.hh" << 68 << 69 #include <CLHEP/Units/PhysicalConstants.h> << 70 << 71 #include <vector> << 72 72 73 class G4NistMessenger; 73 class G4NistMessenger; 74 74 >> 75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 77 75 class G4NistManager 78 class G4NistManager 76 { 79 { 77 public: << 80 >> 81 public: >> 82 78 static G4NistManager* Instance(); 83 static G4NistManager* Instance(); 79 ~G4NistManager(); 84 ~G4NistManager(); 80 85 81 // Get G4Element by index 86 // Get G4Element by index 82 // 87 // 83 inline G4Element* GetElement(std::size_t ind << 88 inline G4Element* GetElement(size_t index); 84 << 89 85 // Find or build G4Element by atomic number 90 // Find or build G4Element by atomic number 86 // 91 // 87 inline G4Element* FindElement(G4int Z) const << 92 inline G4Element* FindOrBuildElement(G4int Z, G4bool isotopes=true); 88 inline G4Element* FindOrBuildElement(G4int Z << 93 89 << 90 // Find or build G4Element by symbol 94 // Find or build G4Element by symbol 91 // 95 // 92 inline G4Element* FindOrBuildElement(const G << 96 inline G4Element* FindOrBuildElement(const G4String& symb, >> 97 G4bool isotopes=true); 93 98 94 // Get number of elements 99 // Get number of elements 95 // 100 // 96 inline std::size_t GetNumberOfElements() con << 101 inline size_t GetNumberOfElements() const; 97 102 98 // Get atomic number by element symbol 103 // Get atomic number by element symbol 99 // 104 // 100 inline G4int GetZ(const G4String& symb) cons 105 inline G4int GetZ(const G4String& symb) const; 101 106 102 // Get atomic weight by element symbol - mea << 107 // Get the mass of the element in amu for the natuaral isotope composition 103 // an atom with electron shell for the natur << 108 // with electron shell 104 // << 105 inline G4double GetAtomicMassAmu(const G4Str << 106 << 107 // Get atomic weight in atomic units - mean << 108 // with electron shell for the natural isoto << 109 // 109 // 110 inline G4double GetAtomicMassAmu(G4int Z) co 110 inline G4double GetAtomicMassAmu(G4int Z) const; 111 111 112 // Get mass of isotope without electron shel << 112 // Get mass of the isotope in Geant4 units without electron shell 113 // 113 // 114 inline G4double GetIsotopeMass(G4int Z, G4in 114 inline G4double GetIsotopeMass(G4int Z, G4int N) const; 115 115 116 // Get mass in Geant4 energy units of an ato << 116 // Get mass of the isotope in Geant4 units with electron shell 117 // with the electron shell << 118 // 117 // 119 inline G4double GetAtomicMass(G4int Z, G4int 118 inline G4double GetAtomicMass(G4int Z, G4int N) const; 120 119 121 // Get total ionisation energy of an atom 120 // Get total ionisation energy of an atom 122 // 121 // 123 inline G4double GetTotalElectronBindingEnerg 122 inline G4double GetTotalElectronBindingEnergy(G4int Z) const; 124 123 125 // Get N for the first natural isotope 124 // Get N for the first natural isotope 126 // 125 // 127 inline G4int GetNistFirstIsotopeN(G4int Z) c 126 inline G4int GetNistFirstIsotopeN(G4int Z) const; 128 127 129 // Get number of natural isotopes 128 // Get number of natural isotopes 130 // 129 // 131 inline G4int GetNumberOfNistIsotopes(G4int Z 130 inline G4int GetNumberOfNistIsotopes(G4int Z) const; 132 131 133 // Get natural isotope abundance << 132 // Get natural isotope abandance 134 // 133 // 135 inline G4double GetIsotopeAbundance(G4int Z, 134 inline G4double GetIsotopeAbundance(G4int Z, G4int N) const; 136 135 137 // Print element by Z 136 // Print element by Z 138 // 137 // 139 inline void PrintElement(G4int Z) const; << 138 inline void PrintElement(G4int Z); 140 139 141 // Print element from internal DB by symbol, 140 // Print element from internal DB by symbol, if "all" - print all elements 142 // 141 // 143 void PrintElement(const G4String&) const; << 142 void PrintElement(const G4String&); 144 143 145 // Print G4Element by name, if "all" - print 144 // Print G4Element by name, if "all" - print all G4Elements 146 // 145 // 147 void PrintG4Element(const G4String&) const; << 146 void PrintG4Element(const G4String&); 148 147 149 // Access to the vector of Geant4 predefined << 148 // Access to the vector of Geant4 predefined element names 150 // 149 // 151 inline const std::vector<G4String>& GetNistE 150 inline const std::vector<G4String>& GetNistElementNames() const; 152 151 153 // Access mean ionisation energy for atoms ( << 152 // Get G4Material by index 154 // << 155 inline G4double GetMeanIonisationEnergy(G4in << 156 << 157 // Access nominal density by atomic number f << 158 // by the index for other NIST materials << 159 // 153 // 160 inline G4double GetNominalDensity(G4int Z) c << 154 inline G4Material* GetMaterial(size_t index); 161 << 155 162 // Get G4Material by index << 163 // << 164 inline G4Material* GetMaterial(std::size_t i << 165 << 166 // Find or build a G4Material by name, from 156 // Find or build a G4Material by name, from the Geant4 dataBase 167 // 157 // 168 inline G4Material* FindMaterial(const G4Stri << 158 inline G4Material* FindOrBuildMaterial(const G4String& name, 169 inline G4Material* FindOrBuildMaterial( << 159 G4bool isotopes=true, 170 const G4String& name, G4bool isotopes = tr << 160 G4bool warning=false); 171 << 161 172 // Find or build a simple material via atomi << 173 // << 174 inline G4Material* FindSimpleMaterial(G4int << 175 inline G4Material* FindOrBuildSimpleMaterial << 176 << 177 // Build G4Material with user defined name a << 178 // of a material from Geant4 dataBase << 179 // << 180 G4Material* BuildMaterialWithNewDensity(cons << 181 G4double density = 0.0, G4double temp = NT << 182 << 183 // Construct a G4Material from scratch by at 162 // Construct a G4Material from scratch by atome count 184 // temperature and pressure should be consis << 163 // 185 // << 164 inline G4Material* ConstructNewMaterial( 186 inline G4Material* ConstructNewMaterial(cons << 165 const G4String& name, 187 const std::vector<G4int>& nbAtoms, G4doubl << 166 const std::vector<G4String>& elm, 188 G4State state = kStateSolid, G4double temp << 167 const std::vector<G4int>& nbAtoms, 189 G4double pressure = CLHEP::STP_Pressure); << 168 G4double dens, 190 << 169 G4bool isotopes=true, >> 170 G4State state = kStateSolid, >> 171 G4double temp = STP_Temperature, >> 172 G4double pressure = STP_Pressure); >> 173 191 // Construct a G4Material from scratch by fr 174 // Construct a G4Material from scratch by fraction mass 192 // temperature and pressure should be consis << 175 // 193 // << 176 inline G4Material* ConstructNewMaterial( 194 inline G4Material* ConstructNewMaterial(cons << 177 const G4String& name, 195 const std::vector<G4double>& weight, G4dou << 178 const std::vector<G4String>& elm, 196 G4State state = kStateSolid, G4double temp << 179 const std::vector<G4double>& weight, 197 G4double pressure = CLHEP::STP_Pressure); << 180 G4double dens, >> 181 G4bool isotopes=true, >> 182 G4State state = kStateSolid, >> 183 G4double temp = STP_Temperature, >> 184 G4double pressure = STP_Pressure); 198 185 199 // Construct a gas G4Material from scratch b 186 // Construct a gas G4Material from scratch by atome count 200 // << 187 // 201 inline G4Material* ConstructNewGasMaterial(c << 188 inline G4Material* ConstructNewGasMaterial(const G4String& name, 202 G4double temp, G4double pres, G4bool isoto << 189 const G4String& nameNist, 203 << 190 G4double temp, 204 // Construct an ideal gas G4Material from sc << 191 G4double pres, 205 // << 192 G4bool isotopes=true); 206 inline G4Material* ConstructNewIdealGasMater << 207 const std::vector<G4String>& elm, const st << 208 G4double temp = NTP_Temperature, G4double << 209 << 210 // enable/disable density effect calculator << 211 // << 212 void SetDensityEffectCalculatorFlag(const G4 << 213 << 214 // enable/disable density effect calculator << 215 // << 216 void SetDensityEffectCalculatorFlag(G4Materi << 217 193 218 // Get number of G4Materials 194 // Get number of G4Materials 219 // 195 // 220 inline std::size_t GetNumberOfMaterials() co << 196 inline size_t GetNumberOfMaterials(); 221 << 197 222 inline G4int GetVerbose() const; << 198 inline G4int GetVerbose(); 223 199 224 void SetVerbose(G4int); 200 void SetVerbose(G4int); 225 201 226 // Print G4Material by name 202 // Print G4Material by name 227 // 203 // 228 void PrintG4Material(const G4String&) const; << 204 void PrintG4Material(const G4String&); 229 205 230 // Print predefined Geant4 materials: 206 // Print predefined Geant4 materials: 231 // "simple" - only pure materials in basic s 207 // "simple" - only pure materials in basic state (Z = 1, ..., 98) 232 // "compound" - NIST compounds 208 // "compound" - NIST compounds 233 // "hep" - HEP materials and compounds 209 // "hep" - HEP materials and compounds 234 // "bio" - bio-medical materials and compoun << 235 // "all" - all 210 // "all" - all 236 // 211 // 237 inline void ListMaterials(const G4String&) c << 212 inline void ListMaterials(const G4String&); 238 213 239 // Access to the list of names of Geant4 pre 214 // Access to the list of names of Geant4 predefined materials 240 // 215 // 241 inline const std::vector<G4String>& GetNistM 216 inline const std::vector<G4String>& GetNistMaterialNames() const; 242 217 243 // Fast computation of Z^1/3 218 // Fast computation of Z^1/3 244 // 219 // 245 inline G4double GetZ13(G4double Z) const; << 220 inline G4double GetZ13(G4double Z); 246 inline G4double GetZ13(G4int Z) const; << 221 inline G4double GetZ13(G4int Z); 247 222 248 // Fast computation of A^0.27 for natuaral a << 223 // Fast computation of A^0.27 for natuaral abandances 249 // 224 // 250 inline G4double GetA27(G4int Z) const; << 225 inline G4double GetA27(G4int Z); 251 226 252 // Fast computation of log(A) 227 // Fast computation of log(A) 253 // 228 // 254 inline G4double GetLOGZ(G4int Z) const; << 229 inline G4double GetLOGA(G4double A); 255 inline G4double GetLOGAMU(G4int Z) const; << 230 inline G4double GetLOGZ(G4int Z); 256 << 257 G4ICRU90StoppingData* GetICRU90StoppingData( << 258 231 259 private: << 232 // Fast computation of log(A) for natuaral abandances 260 G4NistManager(); << 233 // >> 234 inline G4double GetLOGA(G4int Z); 261 235 262 std::vector<G4Element*> elements; << 236 private: 263 std::vector<G4Material*> materials; << 264 237 265 G4ICRU90StoppingData* fICRU90; << 238 G4NistManager(); 266 G4NistElementBuilder* elmBuilder; << 239 static G4NistManager* instance; 267 G4NistMaterialBuilder* matBuilder; << 268 G4NistMessenger* messenger; << 269 G4Pow* g4pow; << 270 const G4MaterialTable* theMaterialTable; << 271 const G4ElementTable* theElementTable; << 272 const G4IsotopeTable* theIsotopeTable; << 273 240 >> 241 G4double POWERZ13[256]; >> 242 G4double LOGA[256]; 274 G4double POWERA27[101]; 243 G4double POWERA27[101]; 275 G4double LOGAZ[101]; 244 G4double LOGAZ[101]; >> 245 >> 246 std::vector<G4Element*> elements; >> 247 std::vector<G4Material*> materials; >> 248 >> 249 size_t nElements; >> 250 size_t nMaterials; >> 251 >> 252 G4int verbose; >> 253 >> 254 G4NistElementBuilder* elmBuilder; >> 255 G4NistMaterialBuilder* matBuilder; >> 256 G4NistMessenger* messenger; 276 257 277 std::size_t nElements; << 278 std::size_t nMaterials; << 279 G4int verbose; << 280 }; 258 }; 281 259 282 //....oooOO0OOooo........oooOO0OOooo........oo 260 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 283 << 284 inline std::size_t G4NistManager::GetNumberOfM << 285 << 286 //....oooOO0OOooo........oooOO0OOooo........oo 261 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 287 262 288 inline G4Element* G4NistManager::GetElement(st << 263 inline size_t G4NistManager::GetNumberOfMaterials() 289 { 264 { 290 return (index < theElementTable->size()) ? ( << 265 return nMaterials; 291 } 266 } 292 267 293 //....oooOO0OOooo........oooOO0OOooo........oo 268 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 294 269 295 inline G4Element* G4NistManager::FindElement(G << 270 inline G4Element* G4NistManager::GetElement(size_t index) >> 271 { >> 272 G4Element* elm = 0; >> 273 const G4ElementTable* theElementTable = G4Element::GetElementTable(); >> 274 if(index < theElementTable->size()) elm = (*theElementTable)[index]; >> 275 return elm; >> 276 } 296 277 297 //....oooOO0OOooo........oooOO0OOooo........oo 278 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 298 279 299 inline G4Element* G4NistManager::FindOrBuildEl << 280 inline >> 281 G4Element* G4NistManager::FindOrBuildElement(G4int Z, G4bool isotopes) 300 { 282 { 301 return elmBuilder->FindOrBuildElement(Z, iso 283 return elmBuilder->FindOrBuildElement(Z, isotopes); 302 } 284 } 303 285 304 //....oooOO0OOooo........oooOO0OOooo........oo 286 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 305 287 306 inline G4Element* G4NistManager::FindOrBuildEl << 288 inline >> 289 G4Element* G4NistManager::FindOrBuildElement(const G4String& symb, >> 290 G4bool isotopes) 307 { 291 { 308 return elmBuilder->FindOrBuildElement(symb, 292 return elmBuilder->FindOrBuildElement(symb, isotopes); 309 } 293 } 310 294 311 //....oooOO0OOooo........oooOO0OOooo........oo 295 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 312 296 313 inline std::size_t G4NistManager::GetNumberOfE << 297 inline size_t G4NistManager::GetNumberOfElements() const 314 << 298 { 315 //....oooOO0OOooo........oooOO0OOooo........oo << 299 return nElements; 316 << 300 } 317 inline G4int G4NistManager::GetZ(const G4Strin << 318 301 319 //....oooOO0OOooo........oooOO0OOooo........oo 302 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 320 303 321 inline G4double G4NistManager::GetAtomicMassAm << 304 inline G4int G4NistManager::GetZ(const G4String& symb) const 322 { 305 { 323 return elmBuilder->GetAtomicMassAmu(symb); << 306 return elmBuilder->GetZ(symb); 324 } 307 } 325 308 326 //....oooOO0OOooo........oooOO0OOooo........oo 309 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 327 310 328 inline G4double G4NistManager::GetAtomicMassAm 311 inline G4double G4NistManager::GetAtomicMassAmu(G4int Z) const 329 { 312 { 330 return elmBuilder->GetAtomicMassAmu(Z); << 313 return elmBuilder->GetA(Z); 331 } 314 } 332 315 333 //....oooOO0OOooo........oooOO0OOooo........oo 316 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 334 317 335 inline G4double G4NistManager::GetIsotopeMass( << 318 inline >> 319 G4double G4NistManager::GetIsotopeMass(G4int Z, G4int N) const 336 { 320 { 337 return elmBuilder->GetIsotopeMass(Z, N); 321 return elmBuilder->GetIsotopeMass(Z, N); 338 } 322 } 339 323 340 //....oooOO0OOooo........oooOO0OOooo........oo 324 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 341 325 342 inline G4double G4NistManager::GetAtomicMass(G << 326 inline >> 327 G4double G4NistManager::GetAtomicMass(G4int Z, G4int N) const 343 { 328 { 344 return elmBuilder->GetAtomicMass(Z, N); 329 return elmBuilder->GetAtomicMass(Z, N); 345 } 330 } 346 331 347 //....oooOO0OOooo........oooOO0OOooo........oo 332 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 348 333 349 inline G4double G4NistManager::GetTotalElectro << 334 inline >> 335 G4double G4NistManager::GetTotalElectronBindingEnergy(G4int Z) const 350 { 336 { 351 return elmBuilder->GetTotalElectronBindingEn 337 return elmBuilder->GetTotalElectronBindingEnergy(Z); 352 } 338 } 353 339 354 //....oooOO0OOooo........oooOO0OOooo........oo 340 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 355 341 356 inline G4double G4NistManager::GetIsotopeAbund << 342 inline >> 343 G4double G4NistManager::GetIsotopeAbundance(G4int Z, G4int N) const 357 { 344 { 358 return elmBuilder->GetIsotopeAbundance(Z, N) 345 return elmBuilder->GetIsotopeAbundance(Z, N); 359 } 346 } 360 347 361 //....oooOO0OOooo........oooOO0OOooo........oo 348 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 362 349 363 inline G4int G4NistManager::GetNistFirstIsotop << 350 inline >> 351 G4int G4NistManager::GetNistFirstIsotopeN(G4int Z) const 364 { 352 { 365 return elmBuilder->GetNistFirstIsotopeN(Z); 353 return elmBuilder->GetNistFirstIsotopeN(Z); 366 } 354 } 367 355 368 //....oooOO0OOooo........oooOO0OOooo........oo 356 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 369 357 370 inline G4int G4NistManager::GetNumberOfNistIso << 358 inline >> 359 G4int G4NistManager::GetNumberOfNistIsotopes(G4int Z) const 371 { 360 { 372 return elmBuilder->GetNumberOfNistIsotopes(Z 361 return elmBuilder->GetNumberOfNistIsotopes(Z); 373 } 362 } 374 363 375 //....oooOO0OOooo........oooOO0OOooo........oo 364 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 376 365 377 inline const std::vector<G4String>& G4NistMana << 366 inline >> 367 const std::vector<G4String>& G4NistManager::GetNistElementNames() const 378 { 368 { 379 return elmBuilder->GetElementNames(); 369 return elmBuilder->GetElementNames(); 380 } 370 } 381 371 382 //....oooOO0OOooo........oooOO0OOooo........oo 372 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 383 373 384 inline G4double G4NistManager::GetMeanIonisati << 374 inline void G4NistManager::PrintElement(G4int Z) 385 { 375 { 386 return matBuilder->GetMeanIonisationEnergy(Z << 376 elmBuilder->PrintElement(Z); 387 } 377 } 388 378 389 //....oooOO0OOooo........oooOO0OOooo........oo 379 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 390 380 391 inline G4double G4NistManager::GetNominalDensi << 381 inline G4Material* G4NistManager::GetMaterial(size_t index) 392 { 382 { 393 return matBuilder->GetNominalDensity(Z); << 383 const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable(); >> 384 G4Material* mat = 0; >> 385 if(index < theMaterialTable->size()) mat = (*theMaterialTable)[index]; >> 386 return mat; 394 } 387 } 395 388 396 //....oooOO0OOooo........oooOO0OOooo........oo 389 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 397 390 398 inline void G4NistManager::PrintElement(G4int << 391 inline G4int G4NistManager::GetVerbose() 399 << 400 //....oooOO0OOooo........oooOO0OOooo........oo << 401 << 402 inline G4Material* G4NistManager::GetMaterial( << 403 { 392 { 404 return (index < theMaterialTable->size()) ? << 393 return verbose; 405 } 394 } 406 395 407 //....oooOO0OOooo........oooOO0OOooo........oo 396 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 408 397 409 inline G4int G4NistManager::GetVerbose() const << 398 inline 410 << 399 G4Material* G4NistManager::FindOrBuildMaterial(const G4String& name, 411 //....oooOO0OOooo........oooOO0OOooo........oo << 400 G4bool isotopes, 412 << 401 G4bool warning) 413 inline G4Material* G4NistManager::FindMaterial << 414 { 402 { 415 return matBuilder->FindMaterial(name); << 403 return matBuilder->FindOrBuildMaterial(name, isotopes, warning); 416 } 404 } 417 405 418 //....oooOO0OOooo........oooOO0OOooo........oo 406 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 419 407 420 inline G4Material* G4NistManager::FindOrBuildM << 408 inline G4Material* G4NistManager::ConstructNewMaterial( >> 409 const G4String& name, >> 410 const std::vector<G4String>& elm, >> 411 const std::vector<G4int>& nbAtoms, >> 412 G4double dens, >> 413 G4bool isotopes, >> 414 G4State state, >> 415 G4double T, >> 416 G4double P) >> 417 421 { 418 { 422 return matBuilder->FindOrBuildMaterial(name, << 419 return >> 420 matBuilder->ConstructNewMaterial(name,elm,nbAtoms,dens,isotopes,state,T,P); 423 } 421 } 424 422 425 //....oooOO0OOooo........oooOO0OOooo........oo 423 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 426 424 427 inline G4Material* G4NistManager::FindSimpleMa << 425 inline G4Material* G4NistManager::ConstructNewMaterial( >> 426 const G4String& name, >> 427 const std::vector<G4String>& elm, >> 428 const std::vector<G4double>& w, >> 429 G4double dens, >> 430 G4bool isotopes, >> 431 G4State state, >> 432 G4double T, >> 433 G4double P) 428 { 434 { 429 return matBuilder->FindSimpleMaterial(Z); << 435 return matBuilder->ConstructNewMaterial(name,elm,w,dens,isotopes,state,T,P); 430 } 436 } 431 437 432 //....oooOO0OOooo........oooOO0OOooo........oo 438 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 433 439 434 inline G4Material* G4NistManager::FindOrBuildS << 440 inline G4Material* G4NistManager::ConstructNewGasMaterial( >> 441 const G4String& name, >> 442 const G4String& nameNist, >> 443 G4double temp, G4double pres, >> 444 G4bool isotopes) 435 { 445 { 436 return matBuilder->FindOrBuildSimpleMaterial << 446 return matBuilder->ConstructNewGasMaterial(name,nameNist, >> 447 temp,pres,isotopes); 437 } 448 } 438 449 439 //....oooOO0OOooo........oooOO0OOooo........oo 450 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 440 451 441 inline G4Material* G4NistManager::ConstructNew << 452 inline void G4NistManager::ListMaterials(const G4String& list) 442 const std::vector<G4String>& elm, const std: << 443 G4State state, G4double T, G4double P) << 444 << 445 { 453 { 446 return matBuilder->ConstructNewMaterial(name << 454 matBuilder->ListMaterials(list); 447 } 455 } 448 456 449 //....oooOO0OOooo........oooOO0OOooo........oo 457 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 450 458 451 inline G4Material* G4NistManager::ConstructNew << 459 inline 452 const std::vector<G4String>& elm, const std: << 460 const std::vector<G4String>& G4NistManager::GetNistMaterialNames() const 453 G4State state, G4double T, G4double P) << 454 { 461 { 455 return matBuilder->ConstructNewMaterial(name << 462 return matBuilder->GetMaterialNames(); 456 } 463 } 457 464 458 //....oooOO0OOooo........oooOO0OOooo........oo 465 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 459 466 460 inline G4Material* G4NistManager::ConstructNew << 467 inline G4double G4NistManager::GetZ13(G4double Z) 461 const G4String& name, const G4String& nameNi << 462 { 468 { 463 return matBuilder->ConstructNewGasMaterial(n << 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); 464 } 474 } 465 475 466 //....oooOO0OOooo........oooOO0OOooo........oo 476 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 467 477 468 inline G4Material* G4NistManager::ConstructNew << 478 inline G4double G4NistManager::GetZ13(G4int Z) 469 const std::vector<G4String>& elm, const std: << 470 G4double P) << 471 { 479 { 472 return matBuilder->ConstructNewIdealGasMater << 480 return POWERZ13[Z]; 473 } 481 } 474 482 475 //....oooOO0OOooo........oooOO0OOooo........oo 483 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 476 484 477 inline void G4NistManager::ListMaterials(const << 485 inline G4double G4NistManager::GetA27(G4int Z) 478 { 486 { 479 matBuilder->ListMaterials(list); << 487 G4double res = 0.0; >> 488 if(Z < 101) res = POWERA27[Z]; >> 489 return res; 480 } 490 } 481 491 482 //....oooOO0OOooo........oooOO0OOooo........oo 492 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 483 493 484 inline const std::vector<G4String>& G4NistMana << 494 inline G4double G4NistManager::GetLOGZ(G4int Z) 485 { 495 { 486 return matBuilder->GetMaterialNames(); << 496 G4double res = 0.0; >> 497 if(Z < 256) res = LOGA[Z]; >> 498 return res; 487 } 499 } 488 500 489 //....oooOO0OOooo........oooOO0OOooo........oo 501 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 490 502 491 inline G4double G4NistManager::GetZ13(G4double << 503 inline G4double G4NistManager::GetLOGA(G4double A) 492 << 493 //....oooOO0OOooo........oooOO0OOooo........oo << 494 << 495 inline G4double G4NistManager::GetZ13(G4int Z) << 496 << 497 //....oooOO0OOooo........oooOO0OOooo........oo << 498 << 499 inline G4double G4NistManager::GetA27(G4int Z) << 500 { 504 { 501 return (0 <= Z && Z < 101) ? POWERA27[Z] : g << 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); 502 } 510 } 503 511 504 //....oooOO0OOooo........oooOO0OOooo........oo 512 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 505 513 506 inline G4double G4NistManager::GetLOGZ(G4int Z << 514 inline G4double G4NistManager::GetLOGA(G4int Z) 507 << 508 //....oooOO0OOooo........oooOO0OOooo........oo << 509 << 510 inline G4double G4NistManager::GetLOGAMU(G4int << 511 { 515 { 512 return (0 <= Z && Z < 101) ? LOGAZ[Z] : 0.0; << 516 G4double res = 0.0; >> 517 if(Z < 101) res = LOGAZ[Z]; >> 518 return res; 513 } 519 } 514 520 515 //....oooOO0OOooo........oooOO0OOooo........oo 521 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 516 522 517 #endif 523 #endif >> 524 518 525