67 fMatPropNames[
kRINDEX] =
"RINDEX";
77 fMatPropNames[
kMIEHG] =
"MIEHG";
110 fMatConstPropNames[
kFERMIPOT] =
"FERMIPOT";
112 fMatConstPropNames[
kSPINFLIP] =
"SPINFLIP";
113 fMatConstPropNames[
kLOSS] =
"LOSS";
114 fMatConstPropNames[
kLOSSCS] =
"LOSSCS";
115 fMatConstPropNames[
kABSCS] =
"ABSCS";
116 fMatConstPropNames[
kSCATCS] =
"SCATCS";
118 fMatConstPropNames[
kMR_NBE] =
"MR_NBE";
119 fMatConstPropNames[
kMR_RRMS] =
"MR_RRMS";
123 fMatConstPropNames[
kMR_EMIN] =
"MR_EMIN";
124 fMatConstPropNames[
kMR_EMAX] =
"MR_EMAX";
180 for (
auto prop : fMP) {
189 std::size_t index = std::distance(fMatConstPropNames.cbegin(),
190 std::find(fMatConstPropNames.cbegin(), fMatConstPropNames.cend(), key));
191 if (index < fMatConstPropNames.size()) {
196 ed <<
"Constant Material Property Index for key " << key <<
" not found.";
204 std::size_t index = std::distance(
205 fMatPropNames.cbegin(), std::find(fMatPropNames.cbegin(), fMatPropNames.cend(), key));
206 if (index < fMatPropNames.size()) {
210 ed <<
"Material Property Index for key " << key <<
" not found.";
220 if (index < (
G4int)fMCP.size() && fMCP[index].second) {
221 return fMCP[index].first;
224 ed <<
"Constant Material Property " << fMatConstPropNames[index] <<
" not found.";
246 return index >= 0 && index < (
G4int)fMCP.size() && fMCP[index].second;
252 std::size_t index = std::distance(fMatConstPropNames.cbegin(),
253 std::find(fMatConstPropNames.cbegin(), fMatConstPropNames.cend(), key));
254 if (index < fMatConstPropNames.size()) {
262 std::size_t index = std::distance(fMatConstPropNames.cbegin(),
263 std::find(fMatConstPropNames.cbegin(), fMatConstPropNames.cend(), key));
264 if (index < fMatConstPropNames.size()) {
273 if (std::find(fMatPropNames.cbegin(), fMatPropNames.cend(), key) != fMatPropNames.cend()) {
282 if (std::find(fMatPropNames.cbegin(), fMatPropNames.cend(), key) != fMatPropNames.cend()) {
293 if (index >= 0 && index < (
G4int)fMP.size()) {
300 const std::vector<G4double>& photonEnergies,
const std::vector<G4double>& propertyValues,
303 if (photonEnergies.size() != propertyValues.size()) {
305 ed <<
"AddProperty error. Number of property values must be equal to the number of\n"
306 <<
"energy values. Property name: " << key;
310 if (photonEnergies.size() == 1) {
312 ed <<
"AddProperty warning. A material property vector must have more than one value.\n"
313 <<
"Unless you will later add an entry, this is an error.\n"
314 <<
"Property name: " << key;
319 for (std::size_t i = 0; i < photonEnergies.size() - 1; ++i) {
320 if (photonEnergies.at(i + 1) < photonEnergies.at(i)) {
322 ed <<
"Energies in material property vector must be in increasing "
323 <<
"order. Key: " << key <<
" Energy: " << photonEnergies.at(i + 1);
329 if (std::find(fMatPropNames.cbegin(), fMatPropNames.cend(), key) == fMatPropNames.cend()) {
331 fMatPropNames.push_back(key);
332 fMP.push_back(
nullptr);
336 ed <<
"Attempting to create a new material property vector " << key <<
" without setting\n"
337 <<
"createNewKey parameter of AddProperty to true.";
343 mpv->SetVerboseLevel(1);
345 mpv->FillSecondDerivatives();
352 if (key ==
"RINDEX") {
367 std::vector<G4double> energies(photonEnergies, photonEnergies + numEntries);
368 std::vector<G4double> values(propertyValues, propertyValues + numEntries);
369 return AddProperty(k, energies, values, createNewKey, spline);
383 ed <<
"Energies in material property vector must be in increasing "
384 <<
"order. Key: " << key <<
" Energy: " << mpv->
Energy(i + 1);
392 ed <<
"AddProperty warning. A material property vector must have more than one value.\n"
393 <<
"Unless you will later add an entry, this is an error.\n"
394 <<
"Property name: " << key;
399 if (std::find(fMatPropNames.cbegin(), fMatPropNames.cend(), key) == fMatPropNames.cend()) {
401 fMatPropNames.push_back(key);
402 fMP.push_back(
nullptr);
406 ed <<
"Attempting to create a new material property key " << key <<
" without setting\n"
407 <<
"createNewKey parameter of AddProperty to true.";
416 if (key ==
"RINDEX") {
439 if (std::find(fMatConstPropNames.cbegin(), fMatConstPropNames.cend(), key) ==
440 fMatConstPropNames.cend())
443 fMatConstPropNames.push_back(key);
444 fMCP.emplace_back(0.,
true);
448 ed <<
"Attempting to create a new material constant property key " << key
449 <<
" without setting\n"
450 <<
"createNewKey parameter of AddProperty to true.";
456 fMCP[index] = std::pair<G4double, G4bool>{propertyValue,
true};
470 if (index < (
G4int)fMCP.size()) {
471 fMCP[index] = std::pair<G4double, G4bool>{0.,
false};
484 fMP[index] =
nullptr;
494 if (std::find(fMatPropNames.cbegin(), fMatPropNames.cend(), key) == fMatPropNames.cend()) {
496 ed <<
"Material Property Vector " << key <<
" not found.";
502 if (targetVector !=
nullptr) {
505 if (aPhotonEnergy == targetVector->
Energy(i)) {
507 ed <<
"Energy values in material property vector must be unique. "
513 targetVector->
InsertValues(aPhotonEnergy, aPropertyValue);
517 ed <<
"Material Property Vector " << key <<
" not found.";
520 if (key ==
"RINDEX") {
535 for (
const auto& prop : fMP) {
536 if (prop !=
nullptr) {
544 for (
const auto& cprop : fMCP) {
546 G4cout << j <<
": " << fMatConstPropNames[j] <<
" " << cprop.first <<
G4endl;
554#ifdef G4MULTITHREADED
565 if (rindex ==
nullptr) {
576 groupvel->SetVerboseLevel(1);
585 "Optical Photon Energy <= 0");
597 "Optical Photon Energy <= 0");
603 vg = c_light / (n0 + (n1 - n0) /
G4Log(E1 / E0));
606 if ((vg < 0) || (vg > c_light / n0)) {
610 groupvel->InsertValues(E0, vg);
614 vg = c_light / (0.5 * (n0 + n1) + (n1 - n0) /
G4Log(E1 / E0));
617 if ((vg < 0) || (vg > c_light / (0.5 * (n0 + n1)))) {
618 vg = c_light / (0.5 * (n0 + n1));
620 groupvel->InsertValues(0.5 * (E0 + E1), vg);
630 "Optical Photon Energy <= 0");
635 vg = c_light / (n1 + (n1 - n0) /
G4Log(E1 / E0));
638 if ((vg < 0) || (vg > c_light / n1)) {
641 groupvel->InsertValues(E1, vg);
645 groupvel->InsertValues(E0, c_light / n0);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4double G4Log(G4double x)
@ kSCINTILLATIONCOMPONENT1
@ kSCINTILLATIONCOMPONENT2
@ kSCINTILLATIONCOMPONENT3
@ kELECTRONSCINTILLATIONYIELD
@ kALPHASCINTILLATIONYIELD
@ kPROTONSCINTILLATIONYIELD
@ kDEUTERONSCINTILLATIONYIELD
@ kTRITONSCINTILLATIONYIELD
@ kSCINTILLATIONTIMECONSTANT1
@ kSCINTILLATIONRISETIME2
@ kTRITONSCINTILLATIONYIELD1
@ kDEUTERONSCINTILLATIONYIELD3
@ kIONSCINTILLATIONYIELD1
@ kSCINTILLATIONRISETIME1
@ kPROTONSCINTILLATIONTIMECONSTANT2
@ kALPHASCINTILLATIONTIMECONSTANT1
@ kELECTRONSCINTILLATIONTIMECONSTANT2
@ kDEUTERONSCINTILLATIONYIELD2
@ kELECTRONSCINTILLATIONTIMECONSTANT3
@ kDEUTERONSCINTILLATIONTIMECONSTANT1
@ kTRITONSCINTILLATIONTIMECONSTANT2
@ kTRITONSCINTILLATIONYIELD2
@ kNumberOfConstPropertyIndex
@ kALPHASCINTILLATIONYIELD2
@ kELECTRONSCINTILLATIONYIELD3
@ kTRITONSCINTILLATIONTIMECONSTANT1
@ kALPHASCINTILLATIONYIELD1
@ kALPHASCINTILLATIONTIMECONSTANT2
@ kPROTONSCINTILLATIONTIMECONSTANT3
@ kDEUTERONSCINTILLATIONTIMECONSTANT3
@ kELECTRONSCINTILLATIONYIELD2
@ kIONSCINTILLATIONYIELD2
@ kIONSCINTILLATIONYIELD3
@ kSCINTILLATIONRISETIME3
@ kPROTONSCINTILLATIONYIELD2
@ kDEUTERONSCINTILLATIONYIELD1
@ kTRITONSCINTILLATIONTIMECONSTANT3
@ kISOTHERMAL_COMPRESSIBILITY
@ kTRITONSCINTILLATIONYIELD3
@ kSCINTILLATIONTIMECONSTANT3
@ kIONSCINTILLATIONTIMECONSTANT1
@ kIONSCINTILLATIONTIMECONSTANT3
@ kPROTONSCINTILLATIONYIELD3
@ kIONSCINTILLATIONTIMECONSTANT2
@ kALPHASCINTILLATIONTIMECONSTANT3
@ kELECTRONSCINTILLATIONYIELD1
@ kALPHASCINTILLATIONYIELD3
@ kSCINTILLATIONTIMECONSTANT2
@ kPROTONSCINTILLATIONYIELD1
@ kCOATEDFRUSTRATEDTRANSMISSION
@ kDEUTERONSCINTILLATIONTIMECONSTANT2
@ kPROTONSCINTILLATIONTIMECONSTANT1
@ kELECTRONSCINTILLATIONTIMECONSTANT1
G4PhysicsFreeVector G4MaterialPropertyVector
#define G4MUTEX_INITIALIZER
G4GLOB_DLL std::ostream G4cout
G4int GetConstPropertyIndex(const G4String &key) const
void AddConstProperty(const G4String &key, G4double propertyValue, G4bool createNewKey=false)
G4bool ConstPropertyExists(const G4String &key) const
void RemoveProperty(const G4String &key)
G4int GetPropertyIndex(const G4String &key) const
virtual ~G4MaterialPropertiesTable()
G4double GetConstProperty(const G4String &key) const
void AddEntry(const G4String &key, G4double aPhotonEnergy, G4double aPropertyValue)
G4MaterialPropertyVector * AddProperty(const G4String &key, const std::vector< G4double > &photonEnergies, const std::vector< G4double > &propertyValues, G4bool createNewKey=false, G4bool spline=false)
G4MaterialPropertyVector * GetProperty(const char *key) const
G4MaterialPropertiesTable()
void RemoveConstProperty(const G4String &key)
void InsertValues(const G4double energy, const G4double value)
G4double Energy(const std::size_t index) const
std::size_t GetVectorLength() const
G4MaterialPropertyVector * GetProperty(const G4String &key, const G4String &mat)