14 #include "CoreUtils/ServiceUtil.h" 16 #include "Geant4/G4Material.hh" 17 #include "Geant4/G4MaterialPropertiesTable.hh" 22 #include "CoreUtils/ServiceUtil.h" 30 std::map<double, double>
const& PropertyVector,
33 std::map<double,double> PropVectorWithUnit;
34 for(
auto const& itr : PropertyVector){
35 PropVectorWithUnit[itr.first *
CLHEP::eV] = itr.second * Unit;
55 <<
"Added const property " 70 <<
"Set Birks constant " 77 std::map<std::string,G4MaterialPropertiesTable*> MaterialTables;
78 std::map<std::string,bool> MaterialsSet;
81 <<
"UPDATING GEOMETRY";
86 MaterialsSet[Material] =
true;
87 MaterialTables[Material] =
new G4MaterialPropertiesTable;
94 if(!MaterialsSet[Material]){
95 MaterialsSet[Material] =
true;
96 MaterialTables[Material] =
new G4MaterialPropertiesTable;
104 for(
auto const& itr : fPropertyList){
106 for(
auto const& jitr : itr.second){
108 std::vector<G4double> g4MomentumVector;
109 std::vector<G4double> g4PropertyVector;
111 for(
auto const& kitr : jitr.second){
112 g4MomentumVector.push_back(kitr.first);
113 g4PropertyVector.push_back(kitr.second);
115 int NoOfElements = g4MomentumVector.size();
116 MaterialTables[Material]->AddProperty(Property.c_str(),
117 &g4MomentumVector[0],
118 &g4PropertyVector[0],
123 <<
" to material table " 129 for(
auto const& itr : fConstPropertyList){
131 for(
auto const& jitr : itr.second){
133 G4double PropertyValue = jitr.second;
134 MaterialTables[Material]->AddConstProperty(Property.c_str(), PropertyValue);
137 <<
"Added const property " 139 <<
" to material table " 146 G4LogicalVolume*
volume = (*i);
147 G4Material* TheMaterial = volume->GetMaterial();
149 for(
auto const& jitr : MaterialTables){
150 if(Material == jitr.first){
151 TheMaterial->SetMaterialPropertiesTable(jitr.second);
154 TheMaterial->GetIonisation()->SetBirksConstant(
fBirksConstants[Material]);
155 volume->SetMaterial(TheMaterial);
163 std::map<
std::string,std::map<double, double> >
const& Reflectances,
164 std::map<
std::string,std::map<double, double> >
const& DiffuseFractions)
166 std::map<double, double> ReflectanceToStore;
167 std::map<double, double> DiffuseToStore;
169 for(
auto const& itMat : Reflectances){
171 ReflectanceToStore.clear();
172 for(
auto const& itEn : itMat.second){
173 ReflectanceToStore[itEn.first] = itEn.second;
178 for(
auto const& itMat : DiffuseFractions){
180 DiffuseToStore.clear();
181 for(
auto const& itEn : itMat.second){
182 DiffuseToStore[itEn.first] = itEn.second;
virtual double ScintBirksConstant() const =0
static constexpr double g
std::map< std::string, double > fBirksConstants
void SetBirksConstant(std::string const &, double, double)
static constexpr double cm3
static const std::string volume[nvol]
void UpdateGeometry(G4LogicalVolumeStore *)
static constexpr double MeV
static constexpr double eV
void SetMaterialConstProperty(std::string const &Material, std::string const &Property, double Value, double Unit)
std::map< std::string, std::map< std::string, double > > fConstPropertyList
#define MF_LOG_INFO(category)
void SetMaterialProperty(std::string const &Material, std::string const &Property, std::map< double, double > const &Values, double Unit)
General GArSoft Utilities.
std::map< std::string, std::map< std::string, std::map< double, double > > > fPropertyList
void GetPropertiesFromServices()
void SetReflectances(std::string const &, std::map< std::string, std::map< double, double > > const &, std::map< std::string, std::map< double, double > > const &)
static constexpr double mm