70 delete(*isotcite).second;
77 delete(*elemcite).second;
84 delete(*matcite).second;
96 for(
auto cite = tgrIsots.cbegin(); cite != tgrIsots.cend(); ++cite)
109 for(
auto cite = tgrElems.cbegin(); cite != tgrElems.cend(); ++cite)
122 for(
auto cite = tgrMates.cbegin(); cite != tgrMates.cend(); ++cite)
126 if(tgr->
GetType() ==
"MaterialSimple")
130 else if(tgr->
GetType() ==
"MaterialMixtureByWeight")
134 else if(tgr->
GetType() ==
"MaterialMixtureByNoAtoms")
138 else if(tgr->
GetType() ==
"MaterialMixtureByVolume")
154 if(g4isot ==
nullptr)
168 G4cout <<
" G4tgbMaterialMgr::FindOrBuildG4Isotope() -"
169 <<
" G4Isotope already built: " << g4isot->
GetName() <<
G4endl;
177 G4cout <<
" G4tgbMaterialMgr::FindOrBuildG4Isotope() - Isotope: " <<
name
192 g4isot = (*cite).second;
196 G4cout <<
" G4tgbMaterialMgr::FindBuiltG4Isotope() - Isotope: " <<
name
197 <<
" = " << g4isot <<
G4endl;
217 G4cout <<
" G4tgbMaterialMgr::FindG4tgbIsotope() -"
218 <<
" G4tgbIsotope found: " << ((*cite).second)->GetName()
222 isot = (*cite).second;
224 if((isot ==
nullptr) && bMustExist)
226 G4String ErrMessage =
"Isotope " +
name +
" not found !";
227 G4Exception(
"G4tgbMaterialMgr::FindG4tgbIsotope()",
"InvalidSetup",
239 if(g4elem ==
nullptr)
242 if(tgbelem ==
nullptr)
245 G4cout <<
" G4NistManager::Instance()->FindOrBuildElement( " <<
G4endl;
250 if(tgbelem->
GetType() ==
"ElementSimple")
254 else if(tgbelem->
GetType() ==
"ElementFromIsotopes")
261 "Element type " + tgbelem->
GetType() +
" does not exist !";
262 G4Exception(
"G4tgbMaterialMgr::GetG4Element()",
"InvalidSetup",
267 if((g4elem !=
nullptr))
273 G4cout <<
" G4tgbMaterialMgr::FindOrBuildG4Element() - Element: "
282 G4String ErrMessage =
"Element " +
name +
" not found !";
283 G4Exception(
"G4tgbMaterialMgr::FindOrBuildG4Element()",
"InvalidSetup",
289 G4cout <<
" G4tgbMaterialMgr::FindOrBuildG4Element() - Element: "
300 G4cout <<
" G4tgbMaterialMgr::GetG4Element() -"
301 <<
" G4Element already built: " << g4elem->
GetName() <<
G4endl;
317 g4elem = (*cite).second;
321 G4cout <<
" G4tgbMaterialMgr::FindBuiltG4Element() - Element: " <<
name
322 <<
" = " << g4elem <<
G4endl;
342 G4cout <<
" G4tgbMaterialMgr::FindG4tgbElement() -"
343 <<
" G4tgbElement found: " << ((*cite).second)->GetName()
347 elem = (*cite).second;
349 if((
elem ==
nullptr) && bMustExist)
351 G4String ErrMessage =
"Element " +
name +
" not found !";
352 G4Exception(
"G4tgbMaterialMgr::FindG4tgbElement()",
"InvalidSetup",
364 if(g4mate ==
nullptr)
368 if(tgbmate ==
nullptr)
385 if(g4mate !=
nullptr)
391 G4cout <<
" G4tgbMaterialMgr::FindOrBuildG4Material() - Material: "
400 G4String ErrMessage =
"Material " +
name +
" not found !";
401 G4Exception(
"G4tgbMaterialMgr::FindOrBuildG4Material()",
"InvalidSetup",
407 G4cout <<
" G4tgbMaterialMgr::FindOrBuildG4Material() - Element: "
418 G4cout <<
" G4tgbMaterialMgr::FindOrBuildG4Material() -"
419 <<
" G4Material already built: " << g4mate->
GetName() <<
G4endl;
435 g4mate = (*cite).second;
439 G4cout <<
" G4tgbMaterialMgr::FindBuiltG4Material() - Material: " <<
name
440 <<
" = " << g4mate <<
G4endl;
456 mate = (*cite).second;
460 G4cout <<
" G4tgbMaterialMgr::FindG4tgbMaterial() -"
461 <<
" G4tgbMaterial found: " << ((*cite).second)->GetName()
462 <<
" type " << ((*cite).second)->GetName() <<
G4endl;
467 if((mate ==
nullptr) && bMustExist)
469 G4String ErrMessage =
"Material " +
name +
" not found !";
470 G4Exception(
"G4tgbMaterialMgr::FindG4tgbMaterial()",
"InvalidSetup",
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
std::map< G4String, G4tgrElement * > G4mstgrelem
std::map< G4String, G4tgrMaterial * > G4mstgrmate
std::map< G4String, G4tgrIsotope * > G4mstgrisot
const G4String & GetName() const
void SetMeanExcitationEnergy(G4double value)
const G4String & GetName() const
G4IonisParamMat * GetIonisation() const
const G4String & GetName() const
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
static G4NistManager * Instance()
G4Element * FindOrBuildElement(G4int Z, G4bool isotopes=true)
const G4String & GetName() const
G4Element * BuildG4ElementFromIsotopes()
const G4String & GetType() const
G4Element * BuildG4ElementSimple()
G4Isotope * BuildG4Isotope()
const G4String & GetName() const
G4Material * FindBuiltG4Material(const G4String &name) const
G4Isotope * FindOrBuildG4Isotope(const G4String &name)
G4tgbIsotope * FindG4tgbIsotope(const G4String &name, G4bool bMustExist=false) const
G4tgbElement * FindG4tgbElement(const G4String &name, G4bool bMustExist=false) const
G4msg4mate theG4Materials
G4mstgbelem theG4tgbElements
static G4ThreadLocal G4tgbMaterialMgr * theInstance
G4Element * FindBuiltG4Element(const G4String &name) const
G4mstgbmate theG4tgbMaterials
G4Isotope * FindBuiltG4Isotope(const G4String &name) const
G4Element * FindOrBuildG4Element(const G4String &name, G4bool bMustExist=true)
G4Material * FindOrBuildG4Material(const G4String &name, G4bool bMustExist=true)
G4tgbMaterial * FindG4tgbMaterial(const G4String &name, G4bool bMustExist=false) const
G4mstgbisot theG4tgbIsotopes
static G4tgbMaterialMgr * GetInstance()
const G4String & GetName() const
G4tgrMaterial * GetTgrMate() const
virtual G4Material * BuildG4Material()=0
const G4mstgrelem & GetElementList() const
const G4mstgrmate & GetMaterialList() const
static G4tgrMaterialFactory * GetInstance()
const G4mstgrisot & GetIsotopeList() const
const G4String & GetType() const
G4double GetIonisationMeanExcitationEnergy() const
static G4int GetVerboseLevel()
const char * name(G4int ptype)