ECALPropertiesStandard.h
Go to the documentation of this file.
1 /**
2  * @file ECALPropertiesStandard.h
3  * @brief Service provider with utility ECAL functions
4  * @see ECALPropertiesStandard.cxx LArPropertiesStandardTestHelpers.h
5  *
6  * The provider detinfo::LArProperiesStandard supports simple setup for testing
7  * environment, by including in your test:
8  *
9  * #include "DetectorInfo/LArPropertiesStandardTestHelpers.h"
10  *
11  */
12 
13 #ifndef DETECTORINFO_ECALPROPERTIESSTANDARD_H
14 #define DETECTORINFO_ECALPROPERTIESSTANDARD_H
15 
16 
17 // GArSoft libraries
19 
20 // FHiCL libraries
21 #include "fhiclcpp/ParameterSet.h"
22 #include "fhiclcpp/types/Atom.h"
24 #include "fhiclcpp/types/Table.h"
25 
26 // C/C++ standard libraries
27 #include <string>
28 #include <vector>
29 #include <map>
30 #include <set>
31 
32 
33 namespace gar {
34  namespace detinfo {
35  /**
36  * @brief Properties related to liquid argon environment in the detector
37  *
38  * This class can access databases via DatabaseUtil service.
39  *
40  * @note Some of the database connection properties are established before
41  * the beginning of the job and if they change this service will not be
42  * aware of it. These properties petrain, so far, only the connection mode
43  * and not any content of the databases themselves.
44  * @note 2: the database connection features for this base class have been removed
45  */
47  public:
49  explicit ECALPropertiesStandard(fhicl::ParameterSet const& pset,
50  std::set<std::string> ignore_params = {});
52  virtual ~ECALPropertiesStandard() = default;
53 
54  /**
55  * @brief Configures the provider
56  * @param p configuration parameter set
57  * @param ignore_params parameters to be ignored (optional)
58  *
59  * This method will validate the parameter set (except for the parameters
60  * it's explicitly told to ignore) and extract the useful information out
61  * of it.
62  */
63  bool Configure(fhicl::ParameterSet const& pset,
64  std::set<std::string> ignore_params = {});
65  bool Update(uint64_t ts=0);
66 
67  /// SiPM Number of effective pixels (px)
68  virtual double EffectivePixel() const override { return fNeffPx; } ///< g/cm^2
69 
70  /// Light yield of the tile (px/MIP)
71  virtual double LightYield() const override { return fLY; }
72 
73  /// SiPM Gain (ADC/px)
74  virtual double SiPMGain() const override { return fGain; }
75 
76  /// Birks constant (mm/MeV)
77  virtual double ScintBirksConstant() const override { return fBirks; }
78 
79  /// Intercalibration factor
80  virtual double IntercalibrationFactor() const override { return fInterCalib; }
81 
82  //ADC saturation value
83  virtual double ADCSaturation() const override { return fADCSaturation; }
84 
85  //Time resolution of the ECAL in ns
86  virtual double TimeResolution() const override { return fTimeResolution; }
87 
88  //MeV to MIP factor for 5 mm scintillator
89  virtual double MeVtoMIP() const override { return fMeVtoMIP; }
90 
91  //Noise in px
92  virtual double NoisePx() const override { return fNoisepx; }
93 
94  void SetEffectivePixel (double effpx) { fNeffPx = effpx; }
95  void SetLightYield (double ly ) { fLY = ly; }
96  void SetSiPMGain (double gain ) { fGain = gain; }
97  void SetScintBirksConstant (double birks) { fBirks = birks; }
98  void SetIntercalibrationFactor (double intercalib) { fInterCalib = intercalib; }
99  void SetADCSaturation (double adcsaturation) { fADCSaturation = adcsaturation; }
100  void SetTimeResolution (double timeresolution) { fTimeResolution = timeresolution; }
101  void SetMeVtoMIP (double mevtomip) { fMeVtoMIP = mevtomip; }
102  void SetNoisePx (double noisepx) { fNoisepx = noisepx; }
103 
104  private:
105  protected:
106 
107  /// structure with all configuration parameters
109  using Name = fhicl::Name;
111 
112  fhicl::Atom<double> EffectivePixel { Name("EffectivePixel" ), Comment("SiPM Number of effective pixels (px)") };
113  fhicl::Atom<double> LightYield { Name("LightYield" ), Comment("Light yield of the tile (px/MIP)") };
114  fhicl::Atom<double> SiPMGain { Name("SiPMGain" ), Comment("SiPM Gain (ADC/px)") };
115  fhicl::Atom<double> ScintBirksConstant { Name("ScintBirksConstant"), Comment("ScintBirksConstant (mm/MeV)") };
116  fhicl::Atom<double> IntercalibrationFactor { Name("InterCalibFactor"), Comment("InterCalibFactor") };
117  fhicl::Atom<double> ADCSaturation { Name("ADCSaturation"), Comment("ADCSaturation") };
118  fhicl::Atom<double> TimeResolution { Name("TimeResolution"), Comment("TimeResolution") };
119  fhicl::Atom<double> MeVtoMIP { Name("MeVtoMIP"), Comment("MeVtoMIP") };
120  fhicl::Atom<double> NoisePx { Name("Noisepx"), Comment("Noise in px") };
121 
122  }; // Configuration_t
123 
124 
126 
127  double fNeffPx; ///< px
128  double fLY; ///< px/MIP
129  double fGain; ///< ADC/px
130  double fBirks; ///< mm/MeV
131  double fInterCalib;
132  double fADCSaturation; ///< 12-bits
133  double fTimeResolution; ///< in ns
134  double fMeVtoMIP; ///< in MeV / MIP
135  double fNoisepx; ///< noise in px
136 
137  public:
138  // expose the configuration object for framework service
140 
141  }; // class ECALPropertiesStandard
142  } //namespace detinfo
143 } // gar
144 #endif // DETECTORINFO_ECALPROPERTIESSTANDARD_H
virtual double MeVtoMIP() const override
virtual double LightYield() const override
Light yield of the tile (px/MIP)
Properties related to liquid argon environment in the detector.
virtual double EffectivePixel() const override
SiPM Number of effective pixels (px)
ChannelGroupService::Name Name
virtual ~ECALPropertiesStandard()=default
virtual double NoisePx() const override
void SetADCSaturation(double adcsaturation)
virtual double ADCSaturation() const override
virtual double SiPMGain() const override
SiPM Gain (ADC/px)
General LArSoft Utilities.
void SetIntercalibrationFactor(double intercalib)
virtual double IntercalibrationFactor() const override
Intercalibration factor.
General GArSoft Utilities.
bool Configure(fhicl::ParameterSet const &pset, std::set< std::string > ignore_params={})
Configures the provider.
#define Comment
virtual double TimeResolution() const override
structure with all configuration parameters
void SetTimeResolution(double timeresolution)
virtual double ScintBirksConstant() const override
Birks constant (mm/MeV)