Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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::~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

◆ AddElementFromIsotopes()

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}
const G4String & GetName() const
Definition: G4tgrElement.hh:52
G4tgrElement * FindElement(const G4String &name) const
static G4String GetString(const G4String &str)
Definition: G4tgrUtils.cc:178

Referenced by G4tgrLineProcessor::ProcessLine().

◆ AddElementSimple()

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}

Referenced by G4tgrLineProcessor::ProcessLine().

◆ AddIsotope()

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}
const G4String & GetName() const
Definition: G4tgrIsotope.hh:60
G4tgrIsotope * FindIsotope(const G4String &name) const

Referenced by G4tgrLineProcessor::ProcessLine().

◆ AddMaterialMixture()

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
191 mate = new G4tgrMaterialMixture( mixtType, wl );
192
193 //---------- register this material
194 theG4tgrMaterials[ mate->GetName() ] = mate;
195
196 return mate;
197}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
G4tgrMaterial * FindMaterial(const G4String &name) const
const G4String & GetName() const
static G4int GetVerboseLevel()

Referenced by G4tgrLineProcessor::ProcessLine().

◆ AddMaterialSimple()

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}

Referenced by G4tgrLineProcessor::ProcessLine().

◆ DumpElementList()

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}

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

◆ DumpIsotopeList()

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}

Referenced by G4tgrVolumeMgr::DumpSummary().

◆ DumpMaterialList()

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 & GetType() const
G4int GetNumberOfComponents() const

Referenced by G4tgrVolumeMgr::DumpSummary().

◆ FindElement()

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 {
251 G4cout << " G4tgrElement found: "
252 << ( (*cite).second )->GetName() << G4endl;
253 }
254#endif
255 return (*cite).second;
256 }
257}

Referenced by AddElementFromIsotopes(), and AddElementSimple().

◆ FindIsotope()

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}

Referenced by AddIsotope().

◆ FindMaterial()

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}

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

◆ GetElementList()

const G4mstgrelem & G4tgrMaterialFactory::GetElementList ( ) const
inline

Definition at line 101 of file G4tgrMaterialFactory.hh.

101{return theG4tgrElements; }

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

◆ GetInstance()

G4tgrMaterialFactory * G4tgrMaterialFactory::GetInstance ( )
static

◆ GetIsotopeList()

const G4mstgrisot & G4tgrMaterialFactory::GetIsotopeList ( ) const
inline

Definition at line 100 of file G4tgrMaterialFactory.hh.

100{return theG4tgrIsotopes; }

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

◆ GetMaterialList()

const G4mstgrmate & G4tgrMaterialFactory::GetMaterialList ( ) const
inline

Definition at line 102 of file G4tgrMaterialFactory.hh.

102{return theG4tgrMaterials;}

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


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