LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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/types/Atom.h"
45 #if DETECTORINFO_LARPROPERTIESSTANDARD_HASOPTIONALATOM
47 #endif
49 
50 namespace fhicl {
51  class ParameterSet;
52 }
53 
54 // C/C++ standard libraries
55 #include <map>
56 #include <set>
57 #include <string>
58 #include <vector>
59 
60 namespace detinfo {
73  public:
75  explicit LArPropertiesStandard(fhicl::ParameterSet const& pset,
76  std::set<std::string> ignore_params = {});
78  virtual ~LArPropertiesStandard() = default;
79 
89  bool Configure(fhicl::ParameterSet const& pset, std::set<std::string> ignore_params = {});
90  bool Update(uint64_t ts = 0);
91 
92  virtual double RadiationLength() const override { return fRadiationLength; }
93 
94  virtual double Argon39DecayRate() const override
95  {
96  return fArgon39DecayRate;
97  } // decays per cm^3 per second
98 
100  virtual double AtomicNumber() const override { return fZ; }
102  virtual double AtomicMass() const override { return fA; }
104  virtual double ExcitationEnergy() const override { return fI; }
105 
106  virtual double ScintResolutionScale() const override { return fScintResolutionScale; }
107  virtual double ScintFastTimeConst() const override { return fScintFastTimeConst; }
108  virtual double ScintSlowTimeConst() const override { return fScintSlowTimeConst; }
109  virtual double ScintBirksConstant() const override { return fScintBirksConstant; }
110 
111  virtual bool ScintByParticleType() const override { return fScintByParticleType; }
112 
113  virtual double ScintYield(bool prescale = false) const override
114  {
115  return fScintYield * ScintPreScale(prescale);
116  }
117  virtual double ScintPreScale(bool prescale = true) const override
118  {
119  return (prescale ? fScintPreScale : 1);
120  }
121  virtual double ScintYieldRatio() const override { return fScintYieldRatio; }
122 
123  virtual double ProtonScintYield(bool prescale = false) const override
124  {
125  return fProtonScintYield * ScintPreScale(prescale);
126  }
127  virtual double ProtonScintYieldRatio() const override { return fProtonScintYieldRatio; }
128  virtual double MuonScintYield(bool prescale = false) const override
129  {
130  return fMuonScintYield * ScintPreScale(prescale);
131  }
132  virtual double MuonScintYieldRatio() const override { return fMuonScintYieldRatio; }
133  virtual double KaonScintYield(bool prescale = false) const override
134  {
135  return fKaonScintYield * ScintPreScale(prescale);
136  }
137  virtual double KaonScintYieldRatio() const override { return fKaonScintYieldRatio; }
138  virtual double PionScintYield(bool prescale = false) const override
139  {
140  return fPionScintYield * ScintPreScale(prescale);
141  }
142  virtual double PionScintYieldRatio() const override { return fPionScintYieldRatio; }
143  virtual double ElectronScintYield(bool prescale = false) const override
144  {
145  return fElectronScintYield * ScintPreScale(prescale);
146  }
147  virtual double ElectronScintYieldRatio() const override { return fElectronScintYieldRatio; }
148  virtual double AlphaScintYield(bool prescale = false) const override
149  {
150  return fAlphaScintYield * ScintPreScale(prescale);
151  }
152  virtual double AlphaScintYieldRatio() const override { return fAlphaScintYieldRatio; }
153  virtual bool CerenkovLightEnabled() const override { return fEnableCerenkovLight; }
154 
155  virtual std::map<double, double> SlowScintSpectrum() const override;
156  virtual std::map<double, double> FastScintSpectrum() const override;
157  virtual std::map<double, double> RIndexSpectrum() const override;
158  virtual std::map<double, double> AbsLengthSpectrum() const override;
159  virtual std::map<double, double> RayleighSpectrum() const override;
160 
161  virtual std::map<std::string, std::map<double, double>> SurfaceReflectances() const override;
162  virtual std::map<std::string, std::map<double, double>> SurfaceReflectanceDiffuseFractions()
163  const override;
164 
165  void SetRadiationLength(double rl) { fRadiationLength = rl; }
166  void SetArgon39DecayRate(double r) { fArgon39DecayRate = r; }
167  void SetAtomicNumber(double z) { fZ = z; }
168  void SetAtomicMass(double a) { fA = a; }
169  void SetMeanExcitationEnergy(double e) { fI = e; }
170 
171  void SetFastScintSpectrum(std::vector<double> s) { fFastScintSpectrum = s; }
172  void SetFastScintEnergies(std::vector<double> s) { fFastScintEnergies = s; }
173  void SetSlowScintSpectrum(std::vector<double> s) { fSlowScintSpectrum = s; }
174  void SetSlowScintEnergies(std::vector<double> s) { fSlowScintEnergies = s; }
175  void SetRIndexSpectrum(std::vector<double> s) { fRIndexSpectrum = s; }
176  void SetRIndexEnergies(std::vector<double> s) { fRIndexEnergies = s; }
177  void SetAbsLengthSpectrum(std::vector<double> s) { fAbsLengthSpectrum = s; }
178  void SetAbsLengthEnergies(std::vector<double> s) { fAbsLengthEnergies = s; }
179  void SetRayleighSpectrum(std::vector<double> s) { fRayleighSpectrum = s; }
180  void SetRayleighEnergies(std::vector<double> s) { fRayleighEnergies = s; }
181 
182  void SetScintByParticleType(bool l) { fScintByParticleType = l; }
183  void SetProtonScintYield(double y) { fProtonScintYield = y; }
184  void SetProtonScintYieldRatio(double r) { fProtonScintYieldRatio = r; }
185  void SetMuonScintYield(double y) { fMuonScintYield = y; }
186  void SetMuonScintYieldRatio(double r) { fMuonScintYieldRatio = r; }
187  void SetPionScintYield(double y) { fPionScintYield = y; }
188  void SetPionScintYieldRatio(double r) { fPionScintYieldRatio = r; }
189  void SetKaonScintYield(double y) { fKaonScintYield = y; }
190  void SetKaonScintYieldRatio(double r) { fKaonScintYieldRatio = r; }
191  void SetElectronScintYield(double y) { fElectronScintYield = y; }
192  void SetElectronScintYieldRatio(double r) { fElectronScintYieldRatio = r; }
193  void SetAlphaScintYield(double y) { fAlphaScintYield = y; }
194  void SetAlphaScintYieldRatio(double r) { fAlphaScintYieldRatio = r; }
195 
196  void SetScintYield(double y) { fScintYield = y; }
197  void SetScintPreScale(double s) { fScintPreScale = s; }
198  void SetScintResolutionScale(double r) { fScintResolutionScale = r; }
199  void SetScintFastTimeConst(double t) { fScintFastTimeConst = t; }
200  void SetScintSlowTimeConst(double t) { fScintSlowTimeConst = t; }
201  void SetScintYieldRatio(double r) { fScintYieldRatio = r; }
202  void SetScintBirksConstant(double kb) { fScintBirksConstant = kb; }
203  void SetEnableCerenkovLight(bool f) { fEnableCerenkovLight = f; }
204 
205  void SetReflectiveSurfaceNames(std::vector<std::string> n) { fReflectiveSurfaceNames = n; }
206  void SetReflectiveSurfaceEnergies(std::vector<double> e) { fReflectiveSurfaceEnergies = e; }
207  void SetReflectiveSurfaceReflectances(std::vector<std::vector<double>> r)
208  {
209  fReflectiveSurfaceReflectances = r;
210  }
212  {
213  fReflectiveSurfaceDiffuseFractions = f;
214  }
215 
216  void SetExtraMatProperties(bool l) { fExtraMatProperties = l; }
217  virtual bool ExtraMatProperties() const override { return fExtraMatProperties; }
218  virtual double TpbTimeConstant() const override { return fTpbTimeConstant; }
219 
220  virtual std::map<double, double> TpbAbs() const override;
221  virtual std::map<double, double> TpbEm() const override;
222 
223  void SetTpbTimeConstant(double y) { fTpbTimeConstant = y; }
224 
225  void SetTpbEmmisionEnergies(std::vector<double> s) { fTpbEmmisionEnergies = s; }
226  void SetTpbEmmisionSpectrum(std::vector<double> s) { fTpbEmmisionSpectrum = s; }
227  void SetTpbAbsorptionEnergies(std::vector<double> s) { fTpbAbsorptionEnergies = s; }
228  void SetTpbAbsorptionSpectrum(std::vector<double> s) { fTpbAbsorptionSpectrum = s; }
229 
230  private:
231  protected:
234  using Name = fhicl::Name;
236 
237  fhicl::Atom<double> RadiationLength{Name("RadiationLength"),
238  Comment("radiation length [g/cm^2]")};
239  fhicl::Atom<double> AtomicNumber{Name("AtomicNumber"),
240  Comment("atomic number (yes, yes, it's 18...)")};
241  fhicl::Atom<double> AtomicMass{Name("AtomicMass"), Comment("atomic mass [g/mol]")};
242  fhicl::Atom<double> MeanExcitationEnergy{Name("ExcitationEnergy"),
243  Comment("mean excitation energy [eV]")};
244 
245  fhicl::Atom<double> Argon39DecayRate{Name("Argon39DecayRate"), Comment("decays/(cm^3 s)")};
246 
247  // scintillation parameters
248  fhicl::Sequence<double> FastScintEnergies{Name("FastScintEnergies"), Comment("")};
249  fhicl::Sequence<double> FastScintSpectrum{Name("FastScintSpectrum"), Comment("")};
250  fhicl::Sequence<double> SlowScintEnergies{Name("SlowScintEnergies"), Comment("")};
251  fhicl::Sequence<double> SlowScintSpectrum{Name("SlowScintSpectrum"), Comment("")};
252  fhicl::Sequence<double> AbsLengthEnergies{Name("AbsLengthEnergies"), Comment("")};
253  fhicl::Sequence<double> AbsLengthSpectrum{Name("AbsLengthSpectrum"), Comment("")};
254  fhicl::Sequence<double> RIndexEnergies{Name("RIndexEnergies"), Comment("")};
255  fhicl::Sequence<double> RIndexSpectrum{Name("RIndexSpectrum"), Comment("")};
256  fhicl::Sequence<double> RayleighEnergies{Name("RayleighEnergies"), Comment("")};
257  fhicl::Sequence<double> RayleighSpectrum{Name("RayleighSpectrum"), Comment("")};
258 
259  fhicl::Atom<double> ScintResolutionScale{Name("ScintResolutionScale"), Comment("")};
260  fhicl::Atom<double> ScintFastTimeConst{Name("ScintFastTimeConst"), Comment("")};
261  fhicl::Atom<double> ScintSlowTimeConst{Name("ScintSlowTimeConst"), Comment("")};
262  fhicl::Atom<double> ScintBirksConstant{Name("ScintBirksConstant"), Comment("")};
263  fhicl::Atom<double> ScintYield{Name("ScintYield"), Comment("")};
264  fhicl::Atom<double> ScintPreScale{Name("ScintPreScale"), Comment("")};
265  fhicl::Atom<double> ScintYieldRatio{Name("ScintYieldRatio"), Comment("")};
266  fhicl::Atom<bool> ScintByParticleType{Name("ScintByParticleType"), Comment("")};
267 
268  fhicl::Sequence<double> TpbEmmisionEnergies{Name("TpbEmmisionEnergies"), Comment("")};
269  fhicl::Sequence<double> TpbEmmisionSpectrum{Name("TpbEmmisionSpectrum"), Comment("")};
270  fhicl::Sequence<double> TpbAbsorptionEnergies{Name("TpbAbsorptionEnergies"), Comment("")};
271  fhicl::Sequence<double> TpbAbsorptionSpectrum{Name("TpbAbsorptionSpectrum"), Comment("")};
272 
273  fhicl::Atom<double> TpbTimeConstant{Name("TpbTimeConstant"), Comment("")};
274  fhicl::Atom<bool> ExtraMatProperties{Name("LoadExtraMatProperties"), Comment("")};
275 
276 #if DETECTORINFO_LARPROPERTIESSTANDARD_HASOPTIONALATOM
277  fhicl::OptionalAtom<double> ProtonScintYield{
278  Name("ProtonScintYield"),
279  Comment("(only if ScintByParticleType is true)")};
280  fhicl::OptionalAtom<double> ProtonScintYieldRatio{
281  Name("ProtonScintYieldRatio"),
282  Comment("(only if ScintByParticleType is true)")};
283  fhicl::OptionalAtom<double> MuonScintYield{Name("MuonScintYield"),
284  Comment("(only if ScintByParticleType is true)")};
285  fhicl::OptionalAtom<double> MuonScintYieldRatio{
286  Name("MuonScintYieldRatio"),
287  Comment("(only if ScintByParticleType is true)")};
288  fhicl::OptionalAtom<double> PionScintYield{Name("PionScintYield"),
289  Comment("(only if ScintByParticleType is true)")};
290  fhicl::OptionalAtom<double> PionScintYieldRatio{
291  Name("PionScintYieldRatio"),
292  Comment("(only if ScintByParticleType is true)")};
293  fhicl::OptionalAtom<double> KaonScintYield{Name("KaonScintYield"),
294  Comment("(only if ScintByParticleType is true)")};
295  fhicl::OptionalAtom<double> KaonScintYieldRatio{
296  Name("KaonScintYieldRatio"),
297  Comment("(only if ScintByParticleType is true)")};
298  fhicl::OptionalAtom<double> ElectronScintYield{
299  Name("ElectronScintYield"),
300  Comment("(only if ScintByParticleType is true)")};
301  fhicl::OptionalAtom<double> ElectronScintYieldRatio{
302  Name("ElectronScintYieldRatio"),
303  Comment("(only if ScintByParticleType is true)")};
304  fhicl::OptionalAtom<double> AlphaScintYield{Name("AlphaScintYield"),
305  Comment("(only if ScintByParticleType is true)")};
306  fhicl::OptionalAtom<double> AlphaScintYieldRatio{
307  Name("AlphaScintYieldRatio"),
308  Comment("(only if ScintByParticleType is true)")};
309 #endif // DETECTORINFO_LARPROPERTIESSTANDARD_HASOPTIONALATOM?
310 
311  fhicl::Atom<bool> EnableCerenkovLight{Name("EnableCerenkovLight"), Comment("")};
312 
313  fhicl::Sequence<std::string> ReflectiveSurfaceNames{Name("ReflectiveSurfaceNames"),
314  Comment("")};
315  fhicl::Sequence<double> ReflectiveSurfaceEnergies{Name("ReflectiveSurfaceEnergies"),
316  Comment("")};
317  fhicl::Sequence<fhicl::Sequence<double>> ReflectiveSurfaceReflectances{
318  Name("ReflectiveSurfaceReflectances"),
319  Comment("")};
320  fhicl::Sequence<fhicl::Sequence<double>> ReflectiveSurfaceDiffuseFractions{
321  Name("ReflectiveSurfaceDiffuseFractions"),
322  Comment("")};
323 
324  }; // Configuration_t
325 
326 #if !DETECTORINFO_LARPROPERTIESSTANDARD_HASOPTIONALATOM
327  struct ConfigWithScintByType_t : public Configuration_t {
329 
330  fhicl::Atom<double> ProtonScintYield{Name("ProtonScintYield"),
331  Comment("(only if ScintByParticleType is true)")};
332  fhicl::Atom<double> ProtonScintYieldRatio{Name("ProtonScintYieldRatio"),
333  Comment("(only if ScintByParticleType is true)")};
334  fhicl::Atom<double> MuonScintYield{Name("MuonScintYield"),
335  Comment("(only if ScintByParticleType is true)")};
336  fhicl::Atom<double> MuonScintYieldRatio{Name("MuonScintYieldRatio"),
337  Comment("(only if ScintByParticleType is true)")};
338  fhicl::Atom<double> PionScintYield{Name("PionScintYield"),
339  Comment("(only if ScintByParticleType is true)")};
340  fhicl::Atom<double> PionScintYieldRatio{Name("PionScintYieldRatio"),
341  Comment("(only if ScintByParticleType is true)")};
342  fhicl::Atom<double> KaonScintYield{Name("KaonScintYield"),
343  Comment("(only if ScintByParticleType is true)")};
344  fhicl::Atom<double> KaonScintYieldRatio{Name("KaonScintYieldRatio"),
345  Comment("(only if ScintByParticleType is true)")};
346  fhicl::Atom<double> ElectronScintYield{Name("ElectronScintYield"),
347  Comment("(only if ScintByParticleType is true)")};
348  fhicl::Atom<double> ElectronScintYieldRatio{Name("ElectronScintYieldRatio"),
349  Comment("(only if ScintByParticleType is true)")};
350  fhicl::Atom<double> AlphaScintYield{Name("AlphaScintYield"),
351  Comment("(only if ScintByParticleType is true)")};
352  fhicl::Atom<double> AlphaScintYieldRatio{Name("AlphaScintYieldRatio"),
353  Comment("(only if ScintByParticleType is true)")};
354 
355  }; // ConfigWithScintByType_t
356 #endif // !DETECTORINFO_LARPROPERTIESSTANDARD_HASOPTIONALATOM?
357 
359 
362 
363  // Following parameters are for use in Bethe-Bloch formula for dE/dx.
364 
365  double fZ;
366  double fA;
367  double fI;
368 
369  // Optical parameters for LAr
370 
371  std::vector<double> fFastScintSpectrum;
372  std::vector<double> fFastScintEnergies;
373  std::vector<double> fSlowScintSpectrum;
374  std::vector<double> fSlowScintEnergies;
375  std::vector<double> fRIndexSpectrum;
376  std::vector<double> fRIndexEnergies;
377  std::vector<double> fAbsLengthSpectrum;
378  std::vector<double> fAbsLengthEnergies;
379  std::vector<double> fRayleighSpectrum;
380  std::vector<double> fRayleighEnergies;
381 
383 
396 
397  double fScintYield;
404 
406 
407  std::vector<std::string> fReflectiveSurfaceNames;
408  std::vector<double> fReflectiveSurfaceEnergies;
409  std::vector<std::vector<double>> fReflectiveSurfaceReflectances;
410  std::vector<std::vector<double>> fReflectiveSurfaceDiffuseFractions;
411 
414  std::vector<double> fTpbEmmisionEnergies;
415  std::vector<double> fTpbEmmisionSpectrum;
416  std::vector<double> fTpbAbsorptionEnergies;
417  std::vector<double> fTpbAbsorptionSpectrum;
418 
419  /*
420  struct DBsettingsClass {
421  DBsettingsClass();
422 
423  bool ToughErrorTreatment; ///< equivalent parameter in DatabaseUtil
424  bool ShouldConnect; ///< equivalent parameter in DatabaseUtil
425  }; // DBsettingsClass
426 
427  DBsettingsClass DBsettings; ///< settings read from DB access
428  */
429 
430  public:
431  // expose the configuration object for framework service
432 #if DETECTORINFO_LARPROPERTIESSTANDARD_HASOPTIONALATOM
434 #else // !DETECTORINFO_LARPROPERTIESSTANDARD_HASOPTIONALATOM?
436 #endif // !DETECTORINFO_LARPROPERTIESSTANDARD_HASOPTIONALATOM?
437 
438  }; // class LArPropertiesStandard
439 } //namespace detinfo
440 #endif // LARPROPERTIES_H
TRandom r
Definition: spectrum.C:23
std::vector< double > fTpbEmmisionSpectrum
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 double Argon39DecayRate() const override
virtual double MuonScintYieldRatio() const override
std::vector< double > fTpbAbsorptionSpectrum
Float_t y
Definition: compare.C:6
virtual double ExcitationEnergy() const override
Ar mean excitation energy (eV)
Double_t z
Definition: plot.C:276
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 double MuonScintYield(bool prescale=false) const override
virtual double AlphaScintYieldRatio() const override
virtual double PionScintYieldRatio() const override
bool Update(detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, PFPStruct &pfp)
Definition: PFPUtils.cxx:1055
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:289
virtual double AlphaScintYield(bool prescale=false) const override
std::vector< std::string > fReflectiveSurfaceNames
virtual double ScintResolutionScale() const override
parameter set interface
structure with all configuration parameters
void SetReflectiveSurfaceEnergies(std::vector< double > e)
std::vector< double > fFastScintSpectrum
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 SetReflectiveSurfaceDiffuseFractions(std::vector< std::vector< double >> f)
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 SetTpbAbsorptionSpectrum(std::vector< double > s)
std::vector< std::vector< double > > fReflectiveSurfaceReflectances
double fI
Ar mean excitation energy (eV)
void SetReflectiveSurfaceReflectances(std::vector< std::vector< double >> r)
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
std::vector< double > fTpbAbsorptionEnergies
Char_t n[5]
virtual double ScintBirksConstant() const override
std::vector< double > fRayleighEnergies
virtual bool ExtraMatProperties() const override
Float_t e
Definition: plot.C:35
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
void SetRayleighEnergies(std::vector< double > s)