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 #include "fhiclcpp/ParameterSet.h"
21 
22 // ROOT includes
23 #include "TF1.h"
24 
25 namespace opdet
26 {
28  public:
29 
31 
32  /// Returns sample frequency in MHz
33  double SampleFreq() const noexcept { return fSampleFreq; }
34  /// Returns window start time in us ... with respect to MC photon T0
35  double TimeBegin() const noexcept { return fTimeBegin; }
36  /// Returns window end time in us ... with respect to MC photon T0
37  double TimeEnd() const noexcept { return fTimeEnd; }
38 
39  /**
40  DEPRECATED as far as Kazu is concerned for UBooNE PMT simulation.
41  Any comment? --Kazu 08/05/2013
42  */
43  std::vector<double> WaveformInit(std::string WaveformFile);
44 
45  /**
46  Convert the given time into time-slice number.
47  Input time should be in ns unit and measurd w.r.t. MC photon T0
48  */
49  optdata::TimeSlice_t GetTimeSlice(double time_ns);
50 
51  /// Returns quantum efficiency
52  double QE() const noexcept { return fQE; }
53  /// Returns rate of dark noise
54  double DarkRate() const noexcept { return fDarkRate; }
55  /// Returns rate of pedestal fluctuation
56  double PedFlucRate() const noexcept { return fPedFlucRate; }
57  /// Returns amplitude of pedestal fluctuation
59  /// Returns the saturation scale of the electronics
61  /// Returns the ADCBaseline set mean value
63  /// Returns WF time constant used in analytical model
64  double WFTimeConstant() const noexcept { return fWFTimeConstant; }
65  /// Returns WF power factor used in analytical model
66  double WFPowerFactor() const noexcept { return fWFPowerFactor; }
67  /// Returns set mean gain value for LOW gain
68  double LowGainMean () const noexcept { return fLowGainMean; }
69  /// Returns set mean gain value for HIGH gain
70  double HighGainMean () const noexcept { return fHighGainMean; }
71  /// Returns generated LOW gain value for input channel (PMT-to-PMT spread applied)
72  double LowGainMean (optdata::Channel_t ch) const;
73  /// Returns generated HIGH gain value for input channel (PMT-to-PMT spread applied)
74  double HighGainMean (optdata::Channel_t ch) const;
75 
76  /// Returns set value for intrinsic gain spread (common to HIGH and LOW)
77  double GainSpread () const noexcept { return fGainSpread; }
78  /// Returns set value for PMT-to-PMT gain spread
79  double GainSpread_PMT2PMT() const noexcept { return fGainSpread_PMT2PMT; }
80  /// Generate & return LOW gain value for an input channel using mean & spread for this channel
81  double LowGain(optdata::Channel_t ch) const;
82  /// Generate & return HIGH gain value for an input channel using mean & spread for this channel
83  double HighGain(optdata::Channel_t ch) const;
84 
85  /// Returns a vector of double which represents a binned SPE waveform
86  std::vector<double> const& SinglePEWaveform() const noexcept { return fWaveform; }
87  /// Returns an array of HIGH gain
88  std::vector<double> const& HighGainArray() const noexcept { return fHighGainArray; }
89  /// Returns an array of LOW gain
90  std::vector<double> const& LowGainArray() const noexcept { return fLowGainArray; }
91  /// Returns an array of gain spread
92  std::vector<double> const& GainSpreadArray() const noexcept { return fGainSpreadArray; }
93  /// Returns an array of generated pedestal mean value per channel
94  std::vector<optdata::ADC_Count_t> const& PedMeanArray() const noexcept {return fPedMeanArray;}
95 
96  /// Utility function ... To be verified (Kazu 08/05/13)
97  double GetSPEArea();
98  /// Utility function ... To be verified (Kazu 08/05/13)
99  double GetSPECumulativeArea();
100  /// Utility function ... To be verified (Kazu 08/05/13)
101  double GetSPEAmplitude();
102  /// Utility function ... To be verified (Kazu 08/05/13)
103  double GetSPECumulativeAmplitude();
104 
105  private:
106 
107  double fSampleFreq;
108  double fTimeBegin;
109  double fTimeEnd;
110  double fPERescale;
111 
112  std::vector<double> GenEmpiricalWF(std::string WaveformFile);
113  std::vector<double> GenAnalyticalWF();
114  void GenerateWaveform();
115  void FillGainArray();
116  void FillPedMeanArray();
117 
120  double fQE;
121  double fPedFlucRate;
123  double fDarkRate;
127  double fLowGainMean;
132  double fWFLength;
133  double fGainSpread;
136 
141  std::vector<double> fWaveform;
143  std::vector<double> fLowGainArray;
144  std::vector<double> fHighGainArray;
145  std::vector<double> fGainSpreadArray;
146  std::vector<optdata::ADC_Count_t> fPedMeanArray;
148 
149  }; // class OpDigiProperties
150 
151 } //namespace opdet
152 
154 
155 #endif
std::vector< double > const & GainSpreadArray() const noexcept
Returns an array of gain spread.
double TimeEnd() const noexcept
Returns window end time in us ... with respect to MC photon T0.
std::vector< double > fHighGainArray
art::ServiceHandle< geo::Geometry const > fGeometry
OpDigiProperties(fhicl::ParameterSet const &pset)
double DarkRate() const noexcept
Returns rate of dark noise.
std::string string
Definition: nybbler.cc:12
std::vector< double > GenAnalyticalWF()
double GetSPEAmplitude()
Utility function ... To be verified (Kazu 08/05/13)
std::vector< double > fLowGainArray
double LowGainMean() const noexcept
Returns set mean gain value for LOW gain.
art framework interface to geometry description
double GetSPECumulativeArea()
Utility function ... To be verified (Kazu 08/05/13)
double GainSpread() const noexcept
Returns set value for intrinsic gain spread (common to HIGH and LOW)
uint16_t ADC_Count_t
Definition: OpticalTypes.h:16
double SampleFreq() const noexcept
Returns sample frequency in MHz.
std::vector< double > WaveformInit(std::string WaveformFile)
double QE() const noexcept
Returns quantum efficiency.
double GetSPECumulativeAmplitude()
Utility function ... To be verified (Kazu 08/05/13)
std::vector< optdata::ADC_Count_t > const & PedMeanArray() const noexcept
Returns an array of generated pedestal mean value per channel.
std::vector< double > GenEmpiricalWF(std::string WaveformFile)
#define DECLARE_ART_SERVICE(svc, scope)
std::vector< double > const & HighGainArray() const noexcept
Returns an array of HIGH gain.
std::vector< double > const & LowGainArray() const noexcept
Returns an array of LOW gain.
std::vector< double > fWaveform
std::vector< double > const & SinglePEWaveform() const noexcept
Returns a vector of double which represents a binned SPE waveform.
double PedFlucRate() const noexcept
Returns rate of pedestal fluctuation.
optdata::ADC_Count_t ADCBaseline() const noexcept
Returns the ADCBaseline set mean value.
optdata::ADC_Count_t fPedFlucAmp
double WFPowerFactor() const noexcept
Returns WF power factor used in analytical model.
double TimeBegin() const noexcept
Returns window start 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 & return LOW gain value for an input channel using mean & spread for this channel...
double HighGain(optdata::Channel_t ch) const
Generate & return HIGH gain value for an input channel using mean & spread for this channel...
optdata::ADC_Count_t PedFlucAmp() const noexcept
Returns amplitude of pedestal fluctuation.
std::vector< optdata::ADC_Count_t > fPedMeanArray
optdata::ADC_Count_t SaturationScale() const noexcept
Returns the saturation scale of the electronics.
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 GainSpread_PMT2PMT() const noexcept
Returns set value for PMT-to-PMT gain spread.
unsigned int Channel_t
Definition: OpticalTypes.h:19
double WFTimeConstant() const noexcept
Returns WF time constant used in analytical model.
optdata::ADC_Count_t fSaturationScale
double HighGainMean() const noexcept
Returns set mean gain value for HIGH gain.