DDASToys for NSCLDAQ  6.2-000
Functions
lmfit_analytic.cpp File Reference

Implementation of analytic fitting functions we use in GSL's LM fitter. More...

#include "lmfit_analytic.h"
#include <algorithm>
#include <stdexcept>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_blas.h>
#include <gsl/gsl_fit.h>
#include <gsl/gsl_multimin.h>
#include <gsl/gsl_multifit_nlin.h>
#include "functions_analytic.h"
#include "jacobian_analytic.h"
Include dependency graph for lmfit_analytic.cpp:

Functions

double estimateK1 (int xmax, double C0, const std::vector< uint16_t > &trace)
 Estimate a value for the steepness parameter of the rising side of the pulse. More...
 

Detailed Description

Implementation of analytic fitting functions we use in GSL's LM fitter.

Function Documentation

◆ estimateK1()

double estimateK1 ( int  xmax,
double  C0,
const std::vector< uint16_t > &  trace 
)

Estimate a value for the steepness parameter of the rising side of the pulse.

Parameters
xmaxWhere the maximum point is.
C0Estimate for the constant offset.
traceThe trace data.
Returns
The risetime estimate.

We approximate xmax as 0.9 of maximum and use that ln(9)/(xmax - xhalf) gives k where xhalf is the position of 1/2 height. If we can't find xhalf then we fall back on a guess of 0.1.

Todo:
Should allow this fallback value to be an input parameter.
Note
For now assume that the half position is within the AOI and are not correcting for flattops.