Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4MaterialPropertiesTable Class Reference

#include <G4MaterialPropertiesTable.hh>

+ Inheritance diagram for G4MaterialPropertiesTable:

Public Member Functions

 G4MaterialPropertiesTable ()
 
virtual ~G4MaterialPropertiesTable ()
 
void AddConstProperty (const G4String &key, G4double PropertyValue)
 
void AddConstProperty (const char *key, G4double PropertyValue)
 
G4MaterialPropertyVectorAddProperty (const G4String &key, const std::vector< G4double > &photonEnergies, const std::vector< G4double > &propertyValues)
 
G4MaterialPropertyVectorAddProperty (const char *key, G4double *PhotonEnergies, G4double *PropertyValues, G4int NumEntries)
 
void AddProperty (const G4String &key, G4MaterialPropertyVector *opv)
 
void AddProperty (const char *key, G4MaterialPropertyVector *opv)
 
void RemoveConstProperty (const G4String &key)
 
void RemoveConstProperty (const char *key)
 
void RemoveProperty (const G4String &key)
 
void RemoveProperty (const char *key)
 
G4double GetConstProperty (const G4String &key) const
 
G4double GetConstProperty (const char *key) const
 
G4double GetConstProperty (const G4int index) const
 
G4bool ConstPropertyExists (const G4String &key) const
 
G4bool ConstPropertyExists (const char *key) const
 
G4bool ConstPropertyExists (const G4int index) const
 
G4MaterialPropertyVectorGetProperty (const char *key, G4bool warning=false)
 
G4MaterialPropertyVectorGetProperty (const G4String &key, G4bool warning=false)
 
G4MaterialPropertyVectorGetProperty (const G4int index, G4bool warning=false)
 
void AddEntry (const G4String &key, G4double aPhotonEnergy, G4double aPropertyValue)
 
void AddEntry (const char *key, G4double aPhotonEnergy, G4double aPropertyValue)
 
G4int GetConstPropertyIndex (const G4String &key, G4bool warning=false) const
 
G4int GetPropertyIndex (const G4String &key, G4bool warning=false) const
 
std::vector< G4StringGetMaterialPropertyNames () const
 
std::vector< G4StringGetMaterialConstPropertyNames () const
 
void DumpTable ()
 
std::map< G4String, G4MaterialPropertyVector *, std::less< G4String > > * GetPropertiesMap ()
 
std::map< G4String, G4double, std::less< G4String > > * GetPropertiesCMap ()
 
const std::map< G4int, G4MaterialPropertyVector *, std::less< G4int > > * GetPropertyMap () const
 
const std::map< G4int, G4double, std::less< G4int > > * GetConstPropertyMap () const
 

Detailed Description

Definition at line 69 of file G4MaterialPropertiesTable.hh.

Constructor & Destructor Documentation

◆ G4MaterialPropertiesTable()

G4MaterialPropertiesTable::G4MaterialPropertiesTable ( )

Definition at line 58 of file G4MaterialPropertiesTable.cc.

