LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
LArPropertiesStandard.h
Go to the documentation of this file.
1 
12 // Historical authors:
14 //
15 // maddalena.antonello@lngs.infn.it
16 // ornella.palamara@lngs.infn.it
17 // msoderbe@syr.edu
18 // joshua.spitz@yale.edu
19 //
20 // Optical Properties:
21 // bjpjones@mit.edu
22 //
23 // Separation of service from Detector info class:
24 // jpaley@fnal.gov
25 //
26 // Test system:
27 // petrillo@fnal.gov
28 //
30 
31 #ifndef DETECTORINFO_LARPROPERTIESSTANDARD_H
32 #define DETECTORINFO_LARPROPERTIESSTANDARD_H
33 
34 //
35 // This flag is for temporary code to work around the missing OptionalAtom
36 // feature in older fhiclcpp
37 //
38 #define DETECTORINFO_LARPROPERTIESSTANDARD_HASOPTIONALATOM 0
39 
40 // LArSoft libraries
42 
43 // FHiCL libraries
44 #include "fhiclcpp/ParameterSet.h"
45 #include "fhiclcpp/types/Atom.h"
46 #if DETECTORINFO_LARPROPERTIESSTANDARD_HASOPTIONALATOM
48 #endif
50 #include "fhiclcpp/types/Table.h"
51 
52 // C/C++ standard libraries
53 #include <string>
54 #include <vector>
55 #include <map>
56 #include <set>
57 
58 
59 
60 namespace detinfo {
73  public:
75  explicit LArPropertiesStandard
76  (fhicl::ParameterSet const& pset, std::set<std::string> ignore_params = {});
78  virtual ~LArPropertiesStandard() = default;
79 
89  bool Configure
90  (fhicl::ParameterSet const& pset, std::set<std::string> ignore_params = {});
91  bool Update(uint64_t ts=0);
92 
93  virtual double RadiationLength() const override { return fRadiationLength; }
94 
95  virtual double Argon39DecayRate() const override { return fArgon39DecayRate; } // decays per cm^3 per second
96 
98  virtual double AtomicNumber() const override { return fZ; }
100  virtual double AtomicMass() const override { return fA; }
102  virtual double ExcitationEnergy() const override { return fI; }
103 
104  virtual double ScintResolutionScale() const override { return fScintResolutionScale; }
105  virtual double ScintFastTimeConst() const override { return fScintFastTimeConst; }
106  virtual double ScintSlowTimeConst() const override { return fScintSlowTimeConst; }
107  virtual double ScintBirksConstant() const override { return fScintBirksConstant; }
108 
109  virtual bool ScintByParticleType() const override { return fScintByParticleType; }
110 
111  virtual double ScintYield(bool prescale = false) const override { return fScintYield * ScintPreScale(prescale);}
112  virtual double ScintPreScale(bool prescale = true) const override { return (prescale ? fScintPreScale : 1); }
113  virtual double ScintYieldRatio() const override { return fScintYieldRatio; }
114 
115  virtual double ProtonScintYield(bool prescale = false) const override { return fProtonScintYield * ScintPreScale(prescale); }
116  virtual double ProtonScintYieldRatio() const override { return fProtonScintYieldRatio; }
117  virtual double MuonScintYield(bool prescale = false) const override { return fMuonScintYield * ScintPreScale(prescale); }
118  virtual double MuonScintYieldRatio() const override { return fMuonScintYieldRatio; }
119  virtual double KaonScintYield(bool prescale = false) const override { return fKaonScintYield * ScintPreScale(prescale); }
120  virtual double KaonScintYieldRatio() const override { return fKaonScintYieldRatio; }
121  virtual double PionScintYield(bool prescale = false) const override { return fPionScintYield * ScintPreScale(prescale); }
122  virtual double PionScintYieldRatio() const override { return fPionScintYieldRatio; }
123  virtual double ElectronScintYield(bool prescale = false) const override { return fElectronScintYield * ScintPreScale(prescale);}
124  virtual double ElectronScintYieldRatio() const override { return fElectronScintYieldRatio; }
125  virtual double AlphaScintYield(bool prescale = false) const override { return fAlphaScintYield * ScintPreScale(prescale); }
126  virtual double AlphaScintYieldRatio() const override { return fAlphaScintYieldRatio; }
127  virtual bool CerenkovLightEnabled() const override { return fEnableCerenkovLight; }
128 
129 
130  virtual std::map<double, double> SlowScintSpectrum() const override;
131  virtual std::map<double, double> FastScintSpectrum() const override;
132  virtual std::map<double, double> RIndexSpectrum() const override;
133  virtual std::map<double, double> AbsLengthSpectrum() const override;
134  virtual std::map<double, double> RayleighSpectrum() const override;
135 
136  virtual std::map<std::string, std::map<double, double> > SurfaceReflectances() const override;
137  virtual std::map<std::string, std::map<double, double> > SurfaceReflectanceDiffuseFractions() const override;
138 
139  void SetRadiationLength(double rl) { fRadiationLength = rl; }
140  void SetArgon39DecayRate(double r) { fArgon39DecayRate = r;}
141  void SetAtomicNumber(double z) { fZ = z;}
142  void SetAtomicMass(double a) { fA = a;}
143  void SetMeanExcitationEnergy(double e) { fI = e;}
144 
145  void SetFastScintSpectrum(std::vector<double> s) { fFastScintSpectrum = s;}
146  void SetFastScintEnergies(std::vector<double> s) { fFastScintEnergies = s;}
147  void SetSlowScintSpectrum(std::vector<double> s) { fSlowScintSpectrum = s;}
148  void SetSlowScintEnergies(std::vector<double> s) { fSlowScintEnergies = s;}
149  void SetRIndexSpectrum(std::vector<double> s) { fRIndexSpectrum = s;}
150  void SetRIndexEnergies(std::vector<double> s) { fRIndexEnergies = s;}
151  void SetAbsLengthSpectrum(std::vector<double> s) { fAbsLengthSpectrum = s;}
152  void SetAbsLengthEnergies(std::vector<double> s) { fAbsLengthEnergies = s;}
153  void SetRayleighSpectrum(std::vector<double> s) { fRayleighSpectrum = s;}
154  void SetRayleighEnergies(std::vector<double> s) { fRayleighEnergies = s;}
155 
169 
170  void SetScintYield(double y) { fScintYield = y;}
171  void SetScintPreScale(double s) { fScintPreScale = s;}
175  void SetScintYieldRatio(double r) { fScintYieldRatio = r;}
178 
179  void SetReflectiveSurfaceNames(std::vector<std::string> n) { fReflectiveSurfaceNames = n;}
183 
185  virtual bool ExtraMatProperties() const override { return fExtraMatProperties; }
186  virtual double TpbTimeConstant() const override { return fTpbTimeConstant; }
187 
188  virtual std::map<double, double> TpbAbs() const override;
189  virtual std::map<double, double> TpbEm() const override;
190 
192 
193  void SetTpbEmmisionEnergies(std::vector<double> s) { fTpbEmmisionEnergies = s;}
194  void SetTpbEmmisionSpectrum(std::vector<double> s) { fTpbEmmisionSpectrum = s;}
195  void SetTpbAbsorptionEnergies(std::vector<double> s) { fTpbAbsorptionEnergies = s;}
196  void SetTpbAbsorptionSpectrum(std::vector<double> s) { fTpbAbsorptionSpectrum = s;}
197 
198 
199  private:
200  protected:
201 
204  using Name = fhicl::Name;
206 
208  { Name("RadiationLength" ), Comment("radiation length [g/cm^2]") };
210  { Name("AtomicNumber" ), Comment("atomic number (yes, yes, it's 18...)") };
212  { Name("AtomicMass" ), Comment("atomic mass [g/mol]") };
214  { Name("ExcitationEnergy"), Comment("mean excitation energy [eV]") };
215 
217  { Name("Argon39DecayRate"), Comment("decays/(cm^3 s)") };
218 
219  // scintillation parameters
220  fhicl::Sequence<double> FastScintEnergies { Name("FastScintEnergies"), Comment("") };
221  fhicl::Sequence<double> FastScintSpectrum { Name("FastScintSpectrum"), Comment("") };
222  fhicl::Sequence<double> SlowScintEnergies { Name("SlowScintEnergies"), Comment("") };
223  fhicl::Sequence<double> SlowScintSpectrum { Name("SlowScintSpectrum"), Comment("") };
224  fhicl::Sequence<double> AbsLengthEnergies { Name("AbsLengthEnergies"), Comment("") };
225  fhicl::Sequence<double> AbsLengthSpectrum { Name("AbsLengthSpectrum"), Comment("") };
226  fhicl::Sequence<double> RIndexEnergies { Name("RIndexEnergies" ), Comment("") };
227  fhicl::Sequence<double> RIndexSpectrum { Name("RIndexSpectrum" ), Comment("") };
228  fhicl::Sequence<double> RayleighEnergies { Name("RayleighEnergies" ), Comment("") };
229  fhicl::Sequence<double> RayleighSpectrum { Name("RayleighSpectrum" ), Comment("") };
230 
231  fhicl::Atom<double> ScintResolutionScale { Name("ScintResolutionScale"), Comment("") };
232  fhicl::Atom<double> ScintFastTimeConst { Name("ScintFastTimeConst" ), Comment("") };
233  fhicl::Atom<double> ScintSlowTimeConst { Name("ScintSlowTimeConst" ), Comment("") };
234  fhicl::Atom<double> ScintBirksConstant { Name("ScintBirksConstant" ), Comment("") };
235  fhicl::Atom<double> ScintYield { Name("ScintYield" ), Comment("") };
236  fhicl::Atom<double> ScintPreScale { Name("ScintPreScale" ), Comment("") };
237  fhicl::Atom<double> ScintYieldRatio { Name("ScintYieldRatio" ), Comment("") };
238  fhicl::Atom<bool > ScintByParticleType { Name("ScintByParticleType" ), Comment("") };
239 
240  fhicl::Sequence<double> TpbEmmisionEnergies { Name("TpbEmmisionEnergies" ), Comment("") };
241  fhicl::Sequence<double> TpbEmmisionSpectrum { Name("TpbEmmisionSpectrum" ), Comment("") };
242  fhicl::Sequence<double> TpbAbsorptionEnergies { Name("TpbAbsorptionEnergies"), Comment("") };
243  fhicl::Sequence<double> TpbAbsorptionSpectrum { Name("TpbAbsorptionSpectrum"), Comment("") };
244 
245  fhicl::Atom<double> TpbTimeConstant { Name("TpbTimeConstant" ), Comment("") };
246  fhicl::Atom<bool > ExtraMatProperties { Name("LoadExtraMatProperties"), Comment("") };
247 
248 
249 #if DETECTORINFO_LARPROPERTIESSTANDARD_HASOPTIONALATOM
251  { Name("ProtonScintYield" ), Comment("(only if ScintByParticleType is true)") };
253  { Name("ProtonScintYieldRatio" ), Comment("(only if ScintByParticleType is true)") };
255  { Name("MuonScintYield" ), Comment("(only if ScintByParticleType is true)") };
257  { Name("MuonScintYieldRatio" ), Comment("(only if ScintByParticleType is true)") };
259  { Name("PionScintYield" ), Comment("(only if ScintByParticleType is true)") };
261  { Name("PionScintYieldRatio" ), Comment("(only if ScintByParticleType is true)") };
263  { Name("KaonScintYield" ), Comment("(only if ScintByParticleType is true)") };
265  { Name("KaonScintYieldRatio" ), Comment("(only if ScintByParticleType is true)") };
267  { Name("ElectronScintYield" ), Comment("(only if ScintByParticleType is true)") };
269  { Name("ElectronScintYieldRatio"), Comment("(only if ScintByParticleType is true)") };
271  { Name("AlphaScintYield" ), Comment("(only if ScintByParticleType is true)") };
273  { Name("AlphaScintYieldRatio" ), Comment("(only if ScintByParticleType is true)") };
274 #endif // DETECTORINFO_LARPROPERTIESSTANDARD_HASOPTIONALATOM?
275 
276  fhicl::Atom<bool > EnableCerenkovLight { Name("EnableCerenkovLight" ), Comment("") };
277 
279  { Name("ReflectiveSurfaceNames"), Comment("") };
281  { Name("ReflectiveSurfaceEnergies"), Comment("") };
283  { Name("ReflectiveSurfaceReflectances"), Comment("") };
285  { Name("ReflectiveSurfaceDiffuseFractions"), Comment("") };
286 
287  }; // Configuration_t
288 
289 #if !DETECTORINFO_LARPROPERTIESSTANDARD_HASOPTIONALATOM
292 
294  { Name("ProtonScintYield" ), Comment("(only if ScintByParticleType is true)") };
296  { Name("ProtonScintYieldRatio" ), Comment("(only if ScintByParticleType is true)") };
298  { Name("MuonScintYield" ), Comment("(only if ScintByParticleType is true)") };
300  { Name("MuonScintYieldRatio" ), Comment("(only if ScintByParticleType is true)") };
302  { Name("PionScintYield" ), Comment("(only if ScintByParticleType is true)") };
304  { Name("PionScintYieldRatio" ), Comment("(only if ScintByParticleType is true)") };
306  { Name("KaonScintYield" ), Comment("(only if ScintByParticleType is true)") };
308  { Name("KaonScintYieldRatio" ), Comment("(only if ScintByParticleType is true)") };
310  { Name("ElectronScintYield" ), Comment("(only if ScintByParticleType is true)") };
312  { Name("ElectronScintYieldRatio"), Comment("(only if ScintByParticleType is true)") };
314  { Name("AlphaScintYield" ), Comment("(only if ScintByParticleType is true)") };
316  { Name("AlphaScintYieldRatio" ), Comment("(only if ScintByParticleType is true)") };
317 
318  }; // ConfigWithScintByType_t
319 #endif // !DETECTORINFO_LARPROPERTIESSTANDARD_HASOPTIONALATOM?
320 
321 
323 
326 
327  // Following parameters are for use in Bethe-Bloch formula for dE/dx.
328 
329  double fZ;
330  double fA;
331  double fI;
332 
333 
334  // Optical parameters for LAr
335 
336  std::vector<double> fFastScintSpectrum;
337  std::vector<double> fFastScintEnergies;
338  std::vector<double> fSlowScintSpectrum;
339  std::vector<double> fSlowScintEnergies;
340  std::vector<double> fRIndexSpectrum;
341  std::vector<double> fRIndexEnergies;
342  std::vector<double> fAbsLengthSpectrum;
343  std::vector<double> fAbsLengthEnergies;
344  std::vector<double> fRayleighSpectrum;
345  std::vector<double> fRayleighEnergies;
346 
348 
361 
362  double fScintYield;
369 
371 
372  std::vector<std::string> fReflectiveSurfaceNames;
373  std::vector<double> fReflectiveSurfaceEnergies;
374  std::vector<std::vector<double> > fReflectiveSurfaceReflectances;
375  std::vector<std::vector<double> > fReflectiveSurfaceDiffuseFractions;
376 
379  std::vector<double> fTpbEmmisionEnergies;
380  std::vector<double> fTpbEmmisionSpectrum;
381  std::vector<double> fTpbAbsorptionEnergies;
382  std::vector<double> fTpbAbsorptionSpectrum;
383 
384  /*
385  struct DBsettingsClass {
386  DBsettingsClass();
387 
388  bool ToughErrorTreatment; ///< equivalent parameter in DatabaseUtil
389  bool ShouldConnect; ///< equivalent parameter in DatabaseUtil
390  }; // DBsettingsClass
391 
392  DBsettingsClass DBsettings; ///< settings read from DB access
393  */
394 
395  public:
396  // expose the configuration object for framework service
397 #if DETECTORINFO_LARPROPERTIESSTANDARD_HASOPTIONALATOM
399 #else // !DETECTORINFO_LARPROPERTIESSTANDARD_HASOPTIONALATOM?
401 #endif // !DETECTORINFO_LARPROPERTIESSTANDARD_HASOPTIONALATOM?
402 
403  }; // class LArPropertiesStandard
404 } //namespace detinfo
405 #endif // LARPROPERTIES_H
std::vector< double > fTpbEmmisionSpectrum
Float_t s
Definition: plot.C:23
virtual bool CerenkovLightEnabled() const override
double fArgon39DecayRate
decays per cm^3 per second
double fA
Ar atomic mass (g/mol)
virtual bool ScintByParticleType() const override
virtual double AtomicMass() const override
Ar atomic mass (g/mol)
virtual std::map< double, double > SlowScintSpectrum() const override
virtual double Argon39DecayRate() const override
virtual std::map< double, double > TpbAbs() const override
virtual double MuonScintYieldRatio() const override
std::vector< double > fTpbAbsorptionSpectrum
Float_t y
Definition: compare.C:6
virtual ~LArPropertiesStandard()=default
virtual double ExcitationEnergy() const override
Ar mean excitation energy (eV)
Double_t z
Definition: plot.C:279
virtual double ScintYieldRatio() const override
virtual double ScintYield(bool prescale=false) const override
std::vector< double > fFastScintEnergies
std::vector< double > fRayleighSpectrum
void SetAbsLengthSpectrum(std::vector< double > s)
virtual double RadiationLength() const override
g/cm^2
virtual std::map< double, double > TpbEm() const override
virtual double MuonScintYield(bool prescale=false) const override
virtual double AlphaScintYieldRatio() const override
virtual double PionScintYieldRatio() const override
void SetTpbEmmisionSpectrum(std::vector< double > s)
TFile f
Definition: plotHisto.C:6
virtual double ScintPreScale(bool prescale=true) const override
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
virtual std::map< std::string, std::map< double, double > > SurfaceReflectanceDiffuseFractions() const override
virtual double AlphaScintYield(bool prescale=false) const override
std::vector< std::string > fReflectiveSurfaceNames
bool Configure(fhicl::ParameterSet const &pset, std::set< std::string > ignore_params={})
Configures the provider.
virtual double ScintResolutionScale() const override
virtual std::map< double, double > AbsLengthSpectrum() const override
structure with all configuration parameters
void SetReflectiveSurfaceEnergies(std::vector< double > e)
std::vector< double > fFastScintSpectrum
void SetReflectiveSurfaceReflectances(std::vector< std::vector< double > > r)
std::vector< double > fAbsLengthEnergies
virtual double KaonScintYieldRatio() const override
void SetSlowScintEnergies(std::vector< double > s)
std::vector< double > fSlowScintEnergies
structure with all configuration parameters
std::vector< double > fTpbEmmisionEnergies
General LArSoft Utilities.
void SetFastScintSpectrum(std::vector< double > s)
void SetRayleighSpectrum(std::vector< double > s)
void SetTpbEmmisionEnergies(std::vector< double > s)
virtual double ElectronScintYieldRatio() const override
void SetAbsLengthEnergies(std::vector< double > s)
virtual double KaonScintYield(bool prescale=false) const override
void SetFastScintEnergies(std::vector< double > s)
void SetRIndexEnergies(std::vector< double > s)
virtual double ScintFastTimeConst() const override
virtual double ElectronScintYield(bool prescale=false) const override
void SetReflectiveSurfaceDiffuseFractions(std::vector< std::vector< double > > f)
void SetTpbAbsorptionSpectrum(std::vector< double > s)
std::vector< std::vector< double > > fReflectiveSurfaceReflectances
double fI
Ar mean excitation energy (eV)
Properties related to liquid argon environment in the detector.
virtual double PionScintYield(bool prescale=false) const override
std::vector< double > fAbsLengthSpectrum
void SetTpbAbsorptionEnergies(std::vector< double > s)
std::vector< double > fReflectiveSurfaceEnergies
std::vector< double > fSlowScintSpectrum
void SetSlowScintSpectrum(std::vector< double > s)
virtual double ProtonScintYield(bool prescale=false) const override
virtual std::map< double, double > RIndexSpectrum() const override
std::vector< double > fTpbAbsorptionEnergies
Char_t n[5]
virtual std::map< double, double > FastScintSpectrum() const override
virtual std::map< double, double > RayleighSpectrum() const override
fhicl::Sequence< fhicl::Sequence< double > > ReflectiveSurfaceReflectances
virtual double ScintBirksConstant() const override
std::vector< double > fRayleighEnergies
virtual bool ExtraMatProperties() const override
Float_t e
Definition: plot.C:34
virtual std::map< std::string, std::map< double, double > > SurfaceReflectances() const override
void SetReflectiveSurfaceNames(std::vector< std::string > n)
virtual double ScintSlowTimeConst() const override
virtual double TpbTimeConstant() const override
void SetRIndexSpectrum(std::vector< double > s)
virtual double AtomicNumber() const override
Ar atomic number.
std::vector< std::vector< double > > fReflectiveSurfaceDiffuseFractions
virtual double ProtonScintYieldRatio() const override
fhicl::Sequence< fhicl::Sequence< double > > ReflectiveSurfaceDiffuseFractions
void SetRayleighEnergies(std::vector< double > s)