LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
opdet::OpDigiProperties Class Reference

#include "OpDigiProperties.h"

Public Member Functions

 OpDigiProperties (fhicl::ParameterSet const &pset)
 
double SampleFreq () const noexcept
 Returns sample frequency in MHz. More...
 
double TimeBegin () const noexcept
 Returns window start time in us ... with respect to MC photon T0. More...
 
double TimeEnd () const noexcept
 Returns window end time in us ... with respect to MC photon T0. More...
 
std::vector< double > WaveformInit (std::string WaveformFile)
 
optdata::TimeSlice_t GetTimeSlice (double time_ns)
 
double QE () const noexcept
 Returns quantum efficiency. More...
 
double DarkRate () const noexcept
 Returns rate of dark noise. More...
 
double PedFlucRate () const noexcept
 Returns rate of pedestal fluctuation. More...
 
optdata::ADC_Count_t PedFlucAmp () const noexcept
 Returns amplitude of pedestal fluctuation. More...
 
optdata::ADC_Count_t SaturationScale () const noexcept
 Returns the saturation scale of the electronics. More...
 
optdata::ADC_Count_t ADCBaseline () const noexcept
 Returns the ADCBaseline set mean value. More...
 
double WFTimeConstant () const noexcept
 Returns WF time constant used in analytical model. More...
 
double WFPowerFactor () const noexcept
 Returns WF power factor used in analytical model. More...
 
double LowGainMean () const noexcept
 Returns set mean gain value for LOW gain. More...
 
double HighGainMean () const noexcept
 Returns set mean gain value for HIGH gain. More...
 
double LowGainMean (optdata::Channel_t ch) const
 Returns generated LOW gain value for input channel (PMT-to-PMT spread applied) More...
 
double HighGainMean (optdata::Channel_t ch) const
 Returns generated HIGH gain value for input channel (PMT-to-PMT spread applied) More...
 
double GainSpread () const noexcept
 Returns set value for intrinsic gain spread (common to HIGH and LOW) More...
 
double GainSpread_PMT2PMT () const noexcept
 Returns set value for PMT-to-PMT gain spread. More...
 
double LowGain (optdata::Channel_t ch) const
 Generate & return LOW gain value for an input channel using mean & spread for this channel. More...
 
double HighGain (optdata::Channel_t ch) const
 Generate & return HIGH gain value for an input channel using mean & spread for this channel. More...
 
std::vector< double > const & SinglePEWaveform () const noexcept
 Returns a vector of double which represents a binned SPE waveform. More...
 
std::vector< double > const & HighGainArray () const noexcept
 Returns an array of HIGH gain. More...
 
std::vector< double > const & LowGainArray () const noexcept
 Returns an array of LOW gain. More...
 
std::vector< double > const & GainSpreadArray () const noexcept
 Returns an array of gain spread. More...
 
std::vector< optdata::ADC_Count_t > const & PedMeanArray () const noexcept
 Returns an array of generated pedestal mean value per channel. More...
 
double GetSPEArea ()
 Utility function ... To be verified (Kazu 08/05/13) More...
 
double GetSPECumulativeArea ()
 Utility function ... To be verified (Kazu 08/05/13) More...
 
double GetSPEAmplitude ()
 Utility function ... To be verified (Kazu 08/05/13) More...
 
double GetSPECumulativeAmplitude ()
 Utility function ... To be verified (Kazu 08/05/13) More...
 

Private Member Functions

std::vector< double > GenEmpiricalWF (std::string WaveformFile)
 
std::vector< double > GenAnalyticalWF ()
 
void GenerateWaveform ()
 
void FillGainArray ()
 
void FillPedMeanArray ()
 

Private Attributes

double fSampleFreq
 
double fTimeBegin
 
double fTimeEnd
 
double fPERescale
 
bool fUseEmpiricalGain
 
bool fUseEmpiricalShape
 
double fQE
 
double fPedFlucRate
 
optdata::ADC_Count_t fPedFlucAmp
 
double fDarkRate
 
optdata::ADC_Count_t fSaturationScale
 
optdata::ADC_Count_t fADCBaseline
 
double fADCBaseSpread
 
double fLowGainMean
 
double fHighGainMean
 
double fVoltageAmpForSPE
 
double fWFTimeConstant
 
double fWFPowerFactor
 
double fWFLength
 
double fGainSpread
 
double fGainSpread_PMT2PMT
 
TF1 * fAnalyticalSPE
 
std::string fHighGainFile
 
std::string fLowGainFile
 
std::string fWaveformFile
 
std::string fGainSpreadFile
 
std::vector< double > fWaveform
 
bool fChargeNormalized
 
std::vector< double > fLowGainArray
 
std::vector< double > fHighGainArray
 
