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... | |
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.
hit::CCHitFinderAlg::CCHitFinderAlg | ( | fhicl::ParameterSet const & | pset | ) |
Definition at line 45 of file CCHitFinderAlg.cxx.
|
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 276 of file CCHitFinderAlg.cxx.
|
private |
Definition at line 325 of file CCHitFinderAlg.cxx.
|
private |
Definition at line 545 of file CCHitFinderAlg.cxx.
void hit::CCHitFinderAlg::PrintStats | ( | Stream & | out | ) | const |
Print the fit statistics.
Definition at line 231 of file CCHitFinderAlg.h.
|
virtual |
Definition at line 57 of file CCHitFinderAlg.cxx.
void hit::CCHitFinderAlg::RunCCHitFinder | ( | std::vector< recob::Wire > const & | Wires | ) |
Definition at line 122 of file CCHitFinderAlg.cxx.
|
private |
Definition at line 589 of file CCHitFinderAlg.cxx.
|
private |
Definition at line 660 of file CCHitFinderAlg.cxx.
|
inline |
Returns (and loses) the collection of reconstructed hits.
Definition at line 92 of file CCHitFinderAlg.h.
std::vector<recob::Hit> hit::CCHitFinderAlg::allhits |
Definition at line 82 of file CCHitFinderAlg.h.
|
private |
Definition at line 165 of file CCHitFinderAlg.h.
|
private |
Definition at line 163 of file CCHitFinderAlg.h.
|
private |
Definition at line 166 of file CCHitFinderAlg.h.
|
private |
Definition at line 136 of file CCHitFinderAlg.h.
|
private |
Definition at line 134 of file CCHitFinderAlg.h.
|
private |
Definition at line 115 of file CCHitFinderAlg.h.
|
private |
Definition at line 135 of file CCHitFinderAlg.h.
|
private |
Definition at line 109 of file CCHitFinderAlg.h.
|
private |
Definition at line 107 of file CCHitFinderAlg.h.
|
private |
Estimated noise error on the Signal.
Definition at line 104 of file CCHitFinderAlg.h.
|
private |
counts of the good fits
Definition at line 193 of file CCHitFinderAlg.h.
|
private |
a set of functions ready to be used
Definition at line 178 of file CCHitFinderAlg.h.
|
private |
Definition at line 102 of file CCHitFinderAlg.h.
|
private |
Definition at line 103 of file CCHitFinderAlg.h.
|
private |
Definition at line 100 of file CCHitFinderAlg.h.
|
private |
Definition at line 101 of file CCHitFinderAlg.h.
|
private |
Definition at line 157 of file CCHitFinderAlg.h.
|
private |
Definition at line 108 of file CCHitFinderAlg.h.
|
private |
Definition at line 120 of file CCHitFinderAlg.h.
|
private |
whether to attempt using a fast fit on single gauss.
Definition at line 176 of file CCHitFinderAlg.h.
|
private |
Definition at line 158 of file CCHitFinderAlg.h.
|
private |
Definition at line 158 of file CCHitFinderAlg.h.
|
private |
Definition at line 159 of file CCHitFinderAlg.h.
|
private |
Definition at line 159 of file CCHitFinderAlg.h.
|
private |
Definition at line 160 of file CCHitFinderAlg.h.
|
private |
Definition at line 160 of file CCHitFinderAlg.h.
|
private |
Definition at line 124 of file CCHitFinderAlg.h.
|
private |
Definition at line 167 of file CCHitFinderAlg.h.
|
private |
Definition at line 173 of file CCHitFinderAlg.h.
|
private |
Definition at line 168 of file CCHitFinderAlg.h.
|
private |
Definition at line 172 of file CCHitFinderAlg.h.
|
private |
Definition at line 171 of file CCHitFinderAlg.h.
|
private |
Definition at line 170 of file CCHitFinderAlg.h.
|
staticprivate |
Definition at line 220 of file CCHitFinderAlg.h.
|
private |
Definition at line 130 of file CCHitFinderAlg.h.
|
private |
Definition at line 131 of file CCHitFinderAlg.h.
|
private |
Definition at line 133 of file CCHitFinderAlg.h.
|
private |
Definition at line 132 of file CCHitFinderAlg.h.
|
private |
Definition at line 164 of file CCHitFinderAlg.h.
|
private |
Definition at line 174 of file CCHitFinderAlg.h.
|
staticprivate |
Definition at line 117 of file CCHitFinderAlg.h.
|
staticprivate |
Definition at line 118 of file CCHitFinderAlg.h.
|
private |
Definition at line 111 of file CCHitFinderAlg.h.
|
private |
Definition at line 113 of file CCHitFinderAlg.h.
|
private |
Definition at line 112 of file CCHitFinderAlg.h.
|
private |
counts of the tried fits
Definition at line 194 of file CCHitFinderAlg.h.