LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
Hit finder algorithm designed to work with Cluster Crawler. More...
#include "CCHitFinderAlg.h"
Classes | |
struct | FitStats_t |
class | HitChannelInfo_t |
exchange data about the originating wire More... | |
Public Member Functions | |
CCHitFinderAlg (fhicl::ParameterSet const &pset) | |
virtual | ~CCHitFinderAlg ()=default |
virtual void | reconfigure (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 *ticks=0, float *signl=0, 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 |
art::ServiceHandle< geo::Geometry > | geom |
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... | |
std::unique_ptr< 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 82 of file CCHitFinderAlg.h.
hit::CCHitFinderAlg::CCHitFinderAlg | ( | fhicl::ParameterSet const & | pset | ) |
Definition at line 51 of file CCHitFinderAlg.cxx.
References reconfigure().
|
virtualdefault |
|
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 282 of file CCHitFinderAlg.cxx.
References lar::util::GaussianFit< T >::add(), lar::util::GaussianFit< T >::ChiSquare(), lar::util::GaussianFit< T >::FillResults(), LOG_DEBUG, lar::util::GaussianFit< T >::NDF(), and par.
Referenced by FitNG().
|
private |
Definition at line 331 of file CCHitFinderAlg.cxx.
References 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 551 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 235 of file CCHitFinderAlg.h.
References hit::CCHitFinderAlg::FitStats_t::FastFits, FinalFitStats, fUseFastFit, MaxGaussians, hit::CCHitFinderAlg::FitStats_t::MultiGausFits, and TriedFitStats.
Referenced by YieldHits().
|
virtual |
Definition at line 63 of file CCHitFinderAlg.cxx.
References art::errors::Configuration, fChiNorms, fChiSplit, FinalFitStats, fMaxBumps, fMaxXtraHits, fMinPeak, fMinRMS, fStudyHits, fUseChannelFilter, fUseFastFit, fUTickRange, fUWireRange, fVTickRange, fVWireRange, fWTickRange, fWWireRange, fhicl::ParameterSet::get(), fhicl::ParameterSet::has_key(), hit::CCHitFinderAlg::HitChannelInfo_t::HitChannelInfo_t(), LOG_WARNING, MaxGaussians, hit::CCHitFinderAlg::FitStats_t::Reset(), and TriedFitStats.
Referenced by CCHitFinderAlg(), and cluster::ClusterCrawler::reconfigure().
void hit::CCHitFinderAlg::RunCCHitFinder | ( | std::vector< recob::Wire > const & | Wires | ) |
Definition at line 128 of file CCHitFinderAlg.cxx.
References hit::CCHitFinderAlg::FitStats_t::AddMultiGaus(), allhits, bumps, recob::Wire::Channel(), geo::GeometryCore::ChannelToWire(), chidof, chinorm, dof, fChiNorms, fChiSplit, FinalFitStats, FitNG(), fMaxBumps, fMaxXtraHits, fMinPeak, fMinRMS, fStudyHits, MakeCrudeHit(), SelRAT, recob::Wire::Signal(), StoreHits(), StudyHits(), theChannel, thePlane, and theWireNum.
Referenced by cluster::ClusterCrawler::produce().
|
private |
Definition at line 595 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 666 of file CCHitFinderAlg.cxx.
References bumpChi, bumpCnt, bumpRMS, bumps, chidof, fChiNorms, fMinPeak, fUTickRange, fUWireRange, fVTickRange, fVWireRange, fWTickRange, fWWireRange, hitCnt, hiTime, hitRMS, hiWire, loTime, loWire, par, RATCnt, art::right(), SelRAT, thePlane, and theWireNum.
Referenced by RunCCHitFinder(), and StoreHits().
|
inline |
Returns (and loses) the collection of reconstructed hits.
Definition at line 96 of file CCHitFinderAlg.h.
References PrintStats().
Referenced by cluster::ClusterCrawler::produce().
std::vector<recob::Hit> hit::CCHitFinderAlg::allhits |
Definition at line 86 of file CCHitFinderAlg.h.
Referenced by RunCCHitFinder(), and StoreHits().
|
private |
Definition at line 169 of file CCHitFinderAlg.h.
Referenced by StudyHits().
|
private |
Definition at line 167 of file CCHitFinderAlg.h.
Referenced by StudyHits().
|
private |
Definition at line 170 of file CCHitFinderAlg.h.
Referenced by StudyHits().
|
private |
Definition at line 140 of file CCHitFinderAlg.h.
Referenced by FitNG(), RunCCHitFinder(), and StudyHits().
|
private |
Definition at line 138 of file CCHitFinderAlg.h.
Referenced by FitNG(), MakeCrudeHit(), RunCCHitFinder(), StoreHits(), and StudyHits().
|
private |
Definition at line 119 of file CCHitFinderAlg.h.
Referenced by FitNG(), and RunCCHitFinder().
|
private |
Definition at line 139 of file CCHitFinderAlg.h.
Referenced by FitNG(), MakeCrudeHit(), RunCCHitFinder(), and StoreHits().
|
private |
Definition at line 113 of file CCHitFinderAlg.h.
|
private |
Definition at line 111 of file CCHitFinderAlg.h.
Referenced by reconfigure(), RunCCHitFinder(), and StudyHits().
|
private |
Estimated noise error on the Signal.
Definition at line 108 of file CCHitFinderAlg.h.
Referenced by reconfigure(), and RunCCHitFinder().
|
private |
counts of the good fits
Definition at line 197 of file CCHitFinderAlg.h.
Referenced by FitNG(), PrintStats(), reconfigure(), and RunCCHitFinder().
|
private |
a set of functions ready to be used
Definition at line 182 of file CCHitFinderAlg.h.
|
private |
Definition at line 106 of file CCHitFinderAlg.h.
Referenced by reconfigure(), and RunCCHitFinder().
|
private |
Definition at line 107 of file CCHitFinderAlg.h.
Referenced by reconfigure(), and RunCCHitFinder().
|
private |
Definition at line 104 of file CCHitFinderAlg.h.
Referenced by FitNG(), reconfigure(), RunCCHitFinder(), and StudyHits().
|
private |
Definition at line 105 of file CCHitFinderAlg.h.
Referenced by FitNG(), reconfigure(), and RunCCHitFinder().
|
private |
Definition at line 161 of file CCHitFinderAlg.h.
Referenced by reconfigure(), RunCCHitFinder(), and StoreHits().
|
private |
Definition at line 112 of file CCHitFinderAlg.h.
|
private |
Definition at line 124 of file CCHitFinderAlg.h.
Referenced by reconfigure().
|
private |
whether to attempt using a fast fit on single gauss.
Definition at line 180 of file CCHitFinderAlg.h.
Referenced by FitNG(), PrintStats(), and reconfigure().
|
private |
Definition at line 162 of file CCHitFinderAlg.h.
Referenced by reconfigure(), and StudyHits().
|
private |
Definition at line 162 of file CCHitFinderAlg.h.
Referenced by reconfigure(), and StudyHits().
|
private |
Definition at line 163 of file CCHitFinderAlg.h.
Referenced by reconfigure(), and StudyHits().
|
private |
Definition at line 163 of file CCHitFinderAlg.h.
Referenced by reconfigure(), and StudyHits().
|
private |
Definition at line 164 of file CCHitFinderAlg.h.
Referenced by reconfigure(), and StudyHits().
|
private |
Definition at line 164 of file CCHitFinderAlg.h.
Referenced by reconfigure(), and StudyHits().
|
private |
Definition at line 128 of file CCHitFinderAlg.h.
|
private |
Definition at line 171 of file CCHitFinderAlg.h.
Referenced by StudyHits().
|
private |
Definition at line 177 of file CCHitFinderAlg.h.
Referenced by StoreHits(), and StudyHits().
|
private |
Definition at line 172 of file CCHitFinderAlg.h.
Referenced by StudyHits().
|
private |
Definition at line 176 of file CCHitFinderAlg.h.
Referenced by StudyHits().
|
private |
Definition at line 175 of file CCHitFinderAlg.h.
Referenced by StoreHits(), and StudyHits().
|
private |
Definition at line 174 of file CCHitFinderAlg.h.
Referenced by StudyHits().
|
staticprivate |
Definition at line 224 of file CCHitFinderAlg.h.
Referenced by PrintStats(), and reconfigure().
|
private |
Definition at line 134 of file CCHitFinderAlg.h.
Referenced by FastGaussianFit(), FitNG(), MakeCrudeHit(), StoreHits(), and StudyHits().
|
private |
Definition at line 135 of file CCHitFinderAlg.h.
Referenced by FitNG(), MakeCrudeHit(), and StoreHits().
|
private |
Definition at line 137 of file CCHitFinderAlg.h.
|
private |
Definition at line 136 of file CCHitFinderAlg.h.
|
private |
Definition at line 168 of file CCHitFinderAlg.h.
Referenced by StudyHits().
|
private |
Definition at line 178 of file CCHitFinderAlg.h.
Referenced by RunCCHitFinder(), and StudyHits().
|
staticprivate |
Definition at line 121 of file CCHitFinderAlg.h.
Referenced by MakeCrudeHit(), and StoreHits().
|
staticprivate |
Definition at line 122 of file CCHitFinderAlg.h.
Referenced by StoreHits().
|
private |
Definition at line 115 of file CCHitFinderAlg.h.
Referenced by RunCCHitFinder().
|
private |
Definition at line 117 of file CCHitFinderAlg.h.
Referenced by FitNG(), RunCCHitFinder(), and StudyHits().
|
private |
Definition at line 116 of file CCHitFinderAlg.h.
Referenced by RunCCHitFinder(), and StudyHits().
|
private |
counts of the tried fits
Definition at line 198 of file CCHitFinderAlg.h.
Referenced by FitNG(), PrintStats(), and reconfigure().