#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
static int max(int a, int b)
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
static int max(int a, int b)
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(sqlite3 *db, std::string const &table_name, std::string const &column_name)
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";
177 heightVector.erase(heightVector.begin()+i);
std::vector< float > fAmpErrorVector
std::vector< float > fSigmaVector
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
QTextStream & bin(QTextStream &s)
cet::coded_exception< error, detail::translate > exception
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::vector< float > fSigmaVector
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
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;
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
QTextStream & endl(QTextStream &s)
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 |
float hit::RFFHitFitter::fFinalAmpThreshold |
|
private |
float hit::RFFHitFitter::fMeanMatchThreshold |
|
private |
unsigned int hit::RFFHitFitter::fMinMergeMultiplicity |
|
private |
std::vector<float> hit::RFFHitFitter::fSigmaErrorVector |
|
private |
The documentation for this class was generated from the following files: