LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
opdet::OpDigiProperties Class Reference

#include "OpDigiProperties.h"

Public Member Functions

 OpDigiProperties (fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
 
 ~OpDigiProperties ()
 
void reconfigure (fhicl::ParameterSet const &p)
 
double SampleFreq ()
 Returns sample frequency in MHz. More...
 
double TimeBegin ()
 Returns window start time in us ... with respect to MC photon T0. More...
 
double TimeEnd ()
 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
 Returns quantum efficiency. More...
 
double DarkRate () const
 Returns rate of dark noise. More...
 
double PedFlucRate () const
 Returns rate of pedestal fluctuation. More...
 
optdata::ADC_Count_t PedFlucAmp () const
 Returns amplitude of pedestal fluctuation. More...
 
optdata::ADC_Count_t SaturationScale () const
 Returns the saturation scale of the electronics. More...
 
optdata::ADC_Count_t ADCBaseline () const
 Returns the ADCBaseline set mean value. More...
 
double WFTimeConstant () const
 Returns WF time constant used in analytical model. More...
 
double WFPowerFactor () const
 Returns WF power factor used in analytical model. More...
 
double LowGainMean () const
 Returns set mean gain value for LOW gain. More...
 
double HighGainMean () const
 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
 Returns set value for intrinsic gain spread (common to HIGH and LOW) More...
 
double GainSpread_PMT2PMT () const
 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 > SinglePEWaveform () const
 Returns a vector of double which represents a binned SPE waveform. More...
 
std::vector< double > HighGainArray () const
 Returns an array of HIGH gain. More...
 
std::vector< double > LowGainArray () const
 Returns an array of LOW gain. More...
 
std::vector< double > GainSpreadArray () const
 Returns an array of gain spread. More...
 
std::vector< optdata::ADC_Count_tPedMeanArray () const
 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::GeometryfGeometry
 

Detailed Description

Definition at line 29 of file OpDigiProperties.h.

Constructor & Destructor Documentation

opdet::OpDigiProperties::OpDigiProperties ( fhicl::ParameterSet const &  pset,
art::ActivityRegistry reg 
)

Definition at line 24 of file OpDigiProperties_service.cc.

References reconfigure().

26  : fAnalyticalSPE(0)
27  {
28  this->reconfigure(pset);
29  }
void reconfigure(fhicl::ParameterSet const &p)
opdet::OpDigiProperties::~OpDigiProperties ( )

Definition at line 32 of file OpDigiProperties_service.cc.

33  {
34 
35  }

Member Function Documentation

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

Returns the ADCBaseline set mean value.

Definition at line 67 of file OpDigiProperties.h.

References fADCBaseline.

67 { return fADCBaseline; }
optdata::ADC_Count_t fADCBaseline
double opdet::OpDigiProperties::DarkRate ( ) const
inline

Returns rate of dark noise.

Definition at line 59 of file OpDigiProperties.h.

References fDarkRate.

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

Definition at line 209 of file OpDigiProperties_service.cc.

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

Referenced by reconfigure().

209  {
211  {
212  // Fill fron user's text files.
213  mf::LogWarning("OpDigiProperties")<<"Using empirical table of gain for each PMT...";
214  std::string FullPath;
215  cet::search_path sp("FW_SEARCH_PATH");
216 
217  if( !sp.find_file(fHighGainFile, FullPath) )
218  throw cet::exception("OpDigiProperties") << "Unable to find high gain spread file in " << sp.to_string() << "\n";
219 
220  mf::LogWarning("OpDigiProperties")<<"OpDigiProperties opening high gain spread file at " << FullPath.c_str();
221  std::ifstream HighGainFile(FullPath.c_str());
222  if(HighGainFile.is_open()) {
223  std::string line;
224  while ( HighGainFile.good() ){
225  getline(HighGainFile, line);
226  fHighGainArray.push_back(strtod(line.c_str(),NULL));
227  }
228  }else throw cet::exception("OpDigiProperties")<<"Unable to open file!\n";
229 
230  FullPath="";
231  if( !sp.find_file(fLowGainFile, FullPath) )
232  throw cet::exception("OpDigiProperties") << "Unable to find low gain spread file in " << sp.to_string() << "\n";
233 
234  mf::LogWarning("OpDigiProperties")<<"OpDigiProperties opening low gain spread file at " << FullPath.c_str();
235  std::ifstream LowGainFile(FullPath.c_str());
236  if(LowGainFile.is_open()) {
237  std::string line;
238  while ( LowGainFile.good() ){
239  getline(LowGainFile, line);
240  fLowGainArray.push_back(strtod(line.c_str(),NULL));
241  }
242  }else throw cet::exception("OpDigiProperties")<<"Unable to open file!\n";
243 
244  FullPath="";
245  if( !sp.find_file(fGainSpreadFile, FullPath) )
246  throw cet::exception("OpDigiProperties") << "Unable to find low gain spread file in " << sp.to_string() << "\n";
247 
248  mf::LogWarning("OpDigiProperties")<<"OpDigiProperties opening low gain spread file at " << FullPath.c_str();
249  std::ifstream GainSpreadFile(FullPath.c_str());
250  if(GainSpreadFile.is_open()) {
251  std::string line;
252  while ( GainSpreadFile.good() ){
253  getline(GainSpreadFile, line);
254  fGainSpreadArray.push_back(strtod(line.c_str(),NULL));
255  }
256  }else throw cet::exception("OpDigiProperties")<<"Unable to open file!\n";
257 
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(CLHEP::RandGauss::shoot(fLowGainMean,fLowGainMean*fGainSpread_PMT2PMT));
270  fHighGainArray.push_back(CLHEP::RandGauss::shoot(fHighGainMean,fHighGainMean*fGainSpread_PMT2PMT));
271  fGainSpreadArray.push_back(fGainSpread);
272  }
273  }
274 
275  //
276  // Note:
277  // Check for # entries. These exceptions ensures we have enough # of elements.
278  // When a user access the elements by a channel number using LowGainMean(Channel_t ch) etc.,
279  // those functions do not check if the given channel number is valid or not to keep a high
280  // performance of the code. If there's an invalid memory access error in run-time, then
281  // it must mean the user provided an invalid channel number and not due to insufficient
282  // vector elements filled in this function.
283  //
284  if(fLowGainArray.size()<fGeometry->NOpChannels())
285  throw cet::exception("OpDigiProperties")<<"Low gain missing for some channels!\n";
286  if(fHighGainArray.size()<fGeometry->NOpChannels())
287  throw cet::exception("OpDigiProperties")<<"High gain missing for some channels!\n";
288  if(fGainSpreadArray.size()<fGeometry->NOpChannels())
289  throw cet::exception("OpDigiProperties")<<"Gain spread missing for some channels!\n";
290  }
std::vector< double > fHighGainArray
art::ServiceHandle< geo::Geometry > 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 203 of file OpDigiProperties_service.cc.

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

