LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
hit::CCHitFinderAlg Class Reference

Hit finder algorithm designed to work with Cluster Crawler. More...

#include "CCHitFinderAlg.h"

Classes

struct  FitStats_t
 
struct  HitChannelInfo_t
 exchange data about the originating wire More...
 

Public Member Functions

 CCHitFinderAlg (fhicl::ParameterSet const &pset)
 
void RunCCHitFinder (std::vector< recob::Wire > const &Wires)
 
std::vector< recob::Hit > && YieldHits ()
 Returns (and loses) the collection of reconstructed hits. More...
 
template<typename Stream >
void PrintStats (Stream &out) const
 Print the fit statistics. More...
 

Public Attributes

std::vector< recob::Hitallhits
 

Private Member Functions

void FitNG (unsigned short nGaus, unsigned short npt, float *ticks, float *signl)
 
void MakeCrudeHit (unsigned short npt, float *ticks, float *signl)
 
void StoreHits (unsigned short TStart, unsigned short npt, HitChannelInfo_t info, float adcsum)
 
void StudyHits (unsigned short flag, unsigned short npt=0, float *signl=nullptr, unsigned short tstart=0)
 

Static Private Member Functions

static bool FastGaussianFit (unsigned short npt, float const *ticks, float const *signl, std::array< double, 3 > &params, std::array< double, 3 > &paramerrors, float &chidof)
 Performs a "fast" fit. More...
 

Private Attributes

std::vector< float > fMinPeak
 
std::vector< float > fMinRMS
 
unsigned short fMaxBumps
 
unsigned short fMaxXtraHits
 
float fChiSplit
 Estimated noise error on the Signal. More...
 
std::vector< float > fChiNorms
 
std::vector< float > fTimeOffsets
 
std::vector< float > fChgNorms
 
raw::ChannelID_t theChannel
 
unsigned short theWireNum
 
unsigned short thePlane
 
float chinorm
 
bool fUseChannelFilter
 
geo::WireReadoutGeom const * wireReadoutGeom
 
std::vector< double > par
 
std::vector< double > parerr
 
std::vector< double > parmin
 
std::vector< double > parmax
 
float chidof
 
int dof
 
std::vector< unsigned short > bumps
 
bool fStudyHits
 
std::vector< short > fUWireRange
 
std::vector< short > fUTickRange
 
std::vector< short > fVWireRange
 
std::vector< short > fVTickRange
 
std::vector< short > fWWireRange
 
std::vector< short > fWTickRange
 
std::vector< int > bumpCnt
 
std::vector< int > RATCnt
 
std::vector< float > bumpChi
 
std::vector< float > bumpRMS
 
std::vector< int > hitCnt
 
std::vector< float > hitRMS
 
std::vector< float > loWire
 
std::vector< float > loTime
 
std::vector< float > hiWire
 
std::vector< float > hiTime
 
bool SelRAT
 
bool fUseFastFit
 whether to attempt using a fast fit on single gauss. More...
 
GausFitCache FitCache
 a set of functions ready to be used More...
 
FitStats_t FinalFitStats
 counts of the good fits More...
 
FitStats_t TriedFitStats
 counts of the tried fits More...
 

Static Private Attributes

static constexpr float Sqrt2Pi = 2.5066
 
static constexpr float SqrtPi = 1.7725
 
static constexpr unsigned int MaxGaussians = 20
 

Detailed Description

Hit finder algorithm designed to work with Cluster Crawler.

This algorithm used to store hits in a proprietary CCHit data structure. It has now been changed to use recob::Hit class directly. It is possible to translate the former into the latter, with one exception, as follows:

// this is the original CCHit definition
struct CCHit {
  float Charge;            // recob::Hit::Integral()
  float ChargeErr;         // recob::Hit::SigmaIntegral()
  float Amplitude;         // recob::Hit::PeakAmplitude()
  float AmplitudeErr;      // recob::Hit::SigmaPeakAmplitude()
  float Time;              // recob::Hit::PeakTime()
  float TimeErr;           // recob::Hit::SigmaPeakTime()
  float RMS;               // recob::Hit::RMS()
  float RMSErr;            // dropped
  float ChiDOF;            // recob::Hit::GoodnessOfFit()
  int   DOF;               // recob::Hit::DegreesOfFreedom()
  float ADCSum;            // recob::Hit::SummedADC()
  unsigned short WireNum;  // recob::Hit::WireID().Wire
  unsigned short numHits;  // recob::Hit::Multiplicity()
  unsigned int LoHitID;    // see below
  float LoTime;            // recob::Hit::StartTick()
  float HiTime;            // recob::Hit::EndTick()
  short InClus;            // dropped; see below
  geo::WireID WirID;       // recob::Hit::WireID()
  recob::Wire const* Wire; // dropped; see below
};

The uncertainty on RMS has been dropped for good.

The LoHitID member used to mean the index of the first hit in the "hit train" (that is the set of hits extracted from the same region of interest). That is a concept that is not portable. If your hit list is still the original one as produced by this algorithm, or if at least the hits from the same train are stored sorted and contiguously, for a hit with index iHit, the equivalent value of LoHitID is iHit - hit.LocalIndex().

There is no pointer to the wire any more in recob::Hit. The wire can be obtained through associations, that are typically produced by the art module that runs CCHitFinderAlg (e.g. CCHitFinder). The channel ID is also directly available as recob::Hit::Channel().

Definition at line 78 of file CCHitFinderAlg.h.

Constructor & Destructor Documentation

hit::CCHitFinderAlg::CCHitFinderAlg ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 43 of file CCHitFinderAlg.cxx.

References art::errors::Configuration, fChiNorms, fChiSplit, FinalFitStats, fMaxBumps, fMaxXtraHits, fMinPeak, fMinRMS, fStudyHits, fUseChannelFilter, fUseFastFit, fUTickRange, fUWireRange, fVTickRange, fVWireRange, fWTickRange, fWWireRange, MaxGaussians, MF_LOG_WARNING, hit::CCHitFinderAlg::FitStats_t::Reset(), and TriedFitStats.