59{
60 // elements of these 2 vectors must be in same order as
61 // the corresponding enums in G4MaterialPropertiesIndex.hh
62 G4MaterialPropertyName.push_back(G4String("RINDEX"));
63 G4MaterialPropertyName.push_back(G4String("REFLECTIVITY"));
64 G4MaterialPropertyName.push_back(G4String("REALRINDEX"));
65 G4MaterialPropertyName.push_back(G4String("IMAGINARYRINDEX"));
66 G4MaterialPropertyName.push_back(G4String("EFFICIENCY"));
67 G4MaterialPropertyName.push_back(G4String("TRANSMITTANCE"));
68 G4MaterialPropertyName.push_back(G4String("SPECULARLOBECONSTANT"));
69 G4MaterialPropertyName.push_back(G4String("SPECULARSPIKECONSTANT"));
70 G4MaterialPropertyName.push_back(G4String("BACKSCATTERCONSTANT"));
71 G4MaterialPropertyName.push_back(G4String("GROUPVEL"));
72 G4MaterialPropertyName.push_back(G4String("MIEHG"));
73 G4MaterialPropertyName.push_back(G4String("RAYLEIGH"));
74 G4MaterialPropertyName.push_back(G4String("WLSCOMPONENT"));
75 G4MaterialPropertyName.push_back(G4String("WLSABSLENGTH"));
76 G4MaterialPropertyName.push_back(G4String("WLSCOMPONENT2"));
77 G4MaterialPropertyName.push_back(G4String("WLSABSLENGTH2"));
78 G4MaterialPropertyName.push_back(G4String("ABSLENGTH"));
79 G4MaterialPropertyName.push_back(G4String("FASTCOMPONENT"));
80 G4MaterialPropertyName.push_back(G4String("SLOWCOMPONENT"));
81 G4MaterialPropertyName.push_back(G4String("PROTONSCINTILLATIONYIELD"));
82 G4MaterialPropertyName.push_back(G4String("DEUTERONSCINTILLATIONYIELD"));
83 G4MaterialPropertyName.push_back(G4String("TRITONSCINTILLATIONYIELD"));
84 G4MaterialPropertyName.push_back(G4String("ALPHASCINTILLATIONYIELD"));
85 G4MaterialPropertyName.push_back(G4String("IONSCINTILLATIONYIELD"));
86 G4MaterialPropertyName.push_back(G4String("ELECTRONSCINTILLATIONYIELD"));
87 G4MaterialPropertyName.push_back(G4String("SCINTILLATIONCOMPONENT1"));
88 G4MaterialPropertyName.push_back(G4String("SCINTILLATIONCOMPONENT2"));
89 G4MaterialPropertyName.push_back(G4String("SCINTILLATIONCOMPONENT3"));
90
91 G4MaterialConstPropertyName.push_back(G4String("SURFACEROUGHNESS"));
92 G4MaterialConstPropertyName.push_back(G4String("ISOTHERMAL_COMPRESSIBILITY"));
93 G4MaterialConstPropertyName.push_back(G4String("RS_SCALE_FACTOR"));
94 G4MaterialConstPropertyName.push_back(G4String("WLSMEANNUMBERPHOTONS"));
95 G4MaterialConstPropertyName.push_back(G4String("WLSTIMECONSTANT"));
96 G4MaterialConstPropertyName.push_back(G4String("WLSMEANNUMBERPHOTONS2"));
97 G4MaterialConstPropertyName.push_back(G4String("WLSTIMECONSTANT2"));
98 G4MaterialConstPropertyName.push_back(G4String("MIEHG_FORWARD"));
99 G4MaterialConstPropertyName.push_back(G4String("MIEHG_BACKWARD"));
100 G4MaterialConstPropertyName.push_back(G4String("MIEHG_FORWARD_RATIO"));
101 G4MaterialConstPropertyName.push_back(G4String("SCINTILLATIONYIELD"));
102 G4MaterialConstPropertyName.push_back(G4String("RESOLUTIONSCALE"));
103 G4MaterialConstPropertyName.push_back(G4String("FASTTIMECONSTANT"));
104 G4MaterialConstPropertyName.push_back(G4String("FASTSCINTILLATIONRISETIME"));
105 G4MaterialConstPropertyName.push_back(G4String("SLOWTIMECONSTANT"));
106 G4MaterialConstPropertyName.push_back(G4String("SLOWSCINTILLATIONRISETIME"));
107 G4MaterialConstPropertyName.push_back(G4String("YIELDRATIO"));
108 G4MaterialConstPropertyName.push_back(G4String("FERMIPOT"));
109 G4MaterialConstPropertyName.push_back(G4String("DIFFUSION"));
110 G4MaterialConstPropertyName.push_back(G4String("SPINFLIP"));
111 G4MaterialConstPropertyName.push_back(G4String("LOSS"));
112 G4MaterialConstPropertyName.push_back(G4String("LOSSCS"));
113 G4MaterialConstPropertyName.push_back(G4String("ABSCS"));
114 G4MaterialConstPropertyName.push_back(G4String("SCATCS"));
115 G4MaterialConstPropertyName.push_back(G4String("MR_NBTHETA"));
116 G4MaterialConstPropertyName.push_back(G4String("MR_NBE"));
117 G4MaterialConstPropertyName.push_back(G4String("MR_RRMS"));
118 G4MaterialConstPropertyName.push_back(G4String("MR_CORRLEN"));
119 G4MaterialConstPropertyName.push_back(G4String("MR_THETAMIN"));
120 G4MaterialConstPropertyName.push_back(G4String("MR_THETAMAX"));
121 G4MaterialConstPropertyName.push_back(G4String("MR_EMIN"));
122 G4MaterialConstPropertyName.push_back(G4String("MR_EMAX"));
123 G4MaterialConstPropertyName.push_back(G4String("MR_ANGNOTHETA"));
124 G4MaterialConstPropertyName.push_back(G4String("MR_ANGNOPHI"));
125 G4MaterialConstPropertyName.push_back(G4String("MR_ANGCUT"));
126 G4MaterialConstPropertyName.push_back(G4String("SCINTILLATIONTIMECONSTANT1"));
127 G4MaterialConstPropertyName.push_back(G4String("SCINTILLATIONTIMECONSTANT2"));
128 G4MaterialConstPropertyName.push_back(G4String("SCINTILLATIONTIMECONSTANT3"));
129 G4MaterialConstPropertyName.push_back(G4String("SCINTILLATIONRISETIME1"));
130 G4MaterialConstPropertyName.push_back(G4String("SCINTILLATIONRISETIME2"));
131 G4MaterialConstPropertyName.push_back(G4String("SCINTILLATIONRISETIME3"));
132 G4MaterialConstPropertyName.push_back(G4String("SCINTILLATIONYIELD1"));
133 G4MaterialConstPropertyName.push_back(G4String("SCINTILLATIONYIELD2"));
134 G4MaterialConstPropertyName.push_back(G4String("SCINTILLATIONYIELD3"));
135 G4MaterialConstPropertyName.push_back(G4String("PROTONSCINTILLATIONYIELD1"));
136 G4MaterialConstPropertyName.push_back(G4String("PROTONSCINTILLATIONYIELD2"));
137 G4MaterialConstPropertyName.push_back(G4String("PROTONSCINTILLATIONYIELD3"));
138 G4MaterialConstPropertyName.push_back(G4String("DEUTERONSCINTILLATIONYIELD1"));
139 G4MaterialConstPropertyName.push_back(G4String("DEUTERONSCINTILLATIONYIELD2"));
140 G4MaterialConstPropertyName.push_back(G4String("DEUTERONSCINTILLATIONYIELD3"));
141 G4MaterialConstPropertyName.push_back(G4String("TRITONSCINTILLATIONYIELD1"));
142 G4MaterialConstPropertyName.push_back(G4String("TRITONSCINTILLATIONYIELD2"));
143 G4MaterialConstPropertyName.push_back(G4String("TRITONSCINTILLATIONYIELD3"));
144 G4MaterialConstPropertyName.push_back(G4String("ALPHASCINTILLATIONYIELD1"));
145 G4MaterialConstPropertyName.push_back(G4String("ALPHASCINTILLATIONYIELD2"));
146 G4MaterialConstPropertyName.push_back(G4String("ALPHASCINTILLATIONYIELD3"));
147 G4MaterialConstPropertyName.push_back(G4String("IONSCINTILLATIONYIELD1"));
148 G4MaterialConstPropertyName.push_back(G4String("IONSCINTILLATIONYIELD2"));
149 G4MaterialConstPropertyName.push_back(G4String("IONSCINTILLATIONYIELD3"));
150 G4MaterialConstPropertyName.push_back(G4String("ELECTRONSCINTILLATIONYIELD1"));
151 G4MaterialConstPropertyName.push_back(G4String("ELECTRONSCINTILLATIONYIELD2"));
152 G4MaterialConstPropertyName.push_back(G4String("ELECTRONSCINTILLATIONYIELD3"));
153}

