00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065 #ifndef G4NistManager_h
00066 #define G4NistManager_h 1
00067
00068 #include <vector>
00069 #include <CLHEP/Units/PhysicalConstants.h>
00070
00071 #include "globals.hh"
00072 #include "G4Material.hh"
00073 #include "G4NistElementBuilder.hh"
00074 #include "G4NistMaterialBuilder.hh"
00075 #include "G4Pow.hh"
00076
00077 class G4NistMessenger;
00078
00079
00080
00081
00082 class G4NistManager
00083 {
00084
00085 public:
00086
00087 static G4NistManager* Instance();
00088 ~G4NistManager();
00089
00090
00091
00092 inline G4Element* GetElement(size_t index);
00093
00094
00095
00096 inline G4Element* FindOrBuildElement(G4int Z, G4bool isotopes=true);
00097
00098
00099
00100 inline G4Element* FindOrBuildElement(const G4String& symb,
00101 G4bool isotopes=true);
00102
00103
00104
00105 inline size_t GetNumberOfElements() const;
00106
00107
00108
00109 inline G4int GetZ(const G4String& symb) const;
00110
00111
00112
00113
00114 inline G4double GetAtomicMassAmu(const G4String& symb) const;
00115
00116
00117
00118
00119 inline G4double GetAtomicMassAmu(G4int Z) const;
00120
00121
00122
00123 inline G4double GetIsotopeMass(G4int Z, G4int N) const;
00124
00125
00126
00127
00128 inline G4double GetAtomicMass(G4int Z, G4int N) const;
00129
00130
00131
00132 inline G4double GetTotalElectronBindingEnergy(G4int Z) const;
00133
00134
00135
00136 inline G4int GetNistFirstIsotopeN(G4int Z) const;
00137
00138
00139
00140 inline G4int GetNumberOfNistIsotopes(G4int Z) const;
00141
00142
00143
00144 inline G4double GetIsotopeAbundance(G4int Z, G4int N) const;
00145
00146
00147
00148 inline void PrintElement(G4int Z);
00149
00150
00151
00152 void PrintElement(const G4String&);
00153
00154
00155
00156 void PrintG4Element(const G4String&);
00157
00158
00159
00160 inline const std::vector<G4String>& GetNistElementNames() const;
00161
00162
00163
00164 inline G4double GetMeanIonisationEnergy(G4int Z) const;
00165
00166
00167
00168 inline G4Material* GetMaterial(size_t index);
00169
00170
00171
00172 inline G4Material* FindOrBuildMaterial(const G4String& name,
00173 G4bool isotopes=true,
00174 G4bool warning=false);
00175
00176
00177
00178
00179 G4Material* BuildMaterialWithNewDensity(const G4String& name,
00180 const G4String& basename,
00181 G4double density = 0.0,
00182 G4double temp = CLHEP::STP_Temperature,
00183 G4double pres = CLHEP::STP_Pressure);
00184
00185
00186
00187 inline G4Material* ConstructNewMaterial(
00188 const G4String& name,
00189 const std::vector<G4String>& elm,
00190 const std::vector<G4int>& nbAtoms,
00191 G4double dens,
00192 G4bool isotopes=true,
00193 G4State state = kStateSolid,
00194 G4double temp = CLHEP::STP_Temperature,
00195 G4double pressure = CLHEP::STP_Pressure);
00196
00197
00198
00199 inline G4Material* ConstructNewMaterial(
00200 const G4String& name,
00201 const std::vector<G4String>& elm,
00202 const std::vector<G4double>& weight,
00203 G4double dens,
00204 G4bool isotopes=true,
00205 G4State state = kStateSolid,
00206 G4double temp = CLHEP::STP_Temperature,
00207 G4double pressure = CLHEP::STP_Pressure);
00208
00209
00210
00211 inline G4Material* ConstructNewGasMaterial(const G4String& name,
00212 const G4String& nameNist,
00213 G4double temp,
00214 G4double pres,
00215 G4bool isotopes=true);
00216
00217
00218
00219 inline G4Material* ConstructNewIdealGasMaterial(
00220 const G4String& name,
00221 const std::vector<G4String>& elm,
00222 const std::vector<G4int>& nbAtoms,
00223 G4bool isotopes = true,
00224 G4double temp = CLHEP::STP_Temperature,
00225 G4double pressure = CLHEP::STP_Pressure);
00226
00227
00228
00229 inline size_t GetNumberOfMaterials();
00230
00231 inline G4int GetVerbose();
00232
00233 void SetVerbose(G4int);
00234
00235
00236
00237 void PrintG4Material(const G4String&);
00238
00239
00240
00241
00242
00243
00244
00245 inline void ListMaterials(const G4String&);
00246
00247
00248
00249 inline const std::vector<G4String>& GetNistMaterialNames() const;
00250
00251
00252
00253 inline G4double GetZ13(G4double Z);
00254 inline G4double GetZ13(G4int Z);
00255
00256
00257
00258 inline G4double GetA27(G4int Z);
00259
00260
00261
00262 inline G4double GetLOGA(G4double A);
00263 inline G4double GetLOGZ(G4int Z);
00264
00265
00266
00267 inline G4double GetLOGA(G4int Z);
00268
00269 private:
00270
00271 G4NistManager();
00272 static G4NistManager* instance;
00273
00274 G4Pow* g4pow;
00275 G4double POWERA27[101];
00276 G4double LOGAZ[101];
00277
00278 std::vector<G4Element*> elements;
00279 std::vector<G4Material*> materials;
00280
00281 size_t nElements;
00282 size_t nMaterials;
00283
00284 G4int verbose;
00285
00286 G4NistElementBuilder* elmBuilder;
00287 G4NistMaterialBuilder* matBuilder;
00288 G4NistMessenger* messenger;
00289
00290 };
00291
00292
00293
00294
00295 inline size_t G4NistManager::GetNumberOfMaterials()
00296 {
00297 return nMaterials;
00298 }
00299
00300
00301
00302 inline G4Element* G4NistManager::GetElement(size_t index)
00303 {
00304 G4Element* elm = 0;
00305 const G4ElementTable* theElementTable = G4Element::GetElementTable();
00306 if(index < theElementTable->size()) { elm = (*theElementTable)[index]; }
00307 return elm;
00308 }
00309
00310
00311
00312 inline
00313 G4Element* G4NistManager::FindOrBuildElement(G4int Z, G4bool isotopes)
00314 {
00315 return elmBuilder->FindOrBuildElement(Z, isotopes);
00316 }
00317
00318
00319
00320 inline
00321 G4Element* G4NistManager::FindOrBuildElement(const G4String& symb,
00322 G4bool isotopes)
00323 {
00324 return elmBuilder->FindOrBuildElement(symb, isotopes);
00325 }
00326
00327
00328
00329 inline size_t G4NistManager::GetNumberOfElements() const
00330 {
00331 return nElements;
00332 }
00333
00334
00335
00336 inline G4int G4NistManager::GetZ(const G4String& symb) const
00337 {
00338 return elmBuilder->GetZ(symb);
00339 }
00340
00341
00342
00343 inline G4double G4NistManager::GetAtomicMassAmu(const G4String& symb) const
00344 {
00345 return elmBuilder->GetAtomicMassAmu(symb);
00346 }
00347
00348
00349
00350 inline G4double G4NistManager::GetAtomicMassAmu(G4int Z) const
00351 {
00352 return elmBuilder->GetAtomicMassAmu(Z);
00353 }
00354
00355
00356
00357 inline
00358 G4double G4NistManager::GetIsotopeMass(G4int Z, G4int N) const
00359 {
00360 return elmBuilder->GetIsotopeMass(Z, N);
00361 }
00362
00363
00364
00365 inline
00366 G4double G4NistManager::GetAtomicMass(G4int Z, G4int N) const
00367 {
00368 return elmBuilder->GetAtomicMass(Z, N);
00369 }
00370
00371
00372
00373 inline
00374 G4double G4NistManager::GetTotalElectronBindingEnergy(G4int Z) const
00375 {
00376 return elmBuilder->GetTotalElectronBindingEnergy(Z);
00377 }
00378
00379
00380
00381 inline
00382 G4double G4NistManager::GetIsotopeAbundance(G4int Z, G4int N) const
00383 {
00384 return elmBuilder->GetIsotopeAbundance(Z, N);
00385 }
00386
00387
00388
00389 inline
00390 G4int G4NistManager::GetNistFirstIsotopeN(G4int Z) const
00391 {
00392 return elmBuilder->GetNistFirstIsotopeN(Z);
00393 }
00394
00395
00396
00397 inline
00398 G4int G4NistManager::GetNumberOfNistIsotopes(G4int Z) const
00399 {
00400 return elmBuilder->GetNumberOfNistIsotopes(Z);
00401 }
00402
00403
00404
00405 inline
00406 const std::vector<G4String>& G4NistManager::GetNistElementNames() const
00407 {
00408 return elmBuilder->GetElementNames();
00409 }
00410
00411
00412
00413 inline G4double G4NistManager::GetMeanIonisationEnergy(G4int Z) const
00414 {
00415 return matBuilder->GetMeanIonisationEnergy(Z-1);
00416 }
00417
00418
00419
00420 inline void G4NistManager::PrintElement(G4int Z)
00421 {
00422 elmBuilder->PrintElement(Z);
00423 }
00424
00425
00426
00427 inline G4Material* G4NistManager::GetMaterial(size_t index)
00428 {
00429 const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
00430 G4Material* mat = 0;
00431 if(index < theMaterialTable->size()) mat = (*theMaterialTable)[index];
00432 return mat;
00433 }
00434
00435
00436
00437 inline G4int G4NistManager::GetVerbose()
00438 {
00439 return verbose;
00440 }
00441
00442
00443
00444 inline
00445 G4Material* G4NistManager::FindOrBuildMaterial(const G4String& name,
00446 G4bool isotopes,
00447 G4bool warning)
00448 {
00449 return matBuilder->FindOrBuildMaterial(name, isotopes, warning);
00450 }
00451
00452
00453
00454 inline G4Material* G4NistManager::ConstructNewMaterial(
00455 const G4String& name,
00456 const std::vector<G4String>& elm,
00457 const std::vector<G4int>& nbAtoms,
00458 G4double dens,
00459 G4bool isotopes,
00460 G4State state,
00461 G4double T,
00462 G4double P)
00463
00464 {
00465 return
00466 matBuilder->ConstructNewMaterial(name,elm,nbAtoms,dens,isotopes,state,T,P);
00467 }
00468
00469
00470
00471 inline G4Material* G4NistManager::ConstructNewMaterial(
00472 const G4String& name,
00473 const std::vector<G4String>& elm,
00474 const std::vector<G4double>& w,
00475 G4double dens,
00476 G4bool isotopes,
00477 G4State state,
00478 G4double T,
00479 G4double P)
00480 {
00481 return matBuilder->ConstructNewMaterial(name,elm,w,dens,isotopes,state,T,P);
00482 }
00483
00484
00485
00486 inline G4Material* G4NistManager::ConstructNewGasMaterial(
00487 const G4String& name,
00488 const G4String& nameNist,
00489 G4double temp, G4double pres,
00490 G4bool isotopes)
00491 {
00492 return matBuilder->ConstructNewGasMaterial(name,nameNist,
00493 temp,pres,isotopes);
00494 }
00495
00496
00497
00498 inline G4Material* G4NistManager::ConstructNewIdealGasMaterial(
00499 const G4String& name,
00500 const std::vector<G4String>& elm,
00501 const std::vector<G4int>& nbAtoms,
00502 G4bool isotopes,
00503 G4double T,
00504 G4double P)
00505 {
00506 return
00507 matBuilder->ConstructNewIdealGasMaterial(name,elm,nbAtoms,isotopes,T,P);
00508 }
00509
00510
00511
00512 inline void G4NistManager::ListMaterials(const G4String& list)
00513 {
00514 matBuilder->ListMaterials(list);
00515 }
00516
00517
00518
00519 inline
00520 const std::vector<G4String>& G4NistManager::GetNistMaterialNames() const
00521 {
00522 return matBuilder->GetMaterialNames();
00523 }
00524
00525
00526
00527 inline G4double G4NistManager::GetZ13(G4double A)
00528 {
00529 return g4pow->A13(A);
00530 }
00531
00532
00533
00534 inline G4double G4NistManager::GetZ13(G4int Z)
00535 {
00536 return g4pow->Z13(Z);
00537 }
00538
00539
00540
00541 inline G4double G4NistManager::GetA27(G4int Z)
00542 {
00543 G4double res = 0.0;
00544 if(Z < 101) { res = POWERA27[Z]; }
00545 return res;
00546 }
00547
00548
00549
00550 inline G4double G4NistManager::GetLOGZ(G4int Z)
00551 {
00552 return g4pow->logZ(Z);
00553 }
00554
00555
00556
00557 inline G4double G4NistManager::GetLOGA(G4double A)
00558 {
00559 return g4pow->logA(A);
00560 }
00561
00562
00563
00564 inline G4double G4NistManager::GetLOGA(G4int Z)
00565 {
00566 G4double res = 0.0;
00567 if(Z < 101) { res = LOGAZ[Z]; }
00568 return res;
00569 }
00570
00571
00572
00573 #endif
00574