std::vector< double > fGainSpreadArray
 
std::vector< optdata::ADC_Count_tfPedMeanArray
 
art::ServiceHandle< geo::Geometry const > fGeometry
 

Detailed Description

Definition at line 31 of file OpDigiProperties.h.

Constructor & Destructor Documentation

opdet::OpDigiProperties::OpDigiProperties ( fhicl::ParameterSet const &  pset)

Definition at line 25 of file OpDigiProperties.cc.

References fADCBaseline, fADCBaseSpread, fChargeNormalized, fDarkRate, fGainSpread, fGainSpread_PMT2PMT, fGainSpreadFile, fGeometry, fHighGainArray, fHighGainFile, fHighGainMean, FillGainArray(), FillPedMeanArray(), fLowGainArray, fLowGainFile, fLowGainMean, fPedFlucAmp, fPedFlucRate, fPedMeanArray, fPERescale, fQE, fSampleFreq, fSaturationScale, fTimeBegin, fTimeEnd, fUseEmpiricalGain, fUseEmpiricalShape, fVoltageAmpForSPE, fWaveformFile, fWFLength, fWFPowerFactor, fWFTimeConstant, GenerateWaveform(), fhicl::ParameterSet::get(), and geo::GeometryCore::NOpChannels().

25  : fAnalyticalSPE(0)
26  {
27  fSampleFreq = p.get<double>("SampleFreq");
28  fTimeBegin = p.get<double>("TimeBegin");
29  fTimeEnd = p.get<double>("TimeEnd");
30  fWaveformFile = p.get<std::string>("WaveformFile");
31  fPERescale = p.get<double>("PERescale");
32 
33  // PMT properties
34  fQE = p.get<double>("QE");
35  fDarkRate = p.get<double>("DarkRate");
36  fSaturationScale = p.get<optdata::ADC_Count_t>("SaturationScale");
37 
38  // Shaper properties
39  fUseEmpiricalGain = p.get<bool>("UseEmpiricalGain");
40  fHighGainFile = p.get<std::string>("HighGainFile");
41  fLowGainFile = p.get<std::string>("LowGainFile");
42  fGainSpreadFile = p.get<std::string>("GainSpreadFile");
43 
44  fHighGainMean = p.get<double>("HighGainMean");
45  fLowGainMean = p.get<double>("LowGainMean");
46  fGainSpread = p.get<double>("GainSpread");
47  fGainSpread_PMT2PMT = p.get<double>("GainSpread_PMT2PMT");
48 
49  // Digitization ped fluc
50  fPedFlucRate = p.get<double>("PedFlucRate");
51  fPedFlucAmp = p.get<optdata::ADC_Count_t>("PedFlucAmp");
52  fADCBaseline = p.get<optdata::ADC_Count_t>("ADCBaseline");
53  fADCBaseSpread = p.get<double>("ADCBaseSpread");
54 
55  // WF related stuff
56  fUseEmpiricalShape = p.get<bool>("UseEmpiricalShape");
57  fWFLength = p.get<double>("WFLength");
58 
59  fWaveformFile = p.get<std::string>("WaveformFile");
60  fChargeNormalized = p.get<bool>("WaveformChargeNormalized", false);
61 
62  // Option 2: WF from analytical function
63  fWFPowerFactor = p.get<double>("WFPowerFactor");
64  fWFTimeConstant = p.get<double>("WFTimeConstant");
65  fVoltageAmpForSPE = p.get<double>("VoltageAmpForSPE");
66 
67  // Generate the SPE waveform (i.e. fWaveform)
69 
70  // Fill gain array
71  FillGainArray();
72 
73  // Fill baseline mean
75 
76  // Report
77  std::string msg(Form(
78  "%-10s ... %-10s ... %-10s ... %-10s\n", "Ch. Number", "Pedestal", "High Gain", "Low Gain"));
79  for (unsigned int i = 0; i < fGeometry->NOpChannels(); ++i) {
80  msg += Form("%-10d ... %-10d ... %-10g ... %-10g\n",
81  i,
82  fPedMeanArray[i],
83  fHighGainArray[i],
84  fLowGainArray[i]);
85  }
86  mf::LogInfo(__FUNCTION__) << msg.c_str();
87  }
std::vector< double > fHighGainArray
art::ServiceHandle< geo::Geometry const > fGeometry
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::vector< double > fLowGainArray
unsigned int NOpChannels() const
Number of electronics channels for all the optical detectors.
uint16_t ADC_Count_t
Definition: OpticalTypes.h:16
optdata::ADC_Count_t fPedFlucAmp
std::vector< optdata::ADC_Count_t > fPedMeanArray
optdata::ADC_Count_t fADCBaseline
optdata::ADC_Count_t fSaturationScale

Member Function Documentation

optdata::ADC_Count_t opdet::OpDigiProperties::ADCBaseline ( ) const
inlinenoexcept

Returns the ADCBaseline set mean value.

Definition at line 65 of file OpDigiProperties.h.

65 { return fADCBaseline; }
optdata::ADC_Count_t fADCBaseline
double opdet::OpDigiProperties::DarkRate ( ) const
inlinenoexcept

Returns rate of dark noise.

Definition at line 57 of file OpDigiProperties.h.

57 { return fDarkRate; }
void opdet::OpDigiProperties::FillGainArray ( )
private

Definition at line 198 of file OpDigiProperties.cc.

References fGainSpread, fGainSpread_PMT2PMT, fGainSpreadArray, fGainSpreadFile, fGeometry, fHighGainArray, fHighGainFile, fHighGainMean, fLowGainArray, fLowGainFile, fLowGainMean, fUseEmpiricalGain, and geo::GeometryCore::NOpChannels().

Referenced by OpDigiProperties().

199  {
200  if (fUseEmpiricalGain) {
201  // Fill fron user's text files.
202  mf::LogWarning("OpDigiProperties") << "Using empirical table of gain for each PMT...";
203  std::string FullPath;
204  cet::search_path sp("FW_SEARCH_PATH");
205 
206  if (!sp.find_file(fHighGainFile, FullPath))
207  throw cet::exception("OpDigiProperties")
208  << "Unable to find high gain spread file in " << sp.to_string() << "\n";
209 
210  mf::LogWarning("OpDigiProperties")
211  << "OpDigiProperties opening high gain spread file at " << FullPath.c_str();
212  std::ifstream HighGainFile(FullPath.c_str());
213  if (HighGainFile.is_open()) {
214  std::string line;
215  while (HighGainFile.good()) {
216  getline(HighGainFile, line);
217  fHighGainArray.push_back(strtod(line.c_str(), NULL));
218  }
219  }
220  else
221  throw cet::exception("OpDigiProperties") << "Unable to open file!\n";
222 
223  FullPath = "";
224  if (!sp.find_file(fLowGainFile, FullPath))
225  throw cet::exception("OpDigiProperties")
226  << "Unable to find low gain spread file in " << sp.to_string() << "\n";
227 
228  mf::LogWarning("OpDigiProperties")
229  << "OpDigiProperties opening low gain spread file at " << FullPath.c_str();
230  std::ifstream LowGainFile(FullPath.c_str());
231  if (LowGainFile.is_open()) {
232  std::string line;
233  while (LowGainFile.good()) {
234  getline(LowGainFile, line);
235  fLowGainArray.push_back(strtod(line.c_str(), NULL));
236  }
237  }
238  else
239  throw cet::exception("OpDigiProperties") << "Unable to open file!\n";
240 
241  FullPath = "";
242  if (!sp.find_file(fGainSpreadFile, FullPath))
243  throw cet::exception("OpDigiProperties")
244  << "Unable to find low gain spread file in " << sp.to_string() << "\n";
245 
246  mf::LogWarning("OpDigiProperties")
247  << "OpDigiProperties opening low gain spread file at " << FullPath.c_str();
248  std::ifstream GainSpreadFile(FullPath.c_str());
249  if (GainSpreadFile.is_open()) {
250  std::string line;
251  while (GainSpreadFile.good()) {
252  getline(GainSpreadFile, line);
253  fGainSpreadArray.push_back(strtod(line.c_str(), NULL));
254  }
255  }
256  else
257  throw cet::exception("OpDigiProperties") << "Unable to open file!\n";
258  }
259  else {
260  // Generate a set of gake gain mean & spread.
261  std::string txt;
262  txt += " Generating gain for each pmt.\n";
263  txt += Form(" High gain mean: %g ADC/p.e.\n", fHighGainMean);
264  txt += Form(" Low gain mean: %g ADC/p.e.\n", fLowGainMean);
265  txt += Form(" PMT-to-PMT gain spread : %g \n", fGainSpread_PMT2PMT);
266  txt += Form(" Intrinsic gain spread : %g \n", fGainSpread);
267  mf::LogWarning("OpDigiProperties") << txt.c_str();
268  for (unsigned int i = 0; i < fGeometry->NOpChannels(); ++i) {
269  fLowGainArray.push_back(
270  CLHEP::RandGauss::shoot(fLowGainMean, fLowGainMean * fGainSpread_PMT2PMT));
271  fHighGainArray.push_back(
272  CLHEP::RandGauss::shoot(fHighGainMean, fHighGainMean * fGainSpread_PMT2PMT));
273  fGainSpreadArray.push_back(fGainSpread);
274  }
275  }
276 
277  //
278  // Note:
279  // Check for # entries. These exceptions ensures we have enough # of elements.
280  // When a user access the elements by a channel number using LowGainMean(Channel_t ch) etc.,
281  // those functions do not check if the given channel number is valid or not to keep a high
282  // performance of the code. If there's an invalid memory access error in run-time, then
283  // it must mean the user provided an invalid channel number and not due to insufficient
284  // vector elements filled in this function.
285  //
286  if (fLowGainArray.size() < fGeometry->NOpChannels())
287  throw cet::exception("OpDigiProperties") << "Low gain missing for some channels!\n";
288  if (fHighGainArray.size() < fGeometry->NOpChannels())
289  throw cet::exception("OpDigiProperties") << "High gain missing for some channels!\n";
290  if (fGainSpreadArray.size() < fGeometry->NOpChannels())
291  throw cet::exception("OpDigiProperties") << "Gain spread missing for some channels!\n";
292  }
std::vector< double > fHighGainArray
art::ServiceHandle< geo::Geometry const > fGeometry
std::vector< double > fLowGainArray
unsigned int NOpChannels() const
Number of electronics channels for all the optical detectors.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::vector< double > fGainSpreadArray
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void opdet::OpDigiProperties::FillPedMeanArray ( )
private