44  : FitCache{"GausFitCache_CCHitFinderAlg"}
45  {
46  if (pset.has_key("MinSigInd"))
48  << "CCHitFinderAlg: Using no-longer-valid fcl input: MinSigInd, MinSigCol, etc";
49 
50  fMinPeak = pset.get<std::vector<float>>("MinPeak");
51  fMinRMS = pset.get<std::vector<float>>("MinRMS");
52  fMaxBumps = pset.get<unsigned short>("MaxBumps");
53  fMaxXtraHits = pset.get<unsigned short>("MaxXtraHits");
54  fChiSplit = pset.get<float>("ChiSplit");
55  fChiNorms = pset.get<std::vector<float>>("ChiNorms");
56  fUseFastFit = pset.get<bool>("UseFastFit", false);
57  fUseChannelFilter = pset.get<bool>("UseChannelFilter", true);
58  fStudyHits = pset.get<bool>("StudyHits", false);
59  // The following variables are only used in StudyHits mode
60  fUWireRange = pset.get<std::vector<short>>("UWireRange");
61  fUTickRange = pset.get<std::vector<short>>("UTickRange");
62  fVWireRange = pset.get<std::vector<short>>("VWireRange");
63  fVTickRange = pset.get<std::vector<short>>("VTickRange");
64  fWWireRange = pset.get<std::vector<short>>("WWireRange");
65  fWTickRange = pset.get<std::vector<short>>("WTickRange");
66 
67  if (fMinPeak.size() != fMinRMS.size()) {
68  mf::LogError("CCTF") << "MinPeak size != MinRMS size";
69  return;
70  }
71 
72  if (fMaxBumps > MaxGaussians) {
73  // MF_LOG_WARNING will point the user to this line of code.
74  // Any value of MaxGaussians can be used.
75  // That value is defined in the header file.
76  MF_LOG_WARNING("CCHitFinderAlg")
77  << "CCHitFinder algorithm is currently hard-coded to support at most " << MaxGaussians
78  << " bumps per region of interest, but " << fMaxBumps << " have been requested.\n"
79  << "We are forcing the parameter to " << MaxGaussians
80  << ". If this is not acceptable, increase CCHitFinderAlg::MaxGaussians"
81  << " value and recompile.";
82  fMaxBumps = MaxGaussians;
83  } // if too many gaussians
84 
87 
88  // sanity check for StudyHits mode
89  if (fStudyHits) {
90  if (fUWireRange.size() != 2 || fUTickRange.size() != 2 || fVWireRange.size() != 2 ||
91  fVTickRange.size() != 2 || fWWireRange.size() != 2 || fWTickRange.size() != 2) {
92  mf::LogError("CCHF") << "Invalid vector size for StudyHits. Must be 2";
93  }
94  } // fStudyHits
95  }
unsigned short fMaxBumps
std::vector< short > fWTickRange
float fChiSplit
Estimated noise error on the Signal.
GausFitCache FitCache
a set of functions ready to be used
std::vector< float > fChiNorms
bool fUseFastFit
whether to attempt using a fast fit on single gauss.
FitStats_t TriedFitStats
counts of the tried fits
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
std::vector< short > fUTickRange
void Reset(unsigned int nGaus)
std::vector< short > fUWireRange
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::vector< short > fWWireRange
std::vector< float > fMinPeak
static constexpr unsigned int MaxGaussians
std::vector< short > fVWireRange
std::vector< short > fVTickRange
unsigned short fMaxXtraHits
#define MF_LOG_WARNING(category)
FitStats_t FinalFitStats
counts of the good fits
std::vector< float > fMinRMS

Member Function Documentation

bool hit::CCHitFinderAlg::FastGaussianFit ( unsigned short  npt,
float const *  ticks,
float const *  signl,
std::array< double, 3 > &  params,
std::array< double, 3 > &  paramerrors,
float &  chidof 
)
staticprivate

Performs a "fast" fit.

Parameters
nptnumber of points to be fitted
tickstick coordinates
signlsignal amplitude
paramsan array where the fit parameters will be stored
paramerrorsan array where the fit parameter errors will be stored
chidofa variable where to store chi^2 over degrees of freedom
Returns
whether the fit was successful or not

Note that the fit will bail out and rteurn false if any of the input signal amplitudes is zero or negative.

Also note that currently the chi^2 is not the one from comparing the Gaussian to the signal, but from comparing a fitted parabola to the logarithm of the signal.

Definition at line 234 of file CCHitFinderAlg.cxx.

References lar::util::GaussianFit< T >::add(), lar::util::GaussianFit< T >::ChiSquare(), lar::util::GaussianFit< T >::FillResults(), MF_LOG_DEBUG, lar::util::GaussianFit< T >::NDF(), and par.

Referenced by FitNG().

240  {
241  // parameters: amplitude, mean, sigma
242 
243  lar::util::GaussianFit<double> fitter; // probably "double" is overdoing
244 
245  // apply a time shift so that the center of the time interval is 0
246  const float time_shift = (ticks[npt - 1] + ticks[0]) / 2.F;
247 
248  // fill the input data, no uncertainty
249  for (size_t i = 0; i < npt; ++i) {
250  if (signl[i] <= 0) {
251  MF_LOG_DEBUG("CCHitFinderAlg")
252  << "Non-positive charge encountered. Backing up to ROOT fit.";
253  return false;
254  }
255  // we could freely add a Poisson uncertainty (as third parameter)
256  fitter.add(ticks[i] - time_shift, signl[i]);
257  } // for
258 
259  // we might have found that we don't want the fast fit after all...
260  if (!fitter.FillResults(params, paramerrors)) {
261  // something went wrong...
262  MF_LOG_DEBUG("CCHitFinderAlg") << "Fast Gaussian fit failed.";
263  return false;
264  }
265 
266  // note that this is not the full chi^2, but it is the chi^2 of the
267  // parabolic fit underlying the Gaussian one
268  const double chi2 = fitter.ChiSquare();
269  chidof = chi2 / fitter.NDF();
270 
271  // remove the time shift
272  params[1] += time_shift; // mean
273 
274  // GP: inflate the uncertainties on the fit parameters according to chi2/NDF
275  // (not sure if this is in any way justified)
276  if (chidof > 1.)
277  for (double& par : paramerrors)
278  par *= std::sqrt(chidof);
279 
280  return true;
281  } // FastGaussianFit()
bool add(Data_t x, Data_t y, Data_t sy=Data_t(1.0))
Clears all the input statistics.
Definition: SimpleFits.h:1719
tick ticks
Alias for common language habits.
Definition: electronics.h:76
virtual bool FillResults(FitParameters_t &params, FitMatrix_t &Xmat, Data_t &det, FitMatrix_t &Smat) const override
Fills the specified parameters.
Definition: SimpleFits.h:1803
"Fast" Gaussian fit
Definition: SimpleFits.h:993
virtual int NDF() const override
Returns the degrees of freedom in the determination of the fit.
Definition: SimpleFits.h:1144
#define MF_LOG_DEBUG(id)
virtual Data_t ChiSquare() const override
Returns the of the original fit.
Definition: SimpleFits.h:1135
std::vector< double > par
void hit::CCHitFinderAlg::FitNG ( unsigned short  nGaus,
unsigned short  npt,
float *  ticks,
float *  signl 
)
private

Definition at line 284 of file CCHitFinderAlg.cxx.

References util::abs(), hit::CCHitFinderAlg::FitStats_t::AddFast(), hit::CCHitFinderAlg::FitStats_t::AddMultiGaus(), bumps, chidof, chinorm, dof, FastGaussianFit(), FinalFitStats, fMinPeak, fMinRMS, fUseFastFit, par, parerr, thePlane, and TriedFitStats.