◆ ~G4MaterialPropertiesTable()

G4MaterialPropertiesTable::~G4MaterialPropertiesTable ( )
virtual

Definition at line 159 of file G4MaterialPropertiesTable.cc.

160{
161 MPTiterator i;
162 for (i = MPT.begin(); i != MPT.end(); ++i)
163 {
164 delete (*i).second;
165 }
166 MPT.clear();
167 MPTC.clear();
168
169 MPiterator it;
170 for (it = MP.begin(); it != MP.end(); ++it)
171 {
172 delete (*it).second;
173 }
174 MP.clear();
175 MCP.clear();
176
177 G4MaterialPropertyName.clear();
178 G4MaterialConstPropertyName.clear();
179}

Member Function Documentation

◆ AddConstProperty() [1/2]

void G4MaterialPropertiesTable::AddConstProperty ( const char *  key,
G4double  PropertyValue 
)
inline

◆ AddConstProperty() [2/2]

void G4MaterialPropertiesTable::AddConstProperty ( const G4String key,
G4double  PropertyValue 
)
inline

◆ AddEntry() [1/2]

void G4MaterialPropertiesTable::AddEntry ( const char *  key,
G4double  aPhotonEnergy,
G4double  aPropertyValue 
)

Definition at line 401 of file G4MaterialPropertiesTable.cc.

