LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
GausHitFinder_module.cc
Go to the documentation of this file.
1 #ifndef GAUSHITFINDER_H
2 #define GAUSHITFINDER_H
3 
5 //
6 // GaussHitFinder class
7 //
8 // jaasaadi@syr.edu
9 //
10 // This algorithm is designed to find hits on wires after deconvolution.
11 // -----------------------------------
12 // This algorithm is based on the FFTHitFinder written by Brian Page,
13 // Michigan State University, for the ArgoNeuT experiment.
14 //
15 //
16 // The algorithm walks along the wire and looks for pulses above threshold
17 // The algorithm then attempts to fit n-gaussians to these pulses where n
18 // is set by the number of peaks found in the pulse
19 // If the Chi2/NDF returned is "bad" it attempts to fit n+1 gaussians to
20 // the pulse. If this is a better fit it then uses the parameters of the
21 // Gaussian fit to characterize the "hit" object
22 //
23 // To use this simply include the following in your producers:
24 // gaushit: @local::microboone_gaushitfinder
25 // gaushit: @local::argoneut_gaushitfinder
27 
28 
29 // C/C++ standard library
30 #include <algorithm> // std::accumulate()
31 #include <vector>
32 #include <string>
33 #include <memory> // std::unique_ptr()
34 #include <utility> // std::move()
35 
36 // Framework includes
42 #include "fhiclcpp/ParameterSet.h"
45 
46 // LArSoft Includes
47 #include "larcoreobj/SimpleTypesAndConstants/RawTypes.h" // raw::ChannelID_t
55 #include "HitFilterAlg.h"
56 
59 
60 // ROOT Includes
61 #include "TGraphErrors.h"
62 #include "TH1D.h"
63 #include "TDecompSVD.h"
64 #include "TMath.h"
65 #include "TF1.h"
66 #include "TTree.h"
67 #include "TStopwatch.h"
68 
69 namespace hit{
71 
72 public:
73 
74  explicit GausHitFinder(fhicl::ParameterSet const& pset);
75 
76  void produce(art::Event& evt) override;
77  void beginJob() override;
78  void endJob() override;
79  void reconfigure(fhicl::ParameterSet const& p) ;
80 
81 private:
82 
83  void FillOutHitParameterVector(const std::vector<double>& input, std::vector<double>& output);
84 
86 
87  std::string fCalDataModuleLabel;
88 
89  std::string fAllHitsInstanceName;
90 
91  std::vector<int> fLongMaxHitsVec;
92  std::vector<int> fLongPulseWidthVec;
93 
94  size_t fMaxMultiHit;
96  std::vector<double> fAreaNormsVec;
98  double fChi2NDF;
99 
100  std::vector<float> fPulseHeightCuts;
101  std::vector<float> fPulseWidthCuts;
102  std::vector<float> fPulseRatioCuts;
103 
104  size_t fEventCount;
105 
106  std::vector<std::unique_ptr<reco_tool::ICandidateHitFinder>> fHitFinderToolVec;
107  std::unique_ptr<reco_tool::IPeakFitter> fPeakFitterTool;
108  std::unique_ptr<HitFilterAlg> fHitFilterAlg;
109 
110  TH1F* fFirstChi2;
111  TH1F* fChi2;
112 
113 }; // class GausHitFinder
114 
115 
116 //-------------------------------------------------
117 //-------------------------------------------------
119 {
120  this->reconfigure(pset);
121 
122  // let HitCollectionCreator declare that we are going to produce
123  // hits and associations with wires and raw digits
124  // We want the option to output two hit collections, one filtered
125  // and one with all hits. The key to doing this will be a non-null
126  // instance name for the second collection
127  // (with no particular product label)
129 
130  // and now the filtered hits...
132 
133  return;
134 } // GausHitFinder::GausHitFinder()
135 
136 
137 //-------------------------------------------------
138 //-------------------------------------------------
139 void GausHitFinder::FillOutHitParameterVector(const std::vector<double>& input,
140  std::vector<double>& output)
141 {
142  if(input.size()==0)
143  throw std::runtime_error("GausHitFinder::FillOutHitParameterVector ERROR! Input config vector has zero size.");
144 
146  const unsigned int N_PLANES = geom->Nplanes();
147 
148  if(input.size()==1)
149  output.resize(N_PLANES,input[0]);
150  else if(input.size()==N_PLANES)
151  output = input;
152  else
153  throw std::runtime_error("GausHitFinder::FillOutHitParameterVector ERROR! Input config vector size !=1 and !=N_PLANES.");
154 
155 }
156 
157 
158 //-------------------------------------------------
159 //-------------------------------------------------
161 {
162  // Implementation of optional member function here.
163  fCalDataModuleLabel = p.get< std::string >("CalDataModuleLabel");
164 
165  fAllHitsInstanceName = p.get< std::string >("AllHitsInstanceName","");
166 
167  fFilterHits = p.get< bool >("FilterHits",false);
168 
169  if (fFilterHits) {
170  if (fHitFilterAlg) { // reconfigure existing algorithm
171  fHitFilterAlg->reconfigure(p.get<fhicl::ParameterSet>("HitFilterAlg"));
172  }
173  else { // create a new algorithm instance
174  fHitFilterAlg = std::make_unique<HitFilterAlg>(p.get<fhicl::ParameterSet>("HitFilterAlg"));
175  }
176  }
177 
178  FillOutHitParameterVector(p.get< std::vector<double> >("AreaNorms"), fAreaNormsVec);
179 
180  fLongMaxHitsVec = p.get< std::vector<int>>("LongMaxHits", std::vector<int>() = {25,25,25});
181  fLongPulseWidthVec = p.get< std::vector<int>>("LongPulseWidth", std::vector<int>() = {16,16,16});
182  fMaxMultiHit = p.get< int >("MaxMultiHit");
183  fAreaMethod = p.get< int >("AreaMethod");
184  fTryNplus1Fits = p.get< bool >("TryNplus1Fits");
185  fChi2NDF = p.get< double >("Chi2NDF");
186 
187  fPulseHeightCuts = p.get< std::vector<float>>("PulseHeightCuts", std::vector<float>() = {3.0, 3.0, 3.0});
188  fPulseWidthCuts = p.get< std::vector<float>>("PulseWidthCuts", std::vector<float>() = {2.0, 1.5, 1.0});
189  fPulseRatioCuts = p.get< std::vector<float>>("PulseRatioCuts", std::vector<float>() = {0.35, 0.40, 0.20});
190 
191  // recover the tool to do the candidate hit finding
192  // Recover the vector of fhicl parameters for the ROI tools
193  const fhicl::ParameterSet& hitFinderTools = p.get<fhicl::ParameterSet>("HitFinderToolVec");
194 
195  fHitFinderToolVec.resize(hitFinderTools.get_pset_names().size());
196 
197  for(const std::string& hitFinderTool : hitFinderTools.get_pset_names())
198  {
199  const fhicl::ParameterSet& hitFinderToolParamSet = hitFinderTools.get<fhicl::ParameterSet>(hitFinderTool);
200  size_t planeIdx = hitFinderToolParamSet.get<size_t>("Plane");
201 
202  fHitFinderToolVec.at(planeIdx) = art::make_tool<reco_tool::ICandidateHitFinder>(hitFinderToolParamSet);
203  }
204 
205  // Recover the peak fitting tool
206  fPeakFitterTool = art::make_tool<reco_tool::IPeakFitter>(p.get<fhicl::ParameterSet>("PeakFitter"));
207 
208  return;
209 }
210 
211 //-------------------------------------------------
212 //-------------------------------------------------
214 {
215  // get access to the TFile service
217 
218 
219  // ======================================
220  // === Hit Information for Histograms ===
221  fFirstChi2 = tfs->make<TH1F>("fFirstChi2", "#chi^{2}", 10000, 0, 5000);
222  fChi2 = tfs->make<TH1F>("fChi2", "#chi^{2}", 10000, 0, 5000);
223 }
224 
225 //-------------------------------------------------
226 //-------------------------------------------------
228 {
229 
230 }
231 
232 // This algorithm uses the fact that deconvolved signals are very smooth
233 // and looks for hits as areas between local minima that have signal above
234 // threshold.
235 //-------------------------------------------------
237 {
238  //==================================================================================================
239 
240  TH1::AddDirectory(kFALSE);
241 
242  // Instantiate and Reset a stop watch
243  //TStopwatch StopWatch;
244  //StopWatch.Reset();
245 
246  // ################################
247  // ### Calling Geometry service ###
248  // ################################
250 
251  // ###############################################
252  // ### Making a ptr vector to put on the event ###
253  // ###############################################
254  // this contains the hit collection
255  // and its associations to wires and raw digits
256  recob::HitCollectionCreator allHitCol(*this, evt, fAllHitsInstanceName);
257 
258  // Handle the filtered hits collection...
259  recob::HitCollectionCreator hcol(*this, evt);
260  recob::HitCollectionCreator* filteredHitCol = 0;
261 
262  if( fFilterHits ) filteredHitCol = &hcol;
263 // if (fAllHitsInstanceName != "") filteredHitCol = &hcol;
264 
265  // ##########################################
266  // ### Reading in the Wire List object(s) ###
267  // ##########################################
269  evt.getByLabel(fCalDataModuleLabel,wireVecHandle);
270 
271  // #################################################################
272  // ### Reading in the RawDigit associated with these wires, too ###
273  // #################################################################
275  (wireVecHandle, evt, fCalDataModuleLabel);
276 
277  // Channel Number
279 
280  //#################################################
281  //### Set the charge determination method ###
282  //### Default is to compute the normalized area ###
283  //#################################################
284  std::function<double (double,double,double,double,int,int)> chargeFunc = [](double peakMean, double peakAmp, double peakWidth, double areaNorm, int low, int hi){return std::sqrt(2*TMath::Pi())*peakAmp*peakWidth/areaNorm;};
285 
286  //##############################################
287  //### Alternative is to integrate over pulse ###
288  //##############################################
289  if (fAreaMethod == 0)
290  chargeFunc = [](double peakMean, double peakAmp, double peakWidth, double areaNorm, int low, int hi)
291  {
292  double charge(0);
293  for(int sigPos = low; sigPos < hi; sigPos++)
294  charge += peakAmp * TMath::Gaus(sigPos,peakMean,peakWidth);
295  return charge;
296  };
297 
298  //##############################
299  //### Looping over the wires ###
300  //##############################
301  for(size_t wireIter = 0; wireIter < wireVecHandle->size(); wireIter++)
302  {
303  // ####################################
304  // ### Getting this particular wire ###
305  // ####################################
306  art::Ptr<recob::Wire> wire(wireVecHandle, wireIter);
307  art::Ptr<raw::RawDigit> rawdigits = RawDigits.at(wireIter);
308 
309  // --- Setting Channel Number and Signal type ---
310  channel = wire->Channel();
311 
312  // get the WireID for this hit
313  std::vector<geo::WireID> wids = geom->ChannelToWire(channel);
314  // for now, just take the first option returned from ChannelToWire
315  geo::WireID wid = wids[0];
316  // We need to know the plane to look up parameters
317  geo::PlaneID::PlaneID_t plane = wid.Plane;
318 
319  // ----------------------------------------------------------
320  // -- Setting the appropriate signal widths and thresholds --
321  // -- for the right plane. --
322  // ----------------------------------------------------------
323 
324  // #################################################
325  // ### Set up to loop over ROI's for this wire ###
326  // #################################################
327  const recob::Wire::RegionsOfInterest_t& signalROI = wire->SignalROI();
328 
329  for(const auto& range : signalROI.get_ranges())
330  {
331  // #################################################
332  // ### Getting a vector of signals for this wire ###
333  // #################################################
334  //std::vector<float> signal(wire->Signal());
335 
336  const std::vector<float>& signal = range.data();
337 
338  // ##########################################################
339  // ### Making an iterator for the time ticks of this wire ###
340  // ##########################################################
341  std::vector<float>::const_iterator timeIter; // iterator for time bins
342 
343  // ROI start time
344  raw::TDCtick_t roiFirstBinTick = range.begin_index();
345 
346  // ###########################################################
347  // ### Scan the waveform and find candidate peaks + merge ###
348  // ###########################################################
349 
352 
353  fHitFinderToolVec.at(plane)->findHitCandidates(signal, 0, channel, fEventCount, hitCandidateVec);
354  fHitFinderToolVec.at(plane)->MergeHitCandidates(signal, hitCandidateVec, mergedCandidateHitVec);
355 
356  // #######################################################
357  // ### Lets loop over the pulses we found on this wire ###
358  // #######################################################
359 
360  for(auto& mergedCands : mergedCandidateHitVec)
361  {
362  int startT= mergedCands.front().startTick;
363  int endT = mergedCands.back().stopTick;
364 
365  // ### Putting in a protection in case things went wrong ###
366  // ### In the end, this primarily catches the case where ###
367  // ### a fake pulse is at the start of the ROI ###
368  if (endT - startT < 5) continue;
369 
370  // #######################################################
371  // ### Clearing the parameter vector for the new pulse ###
372  // #######################################################
373 
374  // === Setting the number of Gaussians to try ===
375  int nGausForFit = mergedCands.size();
376 
377  // ##################################################
378  // ### Calling the function for fitting Gaussians ###
379  // ##################################################
380  double chi2PerNDF(0.);
381  int NDF(1);
383 
384  // #######################################################
385  // ### If # requested Gaussians is too large then punt ###
386  // #######################################################
387  if (mergedCands.size() <= fMaxMultiHit)
388  {
389  fPeakFitterTool->findPeakParameters(signal, mergedCands, peakParamsVec, chi2PerNDF, NDF);
390 
391  // If the chi2 is infinite then there is a real problem so we bail
392  if (!(chi2PerNDF < std::numeric_limits<double>::infinity()))
393  {
394  chi2PerNDF = 2.*fChi2NDF;
395  NDF = 2;
396  }
397 
398  fFirstChi2->Fill(chi2PerNDF);
399  }
400 
401  // #######################################################
402  // ### If too large then force alternate solution ###
403  // ### - Make n hits from pulse train where n will ###
404  // ### depend on the fhicl parameter fLongPulseWidth ###
405  // ### Also do this if chi^2 is too large ###
406  // #######################################################
407  if (mergedCands.size() > fMaxMultiHit || nGausForFit * chi2PerNDF > fChi2NDF)
408  {
409  int longPulseWidth = fLongPulseWidthVec.at(plane);
410  int nHitsThisPulse = (endT - startT) / longPulseWidth;
411 
412  if (nHitsThisPulse > fLongMaxHitsVec.at(plane))
413  {
414  nHitsThisPulse = fLongMaxHitsVec.at(plane);
415  longPulseWidth = (endT - startT) / nHitsThisPulse;
416  }
417 
418  if (nHitsThisPulse * longPulseWidth < endT - startT) nHitsThisPulse++;
419 
420  int firstTick = startT;
421  int lastTick = firstTick + std::min(endT,longPulseWidth);
422 
423  peakParamsVec.clear();
424  nGausForFit = nHitsThisPulse;
425  NDF = 1.;
426  chi2PerNDF = chi2PerNDF > fChi2NDF ? chi2PerNDF : -1.;
427 
428  for(int hitIdx = 0; hitIdx < nHitsThisPulse; hitIdx++)
429  {
430  // This hit parameters
431  double sumADC = std::accumulate(signal.begin() + firstTick, signal.begin() + lastTick, 0.);
432  double peakSigma = (lastTick - firstTick) / 3.; // Set the width...
433  double peakAmp = 0.3989 * sumADC / peakSigma; // Use gaussian formulation
434  double peakMean = (firstTick + lastTick) / 2.;
435 
436  // Store hit params
438 
439  peakParams.peakCenter = peakMean;
440  peakParams.peakCenterError = 0.1 * peakMean;
441  peakParams.peakSigma = peakSigma;
442  peakParams.peakSigmaError = 0.1 * peakSigma;
443  peakParams.peakAmplitude = peakAmp;
444  peakParams.peakAmplitudeError = 0.1 * peakAmp;
445 
446  peakParamsVec.push_back(peakParams);
447 
448  // set for next loop
449  firstTick = lastTick;
450  lastTick = std::min(lastTick + longPulseWidth, endT);
451  }
452  }
453 
454  // #######################################################
455  // ### Loop through returned peaks and make recob hits ###
456  // #######################################################
457 
458  int numHits(0);
459 
460  // Make a container for what will be the filtered collection
461  std::vector<recob::Hit> filteredHitVec;
462 
463  for(const auto& peakParams : peakParamsVec)
464  {
465  // Extract values for this hit
466  float peakAmp = peakParams.peakAmplitude;
467  float peakMean = peakParams.peakCenter;
468  float peakWidth = peakParams.peakSigma;
469 
470  // Place one bit of protection here
471  if (std::isnan(peakAmp))
472  {
473  std::cout << "**** hit peak amplitude is a nan! Channel: " << channel << ", start tick: " << startT << std::endl;
474  continue;
475  }
476 
477  // Extract errors
478  float peakAmpErr = peakParams.peakAmplitudeError;
479  float peakMeanErr = peakParams.peakCenterError;
480  float peakWidthErr = peakParams.peakSigmaError;
481 
482  // ### Charge ###
483  float charge = chargeFunc(peakMean, peakAmp, peakWidth, fAreaNormsVec[plane],startT,endT);;
484  float chargeErr = std::sqrt(TMath::Pi()) * (peakAmpErr*peakWidthErr + peakWidthErr*peakAmpErr);
485 
486  // ### limits for getting sums
487  std::vector<float>::const_iterator sumStartItr = signal.begin() + startT;
488  std::vector<float>::const_iterator sumEndItr = signal.begin() + endT;
489 
490  // ### Sum of ADC counts
491  double sumADC = std::accumulate(sumStartItr, sumEndItr, 0.);
492 
493  // ok, now create the hit
494  recob::HitCreator hitcreator(*wire, // wire reference
495  wid, // wire ID
496  startT+roiFirstBinTick, // start_tick TODO check
497  endT+roiFirstBinTick, // end_tick TODO check
498  peakWidth, // rms
499  peakMean+roiFirstBinTick, // peak_time
500  peakMeanErr, // sigma_peak_time
501  peakAmp, // peak_amplitude
502  peakAmpErr, // sigma_peak_amplitude
503  charge, // hit_integral
504  chargeErr, // hit_sigma_integral
505  sumADC, // summedADC FIXME
506  nGausForFit, // multiplicity
507  numHits, // local_index TODO check that the order is correct
508  chi2PerNDF, // goodness_of_fit
509  NDF // dof
510  );
511 
512  filteredHitVec.push_back(hitcreator.copy());
513 
514  const recob::Hit hit(hitcreator.move());
515 
516  // This loop will store ALL hits
517  allHitCol.emplace_back(std::move(hit), wire, rawdigits);
518  numHits++;
519  } // <---End loop over gaussians
520 
521  // Should we filter hits?
522  if (filteredHitCol && !filteredHitVec.empty())
523  {
524  // #######################################################################
525  // Is all this sorting really necessary? Would it be faster to just loop
526  // through the hits and perform simple cuts on amplitude and width on a
527  // hit-by-hit basis, either here in the module (using fPulseHeightCuts and
528  // fPulseWidthCuts) or in HitFilterAlg?
529  // #######################################################################
530 
531  // Sort in ascending peak height
532  std::sort(filteredHitVec.begin(),filteredHitVec.end(),[](const auto& left, const auto& right){return left.PeakAmplitude() > right.PeakAmplitude();});
533 
534  // Reject if the first hit fails the PH/wid cuts
535  if (filteredHitVec.front().PeakAmplitude() < fPulseHeightCuts.at(plane) || filteredHitVec.front().RMS() < fPulseWidthCuts.at(plane)) filteredHitVec.clear();
536 
537  // Now check other hits in the snippet
538  if (filteredHitVec.size() > 1)
539  {
540  // The largest pulse height will now be at the front...
541  float largestPH = filteredHitVec.front().PeakAmplitude();
542 
543  // Find where the pulse heights drop below threshold
544  float threshold(fPulseRatioCuts.at(plane));
545 
546  std::vector<recob::Hit>::iterator smallHitItr = std::find_if(filteredHitVec.begin(),filteredHitVec.end(),[largestPH,threshold](const auto& hit){return hit.PeakAmplitude() < 8. && hit.PeakAmplitude() / largestPH < threshold;});
547 
548  // Shrink to fit
549  if (smallHitItr != filteredHitVec.end()) filteredHitVec.resize(std::distance(filteredHitVec.begin(),smallHitItr));
550 
551  // Resort in time order
552  std::sort(filteredHitVec.begin(),filteredHitVec.end(),[](const auto& left, const auto& right){return left.PeakTime() < right.PeakTime();});
553  }
554 
555  // Copy the hits we want to keep to the filtered hit collection
556  for(const auto& filteredHit : filteredHitVec)
557  if (!fHitFilterAlg || fHitFilterAlg->IsGoodHit(filteredHit)) filteredHitCol->emplace_back(filteredHit, wire, rawdigits);
558  }
559 
560  fChi2->Fill(chi2PerNDF);
561 
562  }//<---End loop over merged candidate hits
563 
564  } //<---End looping over ROI's
565 
566  }//<---End looping over all the wires
567 
568 
569  //==================================================================================================
570  // End of the event -- move the hit collection and the associations into the event
571 
572  if ( filteredHitCol ){
573 
574  // If we filtered hits but no instance name was
575  // specified for the "all hits" collection, then
576  // only save the filtered hits to the event
577  if( fAllHitsInstanceName == "" ) {
578  filteredHitCol->put_into(evt);
579 
580  // otherwise, save both
581  } else {
582  filteredHitCol->put_into(evt);
583  allHitCol.put_into(evt);
584  }
585 
586  } else {
587  allHitCol.put_into(evt);
588  }
589 
590  // Keep track of events processed
591  fEventCount++;
592 
593 } // End of produce()
594 
595 
597 
598 } // end of hit namespace
599 #endif // GAUSHITFINDER_H
std::vector< double > fAreaNormsVec
factors for converting area to same units as peak height
size_t fMaxMultiHit
maximum hits for multi fit
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:112
Encapsulate the construction of a single cyostat.
recob::Hit const & copy() const
Returns the constructed wire.
Definition: HitCreator.h:362
intermediate_table::iterator iterator
std::unique_ptr< HitFilterAlg > fHitFilterAlg
algorithm used to filter out noise hits
Declaration of signal hit object.
std::vector< float > fPulseRatioCuts
std::vector< HitCandidate_t > HitCandidateVec
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
const range_list_t & get_ranges() const
Returns the internal list of non-void ranges.
void produce(art::Event &evt) override
std::vector< int > fLongMaxHitsVec
Maximum number hits on a really long pulse train.
static void declare_products(ModuleType &producer, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Declares the hit products we are going to fill.
Definition: HitCreator.h:1117
std::unique_ptr< reco_tool::IPeakFitter > fPeakFitterTool
Perform fit to candidate peaks.
struct PeakFitParams{float peakCenter PeakFitParams_t
Definition: IPeakFitter.h:31
int TDCtick_t
Type representing a TDC tick.
Definition: RawTypes.h:24
Class managing the creation of a new recob::Hit object.
Definition: HitCreator.h:84
Helper functions to create a hit.
unsigned int PlaneID_t
Type for the ID number.
Definition: geo_types.h:251
int fAreaMethod
Type of area calculation.
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
Definition: RawTypes.h:31
GausHitFinder(fhicl::ParameterSet const &pset)
intermediate_table::const_iterator const_iterator
A class handling a collection of hits and its associations.
Definition: HitCreator.h:513
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:42
raw::ChannelID_t Channel() const
Returns the ID of the channel (or InvalidChannelID)
Definition: Wire.h:164
bool fTryNplus1Fits
whether we will (true) or won&#39;t (false) try n+1 fits
std::vector< float > fPulseWidthCuts
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::vector< int > fLongPulseWidthVec
Sets width of hits used to describe long pulses.
const RegionsOfInterest_t & SignalROI() const
Returns the list of regions of interest.
Definition: Wire.h:161
void emplace_back(recob::Hit &&hit, art::Ptr< recob::Wire > const &wire=art::Ptr< recob::Wire >(), art::Ptr< raw::RawDigit > const &digits=art::Ptr< raw::RawDigit >())
Adds the specified hit to the data collection.
Definition: HitCreator.cxx:245
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:258
void put_into(art::Event &)
Moves the data into an event.
Definition: HitCreator.h:663
Detector simulation of raw signals on wires.
void FillOutHitParameterVector(const std::vector< double > &input, std::vector< double > &output)
std::vector< PeakFitParams_t > PeakParamsVec
Definition: IPeakFitter.h:39
std::vector< float > fPulseHeightCuts
maximum Chisquared / NDF allowed for a hit to be saved
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:104
T * make(ARGS...args) const
Encapsulate the construction of a single detector plane.
This provides an interface for tools which are tasked with fitting peaks on input waveforms...
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
Int_t min
Definition: plot.C:26
void reconfigure(fhicl::ParameterSet const &p)
This provides an interface for tools which are tasked with finding candidate hits on input waveforms...
Declaration of basic channel signal object.
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:49
TCEvent evt
Definition: DataStructs.cxx:5
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:27
std::vector< HitCandidateVec > MergeHitCandidateVec
std::string fAllHitsInstanceName
recob::Hit && move()
Prepares the constructed hit to be moved away.
Definition: HitCreator.h:344
Definition: fwd.h:25
art framework interface to geometry description
Encapsulate the construction of a single detector plane.
std::vector< std::unique_ptr< reco_tool::ICandidateHitFinder > > fHitFinderToolVec
For finding candidate hits.