G4tgrMaterialFactory Class Reference

#include <G4tgrMaterialFactory.hh>


Public Member Functions

 ~G4tgrMaterialFactory ()
G4tgrIsotope * AddIsotope (const std::vector< G4String > &wl)
G4tgrElementSimple * AddElementSimple (const std::vector< G4String > &wl)
G4tgrElementFromIsotopes * AddElementFromIsotopes (const std::vector< G4String > &wl)
G4tgrMaterialSimple * AddMaterialSimple (const std::vector< G4String > &wl)
G4tgrMaterialMixture * AddMaterialMixture (const std::vector< G4String > &wl, const G4String &mixtType)
G4tgrIsotope * FindIsotope (const G4String &name) const
G4tgrElement * FindElement (const G4String &name) const
G4tgrMaterial * FindMaterial (const G4String &name) const
void DumpIsotopeList () const
void DumpElementList () const
void DumpMaterialList () const
const G4mstgrisot & GetIsotopeList () const
const G4mstgrelem & GetElementList () const
const G4mstgrmate & GetMaterialList () const

Static Public Member Functions

static G4tgrMaterialFactory * GetInstance ()


Detailed Description

Definition at line 58 of file G4tgrMaterialFactory.hh.


Constructor & Destructor Documentation

G4tgrMaterialFactory::~G4tgrMaterialFactory (  ) 

Definition at line 67 of file G4tgrMaterialFactory.cc.

00068 {
00069   G4mstgrisot::iterator isotcite;
00070   for( isotcite = theG4tgrIsotopes.begin();
00071        isotcite != theG4tgrIsotopes.end(); isotcite++)
00072   {
00073     delete (*isotcite).second;
00074   }
00075   theG4tgrIsotopes.clear();
00076 
00077   G4mstgrelem::iterator elemcite;
00078   for( elemcite = theG4tgrElements.begin();
00079        elemcite != theG4tgrElements.end(); elemcite++)
00080   {
00081     delete (*elemcite).second;
00082   }
00083   theG4tgrElements.clear();
00084 
00085   G4mstgrmate::iterator matcite;
00086   for( matcite = theG4tgrMaterials.begin();
00087        matcite != theG4tgrMaterials.end(); matcite++)
00088   {
00089     delete (*matcite).second;
00090   }
00091   theG4tgrMaterials.clear();
00092   delete theInstance;
00093 }


Member Function Documentation

G4tgrElementFromIsotopes * G4tgrMaterialFactory::AddElementFromIsotopes ( const std::vector< G4String > &  wl  ) 

Definition at line 131 of file G4tgrMaterialFactory.cc.

References FindElement(), G4tgrElement::GetName(), and G4tgrUtils::GetString().

Referenced by G4tgrLineProcessor::ProcessLine().

00132 {
00133   //---------- Look if element exists
00134   if( FindElement( G4tgrUtils::GetString(wl[1]) ) != 0 )
00135   {
00136     ErrorAlreadyExists("element", wl );
00137   }
00138   
00139   G4tgrElementFromIsotopes* elem = new G4tgrElementFromIsotopes( wl );
00140   theG4tgrElements[elem->GetName()] = elem;
00141 
00142   return elem;
00143 }

G4tgrElementSimple * G4tgrMaterialFactory::AddElementSimple ( const std::vector< G4String > &  wl  ) 

Definition at line 114 of file G4tgrMaterialFactory.cc.

References FindElement(), G4tgrElement::GetName(), and G4tgrUtils::GetString().

Referenced by G4tgrLineProcessor::ProcessLine().

00115 {
00116   //---------- Look if element exists
00117   if( FindElement( G4tgrUtils::GetString(wl[1]) ) != 0 )
00118   {
00119     ErrorAlreadyExists("element", wl );
00120   }
00121   
00122   G4tgrElementSimple* elem = new G4tgrElementSimple( wl );
00123   theG4tgrElements[elem->GetName()] = elem;
00124 
00125   return elem;
00126 }

G4tgrIsotope * G4tgrMaterialFactory::AddIsotope ( const std::vector< G4String > &  wl  ) 

Definition at line 98 of file G4tgrMaterialFactory.cc.

References FindIsotope(), G4tgrIsotope::GetName(), and G4tgrUtils::GetString().

Referenced by G4tgrLineProcessor::ProcessLine().

00099 {
00100   //---------- Look if isotope exists
00101   if( FindIsotope( G4tgrUtils::GetString(wl[1]) ) != 0 )
00102   {
00103     ErrorAlreadyExists("isotope", wl );
00104   }
00105   
00106   G4tgrIsotope* isot = new G4tgrIsotope( wl );
00107   theG4tgrIsotopes[isot->GetName()] = isot;
00108 
00109   return isot;
00110 }

