Hit finding at the edge of a waveform gives inconsistent results
PeakFitterGaussian (larreco:source:larreco/HitFinder/HitFinderTools/PeakFitterGaussian_tool.cc) can have questionable fits set the peak outside the fitted range. This can be indeed close to correct if the region of interest was wrongly determined, or if the waveform suddenly truncates (as it may happen e.g. for a out-of-time cosmic ray depositing energy late in the event).
For example, event 3, channel #2281, ticks 2993-2999 from SBND simulation file
/pnfs/sbnd/persistent/ContinuousIntegration/reference/standard/reco_basic/nucosmics_reco_basic_test_sbndcode_Reference-201803090902.root contain a partial hit whose fit apparently sets the center of the hit at 3001, outside the range of the hit itself.
The region of fit is highlighted in green: -0.601 -1.907 -3.990 -6.033 -6.844 -5.295 -0.843 6.121 14.279 21.804 27.024 (the last digit available,
27.024, is sample 2999). The result is:
Hit #2694: Channel 2281 View = 1 Signal type = 0 Wire = C:0 T:0 P:1 W:295 StartTick = 2993 EndTick = 2999 PeakTime = 3001.00 +/- 300.10 RMS = 5.33 Amplitude = 1085123075017539584.00 +/- 108512305783767040.00 Integral = 3831844752043540480.00 +/- 205155263286607872.00 ADCsum = 29.22 Multiplicity = 0 of 1 GoodnessOfFit = 4000.00 DoF = 1
Depending on the machine, the result may be senseless (as the amplitude in this fit) or sensible (the same hit was elsewhere reconstructed as ample 4.23 calibrated ADC counts).
This edge case should be reconsidered, and in particular the fitter could declare failure to fit and produce no hits.
#1 Updated by Tracy Usher about 2 years ago
There are some cases where the output of the fits does not make sense but I think these should be trapped either by the end user (e.g. perhaps starting to take the chi-square/dof seriously) or in the peak fitter where it might recognize bad parameters being handed to it before the actual attempt to fit.
Do you have statistics on how big an issue this is for SBND?