Referenced by reconfigure().

203  {
204  for(unsigned int i=0;i<fGeometry->NOpChannels();++i)
205  fPedMeanArray.push_back((optdata::ADC_Count_t)(CLHEP::RandGauss::shoot((double)fADCBaseline,fADCBaseSpread)+0.5));
206  }
art::ServiceHandle< geo::Geometry > 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
inline

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

Definition at line 82 of file OpDigiProperties.h.

References fGainSpread.

82 { return fGainSpread; }
double opdet::OpDigiProperties::GainSpread_PMT2PMT ( ) const
inline

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

Definition at line 84 of file OpDigiProperties.h.

References fGainSpread_PMT2PMT, HighGain(), and LowGain().

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

Returns an array of gain spread.

Definition at line 97 of file OpDigiProperties.h.

References fGainSpreadArray.

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

Definition at line 342 of file OpDigiProperties_service.cc.

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

Referenced by GenerateWaveform().

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

Definition at line 307 of file OpDigiProperties_service.cc.

References fChargeNormalized, fSampleFreq, and fWFLength.

Referenced by GenerateWaveform().

308  {
309  // Read in waveform vector from text file
310  std::ifstream WaveformFile (fWaveformFile.c_str());
311  std::string line;
312 
313  mf::LogWarning("OpDigiProperties")<<"OpDigiProperties opening OpDet waveform at " << fWaveformFile.c_str();
314 
315  // Read in each line and place into waveform vector
316  std::vector<double> PEWaveform;
317  if (WaveformFile.is_open())
318  {
319  double MaxAmp=0;
320  double Charge=0;
321  int NSample=0;
322  while ( WaveformFile.good() && NSample<int(fWFLength*fSampleFreq))
323  {
324  getline (WaveformFile, line);
325  double Amp=strtod(line.c_str(),NULL);
326  PEWaveform.push_back(Amp);
327  if(Amp>MaxAmp) MaxAmp=Amp;
328  NSample++;
329  Charge+=Amp;
330  }
331  // rescale
332  if(MaxAmp<=0) throw cet::exception("OpDigiProperties_module")<<"Waveform amplitude <=0!\n";
333  if(!fChargeNormalized)for(unsigned short i=0; i<PEWaveform.size(); i++){ PEWaveform[i]=PEWaveform[i]/MaxAmp; }
334  else for(unsigned short i=0; i<PEWaveform.size(); i++){ PEWaveform[i]=PEWaveform[i]/Charge; }
335  }
336  else throw cet::exception("No Waveform File") << "Unable to open file\n";
337 
338  WaveformFile.close();
339  return(PEWaveform);
340  }
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 292 of file OpDigiProperties_service.cc.

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