Definition at line 190 of file OpDigiProperties.cc.

References fADCBaseline, fADCBaseSpread, fGeometry, fPedMeanArray, and geo::GeometryCore::NOpChannels().

Referenced by OpDigiProperties().

191  {
192  for (unsigned int i = 0; i < fGeometry->NOpChannels(); ++i)
194  CLHEP::RandGauss::shoot((double)fADCBaseline, fADCBaseSpread) + 0.5));
195  }
art::ServiceHandle< geo::Geometry const > fGeometry
unsigned int NOpChannels() const
Number of electronics channels for all the optical detectors.
uint16_t ADC_Count_t
Definition: OpticalTypes.h:16
std::vector< optdata::ADC_Count_t > fPedMeanArray
optdata::ADC_Count_t fADCBaseline
double opdet::OpDigiProperties::GainSpread ( ) const
inlinenoexcept

Returns set value for intrinsic gain spread (common to HIGH and LOW)

Definition at line 80 of file OpDigiProperties.h.

80 { return fGainSpread; }
double opdet::OpDigiProperties::GainSpread_PMT2PMT ( ) const
inlinenoexcept

Returns set value for PMT-to-PMT gain spread.

Definition at line 82 of file OpDigiProperties.h.

std::vector<double> const& opdet::OpDigiProperties::GainSpreadArray ( ) const
inlinenoexcept

Returns an array of gain spread.

Definition at line 95 of file OpDigiProperties.h.

95 { return fGainSpreadArray; }
std::vector< double > fGainSpreadArray
std::vector< double > opdet::OpDigiProperties::GenAnalyticalWF ( )
private

Definition at line 353 of file OpDigiProperties.cc.

References e, fAnalyticalSPE, fChargeNormalized, fSampleFreq, fVoltageAmpForSPE, fWFLength, fWFPowerFactor, and fWFTimeConstant.

Referenced by GenerateWaveform().

354  {
355  mf::LogWarning("OpDigiProperties")
356  << " OpDigiProperties using analytical function for WF generation.";
357  //
358  // Generate waveform from analytical form
359  //
360  if (!fAnalyticalSPE) { // Create analytical function if not yet created
361  fAnalyticalSPE = new TF1("_analyticalSPE",
362  "10^(22)*x^[1]*[0]*exp(-x/[2])/TMath::Factorial([1])",
363  0,
364  fWFLength * 2); // x is time in micro-seconds
365  fAnalyticalSPE->SetParameter(0, fVoltageAmpForSPE); // voltage amplitude for s.p.e.
366  fAnalyticalSPE->SetParameter(1, fWFPowerFactor); // power factor (no unit)
367  fAnalyticalSPE->SetParameter(2, fWFTimeConstant); // time constant in us
368  }
369  //
370  // Define a waveform vector
371  //
372  // Size of WF = time width [us] * frequency [MHz]
373  std::vector<double> PEWaveform(int(fWFLength * fSampleFreq), 0.0);
374  double SamplingDuration = 1. / fSampleFreq; // in micro seconds
375  double MaxAmp = 0;
376  double Charge = 0;
377  for (unsigned short i = 0; i < PEWaveform.size(); ++i) {
378  double Value = fAnalyticalSPE->Integral(i * SamplingDuration, (i + 1) * SamplingDuration) /
379  SamplingDuration;
380  PEWaveform[i] = Value;
381  if (PEWaveform[i] > MaxAmp) MaxAmp = PEWaveform[i];
382  Charge += Value;
383  }
384 
385  // rescale
386  if (MaxAmp <= 0) throw cet::exception("OpDigiProperties_module") << "Waveform amplitude <=0!\n";
387 
388  if (!fChargeNormalized) {
389  for (unsigned short i = 0; i < PEWaveform.size(); i++) {
390  PEWaveform[i] = PEWaveform[i] / MaxAmp;
391  if (PEWaveform[i] < 1.e-4) PEWaveform[i] = 0;
392  }
393  }
394  else
395  for (unsigned short i = 0; i < PEWaveform.size(); i++) {
396  PEWaveform[i] = PEWaveform[i] / Charge;
397  }
398 
399  return PEWaveform;
400  }
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
Float_t e
Definition: plot.C:35
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::vector< double > opdet::OpDigiProperties::GenEmpiricalWF ( std::string  WaveformFile)
private

