 |
Belle II Software
release-05-02-19
|
13 #include <top/dataobjects/TOPRawWaveform.h>
14 #include <top/dbobjects/TOPSampleTimes.h>
26 using Point = std::pair<double, double>;
33 class TOPTemplateFitter {
102 const double averageRMS);
185 const double fitRange);
198 const std::vector<float>& timingCorrection,
const double risingEdgeCFD,
199 const double fitRange);
219 const TOPRawWaveform
m_wf;
void clear()
set sums used during template fit to initial values
static int getTemplateSamples()
Returns the total number of template samples.
const TOPSampleTimes m_sampleTimes
provides timing correction
double Sx
sum of template*weight
double risingEdge
fitted rising edge
TOPTemplateFitter(const TOPRawWaveform &wf, const TOPSampleTimes &sampleTimes, const double averageRMS)
full constructor
const std::vector< double > & getChisqVector() const
Returns calculated chisq values.
static std::vector< double > s_templateSamples
precomputed template samples
void performTemplateFit(const double risingEdgeStart, const double fitRange)
Prepares data and performs the template fit in sample space.
double ComputeMinimizedParametersAndChisq(const MinimizationSums &sums, FitResult &result)
Compute the minimized parameters and chi square value.
static int s_totalTemplateSamples
number of samples used for template
static void setTemplateSamples(int nSamples)
Set the total number of template samples.
double risingEdge
rising edge position of template in samples
Variables used during template fit minimization.
double amplitudeError
fitted amplitude error
double amplitude
amplitude of template function
double Syy
sum of signal sample * signal sample * weight
const FitResult & getFitResult() const
Returns fitted values with errors.
void CalculateParabolaVertex(const Point &p1, const Point &p2, const Point &p3, Point &vertex)
Calculate vertex coordinates of parabola given three data points.
double Sxy
sum of signal sample *template*weight
double getChisq() const
Returns fit chi square.
void clear()
set the fit result variables to zero
double Sxx
sum of template*template*weight
double S1
sum of sample weights
const TOPRawWaveform m_wf
raw sampled waveforms
structure holding values from template fit
static int s_templateResolution
resolution of template with respect to normal sample spacing
double backgroundOffsetError
fitted background offset error
void PerformTemplateFitMinimize(const std::vector< short > &samples, const std::vector< short > &pedestals, const std::vector< float > &timingCorrection, const double risingEdgeCFD, const double fitRange)
performs the template fit
static void InitializeTemplateFit()
Intializes the template fit using default values.
Calibration constants of a singe ASIC channel: time axis (sample times)
static void setUseParabola(bool use)
Enable Usage of parabola improvement.
Abstract base class for different kinds of events.
const double m_averageRMS
average RMS of waveform samples, no database for this
static TemplateParameters & getTemplateParameters()
Returns the template parameters.
double amplitude
fitted amplitude
static void setTemplateParameters(const TemplateParameters ¶ms)
Sets the template parameters.
static bool s_useParabola
try improving fit by making use of parabolic shape of chisq values
static TemplateParameters s_templateParameters
parameters used for the template calculation
static int s_fineOffsetRange
range for offset between template and signal
FitResult m_result
fit result from template fit
static bool getUseParabola()
Returns useParabola.
Parameters of the template function.
static void setTemplateResolution(int resolution)
Set the template resolution.
static int getTemplateResolution()
Returns the template resolution.
static bool s_templateReInitialize
flag showing that the template samples have to be recomputed
double Sy
sum of signal sample * weight
~TOPTemplateFitter()
default destructor
std::vector< double > m_chisq_vec
all computed chi square values from template fit
double m_chisq
chi square value from template fit
double backgroundOffset
fitted background offset