Belle II Software development
|
Waveform fitter class. More...
#include <WaveFitter.h>
Public Types | |
typedef std::function< double(double)> | wave_function_type |
Function type for waveform. | |
typedef std::vector< std::array< double, 6 > > | strip_data_type |
Function type for cluster data. | |
Public Member Functions | |
WaveFitter (wave_function_type wave, std::array< double, 6 > times) | |
Constructor creates an empty fitter with default settings. | |
void | addData (const std::array< double, 6 > &inpData, double rmsNoise) |
Add strip data to the fitter. | |
void | reset () |
Reset fitter data. | |
double | getFittedTime () |
Retrieve fitted time shift value after a fit. | |
double | getFittedTimeError () |
Retrieve error of time shift value after a fit. | |
const std::vector< double > & | getFittedAmplitudes () |
Retrieve strip amplitudes after a fit. | |
const std::vector< double > & | getFittedAmplitudeErrors () |
Retrieve errors of strip amplitudes after a fit. | |
double | getFitLikelihood () |
Return negative log-likelihood for the fit. | |
const strip_data_type & | getData () const |
Get original fitted data. | |
const strip_data_type & | getFitData () |
Get fitted values for all samples. | |
double | getDt () const |
Get sampling interval. | |
const std::array< double, 6 > & | getTimes () const |
Get sample times. | |
double | Chi (double t) |
Get standardized chi2 for a given time shift. | |
double | negLogLikelihood (double t) |
Get negative profile log-likelihood for a given time shift. | |
double | pSignal () |
Calculate probability of the hit being a signal, with given priors for signal and background. | |
double | lrSignal (double a, double b) |
Calculate likelihood ratio Lsignal/Lbackground for acceptance (signal) window given as arguments. | |
double | wave (double t) const |
Get unit waveform value at a given time. | |
Static Public Member Functions | |
static void | setPrecision (int ndigits) |
Set precision of the minimzer. | |
Private Member Functions | |
void | doFit () |
Perform fit on the data. | |
void | calculateAmplitudes () |
Calculate amplitudes. | |
void | calculateFitErrors () |
Calculate fit errors. | |
void | calculateFittedData () |
Calculate fitted data. | |
double | integral12 (double lower, double upper, std::function< double(double)> f) |
High-order Gauss-Legendre quadrature for likelihood integrals. | |
double | integral20 (double lower, double upper, std::function< double(double)> f) |
High-order Gauss-Legendre quadrature for likelihood integrals. | |
Private Attributes | |
bool | m_hasFit |
Are fit results available? | |
double | m_dt |
Time interval between samples. | |
strip_data_type | m_data |
Vector of sextets of APV samples. | |
std::vector< double > | m_noises |
RMS noise for strips. | |
std::array< double, 6 > | m_times |
Vector of sample times. | |
wave_function_type | m_wave |
Waveform function. | |
double | m_fittedTime |
Time from interval (-dt,+dt). | |
double | m_fittedTimeError |
Error estimate of the fitted time. | |
std::vector< double > | m_fittedAmplitudes |
Fitted amplitudes of the sample. | |
std::vector< double > | m_fittedAmplitudeErrors |
Fitted amplitude errors. | |
double | m_fittedLik |
Chi2 from the current fit. | |
int | m_ndf |
Degrees of freedom of the fit. | |
strip_data_type | m_fittedData |
Fitted values from current fit. | |
Static Private Attributes | |
static int | s_minimizer_precision = 6 |
minimizer precision | |
Waveform fitter class.
Definition at line 59 of file WaveFitter.h.
typedef std::vector< std::array<double, 6> > strip_data_type |
Function type for cluster data.
Definition at line 65 of file WaveFitter.h.
typedef std::function<double(double)> wave_function_type |
Function type for waveform.
Definition at line 63 of file WaveFitter.h.
|
inline |
Constructor creates an empty fitter with default settings.
wave | Wave function to use for fitting data |
times | array of points in time at which data are taken |
Definition at line 71 of file WaveFitter.h.
|
inline |
Add strip data to the fitter.
inpData | array of 6 APV signals. |
rmsNoise | RMS noise for the strip. |
Definition at line 81 of file WaveFitter.h.
|
private |
Calculate amplitudes.
Definition at line 115 of file WaveFitter.cc.
|
private |
Calculate fit errors.
This only calculates local (linearization) errors.
Definition at line 134 of file WaveFitter.cc.
|
private |
Calculate fitted data.
Definition at line 161 of file WaveFitter.cc.
double Chi | ( | double | t | ) |
Get standardized chi2 for a given time shift.
t | time shift |
Definition at line 24 of file WaveFitter.cc.
|
private |
Perform fit on the data.
Definition at line 73 of file WaveFitter.cc.
|
inline |
Get original fitted data.
Definition at line 151 of file WaveFitter.h.
|
inline |
|
inline |
Get fitted values for all samples.
Definition at line 156 of file WaveFitter.h.
|
inline |
Return negative log-likelihood for the fit.
Definition at line 142 of file WaveFitter.h.
|
inline |
Retrieve errors of strip amplitudes after a fit.
Definition at line 133 of file WaveFitter.h.
|
inline |
Retrieve strip amplitudes after a fit.
Definition at line 124 of file WaveFitter.h.
|
inline |
Retrieve fitted time shift value after a fit.
Definition at line 106 of file WaveFitter.h.
|
inline |
Retrieve error of time shift value after a fit.
Definition at line 115 of file WaveFitter.h.
|
inline |
|
private |
High-order Gauss-Legendre quadrature for likelihood integrals.
Definition at line 171 of file WaveFitter.cc.
|
private |
High-order Gauss-Legendre quadrature for likelihood integrals.
Definition at line 201 of file WaveFitter.cc.
double lrSignal | ( | double | a, |
double | b | ||
) |
Calculate likelihood ratio Lsignal/Lbackground for acceptance (signal) window given as arguments.
a | lower bound of the acceptance window |
b | upper bound of the acceptance window |
Definition at line 257 of file WaveFitter.cc.
double negLogLikelihood | ( | double | t | ) |
Get negative profile log-likelihood for a given time shift.
t | the time shift at which to calculate the likelihood |
Definition at line 52 of file WaveFitter.cc.
double pSignal | ( | ) |
Calculate probability of the hit being a signal, with given priors for signal and background.
Definition at line 239 of file WaveFitter.cc.
|
inline |
Reset fitter data.
Definition at line 92 of file WaveFitter.h.
|
static |
Set precision of the minimzer.
Definition at line 22 of file WaveFitter.cc.
|
inline |
|
private |
Vector of sextets of APV samples.
Definition at line 214 of file WaveFitter.h.
|
private |
Time interval between samples.
Definition at line 213 of file WaveFitter.h.
|
private |
Fitted amplitude errors.
Definition at line 221 of file WaveFitter.h.
|
private |
Fitted amplitudes of the sample.
Definition at line 220 of file WaveFitter.h.
|
private |
Fitted values from current fit.
Definition at line 224 of file WaveFitter.h.
|
private |
Chi2 from the current fit.
Definition at line 222 of file WaveFitter.h.
|
private |
Time from interval (-dt,+dt).
Definition at line 218 of file WaveFitter.h.
|
private |
Error estimate of the fitted time.
Definition at line 219 of file WaveFitter.h.
|
private |
Are fit results available?
Definition at line 212 of file WaveFitter.h.
|
private |
Degrees of freedom of the fit.
Definition at line 223 of file WaveFitter.h.
|
private |
RMS noise for strips.
Definition at line 215 of file WaveFitter.h.
|
private |
Vector of sample times.
Definition at line 216 of file WaveFitter.h.
|
private |
Waveform function.
Definition at line 217 of file WaveFitter.h.
|
staticprivate |
minimizer precision
Definition at line 195 of file WaveFitter.h.