Definition at line 311 of file OpDigiProperties.cc.

References fChargeNormalized, fSampleFreq, and fWFLength.

Referenced by GenerateWaveform().

312  {
313  // Read in waveform vector from text file
314  std::ifstream WaveformFile(fWaveformFile.c_str());
315  std::string line;
316 
317  mf::LogWarning("OpDigiProperties")
318  << "OpDigiProperties opening OpDet waveform at " << fWaveformFile.c_str();
319 
320  // Read in each line and place into waveform vector
321  std::vector<double> PEWaveform;
322  if (WaveformFile.is_open()) {
323  double MaxAmp = 0;
324  double Charge = 0;
325  int NSample = 0;
326  while (WaveformFile.good() && NSample < int(fWFLength * fSampleFreq)) {
327  getline(WaveformFile, line);
328  double Amp = strtod(line.c_str(), NULL);
329  PEWaveform.push_back(Amp);
330  if (Amp > MaxAmp) MaxAmp = Amp;
331  NSample++;
332  Charge += Amp;
333  }
334  // rescale
335  if (MaxAmp <= 0)
336  throw cet::exception("OpDigiProperties_module") << "Waveform amplitude <=0!\n";
337  if (!fChargeNormalized)
338  for (unsigned short i = 0; i < PEWaveform.size(); i++) {
339  PEWaveform[i] = PEWaveform[i] / MaxAmp;
340  }
341  else
342  for (unsigned short i = 0; i < PEWaveform.size(); i++) {
343  PEWaveform[i] = PEWaveform[i] / Charge;
344  }
345  }
346  else
347  throw cet::exception("No Waveform File") << "Unable to open file\n";
348 
349  WaveformFile.close();
350  return (PEWaveform);
351  }
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void opdet::OpDigiProperties::GenerateWaveform ( )
private

Definition at line 294 of file OpDigiProperties.cc.

References fUseEmpiricalShape, fWaveform, fWaveformFile, GenAnalyticalWF(), and GenEmpiricalWF().

Referenced by OpDigiProperties().

295  {
296  std::string FullPath;
297 
298  if (fUseEmpiricalShape) {
299  cet::search_path sp("FW_SEARCH_PATH");
300  if (!sp.find_file(fWaveformFile, FullPath))
301 
302  throw cet::exception("OpDigiProperties")
303  << "Unable to find PMT waveform file in " << sp.to_string() << "\n";
304 
305  fWaveform = GenEmpiricalWF(FullPath);
306  }
307  else
309  }
std::vector< double > GenAnalyticalWF()
std::vector< double > GenEmpiricalWF(std::string WaveformFile)
std::vector< double > fWaveform
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
double opdet::OpDigiProperties::GetSPEAmplitude ( )

Utility function ... To be verified (Kazu 08/05/13)

Definition at line 99 of file OpDigiProperties.cc.

References fWaveform.

100  {
101  double AmpSoFar = 0;
102  for (size_t i = 0; i != fWaveform.size(); ++i)
103  if (fWaveform.at(i) > AmpSoFar) AmpSoFar = fWaveform.at(i);
104  return AmpSoFar;
105  }
std::vector< double > fWaveform
double opdet::OpDigiProperties::GetSPEArea ( )

Utility function ... To be verified (Kazu 08/05/13)

Definition at line 90 of file OpDigiProperties.cc.

References fWaveform.

91  {
92  double SPEArea = 0;
93  for (size_t i = 0; i != fWaveform.size(); ++i)
94  SPEArea += fWaveform.at(i);
95  return SPEArea;
96  }
std::vector< double > fWaveform
double opdet::OpDigiProperties::GetSPECumulativeAmplitude ( )

Utility function ... To be verified (Kazu 08/05/13)

Definition at line 119 of file OpDigiProperties.cc.

References fWaveform.