Referenced by RunCCHitFinder().

285  {
286  // Fit the signal to n Gaussians
287 
288  dof = npt - 3 * nGaus;
289 
290  chidof = 9999.;
291 
292  if (dof < 3) return;
293  if (bumps.size() == 0) return;
294 
295  // load the fit into a temp vector
296  std::vector<double> partmp;
297  std::vector<double> partmperr;
298 
299  //
300  // if it is possible, we try first with the quick single Gaussian fit
301  //
303 
304  bool bNeedROOTfit = (nGaus > 1) || !fUseFastFit;
305  if (!bNeedROOTfit) {
306  // so, we need only one puny Gaussian;
307  std::array<double, 3> params, paramerrors;
308 
310 
311  if (FastGaussianFit(npt, ticks, signl, params, paramerrors, chidof)) {
312  // success? copy the results in the proper structures
313  partmp.resize(3);
314  std::copy(params.begin(), params.end(), partmp.begin());
315  partmperr.resize(3);
316  std::copy(paramerrors.begin(), paramerrors.end(), partmperr.begin());
317  }
318  else
319  bNeedROOTfit = true; // if we fail, let's schedule ROOT to back us up
320 
321  if (!bNeedROOTfit) FinalFitStats.AddFast();
322 
323  } // if we don't need ROOT to fit
324 
325  if (bNeedROOTfit) {
326  // we may land here either because the simple Gaussian fit did not work (either
327  // failed, or we chose not to trust it) or because the fit is multi-Gaussian
328 
329  // define the fit string to pass to TF1
330 
331  std::stringstream numConv;
332  std::string eqn = "gaus";
333  if (nGaus > 1) eqn = "gaus(0)";
334  for (unsigned short ii = 3; ii < nGaus * 3; ii += 3) {
335  eqn.append(" + gaus(");
336  numConv.str("");
337  numConv << ii;
338  eqn.append(numConv.str());
339  eqn.append(")");
340  }
341 
342  auto Gn = std::make_unique<TF1>("gn", eqn.c_str());
343  TGraph* fitn = new TGraph(npt, ticks, signl);
344 
345  // put in the bump parameters. Assume that nGaus >= bumps.size()
346  for (unsigned short ii = 0; ii < bumps.size(); ++ii) {
347  unsigned short index = ii * 3;
348  unsigned short bumptime = bumps[ii];
349  double amp = signl[bumptime];
350  Gn->SetParameter(index, amp);
351  Gn->SetParLimits(index, 0., 9999.);
352  Gn->SetParameter(index + 1, (double)bumptime);
353  Gn->SetParLimits(index + 1, 0, (double)npt);
354  Gn->SetParameter(index + 2, (double)fMinRMS[thePlane]);
355  Gn->SetParLimits(index + 2, 1., 3 * (double)fMinRMS[thePlane]);
356  } // ii bumps
357 
358  // search for other bumps that may be hidden by the already found ones
359  for (unsigned short ii = bumps.size(); ii < nGaus; ++ii) {
360  // bump height must exceed fMinPeak
361  float big = fMinPeak[thePlane];
362  unsigned short imbig = 0;
363  for (unsigned short jj = 0; jj < npt; ++jj) {
364  float diff = signl[jj] - Gn->Eval((Double_t)jj, 0, 0, 0);
365  if (diff > big) {
366  big = diff;
367  imbig = jj;
368  }
369  } // jj
370  if (imbig > 0) {
371  // set the parameters for the bump
372  unsigned short index = ii * 3;
373  Gn->SetParameter(index, (double)big);
374  Gn->SetParLimits(index, 0., 9999.);
375  Gn->SetParameter(index + 1, (double)imbig);
376  Gn->SetParLimits(index + 1, 0, (double)npt);
377  Gn->SetParameter(index + 2, (double)fMinRMS[thePlane]);
378  Gn->SetParLimits(index + 2, 1., 5 * (double)fMinRMS[thePlane]);
379  } // imbig > 0
380  } // ii
381 
382  // W = set weights to 1, N = no drawing or storing, Q = quiet
383  // B = bounded parameters
384  fitn->Fit(&*Gn, "WNQB");
385 
386  for (unsigned short ipar = 0; ipar < 3 * nGaus; ++ipar) {
387  partmp.push_back(Gn->GetParameter(ipar));
388  partmperr.push_back(Gn->GetParError(ipar));
389  }
390  chidof = Gn->GetChisquare() / (dof * chinorm);
391 
392  delete fitn;
393  // delete Gn;
394 
395  } // if ROOT fit
396 
397  // Sort by increasing time if necessary
398  if (nGaus > 1) {
399  std::vector<std::pair<unsigned short, unsigned short>> times;
400  // fill the sort vector
401  for (unsigned short ii = 0; ii < nGaus; ++ii) {
402  unsigned short index = ii * 3;
403  times.push_back(std::make_pair(partmp[index + 1], ii));
404  } // ii
405  std::sort(times.begin(), times.end());
406  // see if re-arranging is necessary
407  bool sortem = false;
408  for (unsigned short ii = 0; ii < nGaus; ++ii) {
409  if (times[ii].second != ii) {
410  sortem = true;
411  break;
412  }
413  } // ii
414  if (sortem) {
415  // temp temp vectors for putting things in the right time order
416  std::vector<double> partmpt;
417  std::vector<double> partmperrt;
418  for (unsigned short ii = 0; ii < nGaus; ++ii) {
419  unsigned short index = times[ii].second * 3;
420  partmpt.push_back(partmp[index]);
421  partmpt.push_back(partmp[index + 1]);
422  partmpt.push_back(partmp[index + 2]);
423  partmperrt.push_back(partmperr[index]);
424  partmperrt.push_back(partmperr[index + 1]);
425  partmperrt.push_back(partmperr[index + 2]);
426  } // ii
427  partmp = partmpt;
428  partmperr = partmperrt;
429  } // sortem
430  } // nGaus > 1
431 
432  // ensure that the fit is reasonable
433  bool fitok = true;
434  for (unsigned short ii = 0; ii < nGaus; ++ii) {
435  unsigned short index = ii * 3;
436  // ensure that the fitted time is within the signal bounds
437  short fittime = partmp[index + 1];
438  if (fittime < 0 || fittime > npt - 1) {
439  fitok = false;
440  break;
441  }
442  // ensure that the signal peak is large enough
443  if (partmp[index] < fMinPeak[thePlane]) {
444  fitok = false;
445  break;
446  }
447  // ensure that the RMS is large enough but not too large
448  float rms = partmp[index + 2];
449  if (rms < 0.5 * fMinRMS[thePlane] || rms > 5 * fMinRMS[thePlane]) {
450  fitok = false;
451  break;
452  }
453  // ensure that the hits are not too similar in time (< 2 ticks)
454  for (unsigned short jj = 0; jj < nGaus; ++jj) {
455  if (jj == ii) continue;
456  unsigned short jndex = jj * 3;
457  float timediff = std::abs(partmp[jndex + 1] - partmp[index + 1]);
458  if (timediff < 2.) {
459  fitok = false;
460  break;
461  }
462  }
463  if (!fitok) break;
464  }
465 
466  if (fitok) {
467  par = partmp;
468  parerr = partmperr;
469  }
470  else {
471  chidof = 9999.;
472  dof = -1;
473  }
474  } // FitNG
void AddMultiGaus(unsigned int nGaus)
std::vector< unsigned short > bumps
bool fUseFastFit
whether to attempt using a fast fit on single gauss.
constexpr auto abs(T v)
Returns the absolute value of the argument.
FitStats_t TriedFitStats
counts of the tried fits
tick ticks
Alias for common language habits.
Definition: electronics.h:76
unsigned short thePlane
static bool FastGaussianFit(unsigned short npt, float const *ticks, float const *signl, std::array< double, 3 > &params, std::array< double, 3 > &paramerrors, float &chidof)
Performs a "fast" fit.
std::vector< float > fMinPeak
second_as<> second
Type of time stored in seconds, in double precision.
Definition: spacetime.h:82
FitStats_t FinalFitStats
counts of the good fits
std::vector< double > parerr
std::vector< float > fMinRMS
std::vector< double > par
void hit::CCHitFinderAlg::MakeCrudeHit ( unsigned short  npt,
float *  ticks,
float *  signl 
)
private

