All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SBNDataNoise_tool.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file SBNDataNoise.cc
3 /// \author F. Varanini
4 ////////////////////////////////////////////////////////////////////////
5 
6 #include <cmath>
7 #include "IGenNoise.h"
8 #include "art/Framework/Core/EDProducer.h"
9 #include "art/Utilities/ToolMacros.h"
10 #include "art/Utilities/make_tool.h"
11 #include "messagefacility/MessageLogger/MessageLogger.h"
12 #include "cetlib_except/exception.h"
15 #include "art_root_io/TFileService.h"
16 
18 
19 // art extensions
20 #include "nurandom/RandomUtils/NuRandomService.h"
21 
22 #include "icarus_signal_processing/WaveformTools.h"
25 
26 // CLHEP libraries
27 #include "CLHEP/Random/RandFlat.h"
28 #include "CLHEP/Random/RandGeneral.h"
29 #include "CLHEP/Random/RandGaussQ.h"
30 
31 #include "TH1F.h"
32 #include "TProfile.h"
33 #include "TFile.h"
34 
35 #include <Eigen/Core>
36 #include <unsupported/Eigen/FFT>
37 
38 #include <fstream>
39 
40 namespace icarus_tool
41 {
42 
44 {
45 public:
46  explicit SBNDataNoise(const fhicl::ParameterSet& pset);
47 
48  ~SBNDataNoise();
49 
50  void configure(const fhicl::ParameterSet& pset) override;
51 
52  void nextEvent() override;
53 
54  void generateNoise(CLHEP::HepRandomEngine& noise_engine,
55  CLHEP::HepRandomEngine& cornoise_engine,
56  icarusutil::TimeVec& noise,
58  double noise_factor,
59  const geo::PlaneID&,
60  unsigned int board) override;
61 
62 private:
63  void GenerateCorrelatedNoise(CLHEP::HepRandomEngine&, icarusutil::TimeVec&, double, unsigned int, unsigned int);
64  void GenerateUncorrelatedNoise(CLHEP::HepRandomEngine&, icarusutil::TimeVec&, double, unsigned int);
65  void GenNoise(std::function<void (double[])>&, const icarusutil::TimeVec&, icarusutil::TimeVec&, float);
66  void ComputeRMSs();
67  void makeHistograms();
68  void SampleCorrelatedRMSs() ;
69  void ExtractUncorrelatedRMS(float&, int) const;
70 
71  // Member variables from the fhicl file
72  size_t fPlane;
74  float fNoiseRand;
77  std::vector<float> fIncoherentNoiseFrac;
79  std::vector<std::string> fInputNoiseHistFileName;
80  std::string fHistogramName;
85  std::string fTotalRMSHistoName;
86 
87  using CorrFactorsMap = std::map<unsigned int, std::vector<float>>;
88 
90 
91  using WaveformTools = icarus_signal_processing::WaveformTools<icarusutil::SigProcPrecision>;
92 
94 
95  // We'll recover the bin contents and store in a vector
96  // with the likely false hope this will be faster...
97  std::vector<icarusutil::TimeVec> fCoherentNoiseVec; //< Input full noise frequency distribution
98  std::vector<icarusutil::TimeVec> fIncoherentNoiseVec; //< Input full noise frequency distribution
99  Noise::ICoherentNoiseFactor* fCoherentNoiseService; //< Use this to handle the common scale factors per board
100 
101  double fIncoherentNoiseRMS; //< RMS of full noise waveform
102  double fCoherentNoiseRMS; //< RMS of full noise waveform
103 
104  // Container for doing the work
106 
107  // Keep track of seed initialization for uncorrelated noise
108  bool fNeedFirstSeed=true;
109 
110  // Histograms
111  TProfile* fInputNoiseHist;
113  TProfile* fPeakNoiseHist;
114 
115  std::vector<TH1D*> corrRMSHistPtr;
116  std::vector<TH1D*> uncorrRMSHistPtr;
117  std::vector<TH1D*> totalRMSHistPtr;
118 
119  std::vector<float> totalRMS;
120  std::vector<float> rmsUnc;
121  std::vector<float> rmsCorr;
122 
123  // Keep instance of the eigen FFT
124  Eigen::FFT<double> fEigenFFT;
125 
126 };
127 
128 //----------------------------------------------------------------------
129 // Constructor.
130 SBNDataNoise::SBNDataNoise(const fhicl::ParameterSet& pset)
131 {
132  // Recover the configuration of the tool from the input fhicl file and set up
133  configure(pset);
134  ComputeRMSs();
135 
136  // Output some histograms to catalogue what's been done
137  makeHistograms();
138 }
139 
141 {
142 }
143 
144 void SBNDataNoise::configure(const fhicl::ParameterSet& pset)
145 {
146  // Recover the histogram used for noise generation
147  fPlane = pset.get< size_t >("Plane");
148  fMedianNumBins = pset.get< int >("MedianNumBins");
149  fNoiseRand = pset.get< float >("NoiseRand");
150  fCorrelatedSeed = pset.get< long >("CorrelatedSeed",1000);
151  fUncorrelatedSeed = pset.get< long >("UncorrelatedSeed",5000);
152  std::vector<float> noiseFracVec = pset.get< std::vector<float> >("IncoherentNoiseFraction", std::vector<float>());
153  for(auto& noiseFrac : noiseFracVec) {
154  fIncoherentNoiseFrac.push_back(float(noiseFrac));
155  }
156  // fIncoherentNoiseFrac = pset.get< float >("IncoherentNoiseFraction",0.5);
157  fStoreHistograms = pset.get< bool >("StoreHistograms");
158 
159  std::vector<std::string> noiseToolParamSetVec = pset.get< std::vector<std::string> >("NoiseHistFileName", std::vector<std::string>());
160  for(auto& noiseToolParams : noiseToolParamSetVec) {
161  fInputNoiseHistFileName.push_back(std::string(noiseToolParams));
162  }
163  // fInputNoiseHistFileName = pset.get< std::string >("NoiseHistFileName");
164  fCorrelatedHistogramName = pset.get< std::string >("CorrelatedHistogramName");
165  fUncorrelatedHistogramName = pset.get< std::string >("UncorrelatedHistogramName");
166  fCorrelatedRMSHistoName = pset.get< std::string >("CorrelatedRMSHistoName");
167  fUncorrelatedRMSHistoName = pset.get< std::string >("UncorrelatedRMSHistoName");
168  fTotalRMSHistoName = pset.get< std::string >("TotalRMSHistoName");
169  // Initialize the work vector
170  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataForJob();
171  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataForJob(clockData);
172  fNoiseFrequencyVec.resize(detProp.NumberTimeSamples(),std::complex<float>(0.,0.));
173 
174 for(auto& filename : fInputNoiseHistFileName) {
175  // Set up to input the histogram with the overall noise spectrum
176  std::string fullFileName;
177 
178  cet::search_path searchPath("FW_SEARCH_PATH");
179 
180  searchPath.find_file(filename, fullFileName);
181 std::cout << " inputfilename;" << filename << std::endl;
182  std::cout << " fullfilename;" << fullFileName << std::endl;
183  std::cout << "correlated histo name: " << fCorrelatedHistogramName << std::endl;
184 std::cout << "uncorrelated histo name: " << fUncorrelatedHistogramName << std::endl;
185  TFile inputFile(fullFileName.c_str(), "READ");
186 
187  if (!inputFile.IsOpen())
188  throw cet::exception("NoiseFromHist::configure") << "Unable to open input file: " << filename << std::endl;
189 
190  TH1D* corrHistPtr = (TH1D*)inputFile.Get(fCorrelatedHistogramName.c_str());
191  if (!corrHistPtr)
192  throw cet::exception("NoiseFromHist::configure") << "Unable to recover desired histogram: " << fCorrelatedHistogramName << std::endl;
193 
194  TH1D* uncorrHistPtr = (TH1D*)inputFile.Get(fUncorrelatedHistogramName.c_str());
195  if (!inputFile.Get(fUncorrelatedHistogramName.c_str()))
196  throw cet::exception("NoiseFromHist::configure") << "Unable to recover desired histogram: " << fUncorrelatedHistogramName << std::endl;
197 
198  corrRMSHistPtr.push_back((TH1D*)inputFile.Get(fCorrelatedRMSHistoName.c_str()));
199  if (!inputFile.Get(fCorrelatedRMSHistoName.c_str()))
200  throw cet::exception("NoiseFromHist::configure") << "Unable to recover desired histogram: " << fCorrelatedRMSHistoName << std::endl;
201 
202  uncorrRMSHistPtr.push_back((TH1D*)inputFile.Get(fUncorrelatedRMSHistoName.c_str()));
203  if (!inputFile.Get(fUncorrelatedRMSHistoName.c_str()))
204  throw cet::exception("NoiseFromHist::configure") << "Unable to recover desired histogram: " << fUncorrelatedRMSHistoName << std::endl;
205 
206  totalRMSHistPtr.push_back((TH1D*)inputFile.Get(fTotalRMSHistoName.c_str()));
207  if (!inputFile.Get(fTotalRMSHistoName.c_str()))
208  throw cet::exception("NoiseFromHist::configure") << "Unable to recover desired histogram: " << fTotalRMSHistoName << std::endl;
209 
210  // Close the input file
211  inputFile.Close();
212 
213 std::cout << " corr hist nbins " << corrHistPtr->GetNbinsX() << std::endl;
214 std::cout << " uncorr hist nbins " << uncorrHistPtr->GetNbinsX() << std::endl;
215 icarusutil::TimeVec corvec;
216  corvec.resize(corrHistPtr->GetNbinsX(), 0.);
217 
218  // Recover the bin contents into local vectors
219  for(size_t histIdx = 0; histIdx < size_t(corrHistPtr->GetNbinsX()); histIdx++)
220  corvec[histIdx] = corrHistPtr->GetBinContent(histIdx+1);
221 fCoherentNoiseVec.push_back(corvec);
222 icarusutil::TimeVec incvec;
223 incvec.resize(uncorrHistPtr->GetNbinsX(), 0.);
224 
225  // Recover the bin contents into local vectors
226  for(size_t histIdx = 0; histIdx < size_t(uncorrHistPtr->GetNbinsX()); histIdx++)
227  incvec[histIdx] = uncorrHistPtr->GetBinContent(histIdx+1);
228 fIncoherentNoiseVec.push_back(incvec);
229  // Should we store hists?
230 
231 }
232 std::cout << " after filling vectors " << std::endl;
233  if (fStoreHistograms)
234  {
235  // Define histograms
236  art::ServiceHandle<art::TFileService> tfs;
237 
238  art::TFileDirectory* histDirectory = tfs.get();
239 
240  // Make a directory for these histograms
241  art::TFileDirectory dir = histDirectory->mkdir(Form("CorNoisePlane%1zu",fPlane));
242 
243  float sampleRate = sampling_rate(clockData);
244  float readOutSize = detProp.ReadOutWindowSize();
245  float maxFreq = 1.e6 / (2. * sampleRate);
246  float minFreq = 1.e6 / (2. * sampleRate * readOutSize);
247  int numSamples = readOutSize / 2;
248 
249  fInputNoiseHist = dir.make<TProfile>("InNoise", ";freq(kHz)", numSamples, minFreq, maxFreq);
250  fMediaNoiseHist = dir.make<TH1D>("MedNoise", ";ADC", 100, -10., -10.);;
251  fPeakNoiseHist = dir.make<TProfile>("PeakNoise", ";freq(kHz)", numSamples, minFreq, maxFreq);;
252 
253  }
254 
255  // Set up the board->correlated factors map
256  const auto& channelMap = art::ServiceHandle<icarusDB::IICARUSChannelMap const>{}.get();
257 
258  const icarusDB::TPCReadoutBoardToChannelMap& readoutBoardToChannelMap = channelMap->getReadoutBoardToChannelMap();
259 
260  for(const auto& boardPair : readoutBoardToChannelMap)
261  {
262  fCorrFactorsMap.insert({boardPair.first,std::vector<float>(4,0.)});
263  }
264 
265  fCoherentNoiseService = art::ServiceHandle<Noise::ICoherentNoiseFactor>{}.get();
266 
268 
269  return;
270 }
271 
273 {
274  // We update the correlated seed because we want to see different noise event-by-event
275  fCorrelatedSeed = (333 * fCorrelatedSeed) % 900000000;
277  return;
278 }
279 
280 void SBNDataNoise::generateNoise(CLHEP::HepRandomEngine& engine_unc,
281  CLHEP::HepRandomEngine& engine_corr,
282  icarusutil::TimeVec& noise,
284  double noise_factor,
285  const geo::PlaneID& planeID,
286  unsigned int board)
287 {
288 //std::cout << " generating noise channel " << channel << std::endl;
289  //GET THE GEOMETRY.
290 // art::ServiceHandle<geo::Geometry> geom;
291  // get the WireID for this hit
292 // std::vector<geo::WireID> wids = geom->ChannelToWire(channel);
293  // for now, just take the first option returned from ChannelToWire
294 // geo::WireID wid = wids[0];
295  // We need to know the plane to look up parameters
296 
297  size_t cryostat=planeID.Cryostat;
298  size_t tpc=planeID.TPC;
299 // size_t iWire=wid.Wire;
300 //std::cout << " generating noise cryostat " << cryostat << " tpc " << tpc << " wire " << iWire << std::endl;
301 int index=-1;
302 if(cryostat==0&&tpc<2) index=0;
303 if(cryostat==0&&tpc>1) index=1;
304 if(cryostat==1&&tpc<2) index=2;
305 if(cryostat==1&&tpc>1) index=3;
306 
307 //std::cout << " index " << index << std::endl;
308 //std::cout << " totalrms size " << totalRMS.size() << std::endl;
309 
310 // noise_factor=1; ****** not sure why this was done?
311 //noise_factor=totalRMS[index]/3.9;
312 
313 //std::cout << " index " << index << " generating noise totalRMS " << totalRMS[index] << std::endl;
314  // Define a couple of vectors to hold intermediate work
315  icarusutil::TimeVec noise_unc(noise.size(),0.);
316  icarusutil::TimeVec noise_corr(noise.size(),0.);
317 
318  // Make sure the work vector is size right with the output
319  if (fNoiseFrequencyVec.size() != noise.size()) fNoiseFrequencyVec.resize(noise.size(),std::complex<float>(0.,0.));
320  //std::cout << " generating uncorrelated noise " << std::endl;
321  // If applying incoherent noise call the generator
322  GenerateUncorrelatedNoise(engine_unc,noise_unc,noise_factor,index);
323 //int board=iWire/32;
324 
325 
326 //float cf=corrFactors[board][index];
327 
328 CorrFactorsMap::const_iterator corrFactorItr = fCorrFactorsMap.find(board);
329 
330 if (corrFactorItr == fCorrFactorsMap.end()) std::cout << "********************** board " << board << " not found in map!" << std::endl;
331 
332 //float cf = fCorrFactorsMap[board][index];
333 
334 float cf = fCoherentNoiseService->getCoherentNoiseFactor(board,index);
335 
336 
337  GenerateCorrelatedNoise(engine_corr, noise_corr, noise_factor*cf, board, index);
338 
339  // std::cout << " summing noise " << std::endl;
340  // Take the noise as the simple sum of the two contributions
341  std::transform(noise_unc.begin(),noise_unc.end(),noise_corr.begin(),noise.begin(),std::plus<float>());
342 
343  float mediaNoise=0;
344  for(unsigned int jn=0;jn<noise.size();jn++) {
345 //if(!cryostat&&!tpc&&!fPlane&&iWire<2)
346 //{
347 //std::cout << " jn " << jn << " noise sum " << noise.at(jn) << std::endl;
348 //std::cout << " jn " << jn << " noise unc " << noise_unc.at(jn) << std::endl;
349 //std::cout << " jn " << jn << " noise corr " << noise_corr.at(jn) << std::endl;
350 //}
351  mediaNoise+=noise.at(jn);
352 }
353 
354 mediaNoise/=(noise.size());
355 //std::cout << " media noise size " << noise.size() << std::endl;
356 fMediaNoiseHist->Fill(mediaNoise);
357 //std::cout << " media noise " << mediaNoise << std::endl;
358 
359  return;
360 }
361 
362 void SBNDataNoise::GenerateUncorrelatedNoise(CLHEP::HepRandomEngine& engine, icarusutil::TimeVec &noise, double noise_factor, unsigned int index)
363 {
364  // Here we aim to produce a waveform consisting of incoherent noise
365  // Note that this is expected to be the dominate noise contribution
366  // Check for seed initialization
367  if (fNeedFirstSeed)
368  {
369  engine.setSeed(fUncorrelatedSeed,0);
370  fNeedFirstSeed = false;
371  }
372 
373  // Get the generator
374  CLHEP::RandFlat noiseGen(engine,0,1);
375 
376  std::function<void (double[])> randGenFunc = [&noiseGen](double randArray[]){noiseGen.fireArray(2,randArray);};
377 float cf;
378 ExtractUncorrelatedRMS(cf,index);
379  float scaleFactor = cf*noise_factor;
380  //std::cout << " fraction " << fraction <<" unc scale Factor " << scaleFactor << std::endl;
381  GenNoise(randGenFunc, fIncoherentNoiseVec[index], noise, scaleFactor);
382 
383  return;
384 }
385 
386 void SBNDataNoise::GenerateCorrelatedNoise(CLHEP::HepRandomEngine& engine, icarusutil::TimeVec &noise, double noise_factor, unsigned int board, unsigned int index)
387 {
388 
389  // Set the engine seed to the board being considered
390  engine.setSeed(fCorrelatedSeed+board,0);
391 
392  CLHEP::RandFlat noiseGen(engine,0,1);
393 
394  std::function<void (double[])> randGenFunc = [&noiseGen](double randArray[]){noiseGen.fireArray(2,randArray);};
395 
396 
397  float scaleFactor = noise_factor;
398  // std::cout << " fraction " << fraction << " corr scale Factor " << scaleFactor << std::endl;
399  GenNoise(randGenFunc, fCoherentNoiseVec[index], noise, scaleFactor);
400 
401 
402  return;
403 }
404 
405 void SBNDataNoise::GenNoise(std::function<void (double[])>& gen,const icarusutil::TimeVec& freqDist, icarusutil::TimeVec& noise, float scaleFactor)
406 {
407  double rnd_corr[2] = {0.,0.};
408 
409  // Build out the frequency vector
410  for(size_t i=0; i< noise.size()/2; ++i)
411  {
412 //std::cout << " i " << i << " freqdist " << freqDist[i] << std::endl;
413  // exponential noise spectrum
414  gen(rnd_corr);
415  // if(i!=10) continue;
416  float pval = freqDist[i] * ((1-fNoiseRand) + 2 * fNoiseRand*rnd_corr[0]) * scaleFactor;
417  float phase = rnd_corr[1] * 2. * M_PI;
418  // float pval = freqDist[i]*scaleFactor ;
419  // float phase = 0;
420  std::complex<float> tc(pval*cos(phase),pval*sin(phase));
421 
422  fNoiseFrequencyVec[i] = tc;
423 //std::cout << " i " << i << " noise freqvec " << fNoiseFrequencyVec[i] << std::endl;
424  }
425 
426  // inverse FFT MCSignal
427  fEigenFFT.inv(noise, fNoiseFrequencyVec);
428 // for(unsigned int jn=0;jn<noise.size();jn++) std::cout << " jn " << jn << " noise sum " << noise.at(jn) << std::endl;
429 //exit(22);
430  return;
431 }
432 
434 {
435 
436  return;
437 }
438 
440 {
441  // Let's get the rms we expect from the incoherent noise contribution to the waveform
442  // A couple of ways to do this, let's basically invert the frequency spectrum to
443  // produce a waveform and then get the rms from that
444  std::function<void (double[])> randGenFunc = [](double randArray[]){randArray[0]=0.5; randArray[1]=0.5;};
445 
446  icarusutil::TimeVec waveNoise(fIncoherentNoiseVec.back().size());
447  //float scaleFactor = 1.;
448 
449  // GenNoise(randGenFunc, fIncoherentNoiseVec, waveNoise, scaleFactor);
450 
451  // Now get the details...
452  double nSig(3.);
453  double mean,rmsTrunc;
454  int nTrunc;
455  int range;
456 
457  // Use the waveform tool to recover the full rms
458  fWaveformTool.getTruncatedMeanRMS(waveNoise, nSig, mean, fIncoherentNoiseRMS, rmsTrunc, nTrunc, range);
459 
460  // Do the same for the coherent term
461  // GenNoise(randGenFunc, fCoherentNoiseVec, waveNoise, scaleFactor);
462 
463  fWaveformTool.getTruncatedMeanRMS(waveNoise, nSig, mean, fCoherentNoiseRMS, rmsTrunc, nTrunc, range);
464 
465 for(unsigned int jh=0;jh<totalRMSHistPtr.size();jh++) {
466  totalRMS.push_back(totalRMSHistPtr[jh]->GetMean());
467  rmsUnc.push_back(uncorrRMSHistPtr[jh]->GetMean());
468 rmsCorr.push_back(corrRMSHistPtr[jh]->GetMean());
469 fIncoherentNoiseFrac.push_back(rmsUnc.back()/totalRMS.back());
470 //TEMPORARY!
471 //fIncoherentNoiseFrac[jh]=0;
472 std::cout << " index " <<jh << " totalRMS " << totalRMS.back() << std::endl;
473 std::cout << " index " <<jh <<" uncRMS " << rmsUnc.back() << std::endl;
474 std::cout << " index " <<jh <<" corrRMS " << rmsCorr.back() << std::endl;
475 }
476  return;
477 }
479 {
480  for(size_t index = 0; index < 4; index++)
481  {
482  TH1D* noiseHist = corrRMSHistPtr[index];
483 
484  float meanVal = noiseHist->GetMean();
485 
486  for(auto& correction : fCorrFactorsMap)
487  {
488  float corVal = noiseHist->GetRandom() / meanVal;
489 
490  correction.second[index] = corVal;
491  }
492 
494  }
495 }
496 
497 void SBNDataNoise::ExtractUncorrelatedRMS(float& cf, int index) const
498 {
499 TH1D* histo=uncorrRMSHistPtr[index];
500 
501 
502 float rndRMS=histo->GetRandom();
503 float meanRMS=histo->GetMean();
504 cf=rndRMS/meanRMS;
505 //corrFactor=10;
506 //if(fPlane==1) std::cout << " rndRMS " << rndRMS << " meanRMS " << meanRMS << " corrFactor " << corrFactor << std::endl;
507 }
508 
509 
510 DEFINE_ART_CLASS_TOOL(SBNDataNoise)
511 }
std::vector< TH1D * > corrRMSHistPtr
Utilities related to art service access.
icarusutil::FrequencyVec fNoiseFrequencyVec
std::map< unsigned int, std::vector< float >> CorrFactorsMap
static constexpr Sample_t transform(Sample_t sample)
virtual void resetCoherentNoiseFactors(const TH1D *)=0
BEGIN_PROLOG could also be dds filename
std::vector< float > rmsUnc
virtual float getCoherentNoiseFactor(unsigned int, unsigned int) const =0
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
std::vector< float > rmsCorr
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212
std::vector< ComplexVal > FrequencyVec
void GenNoise(std::function< void(double[])> &, const icarusutil::TimeVec &, icarusutil::TimeVec &, float)
void configure(const fhicl::ParameterSet &pset) override
std::vector< float > fIncoherentNoiseFrac
std::vector< std::string > fInputNoiseHistFileName
Eigen::FFT< double > fEigenFFT
std::vector< icarusutil::TimeVec > fIncoherentNoiseVec
std::vector< TH1D * > uncorrRMSHistPtr
void ExtractUncorrelatedRMS(float &, int) const
std::vector< icarusutil::TimeVec > fCoherentNoiseVec
std::vector< SigProcPrecision > TimeVec
Noise::ICoherentNoiseFactor * fCoherentNoiseService
icarus_signal_processing::WaveformTools< icarusutil::SigProcPrecision > WaveformTools
void GenerateUncorrelatedNoise(CLHEP::HepRandomEngine &, icarusutil::TimeVec &, double, unsigned int)
tuple dir
Definition: dropbox.py:28
void GenerateCorrelatedNoise(CLHEP::HepRandomEngine &, icarusutil::TimeVec &, double, unsigned int, unsigned int)
double mean(const std::vector< short > &wf, size_t start, size_t nsample)
Definition: UtilFunc.cxx:13
std::vector< TH1D * > totalRMSHistPtr
std::map< unsigned int, SlotChannelVecPair > TPCReadoutBoardToChannelMap
This is the interface class for a tool to handle a GenNoise for the overall response.
std::vector< float > totalRMS
art::ServiceHandle< art::TFileService > tfs
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:406
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
void generateNoise(CLHEP::HepRandomEngine &noise_engine, CLHEP::HepRandomEngine &cornoise_engine, icarusutil::TimeVec &noise, detinfo::DetectorPropertiesData const &, double noise_factor, const geo::PlaneID &, unsigned int board) override
art framework interface to geometry description
BEGIN_PROLOG could also be cout
auto const detProp
SBNDataNoise(const fhicl::ParameterSet &pset)