Referenced by reconfigure().

293  {
294  std::string FullPath;
295 
296  if(fUseEmpiricalShape){
297  cet::search_path sp("FW_SEARCH_PATH");
298  if( !sp.find_file(fWaveformFile, FullPath) )
299 
300  throw cet::exception("OpDigiProperties") << "Unable to find PMT waveform file in " << sp.to_string() << "\n";
301 
302  fWaveform = GenEmpiricalWF(FullPath);
303 
304  }else fWaveform = GenAnalyticalWF();
305  }
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 48 of file OpDigiProperties_service.cc.

References fWaveform.

Referenced by PedMeanArray().

49  {
50  double AmpSoFar=0;
51  for(size_t i=0; i!=fWaveform.size(); ++i)
52  if(fWaveform.at(i)>AmpSoFar) AmpSoFar=fWaveform.at(i);
53  return AmpSoFar;
54  }
std::vector< double > fWaveform
double opdet::OpDigiProperties::GetSPEArea ( )

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

Definition at line 39 of file OpDigiProperties_service.cc.

References fWaveform.

Referenced by PedMeanArray().

40  {
41  double SPEArea=0;
42  for(size_t i=0; i!=fWaveform.size(); ++i)
43  SPEArea+=fWaveform.at(i);
44  return SPEArea;
45  }
std::vector< double > fWaveform
double opdet::OpDigiProperties::GetSPECumulativeAmplitude ( )

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

Definition at line 69 of file OpDigiProperties_service.cc.

References fWaveform.

Referenced by PedMeanArray().

70  {
71  double AmpSoFar=0, Cumulative=0;
72  for(size_t i=0; i!=fWaveform.size(); ++i)
73  {
74  Cumulative += fWaveform.at(i);
75  if(Cumulative>AmpSoFar) AmpSoFar=Cumulative;
76  }
77  return AmpSoFar;
78  }
std::vector< double > fWaveform
double opdet::OpDigiProperties::GetSPECumulativeArea ( )

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

Definition at line 57 of file OpDigiProperties_service.cc.

References fWaveform.

Referenced by PedMeanArray().

58  {
59  double Cumulative=0, SPEArea=0;
60  for(size_t i=0; i!=fWaveform.size(); ++i)
61  {
62  Cumulative += fWaveform.at(i);
63  SPEArea += Cumulative;
64  }
65  return SPEArea;
66  }
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 104 of file OpDigiProperties_service.cc.

References fSampleFreq, fTimeBegin, fTimeEnd, and max.

Referenced by TimeEnd().

105  {
107 
108  else return optdata::TimeSlice_t((time_ns/1.e3-fTimeBegin)*fSampleFreq);
109  }
Int_t max
Definition: plot.C:27
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 99 of file OpDigiProperties_service.cc.

References fGainSpreadArray, and fHighGainArray.

Referenced by GainSpread_PMT2PMT().

100  {
101  return CLHEP::RandGauss::shoot(fHighGainArray[ch],fGainSpreadArray[ch]*fHighGainArray[ch]);
102  }
std::vector< double > fHighGainArray
std::vector< double > fGainSpreadArray
std::vector<double> opdet::OpDigiProperties::HighGainArray ( ) const
inline

Returns an array of HIGH gain.

Definition at line 93 of file OpDigiProperties.h.