G4tgrMaterialMixture * G4tgrMaterialFactory::AddMaterialMixture ( const std::vector< G4String > &  wl,
const G4String &  mixtType 
)

Definition at line 174 of file G4tgrMaterialFactory.cc.

References FindMaterial(), G4cout, G4endl, G4tgrMaterial::GetName(), G4tgrUtils::GetString(), and G4tgrMessenger::GetVerboseLevel().

Referenced by G4tgrLineProcessor::ProcessLine().

00176 {
00177 #ifdef G4VERBOSE
00178   if( G4tgrMessenger::GetVerboseLevel() >= 2 )
00179   {
00180     G4cout << " G4tgrMaterialFactory::AddMaterialMixture " << wl[1] << G4endl;
00181   }
00182 #endif
00183 
00184   //---------- Look if material already exists
00185   if( FindMaterial( G4tgrUtils::GetString(wl[1]) ) != 0 )
00186   {
00187     ErrorAlreadyExists("material mixture", wl );
00188   }
00189 
00190   G4tgrMaterialMixture* mate; 
00191   mate = new G4tgrMaterialMixture( mixtType, wl );
00192   
00193   //---------- register this material
00194   theG4tgrMaterials[ mate->GetName() ] = mate;
00195   
00196   return mate;
00197 }

G4tgrMaterialSimple * G4tgrMaterialFactory::AddMaterialSimple ( const std::vector< G4String > &  wl  ) 

Definition at line 148 of file G4tgrMaterialFactory.cc.

References FindMaterial(), G4cout, G4endl, G4tgrMaterial::GetName(), G4tgrUtils::GetString(), and G4tgrMessenger::GetVerboseLevel().

Referenced by G4tgrLineProcessor::ProcessLine().

00149 {
00150 #ifdef G4VERBOSE
00151   if( G4tgrMessenger::GetVerboseLevel() >= 2 )
00152   {
00153     G4cout << " G4tgrMaterialFactory::AddMaterialSimple" << wl[1] << G4endl;
00154   }
00155 #endif
00156 
00157   //---------- Look if material exists
00158   if( FindMaterial( G4tgrUtils::GetString(wl[1]) ) != 0 )
00159   {
00160     ErrorAlreadyExists("material simple", wl );
00161   }
00162 
00163   G4tgrMaterialSimple* mate = new G4tgrMaterialSimple("MaterialSimple", wl );
00164 
00165   //---------- register this material
00166   theG4tgrMaterials[ mate->GetName() ] = mate;
00167   
00168   return mate;
00169 }

void G4tgrMaterialFactory::DumpElementList (  )  const

Definition at line 295 of file G4tgrMaterialFactory.cc.

References G4cout, and G4endl.

Referenced by G4tgrVolumeMgr::DumpSummary(), and FindElement().

00296 {
00297   G4cout << " @@@@@@@@@@@@@@@@ DUMPING G4tgrElement's List " << G4endl;
00298   G4mstgrelem::const_iterator cite;
00299   for(cite = theG4tgrElements.begin(); cite != theG4tgrElements.end(); cite++)
00300   {
00301     G4cout << " ELEM: " << (*cite).second->GetName() << G4endl;
00302   }
00303 }

void G4tgrMaterialFactory::DumpIsotopeList (  )  const

Definition at line 283 of file G4tgrMaterialFactory.cc.

References G4cout, and G4endl.

Referenced by G4tgrVolumeMgr::DumpSummary().

00284 {
00285   G4cout << " @@@@@@@@@@@@@@@@ DUMPING G4tgrIsotope's List " << G4endl;
00286   G4mstgrisot::const_iterator cite;
00287   for(cite = theG4tgrIsotopes.begin(); cite != theG4tgrIsotopes.end(); cite++)
00288   {
00289     G4cout << " ISOT: " << (*cite).second->GetName() << G4endl;
00290   }
00291 }

void G4tgrMaterialFactory::DumpMaterialList (  )  const

Definition at line 307 of file G4tgrMaterialFactory.cc.

References G4cout, and G4endl.

Referenced by G4tgrVolumeMgr::DumpSummary().

00308 {
00309   G4cout << " @@@@@@@@@@@@@@@@ DUMPING G4tgrMaterial's List " << G4endl;
00310   G4mstgrmate::const_iterator cite;
00311   for(cite = theG4tgrMaterials.begin(); cite != theG4tgrMaterials.end(); cite++)
00312   {
00313     G4tgrMaterial* mate = (*cite).second;
00314     G4cout << " MATE: " << mate->GetName() << " Type: " << mate->GetType() 
00315            << " NoComponents= " << mate->GetNumberOfComponents() << G4endl;
00316   }
00317 }

G4tgrElement * G4tgrMaterialFactory::FindElement ( const G4String &  name  )  const

Definition at line 231 of file G4tgrMaterialFactory.cc.