Definition at line 477 of file CCHitFinderAlg.cxx.

References chidof, dof, pmtana::mean(), par, parerr, and Sqrt2Pi.

Referenced by RunCCHitFinder().

478  {
479  // make a single crude hit if fitting failed
480  float sumS = 0.;
481  float sumST = 0.;
482  for (unsigned short ii = 0; ii < npt; ++ii) {
483  sumS += signl[ii];
484  sumST += signl[ii] * ticks[ii];
485  }
486  float mean = sumST / sumS;
487  float rms = 0.;
488  for (unsigned short ii = 0; ii < npt; ++ii) {
489  float arg = ticks[ii] - mean;
490  rms += signl[ii] * arg * arg;
491  }
492  rms = std::sqrt(rms / sumS);
493  float amp = sumS / (Sqrt2Pi * rms);
494  par.clear();
495  par.push_back(amp);
496  par.push_back(mean);
497  par.push_back(rms);
498  // need to do the errors better
499  parerr.clear();
500  float amperr = npt;
501  float meanerr = std::sqrt(1 / sumS);
502  float rmserr = 0.2 * rms;
503  parerr.push_back(amperr);
504  parerr.push_back(meanerr);
505  parerr.push_back(rmserr);
506  chidof = 9999.;
507  dof = -1;
508  } // MakeCrudeHit
tick ticks
Alias for common language habits.
Definition: electronics.h:76
double mean(const std::vector< short > &wf, size_t start, size_t nsample)
Definition: UtilFunc.cxx:13
static constexpr float Sqrt2Pi
std::vector< double > parerr
std::vector< double > par
template<typename Stream >
void hit::CCHitFinderAlg::PrintStats ( Stream &  out) const

Print the fit statistics.

Definition at line 212 of file CCHitFinderAlg.h.

References hit::CCHitFinderAlg::FitStats_t::FastFits, FinalFitStats, fUseFastFit, MaxGaussians, hit::CCHitFinderAlg::FitStats_t::MultiGausFits, and TriedFitStats.

Referenced by hit::HitFinder::endJob(), and YieldHits().

213 {
214  out << "CCHitFinderAlg fit statistics:";
215  if (fUseFastFit) {
216  out << "\n fast 1-Gaussian fits: " << FinalFitStats.FastFits << " succeeded ("
217  << TriedFitStats.FastFits << " tried)";
218  }
219  else
220  out << "\n fast 1-Gaussian fits: disabled";
221 
222  for (unsigned int nGaus = 1; nGaus < MaxGaussians; ++nGaus) {
223  if (TriedFitStats.MultiGausFits[nGaus - 1] == 0) continue;
224  out << "\n " << nGaus << "-Gaussian fits: " << FinalFitStats.MultiGausFits[nGaus - 1]
225  << " accepted (" << TriedFitStats.MultiGausFits[nGaus - 1] << " tried)";
226  } // for nGaus
227  if (TriedFitStats.MultiGausFits.back() > 0) {
228  out << "\n " << FinalFitStats.MultiGausFits.size()
229  << "-Gaussian fits or higher: " << FinalFitStats.MultiGausFits.back() << " accepted ("
230  << TriedFitStats.MultiGausFits.back() << " tried)";
231  }
232  out << std::endl;
233 } // CCHitFinderAlg::FitStats_t::Print()
bool fUseFastFit
whether to attempt using a fast fit on single gauss.
FitStats_t TriedFitStats
counts of the tried fits
unsigned int FastFits
count of single-Gaussian fast fits
std::vector< unsigned int > MultiGausFits
multi-Gaussian stats
static constexpr unsigned int MaxGaussians
FitStats_t FinalFitStats
counts of the good fits
void hit::CCHitFinderAlg::RunCCHitFinder ( std::vector< recob::Wire > const &  Wires)

Definition at line 98 of file CCHitFinderAlg.cxx.

References hit::CCHitFinderAlg::FitStats_t::AddMultiGaus(), allhits, bumps, recob::Wire::Channel(), geo::WireReadoutGeom::ChannelToWire(), chidof, chinorm, dof, fChiNorms, fChiSplit, FinalFitStats, FitNG(), fMaxBumps, fMaxXtraHits, fMinPeak, fMinRMS, fStudyHits, MakeCrudeHit(), SelRAT, recob::Wire::Signal(), geo::WireReadoutGeom::SignalType(), StoreHits(), StudyHits(), theChannel, thePlane, theWireNum, and wireReadoutGeom.

Referenced by hit::HitFinder::produce(), and cluster::ClusterCrawler::produce().

99  {
100  allhits.clear();
101 
102  constexpr unsigned short maxticks = 1000;
103  float* ticks = new float[maxticks];
104  // define the ticks array used for fitting
105  for (unsigned short ii = 0; ii < maxticks; ++ii) {
106  ticks[ii] = ii;
107  }
108  float* signl = new float[maxticks];
109  float adcsum = 0;
110  // initialize the vectors for the hit study
111  if (fStudyHits) StudyHits(0);
112  bool first;
113 
114  lariov::ChannelStatusProvider const& channelStatus =
116 
117  for (size_t wireIter = 0; wireIter < Wires.size(); wireIter++) {
118  recob::Wire const& theWire = Wires[wireIter];
119  theChannel = theWire.Channel();
120  // ignore bad channels
121  if (channelStatus.IsBad(theChannel)) continue;
122 
123  std::vector<geo::WireID> wids = wireReadoutGeom->ChannelToWire(theChannel);
124  thePlane = wids[0].Plane;
125  if (thePlane > fMinPeak.size() - 1) {
126  mf::LogError("CCHF") << "MinPeak vector too small for plane " << thePlane;
127  return;
128  }
129  theWireNum = wids[0].Wire;
130  HitChannelInfo_t WireInfo{&theWire, wids[0], wireReadoutGeom->SignalType(theWire.Channel())};
131 
132  // minimum number of time samples
133  unsigned short minSamples = 2 * fMinRMS[thePlane];
134 
135  // factor used to normalize the chi/dof fits for each plane
137 
138  std::vector<float> signal(theWire.Signal());
139 
140  unsigned short nabove = 0;
141  unsigned short tstart = 0;
142  unsigned short maxtime = signal.size() - 2;
143  // find the min time when the signal is below threshold
144  unsigned short mintime = 3;
145  for (unsigned short time = 3; time < maxtime; ++time) {
146  if (signal[time] < fMinPeak[thePlane]) {
147  mintime = time;
148  break;
149  }
150  }
151  for (unsigned short time = mintime; time < maxtime; ++time) {
152  if (signal[time] > fMinPeak[thePlane]) {
153  if (nabove == 0) tstart = time;
154  ++nabove;
155  }
156  else {
157  // check for a wide enough signal above threshold
158  if (nabove > minSamples) {
159  // skip this wire if the RAT is too long
160  if (nabove > maxticks)
161  mf::LogError("CCHitFinder")
162  << "Long RAT " << nabove << " " << maxticks << " No signal on wire " << theWireNum
163  << " after time " << time;
164  if (nabove > maxticks) break;
165  unsigned short npt = 0;
166  // look for bumps to inform the fit
167  bumps.clear();
168  adcsum = 0;
169  for (unsigned short ii = tstart; ii < time; ++ii) {
170  signl[npt] = signal[ii];
171  adcsum += signl[npt];
172  if (signal[ii] > signal[ii - 1] && signal[ii - 1] > signal[ii - 2] &&
173  signal[ii] > signal[ii + 1] && signal[ii + 1] > signal[ii + 2])
174  bumps.push_back(npt);
175  ++npt;
176  }
177  // decide if this RAT should be studied
178  if (fStudyHits) StudyHits(1, npt, signl, tstart);
179  // just make a crude hit if too many bumps
180  if (bumps.size() > fMaxBumps) {
181  MakeCrudeHit(npt, ticks, signl);
182  StoreHits(tstart, npt, WireInfo, adcsum);
183  nabove = 0;
184  continue;
185  }
186  // start looking for hits with the found bumps
187  unsigned short nHitsFit = bumps.size();
188  unsigned short nfit = 0;
189  chidof = 0.;
190  dof = -1;
191  bool HitStored = false;
192  unsigned short nMaxFit = bumps.size() + fMaxXtraHits;
193  // only used in StudyHits mode
194  first = true;
195  while (nHitsFit <= nMaxFit) {
196 
197  FitNG(nHitsFit, npt, ticks, signl);
198  if (fStudyHits && first && SelRAT) {
199  first = false;
200  StudyHits(2, npt, signl, tstart);
201  }
202  // good chisq so store it
203  if (chidof < fChiSplit) {
204  StoreHits(tstart, npt, WireInfo, adcsum);
205  HitStored = true;
206  break;
207  }
208  // the previous fit was better, so revert to it and store it
209  ++nHitsFit;
210  ++nfit;
211  } // nHitsFit < fMaxXtraHits
212  if (!HitStored && npt < maxticks) {
213  // failed all fitting. Make a crude hit
214  MakeCrudeHit(npt, ticks, signl);
215  StoreHits(tstart, npt, WireInfo, adcsum);
216  }
217  else if (nHitsFit > 0)
218  FinalFitStats.AddMultiGaus(nHitsFit);
219  } // nabove > minSamples
220  nabove = 0;
221  } // signal < fMinPeak
222  } // time
223  } // wireIter
224 
225  // print out
226  if (fStudyHits) StudyHits(4);
227 
228  delete[] ticks;
229  delete[] signl;
230 
231  } //RunCCHitFinder
unsigned short fMaxBumps
void AddMultiGaus(unsigned int nGaus)
float fChiSplit
Estimated noise error on the Signal.
void FitNG(unsigned short nGaus, unsigned short npt, float *ticks, float *signl)
raw::ChannelID_t theChannel
void StoreHits(unsigned short TStart, unsigned short npt, HitChannelInfo_t info, float adcsum)
std::vector< unsigned short > bumps
std::vector< float > fChiNorms
SigType_t SignalType(PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
tick ticks
Alias for common language habits.
Definition: electronics.h:76
std::vector< recob::Hit > allhits
unsigned short thePlane
raw::ChannelID_t Channel() const
Returns the ID of the channel (or InvalidChannelID)
Definition: Wire.h:223
geo::WireReadoutGeom const * wireReadoutGeom
std::vector< float > Signal() const
Return a zero-padded full length vector filled with RoI signal.
Definition: Wire.cxx:30
void StudyHits(unsigned short flag, unsigned short npt=0, float *signl=nullptr, unsigned short tstart=0)
virtual std::vector< WireID > ChannelToWire(raw::ChannelID_t channel) const =0
unsigned short theWireNum
std::vector< float > fMinPeak
Class holding the regions of interest of signal from a channel.
Definition: Wire.h:116
unsigned short fMaxXtraHits
void MakeCrudeHit(unsigned short npt, float *ticks, float *signl)
FitStats_t FinalFitStats
counts of the good fits
std::vector< float > fMinRMS
void hit::CCHitFinderAlg::StoreHits ( unsigned short  TStart,
unsigned short  npt,
HitChannelInfo_t  info,
float  adcsum 
)
private

Definition at line 511 of file CCHitFinderAlg.cxx.

References allhits, recob::Wire::Channel(), chidof, dof, fStudyHits, hiTime, loTime, par, parerr, hit::CCHitFinderAlg::HitChannelInfo_t::sigType, Sqrt2Pi, SqrtPi, StudyHits(), recob::Wire::View(), hit::CCHitFinderAlg::HitChannelInfo_t::wire, and hit::CCHitFinderAlg::HitChannelInfo_t::wireID.

Referenced by RunCCHitFinder().

515  {
516  // store the hits in the struct
517  size_t nhits = par.size() / 3;
518 
519  if (allhits.max_size() - allhits.size() < nhits) {
520  mf::LogError("CCHitFinder") << "Too many hits: existing " << allhits.size() << " plus new "
521  << nhits << " beyond the maximum " << allhits.max_size();
522  return;
523  }
524 
525  if (nhits == 0) return;
526 
527  // fill RMS for single hits
528  if (fStudyHits) StudyHits(3);
529 
530  const float loTime = TStart;
531  const float hiTime = TStart + npt;
532 
533  // Find sum of the areas of all Gaussians
534  float gsum = 0.;
535  for (size_t hit = 0; hit < nhits; ++hit) {
536  const unsigned short index = 3 * hit;
537  gsum += Sqrt2Pi * par[index] * par[index + 2];
538  }
539  for (size_t hit = 0; hit < nhits; ++hit) {
540  const size_t index = 3 * hit;
541  const float charge = Sqrt2Pi * par[index] * par[index + 2];
542  const float charge_err =
543  SqrtPi * (parerr[index] * par[index + 2] + par[index] * parerr[index + 2]);
544 
545  allhits.emplace_back(info.wire->Channel(), // channel
546  loTime, // start_tick
547  hiTime, // end_tick
548  par[index + 1] + TStart, // peak_time
549  parerr[index + 1], // sigma_peak_time
550  par[index + 2], // rms
551  par[index], // peak_amplitude
552  parerr[index], // sigma_peak_amplitude
553  adcsum * charge / gsum, // ROIsummedADC
554  adcsum * charge / gsum, // HitsummedADC NOT CORRECTLY FILLED
555  charge, // hit_integral
556  charge_err, // hit_sigma_integral
557  nhits, // multiplicity
558  hit, // local_index
559  chidof, // goodness_of_fit
560  dof, // dof
561  info.wire->View(), // view
562  info.sigType, // signal_type
563  info.wireID // wireID
564  );
565  } // hit
566  } // StoreHits
static constexpr float SqrtPi
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
std::vector< recob::Hit > allhits
std::vector< float > hiTime
Detector simulation of raw signals on wires.
std::vector< float > loTime
void StudyHits(unsigned short flag, unsigned short npt=0, float *signl=nullptr, unsigned short tstart=0)
static constexpr float Sqrt2Pi
std::vector< double > parerr
std::vector< double > par
void hit::CCHitFinderAlg::StudyHits ( unsigned short  flag,
unsigned short  npt = 0,
float *  signl = nullptr,
unsigned short  tstart = 0 
)
private

Definition at line 569 of file CCHitFinderAlg.cxx.

References util::abs(), bumpChi, bumpCnt, bumpRMS, bumps, chidof, fChiNorms, fMinPeak, fUTickRange, fUWireRange, fVTickRange, fVWireRange, fWTickRange, fWWireRange, hitCnt, hiTime, hitRMS, hiWire, loTime, loWire, par, RATCnt, art::right(), SelRAT, sum, thePlane, and theWireNum.

Referenced by RunCCHitFinder(), and StoreHits().

573  {
574  // study hits in user-selected ranges of wires and ticks in each plane. The user should identify
575  // a shallow-angle isolated track, e.g. using the event display, to determine the wire/tick ranges.
576  // One hit should be reconstructed on each wire when the hit finding fcl parameters are set correctly.
577  // The intent of this study is to determine the correct fcl parameters. The flag variable determines
578  // the operation performed.
579  // flag = 0: Initialize study vectors
580  // flag = 1: Set SelRat true if the Region Above Threshold resides within a wire/hit range
581  // flag = 2: Find the maximum signal and calculate the RMS. Also find the low and high ticks of signals
582  // in the wire range to allow a later calculation of the track angle. This isn't strictly
583  // necessary for the study and presumes that the user has selected compatible regions in each plane.
584  // flag = 3: Accumulate the RMS from the first Gaussian fit
585  // flag = 4: Calculate recommended fcl parameters and print the results to the screen
586 
587  // init
588  if (flag == 0) {
589  for (unsigned short ipl = 0; ipl < 3; ++ipl) {
590  // Average chisq of the first fit on a single bump in each plane
591  bumpChi.push_back(0.);
592  // Average RMS of the dump
593  bumpRMS.push_back(0.);
594  // The number of single bumps in each plane
595  bumpCnt.push_back(0.);
596  // number of RATs
597  RATCnt.push_back(0);
598  // The number of single hits found in each plane
599  hitCnt.push_back(0.);
600  // Average reconstructed hit RMS
601  hitRMS.push_back(0.);
602  // lo/hi wire/time
603  loWire.push_back(9999.);
604  loTime.push_back(0.);
605  hiWire.push_back(-1.);
606  hiTime.push_back(0.);
607  } // ii
608  return;
609  } // flag == 0
610 
611  if (flag == 1) {
612  SelRAT = false;
613  if (thePlane == 0) {
614  if (theWireNum > fUWireRange[0] && theWireNum < fUWireRange[1] && tstart > fUTickRange[0] &&
615  tstart < fUTickRange[1]) {
616  SelRAT = true;
617  RATCnt[thePlane] += 1;
618  }
619  return;
620  } // thePlane == 0
621  if (thePlane == 1) {
622  if (theWireNum > fVWireRange[0] && theWireNum < fVWireRange[1] && tstart > fVTickRange[0] &&
623  tstart < fVTickRange[1]) {
624  SelRAT = true;
625  RATCnt[thePlane] += 1;
626  }
627  return;
628  } // thePlane == 1
629  if (thePlane == 2) {
630  if (theWireNum > fWWireRange[0] && theWireNum < fWWireRange[1] && tstart > fWTickRange[0] &&
631  tstart < fWTickRange[1]) {
632  SelRAT = true;
633  RATCnt[thePlane] += 1;
634  }
635  return;
636  } // thePlane == 2
637  } // flag == 1
638 
639  if (flag == 2) {
640  if (!SelRAT) return;
641  // in this section we find the low/hi wire/time for a signal. This can be used to calculate
642  // the slope dT/dW to study hit width, fraction of crude hits, etc vs dT/dW
643  float big = 0.;
644  float imbig = 0.;
645  for (unsigned short ii = 0; ii < npt; ++ii) {
646  if (signl[ii] > big) {
647  big = signl[ii];
648  imbig = ii;
649  }
650  } // ii
651  // require a significant PH
652  if (big > fMinPeak[0]) {
653  // get the Lo info
654  if (theWireNum < loWire[thePlane]) {
656  loTime[thePlane] = tstart + imbig;
657  }
658  // get the Hi info
659  if (theWireNum > hiWire[thePlane]) {
661  hiTime[thePlane] = tstart + imbig;
662  }
663  } // big > fMinPeak[0]
664  if (bumps.size() == 1 && chidof < 9999.) {
665  bumpCnt[thePlane] += bumps.size();
666  bumpChi[thePlane] += chidof;
667  // calculate the average bin
668  float sumt = 0.;
669  float sum = 0.;
670  for (unsigned short ii = 0; ii < npt; ++ii) {
671  sum += signl[ii];
672  sumt += signl[ii] * ii;
673  } // ii
674  float aveb = sumt / sum;
675  // now calculate the RMS
676  sumt = 0.;
677  for (unsigned short ii = 0; ii < npt; ++ii) {
678  float dbin = (float)ii - aveb;
679  sumt += signl[ii] * dbin * dbin;
680  } // ii
681  bumpRMS[thePlane] += std::sqrt(sumt / sum);
682  } // bumps.size() == 1 && chidof < 9999.
683  return;
684  } // flag == 2
685 
686  // fill info for single hits
687  if (flag == 3) {
688  if (!SelRAT) return;
689  if (par.size() == 3) {
690  hitCnt[thePlane] += 1;
691  hitRMS[thePlane] += par[2];
692  }
693  return;
694  }
695 
696  if (flag == 4) {
697  // The goal is to adjust the fcl inputs so that the number of single
698  // hits found is ~equal to the number of single bumps found for shallow
699  // angle tracks. The ChiNorm inputs should be adjusted so the average
700  // chisq/DOF is ~1 in each plane.
701  std::cout << "Check lo and hi W/T for each plane" << std::endl;
702  for (unsigned short ipl = 0; ipl < 3; ++ipl) {
703  std::cout << ipl << " lo " << loWire[ipl] << " " << loTime[ipl] << " hi " << hiWire[ipl]
704  << " " << hiTime[ipl] << std::endl;
705  }
706  std::cout << " ipl nRAT bCnt bChi bRMS hCnt hRMS dT/dW New_ChiNorm" << std::endl;
707  for (unsigned short ipl = 0; ipl < 3; ++ipl) {
708  if (bumpCnt[ipl] > 0) {
709  bumpChi[ipl] = bumpChi[ipl] / (float)bumpCnt[ipl];
710  bumpRMS[ipl] = bumpRMS[ipl] / (float)bumpCnt[ipl];
711  hitRMS[ipl] = hitRMS[ipl] / (float)hitCnt[ipl];
712  // calculate the slope
713  float dTdW = std::abs((hiTime[ipl] - loTime[ipl]) / (hiWire[ipl] - loWire[ipl]));
714  std::cout << ipl << std::right << std::setw(5) << RATCnt[ipl] << std::setw(5)
715  << bumpCnt[ipl] << std::setw(7) << std::fixed << std::setprecision(2)
716  << bumpChi[ipl] << std::setw(7) << bumpRMS[ipl] << std::setw(7) << hitCnt[ipl]
717  << std::setw(7) << std::setprecision(1) << hitRMS[ipl] << std::setw(7) << dTdW
718  << std::setw(7) << std::setprecision(2) << bumpChi[ipl] * fChiNorms[ipl]
719  << std::endl;
720  } //
721  } // ipl
722  std::cout << "nRAT is the number of Regions Above Threshold (RAT) used in the study.\n";
723  std::cout << "bCnt is the number of single bumps that were successfully fitted \n";
724  std::cout << "bChi is the average chisq/DOF of the first fit\n";
725  std::cout << "bRMS is the average calculated RMS of the bumps\n";
726  std::cout << "hCnt is the number of RATs that have a single hit\n";
727  std::cout << "hRMS is the average RMS from the Gaussian fit -> use this value for "
728  "fMinRMS[plane] in the fcl file\n";
729  std::cout << "dTdW is the slope of the track\n";
730  std::cout
731  << "New_ChiNorm is the recommended values of ChiNorm that should be used in the fcl file\n";
732  bumpChi.clear();
733  bumpRMS.clear();
734  bumpCnt.clear();
735  RATCnt.clear();
736  hitRMS.clear();
737  hitCnt.clear();
738  loWire.clear();
739  loTime.clear();
740  hiWire.clear();
741  hiTime.clear();
742  }
743  } // StudyHits
std::vector< short > fWTickRange
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:102
std::vector< float > loWire
std::vector< float > hiWire
std::vector< unsigned short > bumps
std::vector< float > fChiNorms
std::vector< float > bumpRMS
constexpr auto abs(T v)
Returns the absolute value of the argument.
std::vector< short > fUTickRange
unsigned short thePlane
std::vector< float > hiTime
std::vector< short > fUWireRange
std::vector< int > bumpCnt
std::vector< float > loTime
std::vector< short > fWWireRange
unsigned short theWireNum
std::vector< float > fMinPeak
std::vector< int > hitCnt
std::vector< short > fVWireRange
std::vector< short > fVTickRange
std::vector< float > hitRMS
Double_t sum
Definition: plot.C:31
std::vector< int > RATCnt
std::vector< float > bumpChi
std::vector< double > par
std::vector<recob::Hit>&& hit::CCHitFinderAlg::YieldHits ( )
inline

Returns (and loses) the collection of reconstructed hits.

Definition at line 86 of file CCHitFinderAlg.h.

References PrintStats().

Referenced by hit::HitFinder::produce(), and cluster::ClusterCrawler::produce().

86 { return std::move(allhits); }
std::vector< recob::Hit > allhits

Member Data Documentation

std::vector<recob::Hit> hit::CCHitFinderAlg::allhits

Definition at line 80 of file CCHitFinderAlg.h.

Referenced by RunCCHitFinder(), and StoreHits().

std::vector<float> hit::CCHitFinderAlg::bumpChi
private

Definition at line 151 of file CCHitFinderAlg.h.

Referenced by StudyHits().

std::vector<int> hit::CCHitFinderAlg::bumpCnt
private

Definition at line 149 of file CCHitFinderAlg.h.

Referenced by StudyHits().

std::vector<float> hit::CCHitFinderAlg::bumpRMS
private

Definition at line 152 of file CCHitFinderAlg.h.

Referenced by StudyHits().

std::vector<unsigned short> hit::CCHitFinderAlg::bumps
private

Definition at line 126 of file CCHitFinderAlg.h.

Referenced by FitNG(), RunCCHitFinder(), and StudyHits().

float hit::CCHitFinderAlg::chidof
private

Definition at line 124 of file CCHitFinderAlg.h.

Referenced by FitNG(), MakeCrudeHit(), RunCCHitFinder(), StoreHits(), and StudyHits().

float hit::CCHitFinderAlg::chinorm
private

Definition at line 108 of file CCHitFinderAlg.h.

Referenced by FitNG(), and RunCCHitFinder().

int hit::CCHitFinderAlg::dof
private

Definition at line 125 of file CCHitFinderAlg.h.

Referenced by FitNG(), MakeCrudeHit(), RunCCHitFinder(), and StoreHits().

std::vector<float> hit::CCHitFinderAlg::fChgNorms
private

Definition at line 102 of file CCHitFinderAlg.h.

std::vector<float> hit::CCHitFinderAlg::fChiNorms
private

Definition at line 100 of file CCHitFinderAlg.h.

Referenced by CCHitFinderAlg(), RunCCHitFinder(), and StudyHits().

float hit::CCHitFinderAlg::fChiSplit
private

Estimated noise error on the Signal.

Definition at line 97 of file CCHitFinderAlg.h.

Referenced by CCHitFinderAlg(), and RunCCHitFinder().

FitStats_t hit::CCHitFinderAlg::FinalFitStats
private

counts of the good fits

Definition at line 175 of file CCHitFinderAlg.h.

Referenced by CCHitFinderAlg(), FitNG(), PrintStats(), and RunCCHitFinder().

GausFitCache hit::CCHitFinderAlg::FitCache
private

a set of functions ready to be used

Definition at line 164 of file CCHitFinderAlg.h.

unsigned short hit::CCHitFinderAlg::fMaxBumps
private

Definition at line 95 of file CCHitFinderAlg.h.

Referenced by CCHitFinderAlg(), and RunCCHitFinder().

unsigned short hit::CCHitFinderAlg::fMaxXtraHits
private

Definition at line 96 of file CCHitFinderAlg.h.

Referenced by CCHitFinderAlg(), and RunCCHitFinder().

std::vector<float> hit::CCHitFinderAlg::fMinPeak
private

Definition at line 93 of file CCHitFinderAlg.h.

Referenced by CCHitFinderAlg(), FitNG(), RunCCHitFinder(), and StudyHits().

std::vector<float> hit::CCHitFinderAlg::fMinRMS
private

Definition at line 94 of file CCHitFinderAlg.h.

Referenced by CCHitFinderAlg(), FitNG(), and RunCCHitFinder().

bool hit::CCHitFinderAlg::fStudyHits
private

Definition at line 141 of file CCHitFinderAlg.h.

Referenced by CCHitFinderAlg(), RunCCHitFinder(), and StoreHits().

std::vector<float> hit::CCHitFinderAlg::fTimeOffsets
private

Definition at line 101 of file CCHitFinderAlg.h.

bool hit::CCHitFinderAlg::fUseChannelFilter
private

Definition at line 112 of file CCHitFinderAlg.h.

Referenced by CCHitFinderAlg().

bool hit::CCHitFinderAlg::fUseFastFit
private

whether to attempt using a fast fit on single gauss.

Definition at line 162 of file CCHitFinderAlg.h.

Referenced by CCHitFinderAlg(), FitNG(), and PrintStats().

std::vector<short> hit::CCHitFinderAlg::fUTickRange
private

Definition at line 142 of file CCHitFinderAlg.h.

Referenced by CCHitFinderAlg(), and StudyHits().

std::vector<short> hit::CCHitFinderAlg::fUWireRange
private

Definition at line 142 of file CCHitFinderAlg.h.

Referenced by CCHitFinderAlg(), and StudyHits().

std::vector<short> hit::CCHitFinderAlg::fVTickRange
private

Definition at line 143 of file CCHitFinderAlg.h.

Referenced by CCHitFinderAlg(), and StudyHits().

std::vector<short> hit::CCHitFinderAlg::fVWireRange
private

Definition at line 143 of file CCHitFinderAlg.h.

Referenced by CCHitFinderAlg(), and StudyHits().

std::vector<short> hit::CCHitFinderAlg::fWTickRange
private

Definition at line 144 of file CCHitFinderAlg.h.

Referenced by CCHitFinderAlg(), and StudyHits().

std::vector<short> hit::CCHitFinderAlg::fWWireRange
private

Definition at line 144 of file CCHitFinderAlg.h.

Referenced by CCHitFinderAlg(), and StudyHits().

std::vector<int> hit::CCHitFinderAlg::hitCnt
private

Definition at line 153 of file CCHitFinderAlg.h.

Referenced by StudyHits().

std::vector<float> hit::CCHitFinderAlg::hiTime
private

Definition at line 159 of file CCHitFinderAlg.h.

Referenced by StoreHits(), and StudyHits().

std::vector<float> hit::CCHitFinderAlg::hitRMS
private

Definition at line 154 of file CCHitFinderAlg.h.

Referenced by StudyHits().

std::vector<float> hit::CCHitFinderAlg::hiWire
private

Definition at line 158 of file CCHitFinderAlg.h.

Referenced by StudyHits().

std::vector<float> hit::CCHitFinderAlg::loTime
private

Definition at line 157 of file CCHitFinderAlg.h.

Referenced by StoreHits(), and StudyHits().

std::vector<float> hit::CCHitFinderAlg::loWire
private

Definition at line 156 of file CCHitFinderAlg.h.

Referenced by StudyHits().

constexpr unsigned int hit::CCHitFinderAlg::MaxGaussians = 20
staticprivate

Definition at line 202 of file CCHitFinderAlg.h.

Referenced by CCHitFinderAlg(), and PrintStats().

std::vector<double> hit::CCHitFinderAlg::par
private

Definition at line 120 of file CCHitFinderAlg.h.

Referenced by FastGaussianFit(), FitNG(), MakeCrudeHit(), StoreHits(), and StudyHits().

std::vector<double> hit::CCHitFinderAlg::parerr
private

Definition at line 121 of file CCHitFinderAlg.h.

Referenced by FitNG(), MakeCrudeHit(), and StoreHits().

std::vector<double> hit::CCHitFinderAlg::parmax
private

Definition at line 123 of file CCHitFinderAlg.h.

std::vector<double> hit::CCHitFinderAlg::parmin
private

Definition at line 122 of file CCHitFinderAlg.h.

std::vector<int> hit::CCHitFinderAlg::RATCnt
private

Definition at line 150 of file CCHitFinderAlg.h.

Referenced by StudyHits().

bool hit::CCHitFinderAlg::SelRAT
private

Definition at line 160 of file CCHitFinderAlg.h.

Referenced by RunCCHitFinder(), and StudyHits().

constexpr float hit::CCHitFinderAlg::Sqrt2Pi = 2.5066
staticprivate

Definition at line 109 of file CCHitFinderAlg.h.

Referenced by MakeCrudeHit(), and StoreHits().

constexpr float hit::CCHitFinderAlg::SqrtPi = 1.7725
staticprivate

Definition at line 110 of file CCHitFinderAlg.h.

Referenced by StoreHits().

raw::ChannelID_t hit::CCHitFinderAlg::theChannel
private

Definition at line 104 of file CCHitFinderAlg.h.

Referenced by RunCCHitFinder().

unsigned short hit::CCHitFinderAlg::thePlane
private

Definition at line 106 of file CCHitFinderAlg.h.

Referenced by FitNG(), RunCCHitFinder(), and StudyHits().

unsigned short hit::CCHitFinderAlg::theWireNum
private

Definition at line 105 of file CCHitFinderAlg.h.

Referenced by RunCCHitFinder(), and StudyHits().

FitStats_t hit::CCHitFinderAlg::TriedFitStats
private

counts of the tried fits

Definition at line 176 of file CCHitFinderAlg.h.

Referenced by CCHitFinderAlg(), FitNG(), and PrintStats().

geo::WireReadoutGeom const* hit::CCHitFinderAlg::wireReadoutGeom
private
Initial value:

Definition at line 114 of file CCHitFinderAlg.h.

Referenced by RunCCHitFinder().


The documentation for this class was generated from the following files: