LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
DataProviderAlg.cxx
Go to the documentation of this file.
1 // Class: PointIdAlg
3 // Author: P.Plonski, R.Sulej (Robert.Sulej@cern.ch), D.Stefan, May 2016
5 
7 
9 #include "cetlib_except/exception.h"
11 
15 #include "larevt/CalibrationDBI/Interface/ChannelStatusProvider.h"
16 #include "larevt/CalibrationDBI/Interface/ChannelStatusService.h"
17 namespace detinfo {
18  class DetectorClocksData;
19 }
21 
22 #include "CLHEP/Random/RandGauss.h"
23 
24 #include <algorithm>
25 #include <optional>
26 #include <string>
27 #include <vector>
28 
30  : fAlgView{}
32  , fDriftWindow(10)
33  , fCalorimetryAlg(config.CalorimetryAlg())
36  , fAdcSumOverThr(0)
37  , fAdcSumThr(10) // set fixed threshold of 10 ADC counts for counting the sum
38  , fAdcAreaOverThr(0)
39  , fNoiseSigma(0)
40  , fCoherentSigma(0)
41 {
42  fCalibrateLifetime = config.CalibrateLifetime();
43  fCalibrateAmpl = config.CalibrateAmpl();
44 
46  if (fCalibrateAmpl) {
47  mf::LogInfo("DataProviderAlg") << "Using calibration constants:";
48  for (size_t p = 0; p < fAmplCalibConst.size(); ++p) {
49  try {
51  mf::LogInfo("DataProviderAlg") << " plane:" << p << " const:" << 1.0 / fAmplCalibConst[p];
52  }
53  catch (...) {
54  fAmplCalibConst[p] = 1.0;
55  }
56  }
57  }
58  else {
59  mf::LogInfo("DataProviderAlg") << "No plane-to-plane calibration.";
60  for (size_t p = 0; p < fAmplCalibConst.size(); ++p) {
61  fAmplCalibConst[p] = 1.0;
62  }
63  }
64 
65  fDriftWindow = config.DriftWindow();
66  fDownscaleFullView = config.DownscaleFullView();
68 
69  std::string mode_str = config.DownscaleFn();
70  mf::LogVerbatim("DataProviderAlg") << "Downscale mode is: " << mode_str;
71  if (mode_str == "maxpool") {
72  //fnDownscale = [this](std::vector<float> & dst, std::vector<float> const & adc, size_t tick0) { downscaleMax(dst, adc, tick0); };
74  }
75  else if (mode_str == "maxmean") {
76  //fnDownscale = [this](std::vector<float> & dst, std::vector<float> const & adc, size_t tick0) { downscaleMaxMean(dst, adc, tick0); };
78  }
79  else if (mode_str == "mean") {
80  //fnDownscale = [this](std::vector<float> & dst, std::vector<float> const & adc, size_t tick0) { downscaleMean(dst, adc, tick0); };
82  }
83  else {
84  mf::LogError("DataProviderAlg") << "Downscale mode string not recognized, set to max pooling.";
85  //fnDownscale = [this](std::vector<float> & dst, std::vector<float> const & adc, size_t tick0) { downscaleMax(dst, adc, tick0); };
87  }
88 
89  fAdcMax = config.AdcMax();
90  fAdcMin = config.AdcMin();
91  fAdcOffset = config.OutMin();
92  fAdcScale = (config.OutMax() - fAdcOffset) / (fAdcMax - fAdcMin);
93  fAdcZero = fAdcOffset + fAdcScale * (0 - fAdcMin); // level of zero ADC after scaling
94 
95  if (fAdcMax <= fAdcMin) {
96  throw cet::exception("img::DataProviderAlg") << "Misconfigured: AdcMax <= AdcMin" << std::endl;
97  }
98  if (fAdcScale == 0) {
99  throw cet::exception("img::DataProviderAlg") << "Misconfigured: OutMax == OutMin" << std::endl;
100  }
101 
102  fBlurKernel = config.BlurKernel();
103  fNoiseSigma = config.NoiseSigma();
104  fCoherentSigma = config.CoherentSigma();
105 }
106 // ------------------------------------------------------
107 
109 // ------------------------------------------------------
110 
112  detinfo::DetectorClocksData const& clock_data,
113  detinfo::DetectorPropertiesData const& det_prop,
114  size_t wires,
115  size_t drifts)
116 {
118  result.fNWires = wires;
119  result.fNDrifts = drifts;
120  result.fNScaledDrifts = drifts / fDriftWindow;
121  result.fNCachedDrifts = fDownscaleFullView ? result.fNScaledDrifts : drifts;
122 
123  result.fWireChannels.resize(wires, raw::InvalidChannelID);
124 
125  result.fWireDriftData.resize(wires, std::vector<float>(result.fNCachedDrifts, fAdcZero));
126 
127  result.fLifetimeCorrFactors.resize(drifts);
128  if (fCalibrateLifetime) {
129  for (size_t t = 0; t < drifts; ++t) {
130  result.fLifetimeCorrFactors[t] = fCalorimetryAlg.LifetimeCorrection(clock_data, det_prop, t);
131  }
132  }
133  else {
134  for (size_t t = 0; t < drifts; ++t) {
135  result.fLifetimeCorrFactors[t] = 1.0;
136  }
137  }
138  return result;
139 }
140 // ------------------------------------------------------
141 
142 float img::DataProviderAlg::poolMax(int wire, int drift, size_t r) const
143 {
144  size_t rw = r, rd = r;
145  if (!fDownscaleFullView) { rd *= fDriftWindow; }
146 
147  size_t didx = getDriftIndex(drift);
148  int d0 = didx - rd;
149  if (d0 < 0) { d0 = 0; }
150  int d1 = didx + rd;
151  if (d1 >= (int)fAlgView.fNCachedDrifts) { d1 = fAlgView.fNCachedDrifts - 1; }
152 
153  int w0 = wire - rw;
154  if (w0 < 0) { w0 = 0; }
155  int w1 = wire + rw;
156  if (w1 >= (int)fAlgView.fNWires) { w1 = fAlgView.fNWires - 1; }
157 
158  float adc, max_adc = 0;
159  for (int w = w0; w <= w1; ++w) {
160  auto const* col = fAlgView.fWireDriftData[w].data();
161  for (int d = d0; d <= d1; ++d) {
162  adc = col[d];
163  if (adc > max_adc) { max_adc = adc; }
164  }
165  }
166 
167  return max_adc;
168 }
169 // ------------------------------------------------------
170 
171 //float img::DataProviderAlg::poolSum(int wire, int drift, size_t r) const
172 //{
173 // size_t rw = r, rd = r;
174 // if (!fDownscaleFullView) { rd *= fDriftWindow; }
175 //
176 // size_t didx = getDriftIndex(drift);
177 // int d0 = didx - rd; if (d0 < 0) { d0 = 0; }
178 // int d1 = didx + rd; if (d1 >= (int)fNCachedDrifts) { d1 = fNCachedDrifts - 1; }
179 //
180 // int w0 = wire - rw; if (w0 < 0) { w0 = 0; }
181 // int w1 = wire + rw; if (w1 >= (int)fNWires) { w1 = fNWires - 1; }
182 //
183 // float sum = 0;
184 // for (int w = w0; w <= w1; ++w)
185 // {
186 // auto const * col = fWireDriftData[w].data();
187 // for (int d = d0; d <= d1; ++d) { sum += col[d]; }
188 // }
189 //
190 // return sum;
191 //}
192 // ------------------------------------------------------
193 std::vector<float> img::DataProviderAlg::downscaleMax(std::size_t dst_size,
194  std::vector<float> const& adc,
195  size_t tick0) const
196 {
197  size_t kStop = dst_size;
198  std::vector<float> result(dst_size);
199  if (adc.size() < kStop) { kStop = adc.size(); }
200  for (size_t i = 0, k0 = 0; i < kStop; ++i, k0 += fDriftWindow) {
201  size_t k1 = k0 + fDriftWindow;
202 
203  float max_adc = adc[k0] * fAlgView.fLifetimeCorrFactors[k0 + tick0];
204  for (size_t k = k0 + 1; k < k1; ++k) {
205  float ak = adc[k] * fAlgView.fLifetimeCorrFactors[k + tick0];
206  if (ak > max_adc) max_adc = ak;
207  }
208  result[i] = max_adc;
209  }
210  scaleAdcSamples(result);
211  return result;
212 }
213 
214 std::vector<float> img::DataProviderAlg::downscaleMaxMean(std::size_t dst_size,
215  std::vector<float> const& adc,
216  size_t tick0) const
217 {
218  size_t kStop = dst_size;
219  std::vector<float> result(dst_size);
220  if (adc.size() < kStop) { kStop = adc.size(); }
221  for (size_t i = 0, k0 = 0; i < kStop; ++i, k0 += fDriftWindow) {
222  size_t k1 = k0 + fDriftWindow;
223  size_t max_idx = k0;
224  float max_adc = adc[k0] * fAlgView.fLifetimeCorrFactors[k0 + tick0];
225  for (size_t k = k0 + 1; k < k1; ++k) {
226  float ak = adc[k] * fAlgView.fLifetimeCorrFactors[k + tick0];
227  if (ak > max_adc) {
228  max_adc = ak;
229  max_idx = k;
230  }
231  }
232 
233  size_t n = 1;
234  if (max_idx > 0) {
235  max_adc += adc[max_idx - 1] * fAlgView.fLifetimeCorrFactors[max_idx - 1 + tick0];
236  n++;
237  }
238  if (max_idx + 1 < adc.size()) {
239  max_adc += adc[max_idx + 1] * fAlgView.fLifetimeCorrFactors[max_idx + 1 + tick0];
240  n++;
241  }
242 
243  result[i] = max_adc / n;
244  }
245  scaleAdcSamples(result);
246  return result;
247 }
248 
249 std::vector<float> img::DataProviderAlg::downscaleMean(std::size_t dst_size,
250  std::vector<float> const& adc,
251  size_t tick0) const
252 {
253  size_t kStop = dst_size;
254  std::vector<float> result(dst_size);
255  if (adc.size() < kStop) { kStop = adc.size(); }
256  for (size_t i = 0, k0 = 0; i < kStop; ++i, k0 += fDriftWindow) {
257  size_t k1 = k0 + fDriftWindow;
258 
259  float sum_adc = 0;
260  for (size_t k = k0; k < k1; ++k) {
261  if (k + tick0 < fAlgView.fLifetimeCorrFactors.size())
262  sum_adc += adc[k] * fAlgView.fLifetimeCorrFactors[k + tick0];
263  }
264  result[i] = sum_adc * fDriftWindowInv;
265  }
266  scaleAdcSamples(result);
267  return result;
268 }
269 
270 std::optional<std::vector<float>> img::DataProviderAlg::setWireData(std::vector<float> const& adc,
271  size_t wireIdx) const
272 {
273  if (wireIdx >= fAlgView.fWireDriftData.size()) { return std::nullopt; }
274  auto& wData = fAlgView.fWireDriftData[wireIdx];
275 
276  if (fDownscaleFullView) {
277  if (!adc.empty()) { return downscale(wData.size(), adc, 0); }
278  return std::nullopt;
279  }
280  if (adc.empty()) { return std::nullopt; }
281  if (adc.size() <= wData.size()) { return adc; }
282  return std::vector<float>(adc.begin(), adc.begin() + wData.size());
283 }
284 // ------------------------------------------------------
285 
287  detinfo::DetectorPropertiesData const& det_prop,
288  const std::vector<recob::Wire>& wires,
289  unsigned int plane,
290  unsigned int tpc,
291  unsigned int cryo)
292 {
293  mf::LogInfo("DataProviderAlg") << "Create image for cryo:" << cryo << " tpc:" << tpc
294  << " plane:" << plane;
295 
296  fCryo = cryo;
297  fTPC = tpc;
298  fPlane = plane;
299 
300  fAdcSumOverThr = 0;
301  fAdcAreaOverThr = 0;
302 
303  size_t nwires = fWireReadoutGeom->Nwires({cryo, tpc, plane});
304  size_t ndrifts = det_prop.NumberTimeSamples();
305 
306  fAlgView = resizeView(clock_data, det_prop, nwires, ndrifts);
307 
308  auto const& channelStatus =
310 
311  bool allWrong = true;
312  for (auto const& wire : wires) {
313  auto wireChannelNumber = wire.Channel();
314  if (!channelStatus.IsGood(wireChannelNumber)) { continue; }
315 
316  size_t w_idx = 0;
317  for (auto const& id : fWireReadoutGeom->ChannelToWire(wireChannelNumber)) {
318  if ((id.Plane == plane) && (id.TPC == tpc) && (id.Cryostat == cryo)) {
319  w_idx = id.Wire;
320 
321  auto adc = wire.Signal();
322  if (adc.size() < ndrifts) {
323  mf::LogWarning("DataProviderAlg") << "Wire ADC vector size lower than NumberTimeSamples.";
324  continue; // not critical, maybe other wires are OK, so continue
325  }
326  auto wire_data = setWireData(adc, w_idx);
327  if (!wire_data) {
328  mf::LogWarning("DataProviderAlg") << "Wire data not set.";
329  continue; // also not critical, try to set other wires
330  }
331  fAlgView.fWireDriftData[w_idx] = *wire_data;
332  for (auto v : adc) {
333  if (v >= fAdcSumThr) {
334  fAdcSumOverThr += v;
335  fAdcAreaOverThr++;
336  }
337  }
338 
339  fAlgView.fWireChannels[w_idx] = wireChannelNumber;
340  allWrong = false;
341  }
342  }
343  }
344  if (allWrong) {
345  mf::LogError("DataProviderAlg")
346  << "Wires data not set in the cryo:" << cryo << " tpc:" << tpc << " plane:" << plane;
347  return false;
348  }
349 
350  applyBlur();
351  addWhiteNoise();
353 
354  return true;
355 }
356 // ------------------------------------------------------
357 
359 {
360  val *= fAmplCalibConst[fPlane]; // prescale by plane-to-plane calibration factors
361 
362  if (val < fAdcMin) { val = fAdcMin; } // saturate
363  else if (val > fAdcMax) {
364  val = fAdcMax;
365  }
366 
367  return fAdcOffset +
368  fAdcScale *
369  (val - fAdcMin); // shift and scale to the output range, shift to the output min
370 }
371 // ------------------------------------------------------
372 void img::DataProviderAlg::scaleAdcSamples(std::vector<float>& values) const
373 {
374  float calib = fAmplCalibConst[fPlane];
375  auto* data = values.data();
376 
377  size_t k = 0, size4 = values.size() >> 2, size = values.size();
378  for (size_t i = 0; i < size4; ++i) // vectorize if you can
379  {
380  data[k] *= calib; // prescale by plane-to-plane calibration factors
381  data[k + 1] *= calib;
382  data[k + 2] *= calib;
383  data[k + 3] *= calib;
384 
385  if (data[k] < fAdcMin) { data[k] = fAdcMin; } // saturate min
386  if (data[k + 1] < fAdcMin) { data[k + 1] = fAdcMin; }
387  if (data[k + 2] < fAdcMin) { data[k + 2] = fAdcMin; }
388  if (data[k + 3] < fAdcMin) { data[k + 3] = fAdcMin; }
389 
390  if (data[k] > fAdcMax) { data[k] = fAdcMax; } // saturate max
391  if (data[k + 1] > fAdcMax) { data[k + 1] = fAdcMax; }
392  if (data[k + 2] > fAdcMax) { data[k + 2] = fAdcMax; }
393  if (data[k + 3] > fAdcMax) { data[k + 3] = fAdcMax; }
394 
395  data[k] = fAdcOffset +
396  fAdcScale *
397  (data[k] - fAdcMin); // shift and scale to the output range, shift to the output min
398  data[k + 1] = fAdcOffset + fAdcScale * (data[k + 1] - fAdcMin);
399  data[k + 2] = fAdcOffset + fAdcScale * (data[k + 2] - fAdcMin);
400  data[k + 3] = fAdcOffset + fAdcScale * (data[k + 3] - fAdcMin);
401 
402  k += 4;
403  }
404  while (k < size) {
405  data[k] = scaleAdcSample(data[k]);
406  ++k;
407  } // do the tail
408 }
409 // ------------------------------------------------------
410 
412 {
413  if (fBlurKernel.size() < 2) return;
414 
415  size_t margin_left = (fBlurKernel.size() - 1) >> 1,
416  margin_right = fBlurKernel.size() - margin_left - 1;
417 
418  std::vector<std::vector<float>> src(fAlgView.fWireDriftData.size());
419  for (size_t w = 0; w < fAlgView.fWireDriftData.size(); ++w) {
420  src[w] = fAlgView.fWireDriftData[w];
421  }
422 
423  for (size_t w = margin_left; w < fAlgView.fWireDriftData.size() - margin_right; ++w) {
424  for (size_t d = 0; d < fAlgView.fWireDriftData[w].size(); ++d) {
425  float sum = 0;
426  for (size_t i = 0; i < fBlurKernel.size(); ++i) {
427  sum += fBlurKernel[i] * src[w + i - margin_left][d];
428  }
430  }
431  }
432 }
433 // ------------------------------------------------------
434 
435 // MUST give the same result as get_patch() in scripts/utils.py
437  float drift,
438  size_t size_w,
439  size_t size_d,
440  std::vector<std::vector<float>>& patch) const
441 {
442  int halfSizeW = size_w / 2;
443  int halfSizeD = size_d / 2;
444 
445  int w0 = wire - halfSizeW;
446  int w1 = wire + halfSizeW;
447 
448  size_t sd = (size_t)(drift / fDriftWindow);
449  int d0 = sd - halfSizeD;
450  int d1 = sd + halfSizeD;
451 
452  int wsize = fAlgView.fWireDriftData.size();
453  for (int w = w0, wpatch = 0; w < w1; ++w, ++wpatch) {
454  auto& dst = patch[wpatch];
455  if ((w >= 0) && (w < wsize)) {
456  auto& src = fAlgView.fWireDriftData[w];
457  int dsize = src.size();
458  for (int d = d0, dpatch = 0; d < d1; ++d, ++dpatch) {
459  if ((d >= 0) && (d < dsize)) { dst[dpatch] = src[d]; }
460  else {
461  dst[dpatch] = fAdcZero;
462  }
463  }
464  }
465  else {
466  std::fill(dst.begin(), dst.end(), fAdcZero);
467  }
468  }
469 
470  return true;
471 }
472 
474  float drift,
475  size_t size_w,
476  size_t size_d,
477  std::vector<std::vector<float>>& patch) const
478 {
479  int dsize = fDriftWindow * size_d;
480  int halfSizeW = size_w / 2;
481  int halfSizeD = dsize / 2;
482 
483  int w0 = wire - halfSizeW;
484  int w1 = wire + halfSizeW;
485 
486  int d0 = int(drift) - halfSizeD;
487  int d1 = int(drift) + halfSizeD;
488 
489  if (d0 < 0) d0 = 0;
490 
491  std::vector<float> tmp(dsize);
492  int wsize = fAlgView.fWireDriftData.size();
493  for (int w = w0, wpatch = 0; w < w1; ++w, ++wpatch) {
494  if ((w >= 0) && (w < wsize)) {
495  auto& src = fAlgView.fWireDriftData[w];
496  int src_size = src.size();
497  for (int d = d0, dpatch = 0; d < d1; ++d, ++dpatch) {
498  if ((d >= 0) && (d < src_size)) { tmp[dpatch] = src[d]; }
499  else {
500  tmp[dpatch] = fAdcZero;
501  }
502  }
503  }
504  else {
505  std::fill(tmp.begin(), tmp.end(), fAdcZero);
506  }
507  patch[wpatch] = downscale(patch[wpatch].size(), tmp, d0);
508  }
509 
510  return true;
511 }
512 // ------------------------------------------------------
513 
515 {
516  if (fNoiseSigma == 0) return;
517 
518  double effectiveSigma = scaleAdcSample(fNoiseSigma);
519  if (fDownscaleFullView) effectiveSigma /= fDriftWindow;
520 
521  CLHEP::RandGauss gauss(fRndEngine);
522  std::vector<double> noise(fAlgView.fNCachedDrifts);
523  for (auto& wire : fAlgView.fWireDriftData) {
524  gauss.fireArray(fAlgView.fNCachedDrifts, noise.data(), 0., effectiveSigma);
525  for (size_t d = 0; d < wire.size(); ++d) {
526  wire[d] += noise[d];
527  }
528  }
529 }
530 // ------------------------------------------------------
531 
533 {
534  if (fCoherentSigma == 0) return;
535 
536  double effectiveSigma = scaleAdcSample(fCoherentSigma);
537  if (fDownscaleFullView) effectiveSigma /= fDriftWindow;
538 
539  CLHEP::RandGauss gauss(fRndEngine);
540  std::vector<double> amps1(fAlgView.fWireDriftData.size());
541  std::vector<double> amps2(1 + (fAlgView.fWireDriftData.size() / 32));
542  gauss.fireArray(amps1.size(), amps1.data(), 1., 0.1); // 10% wire-wire ampl. variation
543  gauss.fireArray(amps2.size(), amps2.data(), 1., 0.1); // 10% group-group ampl. variation
544 
545  double group_amp = 1.0;
546  std::vector<double> noise(fAlgView.fNCachedDrifts);
547  for (size_t w = 0; w < fAlgView.fWireDriftData.size(); ++w) {
548  if ((w & 31) == 0) {
549  group_amp = amps2[w >> 5]; // div by 32
550  gauss.fireArray(fAlgView.fNCachedDrifts, noise.data(), 0., effectiveSigma);
551  } // every 32 wires
552 
553  auto& wire = fAlgView.fWireDriftData[w];
554  for (size_t d = 0; d < wire.size(); ++d) {
555  wire[d] += group_amp * amps1[w] * noise[d];
556  }
557  }
558 }
559 // ------------------------------------------------------
TRandom r
Definition: spectrum.C:23
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
std::optional< std::vector< float > > setWireData(std::vector< float > const &adc, size_t wireIdx) const
unsigned int Nwires(PlaneID const &planeid) const
Returns the total number of wires in the specified plane.
std::vector< std::vector< float > > fWireDriftData
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
virtual ~DataProviderAlg()
virtual DataProviderAlgView resizeView(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, size_t wires, size_t drifts)
geo::Geometry const * fGeometry
std::vector< float > downscale(std::size_t dst_size, std::vector< float > const &adc, size_t tick0) const
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
DataProviderAlg(const fhicl::ParameterSet &pset)
std::vector< float > downscaleMaxMean(std::size_t dst_size, std::vector< float > const &adc, size_t tick0) const
Float_t tmp
Definition: plot.C:35
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
unsigned int Plane() const
unsigned int noise()
Definition: chem4.cc:261
std::vector< float > fBlurKernel
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:101
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
double ElectronsFromADCPeak(double adc, unsigned short plane) const
unsigned int MaxPlanes() const
Returns the largest number of planes among all TPCs in this detector.
Definition: OpHitAlg.h:20
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:31
std::vector< float > downscaleMax(std::size_t dst_size, std::vector< float > const &adc, size_t tick0) const
std::vector< float > downscaleMean(std::size_t dst_size, std::vector< float > const &adc, size_t tick0) const
geo::WireReadoutGeom const * fWireReadoutGeom
decltype(auto) values(Coll &&coll)
Range-for loop helper iterating across the values of the specified collection.
Int_t col[ntarg]
Definition: Style.C:29
void scaleAdcSamples(std::vector< float > &values) const
std::vector< raw::ChannelID_t > fWireChannels
Float_t d
Definition: plot.C:235
void fill(const art::PtrVector< recob::Hit > &hits, int only_plane)
General LArSoft Utilities.
float scaleAdcSample(float val) const
DataProviderAlgView fAlgView
calo::CalorimetryAlg fCalorimetryAlg
bool patchFromOriginalView(size_t wire, float drift, size_t size_w, size_t size_d, std::vector< std::vector< float >> &patch) const
bool setWireDriftData(const detinfo::DetectorClocksData &clock_data, const detinfo::DetectorPropertiesData &det_prop, const std::vector< recob::Wire > &wires, unsigned int plane, unsigned int tpc, unsigned int cryo)
virtual std::vector< WireID > ChannelToWire(raw::ChannelID_t channel) const =0
Contains all timing reference information for the detector.
std::vector< float > fLifetimeCorrFactors
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::vector< float > fAmplCalibConst
Declaration of basic channel signal object.
Char_t n[5]
bool patchFromDownsampledView(size_t wire, float drift, size_t size_w, size_t size_d, std::vector< std::vector< float >> &patch) const
EDownscaleMode fDownscaleMode
CLHEP::HepJamesRandom fRndEngine
float poolMax(int wire, int drift, size_t r=0) const
Pool max value in a patch around the wire/drift pixel.
double LifetimeCorrection(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double time, double T0=0) const
Double_t sum
Definition: plot.C:31
Float_t w
Definition: plot.C:20
size_t getDriftIndex(float drift) const
art framework interface to geometry description
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33