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"));
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"));
162 for (i = MPT.begin(); i != MPT.end(); ++i)
170 for (it = MP.begin(); it != MP.end(); ++it)
177 G4MaterialPropertyName.clear();
178 G4MaterialConstPropertyName.clear();
190 size_t index = std::distance(G4MaterialConstPropertyName.begin(),
191 std::find(G4MaterialConstPropertyName.begin(),
192 G4MaterialConstPropertyName.end(), key));
193 if(index < G4MaterialConstPropertyName.size())
return index;
196 ed <<
"Constant Material Property Index for key " << key <<
" not found.";
197 G4Exception(
"G4MaterialPropertiesTable::GetConstPropertyIndex()",
"mat206",
207 size_t index = std::distance(G4MaterialPropertyName.begin(),
208 std::find(G4MaterialPropertyName.begin(),
209 G4MaterialPropertyName.end(), key));
210 if(index < G4MaterialPropertyName.size())
return index;
213 ed <<
"Material Property Index for key " << key <<
" not found.";
214 G4Exception(
"G4MaterialPropertiesTable::GetPropertyIndex()",
"mat207",
227 if ( j != MCP.end() )
return j->second;
229 ed <<
"Constant Material Property Index " << index <<
" not found.";
230 G4Exception(
"G4MaterialPropertiesTable::GetConstProperty()",
"mat202",
254 if ( j != MCP.end() )
return true;
289 if ( i != MP.end() )
return i->second;
292 ed <<
"Material Property for index " << index <<
" not found.";
293 G4Exception(
"G4MaterialPropertiesTable::GetPropertyIndex()",
"mat208",
301 const std::vector<G4double>& photonEnergies,
302 const std::vector<G4double>& propertyValues)
304 if (photonEnergies.size() != propertyValues.size()) {
306 ed <<
"AddProperty error!";
307 G4Exception(
"G4MaterialPropertiesTable::AddProperty()",
"mat210",
312 if (std::find(G4MaterialPropertyName.begin(),
313 G4MaterialPropertyName.end(), key) ==
314 G4MaterialPropertyName.end()) {
315 G4MaterialPropertyName.push_back(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]);
355 if (std::find(G4MaterialPropertyName.begin(),
356 G4MaterialPropertyName.end(), key) ==
357 G4MaterialPropertyName.end()) {
358 G4MaterialPropertyName.push_back(key);
382 if (std::find(G4MaterialPropertyName.begin(),
383 G4MaterialPropertyName.end(), key) ==
384 G4MaterialPropertyName.end()) {
385 G4MaterialPropertyName.push_back(key);
390 if (targetVector !=
nullptr)
392 targetVector->
InsertValues(aPhotonEnergy, aPropertyValue);
396 G4Exception(
"G4MaterialPropertiesTable::AddEntry()",
"mat203",
412 for (i = MP.begin(); i != MP.end(); ++i)
414 G4cout << (*i).first <<
": "<< G4MaterialPropertyName[(*i).first] <<
G4endl;
415 if ( (*i).second != 0 )
417 (*i).second->DumpValues();
421 G4Exception(
"G4MaterialPropertiesTable::DumpTable()",
"mat204",
422 JustWarning,
"NULL Material Property Vector Pointer.");
427 for (j = MCP.begin(); j != MCP.end(); ++j)
429 G4cout << j->first <<
": "<< G4MaterialConstPropertyName[j->first] <<
G4endl;
430 if ( j->second != 0 )
436 G4Exception(
"G4MaterialPropertiesTable::DumpTable()",
"mat202",
442#ifdef G4MULTITHREADED
451#ifdef G4MULTITHREADED
461 if(itr != MP.end())
return itr->second;
466 if (rindex==0) {
return 0; }
484 G4Exception(
"G4MaterialPropertiesTable::CalculateGROUPVEL()",
"mat205",
498 G4Exception(
"G4MaterialPropertiesTable::CalculateGROUPVEL()",
"mat205",
506 vg = c_light/(n0+(n1-n0)/
G4Log(E1/E0));
510 if((vg<0) || (vg>c_light/n0)) { vg = c_light/n0; }
519 vg = c_light/( 0.5*(n0+n1)+(n1-n0)/
G4Log(E1/E0));
523 if((vg<0) || (vg>c_light/(0.5*(n0+n1)))) { vg = c_light/(0.5*(n0+n1)); }
535 G4Exception(
"G4MaterialPropertiesTable::CalculateGROUPVEL()",
"mat205",
542 vg = c_light/(n1+(n1-n0)/
G4Log(E1/E0));
546 if((vg<0) || (vg>c_light/n1)) { vg = c_light/n1; }
561 G4String message(
"SetGROUPVEL will be obsolete from the next release ");
562 message +=
"Use G4MaterialPropertiesTable::CalculateGROUPVEL() instead";
564 G4Exception(
"G4MaterialPropertiesTable::SetGROUPVEL()",
"Obsolete",
566 return CalculateGROUPVEL();
569std::map< G4String, G4MaterialPropertyVector*, std::less<G4String> >*
573 G4String message(
"GetPropertiesMap will be obsolete from the next release ");
574 message +=
"Use G4MaterialPropertiesTable::GetPropertyMap() instead";
575 G4Exception(
"G4MaterialPropertiesTable::GetPropertiesMap()",
"Obsolete",
578 for (MPiterator miter = MP.begin(); miter != MP.end(); miter++)
581 MPT [ G4MaterialPropertyName[miter->first] ] = miter->second;
584 G4Exception(
"G4MaterialPropertiesTable::GetPropertiesMap()",
"NullPointer",
585 JustWarning,
"Null Pointer for Material Property");
595 G4String message(
"GetPropertiesCMap will be obsolete from the next release ");
596 message +=
"Use G4MaterialPropertiesTable::GetConstPropertyMap() instead";
597 G4Exception(
"G4MaterialPropertiesTable::GetPropertiesCMap()",
"Obsolete",
600 for (MCPiterator miter = MCP.begin(); miter != MCP.end(); miter++) {
601 MPTC[ G4MaterialConstPropertyName[miter->first] ] = miter->second;
608 return G4MaterialPropertyName;;
613 return G4MaterialConstPropertyName;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4double G4Log(G4double x)
G4PhysicsOrderedFreeVector G4MaterialPropertyVector
#define G4MUTEX_INITIALIZER
G4GLOB_DLL std::ostream G4cout
std::vector< G4String > GetMaterialPropertyNames() const
G4MaterialPropertyVector * GetProperty(const char *key, G4bool warning=false)
std::vector< G4String > GetMaterialConstPropertyNames() const
std::map< G4String, G4double, std::less< G4String > > * GetPropertiesCMap()
G4int GetPropertyIndex(const G4String &key, G4bool warning=false) const
G4int GetConstPropertyIndex(const G4String &key, G4bool warning=false) const
G4MaterialPropertyVector * AddProperty(const G4String &key, const std::vector< G4double > &photonEnergies, const std::vector< G4double > &propertyValues)
G4bool ConstPropertyExists(const G4String &key) const
std::map< G4String, G4MaterialPropertyVector *, std::less< G4String > > * GetPropertiesMap()
virtual ~G4MaterialPropertiesTable()
G4double GetConstProperty(const G4String &key) const
void AddEntry(const G4String &key, G4double aPhotonEnergy, G4double aPropertyValue)
G4MaterialPropertiesTable()
void InsertValues(G4double energy, G4double value)
G4double Energy(std::size_t index) const
std::size_t GetVectorLength() const