Changeset 850 for trunk/source/materials/include/G4NistManager.hh
- Timestamp:
- Sep 10, 2008, 5:40:37 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/materials/include/G4NistManager.hh
r822 r850 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4NistManager.hh,v 1. 17 2007/12/11 13:32:08 gcosmoExp $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 $ 28 28 // 29 29 // … … 84 84 ~G4NistManager(); 85 85 86 // Elements86 // Get G4Element by index 87 87 // 88 88 inline G4Element* GetElement(size_t index); 89 89 90 90 // Find or build G4Element by atomic number 91 // 91 92 inline G4Element* FindOrBuildElement(G4int Z, G4bool isotopes=true); 92 93 93 94 // Find or build G4Element by symbol 95 // 94 96 inline G4Element* FindOrBuildElement(const G4String& symb, 95 97 G4bool isotopes=true); 96 98 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 // 101 110 inline G4double GetAtomicMassAmu(G4int Z) const; 102 111 103 // Mass in Geant4 units 112 // Get mass of the isotope in Geant4 units without electron shell 113 // 104 114 inline G4double GetIsotopeMass(G4int Z, G4int N) const; 115 116 // Get mass of the isotope in Geant4 units with electron shell 117 // 105 118 inline G4double GetAtomicMass(G4int Z, G4int N) const; 106 119 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 // 111 134 inline G4double GetIsotopeAbundance(G4int Z, G4int N) const; 112 135 136 // Print element by Z 137 // 113 138 inline void PrintElement(G4int Z); 114 139 140 // Print element from internal DB by symbol, if "all" - print all elements 141 // 115 142 void PrintElement(const G4String&); 143 144 // Print G4Element by name, if "all" - print all G4Elements 145 // 116 146 void PrintG4Element(const G4String&); 117 147 148 // Access to the vector of Geant4 predefined element names 149 // 118 150 inline const std::vector<G4String>& GetNistElementNames() const; 119 151 120 // Materials152 // Get G4Material by index 121 153 // 122 154 inline G4Material* GetMaterial(size_t index); 123 155 124 // Find or build a G4Material by name, from the dataBase156 // Find or build a G4Material by name, from the Geant4 dataBase 125 157 // 126 158 inline G4Material* FindOrBuildMaterial(const G4String& name, … … 128 160 G4bool warning=false); 129 161 130 // construct a G4Material from scratch by atome count162 // Construct a G4Material from scratch by atome count 131 163 // 132 164 inline G4Material* ConstructNewMaterial( … … 140 172 G4double pressure = STP_Pressure); 141 173 142 // construct a G4Material from scratch by fraction mass174 // Construct a G4Material from scratch by fraction mass 143 175 // 144 176 inline G4Material* ConstructNewMaterial( … … 152 184 G4double pressure = STP_Pressure); 153 185 154 // construct a gas G4Material from scratch by atome count186 // Construct a gas G4Material from scratch by atome count 155 187 // 156 188 inline G4Material* ConstructNewGasMaterial(const G4String& name, … … 160 192 G4bool isotopes=true); 161 193 194 // Get number of G4Materials 195 // 162 196 inline size_t GetNumberOfMaterials(); 163 197 … … 166 200 void SetVerbose(G4int); 167 201 202 // Print G4Material by name 203 // 168 204 void PrintG4Material(const G4String&); 169 205 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 // 170 212 inline void ListMaterials(const G4String&); 171 213 214 // Access to the list of names of Geant4 predefined materials 215 // 172 216 inline const std::vector<G4String>& GetNistMaterialNames() const; 173 217 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); 177 235 178 236 private: … … 181 239 static G4NistManager* instance; 182 240 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]; 185 245 186 246 std::vector<G4Element*> elements; … … 201 261 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 202 262 203 inline 204 size_t G4NistManager::GetNumberOfMaterials() 263 inline size_t G4NistManager::GetNumberOfMaterials() 205 264 { 206 265 return nMaterials; … … 209 268 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 210 269 211 inline 212 G4Element* G4NistManager::GetElement(size_t index) 270 inline G4Element* G4NistManager::GetElement(size_t index) 213 271 { 214 272 G4Element* elm = 0; … … 237 295 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 238 296 239 inline 240 size_t G4NistManager::GetNumberOfElements() const 297 inline size_t G4NistManager::GetNumberOfElements() const 241 298 { 242 299 return nElements; … … 245 302 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 246 303 247 inline 248 G4int G4NistManager::GetZ(const G4String& symb) const 304 inline G4int G4NistManager::GetZ(const G4String& symb) const 249 305 { 250 306 return elmBuilder->GetZ(symb); … … 253 309 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 254 310 255 inline 256 G4double G4NistManager::GetAtomicMassAmu(G4int Z) const 311 inline G4double G4NistManager::GetAtomicMassAmu(G4int Z) const 257 312 { 258 313 return elmBuilder->GetA(Z); … … 278 333 279 334 inline 335 G4double G4NistManager::GetTotalElectronBindingEnergy(G4int Z) const 336 { 337 return elmBuilder->GetTotalElectronBindingEnergy(Z); 338 } 339 340 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 341 342 inline 280 343 G4double G4NistManager::GetIsotopeAbundance(G4int Z, G4int N) const 281 344 { … … 309 372 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 310 373 311 inline 312 void G4NistManager::PrintElement(G4int Z) 374 inline void G4NistManager::PrintElement(G4int Z) 313 375 { 314 376 elmBuilder->PrintElement(Z); … … 317 379 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 318 380 319 inline 320 G4Material* G4NistManager::GetMaterial(size_t index) 381 inline G4Material* G4NistManager::GetMaterial(size_t index) 321 382 { 322 383 const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable(); … … 328 389 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 329 390 330 inline 331 G4int G4NistManager::GetVerbose() 391 inline G4int G4NistManager::GetVerbose() 332 392 { 333 393 return verbose; … … 346 406 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 347 407 348 inline 349 G4Material* G4NistManager::ConstructNewMaterial( 408 inline G4Material* G4NistManager::ConstructNewMaterial( 350 409 const G4String& name, 351 410 const std::vector<G4String>& elm, … … 364 423 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 365 424 366 inline 367 G4Material* G4NistManager::ConstructNewMaterial( 425 inline G4Material* G4NistManager::ConstructNewMaterial( 368 426 const G4String& name, 369 427 const std::vector<G4String>& elm, … … 380 438 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 381 439 382 inline 383 G4Material* G4NistManager::ConstructNewGasMaterial( 440 inline G4Material* G4NistManager::ConstructNewGasMaterial( 384 441 const G4String& name, 385 442 const G4String& nameNist, … … 393 450 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 394 451 395 inline 396 void G4NistManager::ListMaterials(const G4String& list) 452 inline void G4NistManager::ListMaterials(const G4String& list) 397 453 { 398 454 matBuilder->ListMaterials(list); … … 409 465 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 410 466 467 inline 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 478 inline G4double G4NistManager::GetZ13(G4int Z) 479 { 480 return POWERZ13[Z]; 481 } 482 483 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 484 485 inline 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 494 inline 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 503 inline 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 514 inline 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 411 523 #endif 412 524
Note: See TracChangeset
for help on using the changeset viewer.