LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
MaterialPropertyLoader.h
Go to the documentation of this file.
1 //
6 // Class to set material properties for different materials in
7 // the detector. Currently used to supply optical properties to LAr
8 // and other optical elements of the detector.
9 //
10 
11 // TODO uniform the header guard format to LArSoft common
12 #ifndef LArG4_MaterialPropertyLoader_h
13 #define LArG4_MaterialPropertyLoader_h
14 
15 #include <map>
16 #include <string>
17 
18 class G4LogicalVolumeStore;
19 
20 namespace detinfo {
21  class DetectorPropertiesData;
22 }
23 
24 namespace larg4 {
25 
51  public:
52  // TODO turn arguments into constant references
53  //Accessors
54  std::map<double, double> GetMaterialProperty(std::string Material, std::string Property)
55  {
56  return fPropertyList[Material][Property];
57  }
58 
59  // TODO turn arguments into constant references
60  double GetMaterialConstProperty(std::string Material, std::string Property)
61  {
62  return fConstPropertyList[Material][Property];
63  }
64 
65  // TODO turn argument into constant reference
66  std::map<std::string, double> const& GetMaterialConstProperties(std::string Material)
67  {
68  return fConstPropertyList[Material];
69  }
70 
71  // TODO turn argument into constant reference
72  std::map<std::string, std::map<double, double>> const& GetMaterialProperties(
73  std::string Material)
74  {
75  return fPropertyList[Material];
76  }
77 
78  // --- BEGIN Methods to set material properties ----------------------------
81 
97  // TODO turn arguments into constant references
98  void SetMaterialProperty(std::string Material,
99  std::string Property,
100  std::map<double, double> Values,
101  double Unit);
102 
115  // TODO turn arguments into constant references
116  void SetMaterialConstProperty(std::string Material,
117  std::string Property,
118  double Value,
119  double Unit);
120 
122  // --- END Methods to set material properties ------------------------------
123 
124  // --- BEGIN Setting of specific properties --------------------------------
127 
128  // Method to set LArG4 Birks constant
129  void SetBirksConstant(std::string, double, double);
130 
134  // TODO turn the arguments into constant references (using type aliases)
135  void SetReflectances(std::string,
136  std::map<std::string, std::map<double, double>>,
137  std::map<std::string, std::map<double, double>>);
138  // TODO turn the argument into constant reference (using type aliases)
139  void SetReflectances(std::map<std::string, std::map<double, double>>);
140 
142  // --- END Setting of specific properties ----------------------------------
143 
182  void GetPropertiesFromServices(detinfo::DetectorPropertiesData const& detProp);
183 
184  // TODO make this method constant
196  void UpdateGeometry(G4LogicalVolumeStore* lvs);
197 
198  private:
199  // materials properties values
200  std::map<std::string, std::map<std::string, double>> fConstPropertyList;
201 
202  // materials properties energies values
203  std::map<std::string, std::map<std::string, std::map<double, double>>> fPropertyList;
204 
205  std::map<std::string, double> fBirksConstants;
206  }; // clas MaterialPropertyLoader
207 
208 } // namespace larg4
209 
210 #endif // LArG4_MaterialPropertyLoader_h
Stores material properties and sends them to GEANT4 geometry.
std::map< std::string, std::map< std::string, std::map< double, double > > > fPropertyList
Geant4 interface.
std::map< std::string, std::map< std::string, double > > fConstPropertyList
double GetMaterialConstProperty(std::string Material, std::string Property)
General LArSoft Utilities.
std::map< std::string, std::map< double, double > > const & GetMaterialProperties(std::string Material)
std::map< std::string, double > const & GetMaterialConstProperties(std::string Material)
std::map< std::string, double > fBirksConstants
std::map< double, double > GetMaterialProperty(std::string Material, std::string Property)