References DumpElementList(), G4cout, G4endl, and G4tgrMessenger::GetVerboseLevel().

Referenced by AddElementFromIsotopes(), and AddElementSimple().

00232 {
00233 #ifdef G4VERBOSE
00234   if( G4tgrMessenger::GetVerboseLevel() >= 3 )
00235   {
00236     G4cout << " G4tgrMaterialFactory::FindElement() - " << name << G4endl;
00237   }
00238 #endif
00239   G4mstgrelem::const_iterator cite;
00240   cite = theG4tgrElements.find( name ); 
00241   if( cite == theG4tgrElements.end() )
00242   {
00243     return 0;
00244   }
00245   else
00246   {
00247 #ifdef G4VERBOSE
00248     if( G4tgrMessenger::GetVerboseLevel() >= 3 )
00249     {
00250       DumpElementList();
00251       G4cout << " G4tgrElement found: "
00252              << ( (*cite).second )->GetName() << G4endl;
00253     }
00254 #endif
00255     return (*cite).second;
00256   }
00257 }

G4tgrIsotope * G4tgrMaterialFactory::FindIsotope ( const G4String &  name  )  const

Definition at line 201 of file G4tgrMaterialFactory.cc.

References G4cout, G4endl, and G4tgrMessenger::GetVerboseLevel().

Referenced by AddIsotope().

00202 {
00203 #ifdef G4VERBOSE
00204   if( G4tgrMessenger::GetVerboseLevel() >= 3 )
00205   {
00206      G4cout << " G4tgrMaterialFactory::FindIsotope() - " << name << G4endl;
00207   }
00208 #endif
00209 
00210   G4mstgrisot::const_iterator cite;
00211   cite = theG4tgrIsotopes.find( name ); 
00212   if( cite == theG4tgrIsotopes.end() )
00213   {
00214     return 0;
00215   }
00216   else
00217   {
00218 #ifdef G4VERBOSE
00219     if( G4tgrMessenger::GetVerboseLevel() >= 3 )
00220     {
00221       G4cout << " G4tgrIsotope found: "
00222              << ( (*cite).second )->GetName() << G4endl;
00223     }
00224 #endif
00225     return (*cite).second;
00226   }
00227 }

G4tgrMaterial * G4tgrMaterialFactory::FindMaterial ( const G4String &  name  )  const

Definition at line 261 of file G4tgrMaterialFactory.cc.

References G4cout, G4endl, and G4tgrMessenger::GetVerboseLevel().

Referenced by AddMaterialMixture(), AddMaterialSimple(), and G4tgrLineProcessor::ProcessLine().

00262 {
00263 #ifdef G4VERBOSE
00264   if( G4tgrMessenger::GetVerboseLevel() >= 3 )
00265   {
00266     G4cout << " G4tgrMaterialFactory::FindMaterial() - " << name << G4endl;
00267   }
00268 #endif
00269   G4mstgrmate::const_iterator cite;
00270   cite = theG4tgrMaterials.find( name );
00271   if( cite == theG4tgrMaterials.end() )
00272   {
00273     return 0;
00274   }
00275   else
00276   {
00277     return (*cite).second;
00278   }
00279 }

const G4mstgrelem& G4tgrMaterialFactory::GetElementList (  )  const [inline]

Definition at line 101 of file G4tgrMaterialFactory.hh.

Referenced by G4tgbMaterialMgr::CopyElements(), and G4tgrVolumeMgr::DumpSummary().

00101 {return theG4tgrElements; }

G4tgrMaterialFactory * G4tgrMaterialFactory::GetInstance (  )  [static]

Definition at line 56 of file G4tgrMaterialFactory.cc.

Referenced by G4tgbMaterialMgr::CopyElements(), G4tgbMaterialMgr::CopyIsotopes(), G4tgbMaterialMgr::CopyMaterials(), G4tgrVolumeMgr::DumpSummary(), and G4tgrLineProcessor::ProcessLine().

00057 {
00058   if( !theInstance )
00059   {
00060     theInstance = new G4tgrMaterialFactory;
00061   }
00062   return theInstance;
00063 }

const G4mstgrisot& G4tgrMaterialFactory::GetIsotopeList (  )  const [inline]

Definition at line 100 of file G4tgrMaterialFactory.hh.

Referenced by G4tgbMaterialMgr::CopyIsotopes(), and G4tgrVolumeMgr::DumpSummary().

00100 {return theG4tgrIsotopes; }

const G4mstgrmate& G4tgrMaterialFactory::GetMaterialList (  )  const [inline]

Definition at line 102 of file G4tgrMaterialFactory.hh.

Referenced by G4tgbMaterialMgr::CopyMaterials(), and G4tgrVolumeMgr::DumpSummary().

00102 {return theG4tgrMaterials;}


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:30 2013 for Geant4 by  doxygen 1.4.7