17 #include "Geant4/G4Material.hh" 18 #include "Geant4/G4MaterialPropertiesTable.hh" 19 #include "Geant4/G4LogicalSkinSurface.hh" 20 #include "Geant4/G4OpticalSurface.hh" 28 std::map<double, double> PropertyVector,
31 std::map<double,double> PropVectorWithUnit;
33 it!=PropertyVector.end();
36 PropVectorWithUnit[it->first*CLHEP::eV]=it->second*Unit;
40 mf::LogInfo(
"MaterialPropertyLoader")<<
"Added property " 53 mf::LogInfo(
"MaterialPropertyLoader") <<
"Added const property " 55 << Property <<
" = " << PropertyValue;
65 mf::LogInfo(
"MaterialPropertyLoader") <<
"Set Birks constant " 72 std::map<std::string,G4MaterialPropertiesTable*> MaterialTables;
73 std::map<std::string,bool> MaterialsSet;
76 mf::LogInfo(
"MaterialPropertyLoader") <<
"UPDATING GEOMETRY";
80 std::string Material=i->first;
81 MaterialsSet[Material]=
true;
82 MaterialTables[Material]=
new G4MaterialPropertiesTable;
88 std::string Material=i->first;
89 if(!MaterialsSet[Material]){
90 MaterialsSet[Material]=
true;
91 MaterialTables[Material]=
new G4MaterialPropertiesTable;
100 std::string Material=i->first;
101 for(std::map<std::string,std::map<double,double> >::
const_iterator j = i->second.begin(); j!=i->second.end(); j++){
102 std::string Property=j->first;
103 std::vector<G4double> g4MomentumVector;
104 std::vector<G4double> g4PropertyVector;
107 g4MomentumVector.push_back(k->first);
108 g4PropertyVector.push_back(k->second);
110 int NoOfElements=g4MomentumVector.size();
111 MaterialTables[Material]->AddProperty(Property.c_str(),&g4MomentumVector[0], &g4PropertyVector[0],NoOfElements);
113 mf::LogInfo(
"MaterialPropertyLoader") <<
"Added property " 115 <<
" to material table " 122 std::string Material=i->first;
124 std::string Property=j->first;
125 G4double PropertyValue=j->second;
126 MaterialTables[Material]->AddConstProperty(Property.c_str(), PropertyValue);
128 mf::LogInfo(
"MaterialPropertyLoader") <<
"Added const property " 130 <<
" to material table " 137 G4LogicalVolume* volume = (*i);
138 G4Material* TheMaterial = volume->GetMaterial();
139 std::string Material = TheMaterial->GetName();
147 G4MaterialPropertyVector* PropertyPointer = 0;
148 if(MaterialTables[Material])
149 PropertyPointer = MaterialTables[Material]->GetProperty(
"REFLECTIVITY");
151 if(Material==
"Copper"){
152 std::cout<<
"copper foil surface set "<<volume->GetName()<<std::endl;
153 if(PropertyPointer) {
154 std::cout<<
"defining Copper optical boundary "<<std::endl;
155 G4OpticalSurface* refl_opsurfc =
new G4OpticalSurface(
"Surface copper",glisur,ground,dielectric_metal);
156 refl_opsurfc->SetMaterialPropertiesTable(MaterialTables[Material]);
157 refl_opsurfc->SetPolish(0.2);
158 new G4LogicalSkinSurface(
"refl_surfacec",volume, refl_opsurfc);
161 std::cout<<
"Warning: Copper surface in the geometry without REFLECTIVITY assigned"<<std::endl;
165 std::cout<<
"G10 surface set "<<volume->GetName()<<std::endl;
166 if(PropertyPointer) {
167 std::cout<<
"defining G10 optical boundary "<<std::endl;
168 G4OpticalSurface* refl_opsurfg =
new G4OpticalSurface(
"g10 Surface",glisur,ground,dielectric_metal);
169 refl_opsurfg->SetMaterialPropertiesTable(MaterialTables[Material]);
170 refl_opsurfg->SetPolish(0.1);
171 new G4LogicalSkinSurface(
"refl_surfaceg",volume, refl_opsurfg);
174 std::cout<<
"Warning: G10 surface in the geometry without REFLECTIVITY assigned"<<std::endl;
177 if(Material==
"vm2000"){
178 std::cout<<
"vm2000 surface set "<<volume->GetName()<<std::endl;
179 if(PropertyPointer) {
180 std::cout<<
"defining vm2000 optical boundary "<<std::endl;
181 G4OpticalSurface* refl_opsurf =
new G4OpticalSurface(
"Reflector Surface",unified,groundfrontpainted,dielectric_dielectric);
182 refl_opsurf->SetMaterialPropertiesTable(MaterialTables[Material]);
183 G4double sigma_alpha = 0.8;
184 refl_opsurf->SetSigmaAlpha(sigma_alpha);
185 new G4LogicalSkinSurface(
"refl_surface",volume, refl_opsurf);
188 std::cout<<
"Warning: vm2000 surface in the geometry without REFLECTIVITY assigned"<<std::endl;
190 if(Material==
"ALUMINUM_Al"){
191 std::cout<<
"ALUMINUM_Al surface set "<<volume->GetName()<<std::endl;
192 if(PropertyPointer) {
193 std::cout<<
"defining ALUMINUM_Al optical boundary "<<std::endl;
194 G4OpticalSurface* refl_opsurfs =
new G4OpticalSurface(
"Surface Aluminum",glisur,ground,dielectric_metal);
195 refl_opsurfs->SetMaterialPropertiesTable(MaterialTables[Material]);
196 refl_opsurfs->SetPolish(0.5);
197 new G4LogicalSkinSurface(
"refl_surfaces",volume, refl_opsurfs);
200 std::cout<<
"Warning: ALUMINUM_Al surface in the geometry without REFLECTIVITY assigned"<<std::endl;
202 if(Material==
"STEEL_STAINLESS_Fe7Cr2Ni"){
203 std::cout<<
"STEEL_STAINLESS_Fe7Cr2Ni surface set "<<volume->GetName()<<std::endl;
204 if(PropertyPointer) {
205 std::cout<<
"defining STEEL_STAINLESS_Fe7Cr2Ni optical boundary "<<std::endl;
206 G4OpticalSurface* refl_opsurfs =
new G4OpticalSurface(
"Surface Steel",glisur,ground,dielectric_metal);
207 refl_opsurfs->SetMaterialPropertiesTable(MaterialTables[Material]);
208 refl_opsurfs->SetPolish(0.5);
209 new G4LogicalSkinSurface(
"refl_surfaces",volume, refl_opsurfs);
212 std::cout<<
"Warning: STEEL_STAINLESS_Fe7Cr2Ni surface in the geometry without REFLECTIVITY assigned"<<std::endl;
220 if(Material==j->first){
221 TheMaterial->SetMaterialPropertiesTable(j->second);
224 TheMaterial->GetIonisation()->SetBirksConstant(
fBirksConstants[Material]);
225 volume->SetMaterial(TheMaterial);
234 std::map<double, double> ReflectanceToStore;
235 std::map<double, double> DiffuseToStore;
237 for(std::map<std::string,std::map<double,double> >::
const_iterator itMat=Reflectances.begin();
238 itMat!=Reflectances.end();
241 std::string ReflectancePropName = std::string(
"REFLECTANCE_") + itMat->first;
242 ReflectanceToStore.clear();
244 itEn!=itMat->second.end();
247 ReflectanceToStore[itEn->first]=itEn->second;
252 for(std::map<std::string,std::map<double,double> >::
const_iterator itMat=DiffuseFractions.begin();
253 itMat!=DiffuseFractions.end();
256 std::string DiffusePropName = std::string(
"DIFFUSE_REFLECTANCE_FRACTION_") + itMat->first;
257 DiffuseToStore.clear();
259 itEn!=itMat->second.end();
262 DiffuseToStore[itEn->first]=itEn->second;
272 std::map<double, double> ReflectanceToStore;
274 for(std::map<std::string,std::map<double,double> >::
const_iterator itMat=Reflectances.begin();
275 itMat!=Reflectances.end();
278 ReflectanceToStore.clear();
280 itEn!=itMat->second.end();
283 ReflectanceToStore[itEn->first]=itEn->second;
314 if(DetProp->SimpleBoundary())
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.
void SetReflectances(std::string, std::map< std::string, std::map< double, double > >, std::map< std::string, std::map< double, double > >)
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
virtual double ScintSlowTimeConst() const =0
virtual double ScintFastTimeConst() const =0
virtual double ProtonScintYieldRatio() const =0
void SetMaterialConstProperty(std::string Material, std::string Property, double Value, double Unit)
Stores the specified material property.
virtual double ScintResolutionScale() const =0
std::map< std::string, std::map< std::string, double > > fConstPropertyList
virtual double ProtonScintYield(bool prescale=false) const =0
virtual double PionScintYieldRatio() const =0
virtual bool ExtraMatProperties() const =0
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.
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
virtual std::map< std::string, std::map< double, double > > SurfaceReflectanceDiffuseFractions() const =0
std::map< std::string, std::map< std::string, std::map< double, double > > > fPropertyList
void SetBirksConstant(std::string, double, double)
virtual double KaonScintYieldRatio() const =0
std::map< std::string, double > fBirksConstants
void GetPropertiesFromServices()
Imports properties from LArSoft services.
virtual bool ScintByParticleType() const =0
virtual std::map< double, double > FastScintSpectrum() const =0