All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OpDigiProperties.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // \file OpDigiProperties.h
3 //
4 // \brief service containing information about optical digitization
5 //
6 // \author bjpjones@mit.edu
7 // \author kazuhiro@nevis.columbia.edu
8 //
9 ////////////////////////////////////////////////////////////////////////
10 
11 #ifndef OPDET_OPDIGIPROPERTIES_H
12 #define OPDET_OPDIGIPROPERTIES_H
13 
14 // LArSoft includes
17 
18 // ART includes
19 namespace fhicl { class ParameterSet; }
20 #include "art/Framework/Services/Registry/ServiceHandle.h"
21 
22 // ROOT includes
23 class TF1;
24 
25 #include <string>
26 #include <vector>
27 
28 namespace opdet
29 {
31  public:
32 
33  OpDigiProperties(fhicl::ParameterSet const& pset);
34 
35  /// Returns sample frequency in MHz
36  double SampleFreq() const noexcept { return fSampleFreq; }
37  /// Returns window start time in us ... with respect to MC photon T0
38  double TimeBegin() const noexcept { return fTimeBegin; }
39  /// Returns window end time in us ... with respect to MC photon T0
40  double TimeEnd() const noexcept { return fTimeEnd; }
41 
42  /**
43  DEPRECATED as far as Kazu is concerned for UBooNE PMT simulation.
44  Any comment? --Kazu 08/05/2013
45  */
46  std::vector<double> WaveformInit(std::string WaveformFile);
47 
48  /**
49  Convert the given time into time-slice number.
50  Input time should be in ns unit and measurd w.r.t. MC photon T0
51  */
52  optdata::TimeSlice_t GetTimeSlice(double time_ns);
53 
54  /// Returns quantum efficiency
55  double QE() const noexcept { return fQE; }
56  /// Returns rate of dark noise
57  double DarkRate() const noexcept { return fDarkRate; }
58  /// Returns rate of pedestal fluctuation
59  double PedFlucRate() const noexcept { return fPedFlucRate; }
60  /// Returns amplitude of pedestal fluctuation
62  /// Returns the saturation scale of the electronics
64  /// Returns the ADCBaseline set mean value
66  /// Returns WF time constant used in analytical model
67  double WFTimeConstant() const noexcept { return fWFTimeConstant; }
68  /// Returns WF power factor used in analytical model
69  double WFPowerFactor() const noexcept { return fWFPowerFactor; }
70  /// Returns set mean gain value for LOW gain
71  double LowGainMean () const noexcept { return fLowGainMean; }
72  /// Returns set mean gain value for HIGH gain
73  double HighGainMean () const noexcept { return fHighGainMean; }
74  /// Returns generated LOW gain value for input channel (PMT-to-PMT spread applied)
75  double LowGainMean (optdata::Channel_t ch) const;
76  /// Returns generated HIGH gain value for input channel (PMT-to-PMT spread applied)
77  double HighGainMean (optdata::Channel_t ch) const;
78 
79  /// Returns set value for intrinsic gain spread (common to HIGH and LOW)
80  double GainSpread () const noexcept { return fGainSpread; }
81  /// Returns set value for PMT-to-PMT gain spread
82  double GainSpread_PMT2PMT() const noexcept { return fGainSpread_PMT2PMT; }
83  /// Generate & return LOW gain value for an input channel using mean & spread for this channel
84  double LowGain(optdata::Channel_t ch) const;
85  /// Generate & return HIGH gain value for an input channel using mean & spread for this channel
86  double HighGain(optdata::Channel_t ch) const;
87 
88  /// Returns a vector of double which represents a binned SPE waveform
89  std::vector<double> const& SinglePEWaveform() const noexcept { return fWaveform; }
90  /// Returns an array of HIGH gain
91  std::vector<double> const& HighGainArray() const noexcept { return fHighGainArray; }
92  /// Returns an array of LOW gain
93  std::vector<double> const& LowGainArray() const noexcept { return fLowGainArray; }
94  /// Returns an array of gain spread
95  std::vector<double> const& GainSpreadArray() const noexcept { return fGainSpreadArray; }
96  /// Returns an array of generated pedestal mean value per channel
97  std::vector<optdata::ADC_Count_t> const& PedMeanArray() const noexcept {return fPedMeanArray;}
98 
99  /// Utility function ... To be verified (Kazu 08/05/13)
100  double GetSPEArea();
101  /// Utility function ... To be verified (Kazu 08/05/13)
102  double GetSPECumulativeArea();
103  /// Utility function ... To be verified (Kazu 08/05/13)
104  double GetSPEAmplitude();
105  /// Utility function ... To be verified (Kazu 08/05/13)
106  double GetSPECumulativeAmplitude();
107 
108  private:
109 
110  double fSampleFreq;
111  double fTimeBegin;
112  double fTimeEnd;
113  double fPERescale;
114 
115  std::vector<double> GenEmpiricalWF(std::string WaveformFile);
116  std::vector<double> GenAnalyticalWF();
117  void GenerateWaveform();
118  void FillGainArray();
119  void FillPedMeanArray();
120 
123  double fQE;
124  double fPedFlucRate;
126  double fDarkRate;
130  double fLowGainMean;
135  double fWFLength;
136  double fGainSpread;
139 
140  std::string fHighGainFile;
141  std::string fLowGainFile;
142  std::string fWaveformFile;
143  std::string fGainSpreadFile;
144  std::vector<double> fWaveform;
146  std::vector<double> fLowGainArray;
147  std::vector<double> fHighGainArray;
148  std::vector<double> fGainSpreadArray;
149  std::vector<optdata::ADC_Count_t> fPedMeanArray;
150  art::ServiceHandle<geo::Geometry const> fGeometry;
151 
152  }; // class OpDigiProperties
153 
154 } //namespace opdet
155 
156 DECLARE_ART_SERVICE(opdet::OpDigiProperties, LEGACY)
157 
158 #endif
std::vector< double > fHighGainArray
double WFTimeConstant() const noexcept
Returns WF time constant used in analytical model.
art::ServiceHandle< geo::Geometry const > fGeometry
OpDigiProperties(fhicl::ParameterSet const &pset)
double DarkRate() const noexcept
Returns rate of dark noise.
std::vector< double > const & GainSpreadArray() const noexcept
Returns an array of gain spread.
double PedFlucRate() const noexcept
Returns rate of pedestal fluctuation.
std::vector< double > const & LowGainArray() const noexcept
Returns an array of LOW gain.
std::vector< double > GenAnalyticalWF()
double GetSPEAmplitude()
Utility function ... To be verified (Kazu 08/05/13)
double QE() const noexcept
Returns quantum efficiency.
std::vector< double > fLowGainArray
double WFPowerFactor() const noexcept
Returns WF power factor used in analytical model.
double GetSPECumulativeArea()
Utility function ... To be verified (Kazu 08/05/13)
uint16_t ADC_Count_t
Definition: OpticalTypes.h:16
std::vector< double > WaveformInit(std::string WaveformFile)
optdata::ADC_Count_t ADCBaseline() const noexcept
Returns the ADCBaseline set mean value.
double GetSPECumulativeAmplitude()
Utility function ... To be verified (Kazu 08/05/13)
double SampleFreq() const noexcept
Returns sample frequency in MHz.
std::vector< double > GenEmpiricalWF(std::string WaveformFile)
std::vector< optdata::ADC_Count_t > const & PedMeanArray() const noexcept
Returns an array of generated pedestal mean value per channel.
std::vector< double > fWaveform
double TimeBegin() const noexcept
Returns window start time in us ... with respect to MC photon T0.
optdata::ADC_Count_t fPedFlucAmp
double HighGainMean() const noexcept
Returns set mean gain value for HIGH gain.
std::vector< double > const & HighGainArray() const noexcept
Returns an array of HIGH gain.
double TimeEnd() const noexcept
Returns window end time in us ... with respect to MC photon T0.
unsigned int TimeSlice_t
Definition: OpticalTypes.h:20
double LowGain(optdata::Channel_t ch) const
Generate &amp; return LOW gain value for an input channel using mean &amp; spread for this channel...
double HighGain(optdata::Channel_t ch) const
Generate &amp; return HIGH gain value for an input channel using mean &amp; spread for this channel...
double GainSpread() const noexcept
Returns set value for intrinsic gain spread (common to HIGH and LOW)
optdata::ADC_Count_t SaturationScale() const noexcept
Returns the saturation scale of the electronics.
std::vector< optdata::ADC_Count_t > fPedMeanArray
optdata::TimeSlice_t GetTimeSlice(double time_ns)
std::vector< double > fGainSpreadArray
optdata::ADC_Count_t fADCBaseline
double GetSPEArea()
Utility function ... To be verified (Kazu 08/05/13)
double LowGainMean() const noexcept
Returns set mean gain value for LOW gain.
unsigned int Channel_t
Definition: OpticalTypes.h:19
double GainSpread_PMT2PMT() const noexcept
Returns set value for PMT-to-PMT gain spread.
std::vector< double > const & SinglePEWaveform() const noexcept
Returns a vector of double which represents a binned SPE waveform.
optdata::ADC_Count_t PedFlucAmp() const noexcept
Returns amplitude of pedestal fluctuation.
art framework interface to geometry description
optdata::ADC_Count_t fSaturationScale