![]() |
LArSoft
v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
|
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::Hit > | allhits |
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 > ¶ms, std::array< double, 3 > ¶merrors, 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 |
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.
|
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.
|
staticprivate |
Performs a "fast" fit.
npt | number of points to be fitted |
ticks | tick coordinates |
signl | signal amplitude |
params | an array where the fit parameters will be stored |
paramerrors | an array where the fit parameter errors will be stored |
chidof | a variable where to store chi^2 over degrees of freedom |
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().
|
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().
|
private |
Definition at line 477 of file CCHitFinderAlg.cxx.
References chidof, dof, pmtana::mean(), par, parerr, and Sqrt2Pi.
Referenced by RunCCHitFinder().
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().
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().
|
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().
|
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().
|
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().
std::vector<recob::Hit> hit::CCHitFinderAlg::allhits |
Definition at line 80 of file CCHitFinderAlg.h.
Referenced by RunCCHitFinder(), and StoreHits().
|
private |
Definition at line 151 of file CCHitFinderAlg.h.
Referenced by StudyHits().
|
private |
Definition at line 149 of file CCHitFinderAlg.h.
Referenced by StudyHits().
|
private |
Definition at line 152 of file CCHitFinderAlg.h.
Referenced by StudyHits().
|
private |
Definition at line 126 of file CCHitFinderAlg.h.
Referenced by FitNG(), RunCCHitFinder(), and StudyHits().
|
private |
Definition at line 124 of file CCHitFinderAlg.h.
Referenced by FitNG(), MakeCrudeHit(), RunCCHitFinder(), StoreHits(), and StudyHits().
|
private |
Definition at line 108 of file CCHitFinderAlg.h.
Referenced by FitNG(), and RunCCHitFinder().
|
private |
Definition at line 125 of file CCHitFinderAlg.h.
Referenced by FitNG(), MakeCrudeHit(), RunCCHitFinder(), and StoreHits().
|
private |
Definition at line 102 of file CCHitFinderAlg.h.
|
private |
Definition at line 100 of file CCHitFinderAlg.h.
Referenced by CCHitFinderAlg(), RunCCHitFinder(), and StudyHits().
|
private |
Estimated noise error on the Signal.
Definition at line 97 of file CCHitFinderAlg.h.
Referenced by CCHitFinderAlg(), and RunCCHitFinder().
|
private |
counts of the good fits
Definition at line 175 of file CCHitFinderAlg.h.
Referenced by CCHitFinderAlg(), FitNG(), PrintStats(), and RunCCHitFinder().
|
private |
a set of functions ready to be used
Definition at line 164 of file CCHitFinderAlg.h.
|
private |
Definition at line 95 of file CCHitFinderAlg.h.
Referenced by CCHitFinderAlg(), and RunCCHitFinder().
|
private |
Definition at line 96 of file CCHitFinderAlg.h.
Referenced by CCHitFinderAlg(), and RunCCHitFinder().
|
private |
Definition at line 93 of file CCHitFinderAlg.h.
Referenced by CCHitFinderAlg(), FitNG(), RunCCHitFinder(), and StudyHits().
|
private |
Definition at line 94 of file CCHitFinderAlg.h.
Referenced by CCHitFinderAlg(), FitNG(), and RunCCHitFinder().
|
private |
Definition at line 141 of file CCHitFinderAlg.h.
Referenced by CCHitFinderAlg(), RunCCHitFinder(), and StoreHits().
|
private |
Definition at line 101 of file CCHitFinderAlg.h.
|
private |
Definition at line 112 of file CCHitFinderAlg.h.
Referenced by CCHitFinderAlg().
|
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().
|
private |
Definition at line 142 of file CCHitFinderAlg.h.
Referenced by CCHitFinderAlg(), and StudyHits().
|
private |
Definition at line 142 of file CCHitFinderAlg.h.
Referenced by CCHitFinderAlg(), and StudyHits().
|
private |
Definition at line 143 of file CCHitFinderAlg.h.
Referenced by CCHitFinderAlg(), and StudyHits().
|
private |
Definition at line 143 of file CCHitFinderAlg.h.
Referenced by CCHitFinderAlg(), and StudyHits().
|
private |
Definition at line 144 of file CCHitFinderAlg.h.
Referenced by CCHitFinderAlg(), and StudyHits().
|
private |
Definition at line 144 of file CCHitFinderAlg.h.
Referenced by CCHitFinderAlg(), and StudyHits().
|
private |
Definition at line 153 of file CCHitFinderAlg.h.
Referenced by StudyHits().
|
private |
Definition at line 159 of file CCHitFinderAlg.h.
Referenced by StoreHits(), and StudyHits().
|
private |
Definition at line 154 of file CCHitFinderAlg.h.
Referenced by StudyHits().
|
private |
Definition at line 158 of file CCHitFinderAlg.h.
Referenced by StudyHits().
|
private |
Definition at line 157 of file CCHitFinderAlg.h.
Referenced by StoreHits(), and StudyHits().
|
private |
Definition at line 156 of file CCHitFinderAlg.h.
Referenced by StudyHits().
|
staticprivate |
Definition at line 202 of file CCHitFinderAlg.h.
Referenced by CCHitFinderAlg(), and PrintStats().
|
private |
Definition at line 120 of file CCHitFinderAlg.h.
Referenced by FastGaussianFit(), FitNG(), MakeCrudeHit(), StoreHits(), and StudyHits().
|
private |
Definition at line 121 of file CCHitFinderAlg.h.
Referenced by FitNG(), MakeCrudeHit(), and StoreHits().
|
private |
Definition at line 123 of file CCHitFinderAlg.h.
|
private |
Definition at line 122 of file CCHitFinderAlg.h.
|
private |
Definition at line 150 of file CCHitFinderAlg.h.
Referenced by StudyHits().
|
private |
Definition at line 160 of file CCHitFinderAlg.h.
Referenced by RunCCHitFinder(), and StudyHits().
|
staticprivate |
Definition at line 109 of file CCHitFinderAlg.h.
Referenced by MakeCrudeHit(), and StoreHits().
|
staticprivate |
Definition at line 110 of file CCHitFinderAlg.h.
Referenced by StoreHits().
|
private |
Definition at line 104 of file CCHitFinderAlg.h.
Referenced by RunCCHitFinder().
|
private |
Definition at line 106 of file CCHitFinderAlg.h.
Referenced by FitNG(), RunCCHitFinder(), and StudyHits().
|
private |
Definition at line 105 of file CCHitFinderAlg.h.
Referenced by RunCCHitFinder(), and StudyHits().
|
private |
counts of the tried fits
Definition at line 176 of file CCHitFinderAlg.h.
Referenced by CCHitFinderAlg(), FitNG(), and PrintStats().
|
private |
Definition at line 114 of file CCHitFinderAlg.h.
Referenced by RunCCHitFinder().