Waveform fitter class.
More...
#include <WaveFitter.h>
|
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.
|
|
|
static void | setPrecision (int ndigits) |
| Set precision of the minimzer.
|
|
|
void | doFit () |
| Perform fit on the data.
|
|
void | calculateAmplitudes () |
| Calculate amplitudes.
|
|
void | calculateFitErrors () |
| Calculate fit errors. More...
|
|
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.
|
|
Waveform fitter class.
Definition at line 60 of file WaveFitter.h.
◆ WaveFitter()
Constructor creates an empty fitter with default settings.
- Parameters
-
wave | Wave function to use for fitting data |
times | array of points in time at which data are taken |
Definition at line 72 of file WaveFitter.h.
◆ addData()
void addData |
( |
const std::array< double, 6 > & |
inpData, |
|
|
double |
rmsNoise |
|
) |
| |
|
inline |
Add strip data to the fitter.
- Parameters
-
inpData | array of 6 APV signals. |
rmsNoise | RMS noise for the strip. |
Definition at line 82 of file WaveFitter.h.
◆ calculateFitErrors()
void calculateFitErrors |
( |
| ) |
|
|
private |
Calculate fit errors.
This only calculates local (linearization) errors.
Definition at line 134 of file WaveFitter.cc.
138 for (
int i = 0; i < 6; ++i) {
142 double one_by_sqrtSumw2 = 1.0 /
sqrt(sum_w2);
143 for (
unsigned int row = 0; row <
m_data.size(); ++row)
147 double timestep = 0.1 *
m_dt;
149 for (
int i = 0; i < 6; ++i) {
151 dwave_sq += dwave * dwave;
154 for (
unsigned int row = 0; row <
m_data.size(); ++row) {
double m_fittedTimeError
Error estimate of the fitted time.
std::vector< double > m_fittedAmplitudes
Fitted amplitudes of the sample.
std::vector< double > m_noises
RMS noise for strips.
strip_data_type m_data
Vector of sextets of APV samples.
std::vector< double > m_fittedAmplitudeErrors
Fitted amplitude errors.
double m_dt
Time interval between samples.
double wave(double t) const
Get unit waveform value at a given time.
double m_fittedTime
Time from interval (-dt,+dt).
wave_function_type m_wave
Waveform function.
std::array< double, 6 > m_times
Vector of sample times.
double sqrt(double a)
sqrt for double
◆ Chi()
Get standardized chi2 for a given time shift.
- Parameters
-
- Returns
- chi2/ndf at a given time shift
Definition at line 24 of file WaveFitter.cc.
◆ getData()
Get original fitted data.
- Returns
- vector of arrays of strip data used in the fit.
Definition at line 152 of file WaveFitter.h.
◆ getFitData()
Get fitted values for all samples.
- Returns
- vector of arrays of fit estimates of fitted data.
Definition at line 157 of file WaveFitter.h.
◆ getFitLikelihood()
double getFitLikelihood |
( |
| ) |
|
|
inline |
Return negative log-likelihood for the fit.
- Returns
- negative log-likelihood for the fit
Definition at line 143 of file WaveFitter.h.
◆ getFittedAmplitudeErrors()
const std::vector<double>& getFittedAmplitudeErrors |
( |
| ) |
|
|
inline |
Retrieve errors of strip amplitudes after a fit.
- Returns
- vector<double> of errors of strip amplitude estimates
Definition at line 134 of file WaveFitter.h.
◆ getFittedAmplitudes()
const std::vector<double>& getFittedAmplitudes |
( |
| ) |
|
|
inline |
Retrieve strip amplitudes after a fit.
- Returns
- vector<double> of strip amplitude estimates
Definition at line 125 of file WaveFitter.h.
◆ getFittedTime()
Retrieve fitted time shift value after a fit.
- Returns
- time shift estimate
Definition at line 107 of file WaveFitter.h.
◆ getFittedTimeError()
double getFittedTimeError |
( |
| ) |
|
|
inline |
Retrieve error of time shift value after a fit.
- Returns
- time shift estimate error
Definition at line 116 of file WaveFitter.h.
◆ lrSignal()
double lrSignal |
( |
double |
a, |
|
|
double |
b |
|
) |
| |
Calculate likelihood ratio Lsignal/Lbackground for acceptance (signal) window given as arguments.
- Parameters
-
a | lower bound of the acceptance window |
b | upper bound of the acceptance window |
- Returns
- L(in acc. w.)/L(out of acc. w.)
Definition at line 257 of file WaveFitter.cc.
◆ negLogLikelihood()
double negLogLikelihood |
( |
double |
t | ) |
|
Get negative profile log-likelihood for a given time shift.
- Parameters
-
t | the time shift at which to calculate the likelihood |
- Returns
- log-likelihood integrated over amplitudes at the given t
Definition at line 52 of file WaveFitter.cc.
The documentation for this class was generated from the following files: