176 size_t index = std::distance(
183 ed <<
"Constant Material Property Index for key " << key <<
" not found.";
184 G4Exception(
"G4MaterialPropertiesTable::GetConstPropertyIndex()",
"mat200",
198 ed <<
"Material Property Index for key " << key <<
" not found.";
199 G4Exception(
"G4MaterialPropertiesTable::GetPropertyIndex()",
"mat201",
209 if(index < (
G4int)
fMCP.size() &&
fMCP[index].second ==
true)
210 return fMCP[index].first;
212 ed <<
"Constant Material Property Index " << index <<
" not found.";
213 G4Exception(
"G4MaterialPropertiesTable::GetConstProperty()",
"mat202",
235 if(index >= 0 && index < (
G4int)
fMCP.size() &&
fMCP[index].second ==
true)
245 size_t index = std::distance(
255 size_t index = std::distance(
277 const char* key)
const
289 const G4int index)
const
293 if(index >= 0 && index < (
G4int)
fMP.size())
299 const G4String& key,
const std::vector<G4double>& photonEnergies,
300 const std::vector<G4double>& propertyValues,
G4bool createNewKey,
303 if(photonEnergies.size() != propertyValues.size())
306 ed <<
"AddProperty error!";
307 G4Exception(
"G4MaterialPropertiesTable::AddProperty()",
"mat204",
318 fMP.push_back(
nullptr);
323 ed <<
"Attempting to create a new material property key " << key
324 <<
" without setting\n"
325 <<
"createNewKey parameter of AddProperty to true.";
326 G4Exception(
"G4MaterialPropertiesTable::AddProperty()",
"mat205",
360 std::vector<G4double> energies(photonEnergies, photonEnergies + numEntries);
361 std::vector<G4double> values(propertyValues, propertyValues + numEntries);
362 return AddProperty(k, energies, values, createNewKey, spline);
378 fMP.push_back(
nullptr);
383 ed <<
"Attempting to create a new material property key " << key
384 <<
" without setting\n"
385 <<
"createNewKey parameter of AddProperty to true.";
386 G4Exception(
"G4MaterialPropertiesTable::AddProperty()",
"mat206",
429 fMCP.push_back(std::pair<G4double, G4bool>{ 0.,
true });
434 ed <<
"Attempting to create a new material constant property key " << key
435 <<
" without setting"
436 <<
" createNewKey parameter of AddProperty to true.";
437 G4Exception(
"G4MaterialPropertiesTable::AddProperty()",
"mat207",
443 fMCP[index] = std::pair<G4double, G4bool>{ propertyValue,
true };
459 fMCP[index] = std::pair<G4double, G4bool>{ 0.,
false };
471 fMP[index] =
nullptr;
488 G4Exception(
"G4MaterialPropertiesTable::AddEntry()",
"mat214",
494 if(targetVector !=
nullptr)
496 targetVector->
InsertValues(aPhotonEnergy, aPropertyValue);
500 G4Exception(
"G4MaterialPropertiesTable::AddEntry()",
"mat208",
520 for(
const auto& prop :
fMP)
531 for(
const auto& cprop :
fMCP)
533 if(cprop.second ==
true)
544#ifdef G4MULTITHREADED
556 if(rindex ==
nullptr)
578 G4Exception(
"G4MaterialPropertiesTable::CalculateGROUPVEL()",
"mat211",
592 G4Exception(
"G4MaterialPropertiesTable::CalculateGROUPVEL()",
"mat212",
602 if((vg < 0) || (vg >
c_light / n0))
612 vg =
c_light / (0.5 * (n0 + n1) + (n1 - n0) /
G4Log(E1 / E0));
615 if((vg < 0) || (vg >
c_light / (0.5 * (n0 + n1))))
617 vg =
c_light / (0.5 * (n0 + n1));
629 G4Exception(
"G4MaterialPropertiesTable::CalculateGROUPVEL()",
"mat213",
638 if((vg < 0) || (vg >
c_light / n1))
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4double G4Log(G4double x)
@ kNumberOfConstPropertyIndex
G4PhysicsFreeVector G4MaterialPropertyVector
#define G4MUTEX_INITIALIZER
G4GLOB_DLL std::ostream G4cout
G4MaterialPropertyVector * CalculateGROUPVEL()
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()
std::vector< std::pair< G4double, G4bool > > fMCP
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)
std::vector< G4MaterialPropertyVector * > fMP
std::vector< G4String > fMatConstPropNames
G4MaterialPropertyVector * GetProperty(const char *key) const
G4MaterialPropertiesTable()
std::vector< G4String > fMatPropNames
void RemoveConstProperty(const G4String &key)
void InsertValues(const G4double energy, const G4double value)
void SetVerboseLevel(G4int value)
G4double Energy(const std::size_t index) const
std::size_t GetVectorLength() const
void FillSecondDerivatives(const G4SplineType=G4SplineType::Base, const G4double dir1=0.0, const G4double dir2=0.0)
G4MaterialPropertyVector * GetProperty(const G4String &key, const G4String &mat)