LArSoft  v06_85_00
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
 
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 207 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().

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

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

Referenced by reconfigure().

201  {
202  for(unsigned int i=0;i<fGeometry->NOpChannels();++i)
203  fPedMeanArray.push_back((optdata::ADC_Count_t)(CLHEP::RandGauss::shoot((double)fADCBaseline,fADCBaseSpread)+0.5));
204  }
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 337 of file OpDigiProperties_service.cc.

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

Referenced by GenerateWaveform().

337  {
338  mf::LogWarning("OpDigiProperties")<<" OpDigiProperties using analytical function for WF generation.";
339  //
340  // Generate waveform from analytical form
341  //
342  if(!fAnalyticalSPE) {// Create analytical function if not yet created
343  fAnalyticalSPE = new TF1("_analyticalSPE",
344  "10^(22)*x^[1]*[0]*exp(-x/[2])/TMath::Factorial([1])",
345  0,fWFLength*2); // x is time in micro-seconds
346  fAnalyticalSPE->SetParameter(0,fVoltageAmpForSPE); // voltage amplitude for s.p.e.
347  fAnalyticalSPE->SetParameter(1,fWFPowerFactor); // power factor (no unit)
348  fAnalyticalSPE->SetParameter(2,fWFTimeConstant); // time constant in us
349  }
350  //
351  // Define a waveform vector
352  //
353  // Size of WF = time width [us] * frequency [MHz]
354  std::vector<double> PEWaveform(int( fWFLength * fSampleFreq), 0.0);
355  double SamplingDuration = 1./fSampleFreq; // in micro seconds
356  double MaxAmp=0;
357  for(unsigned short i = 0; i<PEWaveform.size(); ++i){
358  double Value=fAnalyticalSPE->Integral( i * SamplingDuration,
359  (i+1) * SamplingDuration) / SamplingDuration;
360  PEWaveform[i]=Value;
361  if(PEWaveform[i]>MaxAmp) MaxAmp=PEWaveform[i];
362  }
363 
364  // rescale
365  if(MaxAmp<=0) throw cet::exception("OpDigiProperties_module")<<"Waveform amplitude <=0!\n";
366  for(unsigned short i=0; i<PEWaveform.size(); i++) {
367  PEWaveform[i]=PEWaveform[i]/MaxAmp;
368  if(PEWaveform[i]<1.e-4) PEWaveform[i]=0;
369  }
370 
371  return PEWaveform;
372  }
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 305 of file OpDigiProperties_service.cc.

References fSampleFreq, and fWFLength.

Referenced by GenerateWaveform().

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

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

Referenced by reconfigure().

291  {
292  std::string FullPath;
293 
294  if(fUseEmpiricalShape){
295  cet::search_path sp("FW_SEARCH_PATH");
296  if( !sp.find_file(fWaveformFile, FullPath) )
297 
298  throw cet::exception("OpDigiProperties") << "Unable to find PMT waveform file in " << sp.to_string() << "\n";
299 
300  fWaveform = GenEmpiricalWF(FullPath);
301 
302  }else fWaveform = GenAnalyticalWF();
303  }
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, 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  // Option 2: WF from analytical function
149  fWFPowerFactor = p.get< double >("WFPowerFactor" );
150  fWFTimeConstant = p.get< double >("WFTimeConstant" );
151  fVoltageAmpForSPE = p.get< double >("VoltageAmpForSPE" );
152 
153  // Generate the SPE waveform (i.e. fWaveform)
155 
156  // Fill gain array
157  FillGainArray();
158 
159  // Fill baseline mean
161 
162  // Report
163  std::string msg(Form("%-10s ... %-10s ... %-10s ... %-10s\n","Ch. Number","Pedestal","High Gain","Low Gain"));
164  for(unsigned int i=0;i<fGeometry->NOpChannels();++i) {
165  msg+=Form("%-10d ... %-10d ... %-10g ... %-10g\n",i,fPedMeanArray[i],fHighGainArray[i],fLowGainArray[i]);
166  }
167  mf::LogInfo(__FUNCTION__)<<msg.c_str();
168 
169  return;
170  }
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 176 of file OpDigiProperties_service.cc.

References fPERescale.

Referenced by TimeEnd().

177  {
178  // Read in waveform vector from text file
179  std::ifstream WaveformFile (fWaveformFile.c_str());
180  std::string line;
181 
182  mf::LogInfo("OpDigiProperties")<<"OpDigiProperties opening OpDet waveform at " << fWaveformFile.c_str();
183 
184  // Read in each line and place into waveform vector
185  std::vector<double> PEWaveform;
186  if (WaveformFile.is_open())
187  {
188  while ( WaveformFile.good() )
189  {
190  getline (WaveformFile, line);
191  PEWaveform.push_back( fPERescale * strtod( line.c_str(), NULL ) );
192  }
193  }
194  else throw cet::exception("OpDigiProperties") << "No Waveform File: Unable to open file\n";
195 
196  WaveformFile.close();
197  return(PEWaveform);
198  }
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().

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 149 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 151 of file OpDigiProperties.h.

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

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

Definition at line 148 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 147 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 150 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: