Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4tgrMaterialFactory Class Reference

#include <G4tgrMaterialFactory.hh>

Public Member Functions

 ~G4tgrMaterialFactory ()
 
G4tgrIsotopeAddIsotope (const std::vector< G4String > &wl)
 
G4tgrElementSimpleAddElementSimple (const std::vector< G4String > &wl)
 
G4tgrElementFromIsotopesAddElementFromIsotopes (const std::vector< G4String > &wl)
 
G4tgrMaterialSimpleAddMaterialSimple (const std::vector< G4String > &wl)
 
G4tgrMaterialMixtureAddMaterialMixture (const std::vector< G4String > &wl, const G4String &mixtType)
 
G4tgrIsotopeFindIsotope (const G4String &name) const
 
G4tgrElementFindElement (const G4String &name) const
 
G4tgrMaterialFindMaterial (const G4String &name) const
 
void DumpIsotopeList () const
 
void DumpElementList () const
 
void DumpMaterialList () const
 
const G4mstgrisotGetIsotopeList () const
 
const G4mstgrelemGetElementList () const
 
const G4mstgrmateGetMaterialList () const
 

Static Public Member Functions

static G4tgrMaterialFactoryGetInstance ()
 

Detailed Description

Definition at line 58 of file G4tgrMaterialFactory.hh.

Constructor & Destructor Documentation

G4tgrMaterialFactory::~G4tgrMaterialFactory ( )

Definition at line 67 of file G4tgrMaterialFactory.cc.

68 {
69  G4mstgrisot::iterator isotcite;
70  for( isotcite = theG4tgrIsotopes.begin();
71  isotcite != theG4tgrIsotopes.end(); isotcite++)
72  {
73  delete (*isotcite).second;
74  }
75  theG4tgrIsotopes.clear();
76 
77  G4mstgrelem::iterator elemcite;
78  for( elemcite = theG4tgrElements.begin();
79  elemcite != theG4tgrElements.end(); elemcite++)
80  {
81  delete (*elemcite).second;
82  }
83  theG4tgrElements.clear();
84 
85  G4mstgrmate::iterator matcite;
86  for( matcite = theG4tgrMaterials.begin();
87  matcite != theG4tgrMaterials.end(); matcite++)
88  {
89  delete (*matcite).second;
90  }
91  theG4tgrMaterials.clear();
92  delete theInstance;
93 }

Member Function Documentation

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

Definition at line 131 of file G4tgrMaterialFactory.cc.

132 {
133  //---------- Look if element exists
134  if( FindElement( G4tgrUtils::GetString(wl[1]) ) != 0 )
135  {
136  ErrorAlreadyExists("element", wl );
137  }
138 
140  theG4tgrElements[elem->GetName()] = elem;
141 
142  return elem;
143 }
static G4String GetString(const G4String &str)
Definition: G4tgrUtils.cc:180
const G4String & GetName() const
Definition: G4tgrElement.hh:52
G4tgrElement * FindElement(const G4String &name) const

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 114 of file G4tgrMaterialFactory.cc.

115 {
116  //---------- Look if element exists
117  if( FindElement( G4tgrUtils::GetString(wl[1]) ) != 0 )
118  {
119  ErrorAlreadyExists("element", wl );
120  }
121 
122  G4tgrElementSimple* elem = new G4tgrElementSimple( wl );
123  theG4tgrElements[elem->GetName()] = elem;
124 
125  return elem;
126 }
static G4String GetString(const G4String &str)
Definition: G4tgrUtils.cc:180
const G4String & GetName() const
Definition: G4tgrElement.hh:52
G4tgrElement * FindElement(const G4String &name) const

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 98 of file G4tgrMaterialFactory.cc.

99 {
100  //---------- Look if isotope exists
101  if( FindIsotope( G4tgrUtils::GetString(wl[1]) ) != 0 )
102  {
103  ErrorAlreadyExists("isotope", wl );
104  }
105 
106  G4tgrIsotope* isot = new G4tgrIsotope( wl );
107  theG4tgrIsotopes[isot->GetName()] = isot;
108 
109  return isot;
110 }
G4tgrIsotope * FindIsotope(const G4String &name) const
const G4String & GetName() const
Definition: G4tgrIsotope.hh:60
static G4String GetString(const G4String &str)
Definition: G4tgrUtils.cc:180

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 174 of file G4tgrMaterialFactory.cc.

176 {
177 #ifdef G4VERBOSE
179  {
180  G4cout << " G4tgrMaterialFactory::AddMaterialMixture " << wl[1] << G4endl;
181  }
182 #endif
183 
184  //---------- Look if material already exists
185  if( FindMaterial( G4tgrUtils::GetString(wl[1]) ) != 0 )
186  {
187  ErrorAlreadyExists("material mixture", wl );
188  }
189 
190  G4tgrMaterialMixture* mate;
191  mate = new G4tgrMaterialMixture( mixtType, wl );
192 
193  //---------- register this material
194  theG4tgrMaterials[ mate->GetName() ] = mate;
195 
196  return mate;
197 }
const G4String & GetName() const
G4GLOB_DLL std::ostream G4cout
static G4int GetVerboseLevel()
G4tgrMaterial * FindMaterial(const G4String &name) const
static G4String GetString(const G4String &str)
Definition: G4tgrUtils.cc:180
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 148 of file G4tgrMaterialFactory.cc.

149 {
150 #ifdef G4VERBOSE
152  {
153  G4cout << " G4tgrMaterialFactory::AddMaterialSimple" << wl[1] << G4endl;
154  }
155 #endif
156 
157  //---------- Look if material exists
158  if( FindMaterial( G4tgrUtils::GetString(wl[1]) ) != 0 )
159  {
160  ErrorAlreadyExists("material simple", wl );
161  }
162 
163  G4tgrMaterialSimple* mate = new G4tgrMaterialSimple("MaterialSimple", wl );
164 
165  //---------- register this material
166  theG4tgrMaterials[ mate->GetName() ] = mate;
167 
168  return mate;
169 }
const G4String & GetName() const
G4GLOB_DLL std::ostream G4cout
static G4int GetVerboseLevel()
G4tgrMaterial * FindMaterial(const G4String &name) const
static G4String GetString(const G4String &str)
Definition: G4tgrUtils.cc:180
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

void G4tgrMaterialFactory::DumpElementList ( ) const

Definition at line 295 of file G4tgrMaterialFactory.cc.

296 {
297  G4cout << " @@@@@@@@@@@@@@@@ DUMPING G4tgrElement's List " << G4endl;
298  G4mstgrelem::const_iterator cite;
299  for(cite = theG4tgrElements.begin(); cite != theG4tgrElements.end(); cite++)
300  {
301  G4cout << " ELEM: " << (*cite).second->GetName() << G4endl;
302  }
303 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

void G4tgrMaterialFactory::DumpIsotopeList ( ) const

Definition at line 283 of file G4tgrMaterialFactory.cc.

284 {
285  G4cout << " @@@@@@@@@@@@@@@@ DUMPING G4tgrIsotope's List " << G4endl;
286  G4mstgrisot::const_iterator cite;
287  for(cite = theG4tgrIsotopes.begin(); cite != theG4tgrIsotopes.end(); cite++)
288  {
289  G4cout << " ISOT: " << (*cite).second->GetName() << G4endl;
290  }
291 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

void G4tgrMaterialFactory::DumpMaterialList ( ) const

Definition at line 307 of file G4tgrMaterialFactory.cc.

308 {
309  G4cout << " @@@@@@@@@@@@@@@@ DUMPING G4tgrMaterial's List " << G4endl;
310  G4mstgrmate::const_iterator cite;
311  for(cite = theG4tgrMaterials.begin(); cite != theG4tgrMaterials.end(); cite++)
312  {
313  G4tgrMaterial* mate = (*cite).second;
314  G4cout << " MATE: " << mate->GetName() << " Type: " << mate->GetType()
315  << " NoComponents= " << mate->GetNumberOfComponents() << G4endl;
316  }
317 }
const G4String & GetName() const
G4GLOB_DLL std::ostream G4cout
G4int GetNumberOfComponents() const
const G4String & GetType() const
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 231 of file G4tgrMaterialFactory.cc.

232 {
233 #ifdef G4VERBOSE
235  {
236  G4cout << " G4tgrMaterialFactory::FindElement() - " << name << G4endl;
237  }
238 #endif
239  G4mstgrelem::const_iterator cite;
240  cite = theG4tgrElements.find( name );
241  if( cite == theG4tgrElements.end() )
242  {
243  return 0;
244  }
245  else
246  {
247 #ifdef G4VERBOSE
249  {
250  DumpElementList();
251  G4cout << " G4tgrElement found: "
252  << ( (*cite).second )->GetName() << G4endl;
253  }
254 #endif
255  return (*cite).second;
256  }
257 }
G4GLOB_DLL std::ostream G4cout
static G4int GetVerboseLevel()
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 201 of file G4tgrMaterialFactory.cc.

202 {
203 #ifdef G4VERBOSE
205  {
206  G4cout << " G4tgrMaterialFactory::FindIsotope() - " << name << G4endl;
207  }
208 #endif
209 
210  G4mstgrisot::const_iterator cite;
211  cite = theG4tgrIsotopes.find( name );
212  if( cite == theG4tgrIsotopes.end() )
213  {
214  return 0;
215  }
216  else
217  {
218 #ifdef G4VERBOSE
220  {
221  G4cout << " G4tgrIsotope found: "
222  << ( (*cite).second )->GetName() << G4endl;
223  }
224 #endif
225  return (*cite).second;
226  }
227 }
G4GLOB_DLL std::ostream G4cout
static G4int GetVerboseLevel()
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 261 of file G4tgrMaterialFactory.cc.

262 {
263 #ifdef G4VERBOSE
265  {
266  G4cout << " G4tgrMaterialFactory::FindMaterial() - " << name << G4endl;
267  }
268 #endif
269  G4mstgrmate::const_iterator cite;
270  cite = theG4tgrMaterials.find( name );
271  if( cite == theG4tgrMaterials.end() )
272  {
273  return 0;
274  }
275  else
276  {
277  return (*cite).second;
278  }
279 }
G4GLOB_DLL std::ostream G4cout
static G4int GetVerboseLevel()
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

const G4mstgrelem& G4tgrMaterialFactory::GetElementList ( ) const
inline

Definition at line 101 of file G4tgrMaterialFactory.hh.

101 {return theG4tgrElements; }

Here is the caller graph for this function:

G4tgrMaterialFactory * G4tgrMaterialFactory::GetInstance ( )
static

Definition at line 56 of file G4tgrMaterialFactory.cc.

57 {
58  if( !theInstance )
59  {
60  theInstance = new G4tgrMaterialFactory;
61  }
62  return theInstance;
63 }

Here is the caller graph for this function:

const G4mstgrisot& G4tgrMaterialFactory::GetIsotopeList ( ) const
inline

Definition at line 100 of file G4tgrMaterialFactory.hh.

100 {return theG4tgrIsotopes; }

Here is the caller graph for this function:

const G4mstgrmate& G4tgrMaterialFactory::GetMaterialList ( ) const
inline

Definition at line 102 of file G4tgrMaterialFactory.hh.

102 {return theG4tgrMaterials;}

Here is the caller graph for this function:


The documentation for this class was generated from the following files: