#include <RFFHitFitter.h>
Definition at line 31 of file RFFHitFitter.h.
hit::RFFHitFitter::RFFHitFitter |
( |
float |
max_mean, |
|
|
unsigned int |
min_multi, |
|
|
float |
threshold, |
|
|
float |
step = 0.1 , |
|
|
float |
max = 5.0 |
|
) |
| |
Definition at line 24 of file RFFHitFitter.cxx.
void SetFitterParams(float, unsigned int, float)
util::GaussianEliminationAlg fGEAlg
hit::RFFHitFitter::RFFHitFitter |
( |
float |
step = 0.1 , |
|
|
float |
max = 5.0 |
|
) |
| |
Title: RFFHitFitter Class Author: Wes Ketchum (wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov)
Description: Class that does the base RFF algorithm. RFF works by simplifiying a Gaussian fit by dividing a pulse by its derivative. for a Gaussian, the result is a line, with the slope and intercept related to the sigma and mean of the Gaussian.
Input: Signal (vector of floats) Output: Guassian means and sigmas
Definition at line 20 of file RFFHitFitter.cxx.
util::GaussianEliminationAlg fGEAlg
const std::vector<float>& hit::RFFHitFitter::AmplitudeErrorVector |
( |
| ) |
|
|
inline |
Definition at line 48 of file RFFHitFitter.h.
std::vector< float > fAmpErrorVector
const std::vector<float>& hit::RFFHitFitter::AmplitudeVector |
( |
| ) |
|
|
inline |
void hit::RFFHitFitter::CalculateAllMeansAndSigmas |
( |
const std::vector< float > & |
signal | ) |
|
|
private |
Definition at line 57 of file RFFHitFitter.cxx.
59 if(signal.size()<=2)
return;
61 float prev_dev=0,this_dev=0;;
62 float slope=0;
float sigma=0;
63 float intercept=0;
float mean=0;
65 for(
size_t i_tick=1; i_tick < signal.size()-1; i_tick++)
67 this_dev = 0.5*(signal[i_tick+1]-signal[i_tick-1])/signal[i_tick];
68 slope = this_dev - prev_dev;
72 if(slope>=0)
continue;
74 sigma = std::sqrt(-1/slope);
75 intercept = 0.5*(signal[i_tick+1]-signal[i_tick-1])/signal[i_tick] - slope*i_tick;
76 mean = -1*intercept/slope;
std::multiset< MeanSigmaPair, SignalSetComp > fSignalSet
double mean(const std::vector< short > &wf, size_t start, size_t nsample)
void hit::RFFHitFitter::CalculateAmplitudes |
( |
const std::vector< float > & |
signal | ) |
|
|
private |
Definition at line 145 of file RFFHitFitter.cxx.
147 std::vector<float> heightVector(
fMeanVector.size());
153 else if(
fMeanVector[i]+1 > signal.size()) bin=signal.size()-2;
156 if(bin >= signal.size()-1)
157 throw cet::exception(
"RFFHitFitter") <<
"Error in CalculatAmplitudes! bin is out of range!\n"
158 <<
"\tFor element " << i <<
" bin is " << bin <<
"(" <<
fMeanVector[i] <<
")"
159 <<
" but size is " << signal.size() <<
".\n";
161 heightVector[i] = signal[
bin] - (
fMeanVector[i]-(float)bin)*(signal[
bin]-signal[bin+1]);
177 heightVector.erase(heightVector.begin()+i);
std::vector< float > fAmpErrorVector
std::vector< float > fSigmaVector
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
bool HitsBelowThreshold()
util::GaussianEliminationAlg fGEAlg
const std::vector< float > & SolveEquations(const std::vector< float > &meanVector, const std::vector< float > &sigmaVector, const std::vector< float > &heightVector)
std::vector< float > fAmpVector
std::vector< float > fSigmaErrorVector
std::vector< float > fMeanVector
std::vector< float > fMeanErrorVector
void hit::RFFHitFitter::CalculateMergedMeansAndSigmas |
( |
std::size_t |
signal_size | ) |
|
|
private |
Definition at line 97 of file RFFHitFitter.cxx.
unsigned int fMinMergeMultiplicity
std::size_t size(FixedBins< T, C > const &) noexcept
std::vector< float > fSigmaVector
std::vector< std::vector< std::multiset< MeanSigmaPair >::iterator > > fMergeVector
std::vector< float > fSigmaErrorVector
std::vector< float > fMeanVector
std::vector< float > fMeanErrorVector
void hit::RFFHitFitter::ClearResults |
( |
| ) |
|
Definition at line 193 of file RFFHitFitter.cxx.
std::vector< float > fAmpErrorVector
std::vector< float > fSigmaVector
std::vector< std::vector< std::multiset< MeanSigmaPair >::iterator > > fMergeVector
std::multiset< MeanSigmaPair, SignalSetComp > fSignalSet
std::vector< float > fAmpVector
std::vector< float > fSigmaErrorVector
std::vector< float > fMeanVector
std::vector< float > fMeanErrorVector
void hit::RFFHitFitter::CreateMergeVector |
( |
| ) |
|
|
private |
Definition at line 82 of file RFFHitFitter.cxx.
93 prev_mean = it->first;
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
std::vector< std::vector< std::multiset< MeanSigmaPair >::iterator > > fMergeVector
std::multiset< MeanSigmaPair, SignalSetComp > fSignalSet
float fMeanMatchThreshold
bool hit::RFFHitFitter::HitsBelowThreshold |
( |
| ) |
|
|
private |
const std::vector<float>& hit::RFFHitFitter::MeanErrorVector |
( |
| ) |
|
|
inline |
Definition at line 45 of file RFFHitFitter.h.
std::vector< float > fMeanErrorVector
const std::vector<float>& hit::RFFHitFitter::MeanVector |
( |
| ) |
|
|
inline |
unsigned int hit::RFFHitFitter::NHits |
( |
| ) |
|
|
inline |
void hit::RFFHitFitter::PrintResults |
( |
| ) |
|
Definition at line 205 of file RFFHitFitter.cxx.
207 std::cout <<
"InitialSignalSet" << std::endl;
210 std::cout <<
"\t" << sigpair.first <<
" / " << sigpair.second << std::endl;
213 std::cout <<
"\tMean / Sigma / Amp" << std::endl;
214 for(
size_t i=0; i<
NHits(); i++)
std::vector< float > fAmpErrorVector
std::vector< float > fSigmaVector
std::multiset< MeanSigmaPair, SignalSetComp > fSignalSet
std::vector< float > fAmpVector
std::vector< float > fSigmaErrorVector
BEGIN_PROLOG could also be cout
std::vector< float > fMeanVector
std::vector< float > fMeanErrorVector
void hit::RFFHitFitter::RunFitter |
( |
const std::vector< float > & |
signal | ) |
|
Definition at line 48 of file RFFHitFitter.cxx.
void CalculateMergedMeansAndSigmas(std::size_t signal_size)
void CalculateAllMeansAndSigmas(const std::vector< float > &signal)
void CalculateAmplitudes(const std::vector< float > &signal)
void hit::RFFHitFitter::SetFitterParams |
( |
float |
max_mean, |
|
|
unsigned int |
min_multi, |
|
|
float |
threshold |
|
) |
| |
Definition at line 34 of file RFFHitFitter.cxx.
unsigned int fMinMergeMultiplicity
float fMeanMatchThreshold
const std::vector<float>& hit::RFFHitFitter::SigmaErrorVector |
( |
| ) |
|
|
inline |
Definition at line 46 of file RFFHitFitter.h.
std::vector< float > fSigmaErrorVector
const std::vector<float>& hit::RFFHitFitter::SigmaVector |
( |
| ) |
|
|
inline |
std::vector<float> hit::RFFHitFitter::fAmpErrorVector |
|
private |
std::vector<float> hit::RFFHitFitter::fAmpVector |
|
private |
float hit::RFFHitFitter::fFinalAmpThreshold |
|
private |
std::vector<float> hit::RFFHitFitter::fMeanErrorVector |
|
private |
float hit::RFFHitFitter::fMeanMatchThreshold |
|
private |
std::vector<float> hit::RFFHitFitter::fMeanVector |
|
private |
std::vector< std::vector< std::multiset<MeanSigmaPair>::iterator > > hit::RFFHitFitter::fMergeVector |
|
private |
unsigned int hit::RFFHitFitter::fMinMergeMultiplicity |
|
private |
std::vector<float> hit::RFFHitFitter::fSigmaErrorVector |
|
private |
std::vector<float> hit::RFFHitFitter::fSigmaVector |
|
private |
The documentation for this class was generated from the following files: