17 #include "Geant4/G4LogicalSkinSurface.hh" 18 #include "Geant4/G4LogicalVolume.hh" 19 #include "Geant4/G4LogicalVolumeStore.hh" 20 #include "Geant4/G4Material.hh" 21 #include "Geant4/G4MaterialPropertiesTable.hh" 22 #include "Geant4/G4OpticalSurface.hh" 32 std::map<double, double> PropertyVector,
35 std::map<double, double> PropVectorWithUnit;
37 it != PropertyVector.end();
39 PropVectorWithUnit[it->first *
CLHEP::eV] = it->second * Unit;
56 <<
"Added const property " << Material <<
" " << Property <<
" = " << PropertyValue;
65 mf::LogInfo(
"MaterialPropertyLoader") <<
"Set Birks constant " << Material;
72 std::map<std::string, G4MaterialPropertiesTable*> MaterialTables;
73 std::map<std::string, bool> MaterialsSet;
76 mf::LogInfo(
"MaterialPropertyLoader") <<
"UPDATING GEOMETRY";
84 MaterialsSet[Material] =
true;
85 MaterialTables[Material] =
new G4MaterialPropertiesTable;
95 if (!MaterialsSet[Material]) {
96 MaterialsSet[Material] =
true;
97 MaterialTables[Material] =
new G4MaterialPropertiesTable;
111 j != i->second.end();
114 std::vector<G4double> g4MomentumVector;
115 std::vector<G4double> g4PropertyVector;
119 g4MomentumVector.push_back(
k->first);
120 g4PropertyVector.push_back(
k->second);
122 int NoOfElements = g4MomentumVector.size();
123 MaterialTables[Material]->AddProperty(
124 Property.c_str(), &g4MomentumVector[0], &g4PropertyVector[0], NoOfElements);
127 <<
"Added property " << Property <<
" to material table " << Material;
138 j != i->second.end();
141 G4double PropertyValue = j->second;
142 MaterialTables[Material]->AddConstProperty(Property.c_str(), PropertyValue);
145 <<
"Added const property " << Property <<
" to material table " << Material;
151 G4LogicalVolume*
volume = (*i);
152 G4Material* TheMaterial = volume->GetMaterial();
161 G4MaterialPropertyVector* PropertyPointer = 0;
162 if (MaterialTables[Material])
163 PropertyPointer = MaterialTables[Material]->GetProperty(
"REFLECTIVITY");
165 if (Material ==
"Copper") {
166 std::cout <<
"copper foil surface set " << volume->GetName() <<
std::endl;
167 if (PropertyPointer) {
168 std::cout <<
"defining Copper optical boundary " <<
std::endl;
169 G4OpticalSurface* refl_opsurfc =
170 new G4OpticalSurface(
"Surface copper", glisur, ground, dielectric_metal);
171 refl_opsurfc->SetMaterialPropertiesTable(MaterialTables[Material]);
172 refl_opsurfc->SetPolish(0.2);
173 new G4LogicalSkinSurface(
"refl_surfacec", volume, refl_opsurfc);
176 std::cout <<
"Warning: Copper surface in the geometry without REFLECTIVITY assigned" 180 if (Material ==
"G10") {
181 std::cout <<
"G10 surface set " << volume->GetName() <<
std::endl;
182 if (PropertyPointer) {
183 std::cout <<
"defining G10 optical boundary " <<
std::endl;
184 G4OpticalSurface* refl_opsurfg =
185 new G4OpticalSurface(
"g10 Surface", glisur, ground, dielectric_metal);
186 refl_opsurfg->SetMaterialPropertiesTable(MaterialTables[Material]);
187 refl_opsurfg->SetPolish(0.1);
188 new G4LogicalSkinSurface(
"refl_surfaceg", volume, refl_opsurfg);
191 std::cout <<
"Warning: G10 surface in the geometry without REFLECTIVITY assigned" 195 if (Material ==
"vm2000") {
196 std::cout <<
"vm2000 surface set " << volume->GetName() <<
std::endl;
197 if (PropertyPointer) {
198 std::cout <<
"defining vm2000 optical boundary " <<
std::endl;
199 G4OpticalSurface* refl_opsurf =
new G4OpticalSurface(
200 "Reflector Surface", unified, groundfrontpainted, dielectric_dielectric);
201 refl_opsurf->SetMaterialPropertiesTable(MaterialTables[Material]);
202 G4double sigma_alpha = 0.8;
203 refl_opsurf->SetSigmaAlpha(sigma_alpha);
204 new G4LogicalSkinSurface(
"refl_surface", volume, refl_opsurf);
207 std::cout <<
"Warning: vm2000 surface in the geometry without REFLECTIVITY assigned" 210 if (Material ==
"ALUMINUM_Al") {
211 std::cout <<
"ALUMINUM_Al surface set " << volume->GetName() <<
std::endl;
212 if (PropertyPointer) {
213 std::cout <<
"defining ALUMINUM_Al optical boundary " <<
std::endl;
214 G4OpticalSurface* refl_opsurfs =
215 new G4OpticalSurface(
"Surface Aluminum", glisur, ground, dielectric_metal);
216 refl_opsurfs->SetMaterialPropertiesTable(MaterialTables[Material]);
217 refl_opsurfs->SetPolish(0.5);
218 new G4LogicalSkinSurface(
"refl_surfaces", volume, refl_opsurfs);
221 std::cout <<
"Warning: ALUMINUM_Al surface in the geometry without REFLECTIVITY assigned" 224 if (Material ==
"STEEL_STAINLESS_Fe7Cr2Ni") {
225 std::cout <<
"STEEL_STAINLESS_Fe7Cr2Ni surface set " << volume->GetName() <<
std::endl;
226 if (PropertyPointer) {
227 std::cout <<
"defining STEEL_STAINLESS_Fe7Cr2Ni optical boundary " <<
std::endl;
228 G4OpticalSurface* refl_opsurfs =
229 new G4OpticalSurface(
"Surface Steel", glisur, ground, dielectric_metal);
230 refl_opsurfs->SetMaterialPropertiesTable(MaterialTables[Material]);
231 refl_opsurfs->SetPolish(0.5);
232 new G4LogicalSkinSurface(
"refl_surfaces", volume, refl_opsurfs);
235 std::cout <<
"Warning: STEEL_STAINLESS_Fe7Cr2Ni surface in the geometry without " 236 "REFLECTIVITY assigned" 245 MaterialTables.begin();
246 j != MaterialTables.end();
248 if (Material == j->first) {
249 TheMaterial->SetMaterialPropertiesTable(j->second);
252 TheMaterial->GetIonisation()->SetBirksConstant(
fBirksConstants[Material]);
253 volume->SetMaterial(TheMaterial);
262 std::map<
std::string, std::map<double, double>> Reflectances,
263 std::map<
std::string, std::map<double, double>> DiffuseFractions)
265 std::map<double, double> ReflectanceToStore;
266 std::map<double, double> DiffuseToStore;
269 Reflectances.begin();
270 itMat != Reflectances.end();
273 ReflectanceToStore.clear();
275 itEn != itMat->second.end();
277 ReflectanceToStore[itEn->first] = itEn->second;
283 DiffuseFractions.begin();
284 itMat != DiffuseFractions.end();
287 DiffuseToStore.clear();
289 itEn != itMat->second.end();
291 DiffuseToStore[itEn->first] = itEn->second;
299 std::map<
std::string, std::map<double, double>> Reflectances)
301 std::map<double, double> ReflectanceToStore;
304 Reflectances.begin();
305 itMat != Reflectances.end();
307 ReflectanceToStore.clear();
309 itEn != itMat->second.end();
311 ReflectanceToStore[itEn->first] = itEn->second;
333 "SCINTILLATIONYIELD",
static constexpr double cm
virtual double ElectronScintYieldRatio() const =0
virtual double ScintYieldRatio() const =0
virtual double AlphaScintYield(bool prescale=false) const =0
virtual std::map< double, double > AbsLengthSpectrum() const =0
void SetMaterialProperty(std::string Material, std::string Property, std::map< double, double > Values, double Unit)
Stores the specified emergy-dependent material property.
virtual std::map< double, double > RayleighSpectrum() const =0
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
virtual std::map< double, double > RIndexSpectrum() const =0
virtual double AlphaScintYieldRatio() const =0
void GetPropertiesFromServices(detinfo::DetectorPropertiesData const &detProp)
Imports properties from LArSoft services.
virtual double ScintSlowTimeConst() const =0
std::map< std::string, std::map< std::string, std::map< double, double > > > fPropertyList
static const std::string volume[nvol]
virtual double ScintFastTimeConst() const =0
static constexpr double MeV
virtual double ProtonScintYieldRatio() const =0
void SetMaterialConstProperty(std::string Material, std::string Property, double Value, double Unit)
Stores the specified material property.
kilovolt_as<> kilovolt
Type of potential stored in kilovolt, in double precision.
virtual double ScintResolutionScale() const =0
double Efield(unsigned int planegap=0) const
kV/cm
virtual double ProtonScintYield(bool prescale=false) const =0
virtual double PionScintYieldRatio() const =0
std::map< std::string, std::map< std::string, double > > fConstPropertyList
virtual bool ExtraMatProperties() const =0
static constexpr double eV
virtual double ScintBirksConstant() const =0
virtual double ElectronScintYield(bool prescale=false) const =0
virtual double PionScintYield(bool prescale=false) const =0
virtual std::map< double, double > TpbEm() const =0
virtual double TpbTimeConstant() const =0
virtual std::map< std::string, std::map< double, double > > SurfaceReflectances() const =0
void UpdateGeometry(G4LogicalVolumeStore *lvs)
Updates the material properties with the collected values.
bool SimpleBoundary() const
virtual std::map< double, double > SlowScintSpectrum() const =0
virtual double MuonScintYield(bool prescale=false) const =0
virtual double KaonScintYield(bool prescale=false) const =0
virtual std::map< double, double > TpbAbs() const =0
virtual double ScintYield(bool prescale=false) const =0
virtual double MuonScintYieldRatio() const =0
void SetReflectances(std::string, std::map< std::string, std::map< double, double >>, std::map< std::string, std::map< double, double >>)
virtual std::map< std::string, std::map< double, double > > SurfaceReflectanceDiffuseFractions() const =0
void SetBirksConstant(std::string, double, double)
virtual double KaonScintYieldRatio() const =0
std::map< std::string, double > fBirksConstants
virtual bool ScintByParticleType() const =0
virtual std::map< double, double > FastScintSpectrum() const =0
QTextStream & endl(QTextStream &s)