120  {
121  double AmpSoFar = 0, Cumulative = 0;
122  for (size_t i = 0; i != fWaveform.size(); ++i) {
123  Cumulative += fWaveform.at(i);
124  if (Cumulative > AmpSoFar) AmpSoFar = Cumulative;
125  }
126  return AmpSoFar;
127  }
std::vector< double > fWaveform
double opdet::OpDigiProperties::GetSPECumulativeArea ( )

Utility function ... To be verified (Kazu 08/05/13)

Definition at line 108 of file OpDigiProperties.cc.

References fWaveform.

109  {
110  double Cumulative = 0, SPEArea = 0;
111  for (size_t i = 0; i != fWaveform.size(); ++i) {
112  Cumulative += fWaveform.at(i);
113  SPEArea += Cumulative;
114  }
115  return SPEArea;
116  }
std::vector< double > fWaveform
optdata::TimeSlice_t opdet::OpDigiProperties::GetTimeSlice ( double  time_ns)

Convert the given time into time-slice number. Input time should be in ns unit and measurd w.r.t. MC photon T0

Definition at line 152 of file OpDigiProperties.cc.

References fSampleFreq, fTimeBegin, and fTimeEnd.

153  {
154  if (time_ns / 1.e3 > (fTimeEnd - fTimeBegin))
155  return std::numeric_limits<optdata::TimeSlice_t>::max();
156 
157  else
158  return optdata::TimeSlice_t((time_ns / 1.e3 - fTimeBegin) * fSampleFreq);
159  }
unsigned int TimeSlice_t
Definition: OpticalTypes.h:20
double opdet::OpDigiProperties::HighGain ( optdata::Channel_t  ch) const

Generate & return HIGH gain value for an input channel using mean & spread for this channel.

Definition at line 147 of file OpDigiProperties.cc.

References fGainSpreadArray, and fHighGainArray.

148  {
149  return CLHEP::RandGauss::shoot(fHighGainArray[ch], fGainSpreadArray[ch] * fHighGainArray[ch]);
150  }
std::vector< double > fHighGainArray
std::vector< double > fGainSpreadArray
std::vector<double> const& opdet::OpDigiProperties::HighGainArray ( ) const
inlinenoexcept

Returns an array of HIGH gain.

Definition at line 91 of file OpDigiProperties.h.

91 { return fHighGainArray; }
std::vector< double > fHighGainArray
double opdet::OpDigiProperties::HighGainMean ( ) const
inlinenoexcept

Returns set mean gain value for HIGH gain.

Definition at line 73 of file OpDigiProperties.h.

73 { return fHighGainMean; }
double opdet::OpDigiProperties::HighGainMean ( optdata::Channel_t  ch) const

Returns generated HIGH gain value for input channel (PMT-to-PMT spread applied)

Definition at line 137 of file OpDigiProperties.cc.

References fHighGainArray.

138  {
139  return fHighGainArray[ch];
140  }
std::vector< double > fHighGainArray
double opdet::OpDigiProperties::LowGain ( optdata::Channel_t  ch) const

Generate & return LOW gain value for an input channel using mean & spread for this channel.

Definition at line 142 of file OpDigiProperties.cc.

References fGainSpreadArray, and fLowGainArray.

143  {
144  return CLHEP::RandGauss::shoot(fLowGainArray[ch], fGainSpreadArray[ch] * fLowGainArray[ch]);
145  }
std::vector< double > fLowGainArray
std::vector< double > fGainSpreadArray
std::vector<double> const& opdet::OpDigiProperties::LowGainArray ( ) const
inlinenoexcept

Returns an array of LOW gain.

Definition at line 93 of file OpDigiProperties.h.

93 { return fLowGainArray; }
std::vector< double > fLowGainArray
double opdet::OpDigiProperties::LowGainMean ( ) const
inlinenoexcept

Returns set mean gain value for LOW gain.

Definition at line 71 of file OpDigiProperties.h.

71 { return fLowGainMean; }
double opdet::OpDigiProperties::LowGainMean ( optdata::Channel_t  ch) const

Returns generated LOW gain value for input channel (PMT-to-PMT spread applied)

Definition at line 131 of file OpDigiProperties.cc.

References fLowGainArray.

132  {
133  return fLowGainArray[ch];
134  }
std::vector< double > fLowGainArray
optdata::ADC_Count_t opdet::OpDigiProperties::PedFlucAmp ( ) const
inlinenoexcept

Returns amplitude of pedestal fluctuation.

Definition at line 61 of file OpDigiProperties.h.

61 { return fPedFlucAmp; }
optdata::ADC_Count_t fPedFlucAmp
double opdet::OpDigiProperties::PedFlucRate ( ) const
inlinenoexcept

Returns rate of pedestal fluctuation.