References fHighGainArray.

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

Returns set mean gain value for HIGH gain.

Definition at line 75 of file OpDigiProperties.h.

References fHighGainMean, and LowGainMean().

75 { 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 89 of file OpDigiProperties_service.cc.

References fHighGainArray.

90  {
91  return fHighGainArray[ch];
92  }
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 94 of file OpDigiProperties_service.cc.

References fGainSpreadArray, and fLowGainArray.

Referenced by GainSpread_PMT2PMT().

95  {
96  return CLHEP::RandGauss::shoot(fLowGainArray[ch],fGainSpreadArray[ch]*fLowGainArray[ch]);
97  }
std::vector< double > fLowGainArray
std::vector< double > fGainSpreadArray
std::vector<double> opdet::OpDigiProperties::LowGainArray ( ) const
inline

Returns an array of LOW gain.

Definition at line 95 of file OpDigiProperties.h.

References fLowGainArray.

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

Returns set mean gain value for LOW gain.

Definition at line 73 of file OpDigiProperties.h.

References fLowGainMean.

Referenced by HighGainMean().

73 { 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 83 of file OpDigiProperties_service.cc.

References fLowGainArray.

84  {
85  return fLowGainArray[ch];
86  }
std::vector< double > fLowGainArray
optdata::ADC_Count_t opdet::OpDigiProperties::PedFlucAmp ( ) const
inline

Returns amplitude of pedestal fluctuation.

Definition at line 63 of file OpDigiProperties.h.

References fPedFlucAmp.

63 { return fPedFlucAmp; }
optdata::ADC_Count_t fPedFlucAmp
double opdet::OpDigiProperties::PedFlucRate ( ) const
inline

Returns rate of pedestal fluctuation.

Definition at line 61 of file OpDigiProperties.h.

References fPedFlucRate.

61 { return fPedFlucRate; }
std::vector<optdata::ADC_Count_t> opdet::OpDigiProperties::PedMeanArray ( ) const
inline

Returns an array of generated pedestal mean value per channel.

Definition at line 99 of file OpDigiProperties.h.

References fPedMeanArray, GetSPEAmplitude(), GetSPEArea(), GetSPECumulativeAmplitude(), and GetSPECumulativeArea().

99 {return fPedMeanArray;}
std::vector< optdata::ADC_Count_t > fPedMeanArray
double opdet::OpDigiProperties::QE ( ) const
inline
void opdet::OpDigiProperties::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 113 of file OpDigiProperties_service.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().

Referenced by OpDigiProperties().

114  {
115  fSampleFreq = p.get< double >("SampleFreq" );
116  fTimeBegin = p.get< double >("TimeBegin" );
117  fTimeEnd = p.get< double >("TimeEnd" );
118  fWaveformFile = p.get< std::string >("WaveformFile" );
119  fPERescale = p.get< double >("PERescale" );
120 
121  // PMT properties
122  fQE = p.get<double>("QE");
123  fDarkRate = p.get<double>("DarkRate");
124  fSaturationScale = p.get<optdata::ADC_Count_t>("SaturationScale");
125 
126  // Shaper properties
127  fUseEmpiricalGain= p.get<bool >("UseEmpiricalGain");
128  fHighGainFile = p.get<std::string >("HighGainFile");
129  fLowGainFile = p.get<std::string >("LowGainFile");
130  fGainSpreadFile = p.get<std::string >("GainSpreadFile");
131 
132  fHighGainMean = p.get<double >("HighGainMean");
133  fLowGainMean = p.get<double >("LowGainMean");
134  fGainSpread = p.get<double >("GainSpread");
135  fGainSpread_PMT2PMT = p.get<double >("GainSpread_PMT2PMT");
136 
137  // Digitization ped fluc
138  fPedFlucRate = p.get<double>("PedFlucRate");
139  fPedFlucAmp = p.get<optdata::ADC_Count_t>("PedFlucAmp");
140  fADCBaseline = p.get<optdata::ADC_Count_t>("ADCBaseline");
141  fADCBaseSpread = p.get<double>("ADCBaseSpread");
142 
143  // WF related stuff
144  fUseEmpiricalShape = p.get< bool >("UseEmpiricalShape");
145  fWFLength = p.get< double >("WFLength" );
146 
147  fWaveformFile = p.get< std::string >("WaveformFile" );
148  fChargeNormalized = p.get< bool >("WaveformChargeNormalized", false);
149 
150  // Option 2: WF from analytical function
151  fWFPowerFactor = p.get< double >("WFPowerFactor" );
152  fWFTimeConstant = p.get< double >("WFTimeConstant" );
153  fVoltageAmpForSPE = p.get< double >("VoltageAmpForSPE" );
154 
155  // Generate the SPE waveform (i.e. fWaveform)
157 
158  // Fill gain array
159  FillGainArray();
160 
161  // Fill baseline mean
163 
164  // Report
165  std::string msg(Form("%-10s ... %-10s ... %-10s ... %-10s\n","Ch. Number","Pedestal","High Gain","Low Gain"));
166  for(unsigned int i=0;i<fGeometry->NOpChannels();++i) {
167  msg+=Form("%-10d ... %-10d ... %-10g ... %-10g\n",i,fPedMeanArray[i],fHighGainArray[i],fLowGainArray[i]);
168  }
169  mf::LogInfo(__FUNCTION__)<<msg.c_str();
170 
171  return;
172  }
std::vector< double > fHighGainArray
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
art::ServiceHandle< geo::Geometry > fGeometry
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
double opdet::OpDigiProperties::SampleFreq ( )
inline

Returns sample frequency in MHz.

Definition at line 38 of file OpDigiProperties.h.

References fSampleFreq.

38 { return fSampleFreq; }
optdata::ADC_Count_t opdet::OpDigiProperties::SaturationScale ( ) const
inline

Returns the saturation scale of the electronics.

Definition at line 65 of file OpDigiProperties.h.

References fSaturationScale.

65 { return fSaturationScale; }
optdata::ADC_Count_t fSaturationScale
std::vector<double> opdet::OpDigiProperties::SinglePEWaveform ( ) const
inline

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

Definition at line 91 of file OpDigiProperties.h.

References fWaveform.

91 { return fWaveform; }
std::vector< double > fWaveform
double opdet::OpDigiProperties::TimeBegin ( )
inline

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

Definition at line 40 of file OpDigiProperties.h.

References fTimeBegin.

40 { return fTimeBegin; }
double opdet::OpDigiProperties::TimeEnd ( )
inline

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

Definition at line 42 of file OpDigiProperties.h.

References fTimeEnd, GetTimeSlice(), and WaveformInit().

42 { 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 178 of file OpDigiProperties_service.cc.

References fPERescale.

Referenced by TimeEnd().

179  {
180  // Read in waveform vector from text file
181  std::ifstream WaveformFile (fWaveformFile.c_str());
182  std::string line;
183 
184  mf::LogInfo("OpDigiProperties")<<"OpDigiProperties opening OpDet waveform at " << fWaveformFile.c_str();
185 
186  // Read in each line and place into waveform vector
187  std::vector<double> PEWaveform;
188  if (WaveformFile.is_open())
189  {
190  while ( WaveformFile.good() )
191  {
192  getline (WaveformFile, line);
193  PEWaveform.push_back( fPERescale * strtod( line.c_str(), NULL ) );
194  }
195  }
196  else throw cet::exception("OpDigiProperties") << "No Waveform File: Unable to open file\n";
197 
198  WaveformFile.close();
199  return(PEWaveform);
200  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
double opdet::OpDigiProperties::WFPowerFactor ( ) const
inline

Returns WF power factor used in analytical model.

Definition at line 71 of file OpDigiProperties.h.

References fWFPowerFactor.

71 { return fWFPowerFactor; }
double opdet::OpDigiProperties::WFTimeConstant ( ) const
inline

Returns WF time constant used in analytical model.

Definition at line 69 of file OpDigiProperties.h.

References fWFTimeConstant.

69 { return fWFTimeConstant; }

Member Data Documentation

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

Definition at line 130 of file OpDigiProperties.h.

Referenced by ADCBaseline(), FillPedMeanArray(), and reconfigure().

double opdet::OpDigiProperties::fADCBaseSpread
private

Definition at line 131 of file OpDigiProperties.h.

Referenced by FillPedMeanArray(), and reconfigure().

TF1* opdet::OpDigiProperties::fAnalyticalSPE
private

Definition at line 140 of file OpDigiProperties.h.

Referenced by GenAnalyticalWF().

bool opdet::OpDigiProperties::fChargeNormalized
private

Definition at line 147 of file OpDigiProperties.h.

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

double opdet::OpDigiProperties::fDarkRate
private

Definition at line 128 of file OpDigiProperties.h.

Referenced by DarkRate(), and reconfigure().

double opdet::OpDigiProperties::fGainSpread
private

Definition at line 138 of file OpDigiProperties.h.

Referenced by FillGainArray(), GainSpread(), and reconfigure().

double opdet::OpDigiProperties::fGainSpread_PMT2PMT
private

Definition at line 139 of file OpDigiProperties.h.

Referenced by FillGainArray(), GainSpread_PMT2PMT(), and reconfigure().

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

Definition at line 150 of file OpDigiProperties.h.

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

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

Definition at line 145 of file OpDigiProperties.h.

Referenced by FillGainArray(), and reconfigure().

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

Definition at line 152 of file OpDigiProperties.h.

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

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

Definition at line 149 of file OpDigiProperties.h.

Referenced by FillGainArray(), HighGain(), HighGainArray(), HighGainMean(), and reconfigure().

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

Definition at line 142 of file OpDigiProperties.h.

Referenced by FillGainArray(), and reconfigure().

double opdet::OpDigiProperties::fHighGainMean
private

Definition at line 133 of file OpDigiProperties.h.

Referenced by FillGainArray(), HighGainMean(), and reconfigure().

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

Definition at line 148 of file OpDigiProperties.h.

Referenced by FillGainArray(), LowGain(), LowGainArray(), LowGainMean(), and reconfigure().

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

Definition at line 143 of file OpDigiProperties.h.

Referenced by FillGainArray(), and reconfigure().

double opdet::OpDigiProperties::fLowGainMean
private

Definition at line 132 of file OpDigiProperties.h.

Referenced by FillGainArray(), LowGainMean(), and reconfigure().

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

Definition at line 127 of file OpDigiProperties.h.

Referenced by PedFlucAmp(), and reconfigure().

double opdet::OpDigiProperties::fPedFlucRate
private

Definition at line 126 of file OpDigiProperties.h.

Referenced by PedFlucRate(), and reconfigure().

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

Definition at line 151 of file OpDigiProperties.h.

Referenced by FillPedMeanArray(), PedMeanArray(), and reconfigure().

double opdet::OpDigiProperties::fPERescale
private

Definition at line 115 of file OpDigiProperties.h.

Referenced by reconfigure(), and WaveformInit().

double opdet::OpDigiProperties::fQE
private

Definition at line 125 of file OpDigiProperties.h.

Referenced by QE(), and reconfigure().

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

Definition at line 129 of file OpDigiProperties.h.

Referenced by reconfigure(), and SaturationScale().

double opdet::OpDigiProperties::fTimeBegin
private

Definition at line 113 of file OpDigiProperties.h.

Referenced by GetTimeSlice(), reconfigure(), and TimeBegin().

double opdet::OpDigiProperties::fTimeEnd
private

Definition at line 114 of file OpDigiProperties.h.

Referenced by GetTimeSlice(), reconfigure(), and TimeEnd().

bool opdet::OpDigiProperties::fUseEmpiricalGain
private

Definition at line 123 of file OpDigiProperties.h.

Referenced by FillGainArray(), and reconfigure().

bool opdet::OpDigiProperties::fUseEmpiricalShape
private

Definition at line 124 of file OpDigiProperties.h.

Referenced by GenerateWaveform(), and reconfigure().

double opdet::OpDigiProperties::fVoltageAmpForSPE
private

Definition at line 134 of file OpDigiProperties.h.

Referenced by GenAnalyticalWF(), and reconfigure().

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

Definition at line 144 of file OpDigiProperties.h.

Referenced by GenerateWaveform(), and reconfigure().

double opdet::OpDigiProperties::fWFLength
private

Definition at line 137 of file OpDigiProperties.h.

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

double opdet::OpDigiProperties::fWFPowerFactor
private

Definition at line 136 of file OpDigiProperties.h.

Referenced by GenAnalyticalWF(), reconfigure(), and WFPowerFactor().

double opdet::OpDigiProperties::fWFTimeConstant
private

Definition at line 135 of file OpDigiProperties.h.

Referenced by GenAnalyticalWF(), reconfigure(), and WFTimeConstant().


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