404{
405 AddEntry(G4String(key), aPhotonEnergy, aPropertyValue);
406}
void AddEntry(const G4String &key, G4double aPhotonEnergy, G4double aPropertyValue)

◆ AddEntry() [2/2]

void G4MaterialPropertiesTable::AddEntry ( const G4String key,
G4double  aPhotonEnergy,
G4double  aPropertyValue 
)

Definition at line 376 of file G4MaterialPropertiesTable.cc.

379{
380 // Allows to add an entry pair directly to the Material Property Vector
381 // given a key
382 if (std::find(G4MaterialPropertyName.begin(),
383 G4MaterialPropertyName.end(), key) ==
384 G4MaterialPropertyName.end()) {
385 G4MaterialPropertyName.push_back(key);
386 }
387 G4int index = GetPropertyIndex(key);
388
389 G4MaterialPropertyVector *targetVector=MP[index];
390 if (targetVector != nullptr)
391 {
392 targetVector->InsertValues(aPhotonEnergy, aPropertyValue);
393 }
394 else
395 {
396 G4Exception("G4MaterialPropertiesTable::AddEntry()", "mat203",
397 FatalException, "Material Property Vector not found.");
398 }
399}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
int G4int
Definition: G4Types.hh:85
G4int GetPropertyIndex(const G4String &key, G4bool warning=false) const
void InsertValues(G4double energy, G4double value)

Referenced by AddEntry().

◆ AddProperty() [1/4]

G4MaterialPropertyVector * G4MaterialPropertiesTable::AddProperty ( const char *  key,
G4double PhotonEnergies,
G4double PropertyValues,
G4int  NumEntries 
)

Definition at line 332 of file G4MaterialPropertiesTable.cc.

337{
338 // Provides a way of adding a property to the Material Properties
339 // Table given a pair of numbers and a key
340 G4String k(key);
341 std::vector<G4double> energies;
342 std::vector<G4double> values;
343 for (G4int i=0; i<NumEntries; ++i) {
344 energies.push_back(PhotonEnergies[i]);
345 values.push_back(PropertyValues[i]);
346 }
347 return AddProperty(k, energies, values);
348}
G4MaterialPropertyVector * AddProperty(const G4String &key, const std::vector< G4double > &photonEnergies, const std::vector< G4double > &propertyValues)

◆ AddProperty() [2/4]

void G4MaterialPropertiesTable::AddProperty ( const char *  key,
G4MaterialPropertyVector opv 
)

Definition at line 370 of file G4MaterialPropertiesTable.cc.

372{
373 AddProperty(G4String(key), mpv);
374}

◆ AddProperty() [3/4]

G4MaterialPropertyVector * G4MaterialPropertiesTable::AddProperty ( const G4String key,
const std::vector< G4double > &  photonEnergies,
const std::vector< G4double > &  propertyValues 
)

Definition at line 299 of file G4MaterialPropertiesTable.cc.

303{
304 if (photonEnergies.size() != propertyValues.size()) {
306 ed << "AddProperty error!";
307 G4Exception("G4MaterialPropertiesTable::AddProperty()", "mat210",
308 FatalException, ed);
309 }
310
311 // if the key doesn't exist, add it
312 if (std::find(G4MaterialPropertyName.begin(),
313 G4MaterialPropertyName.end(), key) ==
314 G4MaterialPropertyName.end()) {
315 G4MaterialPropertyName.push_back(key);
316 }
317
318 G4MaterialPropertyVector *mpv = new G4MaterialPropertyVector(photonEnergies,
319 propertyValues);
320 G4int index = GetPropertyIndex(key);
321 MP[index] = mpv;
322
323 // if key is RINDEX, we calculate GROUPVEL -
324 // contribution from Tao Lin (IHEP, the JUNO experiment)
325 if (key=="RINDEX") {
326 CalculateGROUPVEL();
327 }
328
329 return mpv;
330}
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
G4PhysicsOrderedFreeVector G4MaterialPropertyVector

Referenced by AddProperty(), G4GDMLReadMaterials::PropertyRead(), and G4GDMLReadSolids::PropertyRead().

◆ AddProperty() [4/4]

void G4MaterialPropertiesTable::AddProperty ( const G4String key,
G4MaterialPropertyVector opv 
)

Definition at line 350 of file G4MaterialPropertiesTable.cc.

351{
352 // Provides a way of adding a property to the Material Properties
353 // Table given an G4MaterialPropertyVector Reference and a key
354 // if the key doesn't exist, add it
355 if (std::find(G4MaterialPropertyName.begin(),
356 G4MaterialPropertyName.end(), key) ==
357 G4MaterialPropertyName.end()) {
358 G4MaterialPropertyName.push_back(key);
359 }
360 G4int index = GetPropertyIndex(key);
361 MP[ index ] = mpv;
362
363 // if key is RINDEX, we calculate GROUPVEL -
364 // contribution from Tao Lin (IHEP, the JUNO experiment)
365 if (key=="RINDEX") {
366 CalculateGROUPVEL();
367 }
368}

◆ ConstPropertyExists() [1/3]

G4bool G4MaterialPropertiesTable::ConstPropertyExists ( const char *  key) const

Definition at line 264 of file G4MaterialPropertiesTable.cc.

265{
266 return ConstPropertyExists(G4String(key));
267}
G4bool ConstPropertyExists(const G4String &key) const

◆ ConstPropertyExists() [2/3]

G4bool G4MaterialPropertiesTable::ConstPropertyExists ( const G4int  index) const

Definition at line 248 of file G4MaterialPropertiesTable.cc.

249{
250 // Returns true if a const property corresponding to 'index' exists
251
252 MCPiterator j;
253 j = MCP.find(index);
254 if ( j != MCP.end() ) return true;
255 return false;
256}

◆ ConstPropertyExists() [3/3]

◆ DumpTable()

void G4MaterialPropertiesTable::DumpTable ( )

Definition at line 408 of file G4MaterialPropertiesTable.cc.

409{
410 // material properties
411 MPiterator i;
412 for (i = MP.begin(); i != MP.end(); ++i)
413 {
414 G4cout << (*i).first << ": "<< G4MaterialPropertyName[(*i).first] <<G4endl;
415 if ( (*i).second != 0 )
416 {
417 (*i).second->DumpValues();
418 }
419 else
420 {
421 G4Exception("G4MaterialPropertiesTable::DumpTable()", "mat204",
422 JustWarning, "NULL Material Property Vector Pointer.");
423 }
424 }
425 // material constant properties
426 MCPiterator j;
427 for (j = MCP.begin(); j != MCP.end(); ++j)
428 {
429 G4cout << j->first <<": "<< G4MaterialConstPropertyName[j->first] <<G4endl;
430 if ( j->second != 0 )
431 {
432 G4cout << j->second << G4endl;
433 }
434 else
435 {
436 G4Exception("G4MaterialPropertiesTable::DumpTable()", "mat202",
437 JustWarning, "No Material Constant Property.");
438 }
439 }
440}
@ JustWarning
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout

◆ GetConstProperty() [1/3]

G4double G4MaterialPropertiesTable::GetConstProperty ( const char *  key) const

Definition at line 243 of file G4MaterialPropertiesTable.cc.

244{
245 return GetConstProperty(G4String(key));
246}
G4double GetConstProperty(const G4String &key) const

◆ GetConstProperty() [2/3]

G4double G4MaterialPropertiesTable::GetConstProperty ( const G4int  index) const

Definition at line 220 of file G4MaterialPropertiesTable.cc.

221{
222 // Returns the constant material property corresponding to an index
223 // fatal exception if property not found
224
225 MCPiterator j;
226 j = MCP.find(index);
227 if ( j != MCP.end() ) return j->second;
229 ed << "Constant Material Property Index " << index << " not found.";
230 G4Exception("G4MaterialPropertiesTable::GetConstProperty()","mat202",
231 FatalException, ed);
232 return 0.;
233}

◆ GetConstProperty() [3/3]

◆ GetConstPropertyIndex()

G4int G4MaterialPropertiesTable::GetConstPropertyIndex ( const G4String key,
G4bool  warning = false 
) const

Definition at line 185 of file G4MaterialPropertiesTable.cc.

187{
188 // Returns the constant material property index corresponding to a key
189
190 size_t index = std::distance(G4MaterialConstPropertyName.begin(),
191 std::find(G4MaterialConstPropertyName.begin(),
192 G4MaterialConstPropertyName.end(), key));
193 if(index < G4MaterialConstPropertyName.size()) return index;
194 if (warning) {
196 ed << "Constant Material Property Index for key " << key << " not found.";
197 G4Exception("G4MaterialPropertiesTable::GetConstPropertyIndex()","mat206",
198 JustWarning, ed);
199 }
200 return -1;
201}

Referenced by ConstPropertyExists(), and GetConstProperty().

◆ GetConstPropertyMap()

const std::map< G4int, G4double, std::less< G4int > > * G4MaterialPropertiesTable::GetConstPropertyMap ( ) const
inline

Definition at line 160 of file G4MaterialPropertiesTable.hh.

160{ return &MCP; }

Referenced by G4GDMLWriteMaterials::PropertyWrite(), and G4GDMLWriteSolids::PropertyWrite().

◆ GetMaterialConstPropertyNames()

std::vector< G4String > G4MaterialPropertiesTable::GetMaterialConstPropertyNames ( ) const

Definition at line 611 of file G4MaterialPropertiesTable.cc.

612{
613 return G4MaterialConstPropertyName;
614}

Referenced by G4GDMLWriteMaterials::PropertyWrite(), and G4GDMLWriteSolids::PropertyWrite().

◆ GetMaterialPropertyNames()

std::vector< G4String > G4MaterialPropertiesTable::GetMaterialPropertyNames ( ) const

Definition at line 606 of file G4MaterialPropertiesTable.cc.

607{
608 return G4MaterialPropertyName;;
609}

Referenced by G4GDMLWriteMaterials::PropertyWrite(), and G4GDMLWriteSolids::PropertyWrite().

◆ GetPropertiesCMap()

std::map< G4String, G4double, std::less< G4String > > * G4MaterialPropertiesTable::GetPropertiesCMap ( )

Definition at line 592 of file G4MaterialPropertiesTable.cc.

593{
594 // warning message
595 G4String message("GetPropertiesCMap will be obsolete from the next release ");
596 message += "Use G4MaterialPropertiesTable::GetConstPropertyMap() instead";
597 G4Exception("G4MaterialPropertiesTable::GetPropertiesCMap()", "Obsolete",
598 JustWarning, message);
599
600 for (MCPiterator miter = MCP.begin(); miter != MCP.end(); miter++) {
601 MPTC[ G4MaterialConstPropertyName[miter->first] ] = miter->second;
602 }
603 return &MPTC;
604}

◆ GetPropertiesMap()

std::map< G4String, G4MaterialPropertyVector *, std::less< G4String > > * G4MaterialPropertiesTable::GetPropertiesMap ( )

Definition at line 570 of file G4MaterialPropertiesTable.cc.

571{
572 // warning message
573 G4String message("GetPropertiesMap will be obsolete from the next release ");
574 message += "Use G4MaterialPropertiesTable::GetPropertyMap() instead";
575 G4Exception("G4MaterialPropertiesTable::GetPropertiesMap()", "Obsolete",
576 JustWarning, message);
577
578 for (MPiterator miter = MP.begin(); miter != MP.end(); miter++)
579 {
580 if(miter->second) {
581 MPT [ G4MaterialPropertyName[miter->first] ] = miter->second;
582 }
583 else {
584 G4Exception("G4MaterialPropertiesTable::GetPropertiesMap()","NullPointer",
585 JustWarning, "Null Pointer for Material Property");
586 continue;
587 }
588 }
589 return &MPT;
590}

◆ GetProperty() [1/3]

◆ GetProperty() [2/3]

G4MaterialPropertyVector * G4MaterialPropertiesTable::GetProperty ( const G4int  index,
G4bool  warning = false 
)

Definition at line 284 of file G4MaterialPropertiesTable.cc.

285{
286 // Returns a Material Property Vector corresponding to an index
287 MPiterator i;
288 i = MP.find(index);
289 if ( i != MP.end() ) return i->second;
290 if (warning) {
292 ed << "Material Property for index " << index << " not found.";
293 G4Exception("G4MaterialPropertiesTable::GetPropertyIndex()","mat208",
294 JustWarning, ed);
295 }
296 return nullptr;
297}

◆ GetProperty() [3/3]

G4MaterialPropertyVector * G4MaterialPropertiesTable::GetProperty ( const G4String key,
G4bool  warning = false 
)

Definition at line 270 of file G4MaterialPropertiesTable.cc.

271{
272 // Returns a Material Property Vector corresponding to a key
273 const G4int index = GetPropertyIndex(key, warning);
274 return GetProperty(index);
275}

◆ GetPropertyIndex()

G4int G4MaterialPropertiesTable::GetPropertyIndex ( const G4String key,
G4bool  warning = false 
) const

Definition at line 203 of file G4MaterialPropertiesTable.cc.

205{
206 // Returns the material property index corresponding to a key
207 size_t index = std::distance(G4MaterialPropertyName.begin(),
208 std::find(G4MaterialPropertyName.begin(),
209 G4MaterialPropertyName.end(), key));
210 if(index < G4MaterialPropertyName.size()) return index;
211 if (warning) {
213 ed << "Material Property Index for key " << key << " not found.";
214 G4Exception("G4MaterialPropertiesTable::GetPropertyIndex()","mat207",
215 JustWarning, ed);
216 }
217 return -1;
218}

Referenced by AddEntry(), AddProperty(), and GetProperty().

◆ GetPropertyMap()

const std::map< G4int, G4MaterialPropertyVector *, std::less< G4int > > * G4MaterialPropertiesTable::GetPropertyMap ( ) const
inline

Definition at line 158 of file G4MaterialPropertiesTable.hh.

158{ return &MP; }

Referenced by G4GDMLWriteMaterials::PropertyWrite(), and G4GDMLWriteSolids::PropertyWrite().

◆ RemoveConstProperty() [1/2]

void G4MaterialPropertiesTable::RemoveConstProperty ( const char *  key)
inline

◆ RemoveConstProperty() [2/2]

void G4MaterialPropertiesTable::RemoveConstProperty ( const G4String key)
inline

◆ RemoveProperty() [1/2]

void G4MaterialPropertiesTable::RemoveProperty ( const char *  key)
inline

◆ RemoveProperty() [2/2]

void G4MaterialPropertiesTable::RemoveProperty ( const G4String key)
inline

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