Definition at line 59 of file OpDigiProperties.h.

59 { return fPedFlucRate; }
std::vector<optdata::ADC_Count_t> const& opdet::OpDigiProperties::PedMeanArray ( ) const
inlinenoexcept

Returns an array of generated pedestal mean value per channel.

Definition at line 97 of file OpDigiProperties.h.

97 { return fPedMeanArray; }
std::vector< optdata::ADC_Count_t > fPedMeanArray
double opdet::OpDigiProperties::QE ( ) const
inlinenoexcept
double opdet::OpDigiProperties::SampleFreq ( ) const
inlinenoexcept

Returns sample frequency in MHz.

Definition at line 36 of file OpDigiProperties.h.

36 { return fSampleFreq; }
optdata::ADC_Count_t opdet::OpDigiProperties::SaturationScale ( ) const
inlinenoexcept

Returns the saturation scale of the electronics.

Definition at line 63 of file OpDigiProperties.h.

63 { return fSaturationScale; }
optdata::ADC_Count_t fSaturationScale
std::vector<double> const& opdet::OpDigiProperties::SinglePEWaveform ( ) const
inlinenoexcept

Returns a vector of double which represents a binned SPE waveform.

Definition at line 89 of file OpDigiProperties.h.

89 { return fWaveform; }
std::vector< double > fWaveform
double opdet::OpDigiProperties::TimeBegin ( ) const
inlinenoexcept

Returns window start time in us ... with respect to MC photon T0.

Definition at line 38 of file OpDigiProperties.h.

38 { return fTimeBegin; }
double opdet::OpDigiProperties::TimeEnd ( ) const
inlinenoexcept

Returns window end time in us ... with respect to MC photon T0.

Definition at line 40 of file OpDigiProperties.h.

40 { return fTimeEnd; }
std::vector< double > opdet::OpDigiProperties::WaveformInit ( std::string  WaveformFile)

DEPRECATED as far as Kazu is concerned for UBooNE PMT simulation. Any comment? –Kazu 08/05/2013

Definition at line 165 of file OpDigiProperties.cc.

References fPERescale.

166  {
167  // Read in waveform vector from text file
168  std::ifstream WaveformFile(fWaveformFile.c_str());
169  std::string line;
170 
171  mf::LogInfo("OpDigiProperties")
172  << "OpDigiProperties opening OpDet waveform at " << fWaveformFile.c_str();
173 
174  // Read in each line and place into waveform vector
175  std::vector<double> PEWaveform;
176  if (WaveformFile.is_open()) {
177  while (WaveformFile.good()) {
178  getline(WaveformFile, line);
179  PEWaveform.push_back(fPERescale * strtod(line.c_str(), NULL));
180  }
181  }
182  else
183  throw cet::exception("OpDigiProperties") << "No Waveform File: Unable to open file\n";
184 
185  WaveformFile.close();
186  return (PEWaveform);
187  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
double opdet::OpDigiProperties::WFPowerFactor ( ) const
inlinenoexcept

Returns WF power factor used in analytical model.

Definition at line 69 of file OpDigiProperties.h.

69 { return fWFPowerFactor; }
double opdet::OpDigiProperties::WFTimeConstant ( ) const
inlinenoexcept

Returns WF time constant used in analytical model.

Definition at line 67 of file OpDigiProperties.h.

67 { return fWFTimeConstant; }

Member Data Documentation

optdata::ADC_Count_t opdet::OpDigiProperties::fADCBaseline
private

Definition at line 127 of file OpDigiProperties.h.

Referenced by FillPedMeanArray(), and OpDigiProperties().

double opdet::OpDigiProperties::fADCBaseSpread
private

Definition at line 128 of file OpDigiProperties.h.

Referenced by FillPedMeanArray(), and OpDigiProperties().

TF1* opdet::OpDigiProperties::fAnalyticalSPE
private

Definition at line 137 of file OpDigiProperties.h.

Referenced by GenAnalyticalWF().

bool opdet::OpDigiProperties::fChargeNormalized
private

Definition at line 144 of file OpDigiProperties.h.

Referenced by GenAnalyticalWF(), GenEmpiricalWF(), and OpDigiProperties().

double opdet::OpDigiProperties::fDarkRate
private

Definition at line 125 of file OpDigiProperties.h.

Referenced by OpDigiProperties().

double opdet::OpDigiProperties::fGainSpread
private

Definition at line 135 of file OpDigiProperties.h.

Referenced by FillGainArray(), and OpDigiProperties().

double opdet::OpDigiProperties::fGainSpread_PMT2PMT
private

Definition at line 136 of file OpDigiProperties.h.

Referenced by FillGainArray(), and OpDigiProperties().

std::vector<double> opdet::OpDigiProperties::fGainSpreadArray
private

Definition at line 147 of file OpDigiProperties.h.

Referenced by FillGainArray(), HighGain(), and LowGain().

std::string opdet::OpDigiProperties::fGainSpreadFile
private

Definition at line 142 of file OpDigiProperties.h.

Referenced by FillGainArray(), and OpDigiProperties().

art::ServiceHandle<geo::Geometry const> opdet::OpDigiProperties::fGeometry
private

Definition at line 149 of file OpDigiProperties.h.

Referenced by FillGainArray(), FillPedMeanArray(), and OpDigiProperties().

std::vector<double> opdet::OpDigiProperties::fHighGainArray
private

Definition at line 146 of file OpDigiProperties.h.

Referenced by FillGainArray(), HighGain(), HighGainMean(), and OpDigiProperties().

std::string opdet::OpDigiProperties::fHighGainFile
private

Definition at line 139 of file OpDigiProperties.h.

Referenced by FillGainArray(), and OpDigiProperties().

double opdet::OpDigiProperties::fHighGainMean
private

Definition at line 130 of file OpDigiProperties.h.

Referenced by FillGainArray(), and OpDigiProperties().

std::vector<double> opdet::OpDigiProperties::fLowGainArray
private

Definition at line 145 of file OpDigiProperties.h.

Referenced by FillGainArray(), LowGain(), LowGainMean(), and OpDigiProperties().

std::string opdet::OpDigiProperties::fLowGainFile
private

Definition at line 140 of file OpDigiProperties.h.

Referenced by FillGainArray(), and OpDigiProperties().

double opdet::OpDigiProperties::fLowGainMean
private

Definition at line 129 of file OpDigiProperties.h.

Referenced by FillGainArray(), and OpDigiProperties().

optdata::ADC_Count_t opdet::OpDigiProperties::fPedFlucAmp
private

Definition at line 124 of file OpDigiProperties.h.

Referenced by OpDigiProperties().

double opdet::OpDigiProperties::fPedFlucRate
private

Definition at line 123 of file OpDigiProperties.h.

Referenced by OpDigiProperties().

std::vector<optdata::ADC_Count_t> opdet::OpDigiProperties::fPedMeanArray
private

Definition at line 148 of file OpDigiProperties.h.

Referenced by FillPedMeanArray(), and OpDigiProperties().

double opdet::OpDigiProperties::fPERescale
private

Definition at line 112 of file OpDigiProperties.h.

Referenced by OpDigiProperties(), and WaveformInit().

double opdet::OpDigiProperties::fQE
private

Definition at line 122 of file OpDigiProperties.h.

Referenced by OpDigiProperties().

double opdet::OpDigiProperties::fSampleFreq
private
optdata::ADC_Count_t opdet::OpDigiProperties::fSaturationScale
private

Definition at line 126 of file OpDigiProperties.h.

Referenced by OpDigiProperties().

double opdet::OpDigiProperties::fTimeBegin
private

Definition at line 110 of file OpDigiProperties.h.

Referenced by GetTimeSlice(), and OpDigiProperties().

double opdet::OpDigiProperties::fTimeEnd
private

Definition at line 111 of file OpDigiProperties.h.

Referenced by GetTimeSlice(), and OpDigiProperties().

bool opdet::OpDigiProperties::fUseEmpiricalGain
private

Definition at line 120 of file OpDigiProperties.h.

Referenced by FillGainArray(), and OpDigiProperties().

bool opdet::OpDigiProperties::fUseEmpiricalShape
private

Definition at line 121 of file OpDigiProperties.h.

Referenced by GenerateWaveform(), and OpDigiProperties().

double opdet::OpDigiProperties::fVoltageAmpForSPE
private

Definition at line 131 of file OpDigiProperties.h.

Referenced by GenAnalyticalWF(), and OpDigiProperties().

std::vector<double> opdet::OpDigiProperties::fWaveform
private
std::string opdet::OpDigiProperties::fWaveformFile
private

Definition at line 141 of file OpDigiProperties.h.

Referenced by GenerateWaveform(), and OpDigiProperties().

double opdet::OpDigiProperties::fWFLength
private

Definition at line 134 of file OpDigiProperties.h.

Referenced by GenAnalyticalWF(), GenEmpiricalWF(), and OpDigiProperties().

double opdet::OpDigiProperties::fWFPowerFactor
private

Definition at line 133 of file OpDigiProperties.h.

Referenced by GenAnalyticalWF(), and OpDigiProperties().

double opdet::OpDigiProperties::fWFTimeConstant
private

Definition at line 132 of file OpDigiProperties.h.

Referenced by GenAnalyticalWF(), and OpDigiProperties().


The documentation for this class was generated from the following files: