110 double d_alpha, d_beta;
121 double un_sur_sigma = 1.;
122 double variation_func_max = 0.;
123 double variation_tim_max = 0.;
132 if (sigmas_sample > 0.)
133 un_sur_sigma = 1. / sigmas_sample;
137 for (
int iter = 0; iter <
fNb_iter; iter++) {
152 for (
int i = num_fit_min;
i < num_fit_max + 1;
i++) {
161 if (
dt > -alpha_beta) {
162 double dt_sur_beta =
dt /
fBeta;
164 double variable = (double)1. +
dt / alpha_beta;
165 double expo = TMath::Exp(-dt_sur_beta);
168 d_alpha = un_sur_sigma * puissance * expo;
176 d11 += d_alpha * d_alpha;
177 d12 += d_alpha * d_beta;
178 d22 += d_beta * d_beta;
180 delta = (adc_to_fit[
i] -
func) * un_sur_sigma;
182 z1 +=
delta * d_alpha;
186 double denom = d11 * d22 - d12 * d12;
191 if (nsamp_used < 3) {
196 variation_func_max = (z1 * d22 -
z2 * d12) /
denom;
197 variation_tim_max = (-z1 * d12 +
z2 * d11) /
denom;
198 chi2 =
chi2 / ((double)nsamp_used - 2.);
212 double func_electronic, dtsbeta,
variable, puiss;
215 return ((Double_t)0.);
221 func_electronic =
fFunc_max * puiss * TMath::Exp(-dtsbeta);
223 func_electronic = 0.;
225 return func_electronic;
231 double denom,
dt, amp1, amp2, amp3;
237 for (
k =
nmin;
k < nmax;
k++) {
239 if (ampl[
k] > ampmax) {
244 amp1 = ampl[
imax - 1];
246 amp3 = ampl[
imax + 1];
247 denom = 2. * amp2 - amp1 - amp3;
250 dt = 0.5 * (amp3 - amp1) /
denom;
259 parout[0] = amp2 + (amp3 - amp1) *
dt * 0.25;
260 parout[1] = (double)
imax +
dt;
261 parout[2] = (double)
imax;
void Fit_parab(double *, int, int, double *)
Quality *__restrict__ uint16_t nmin
virtual void init(int, int, int, int, double, double)
double Electronic_shape(double)
double Fit_electronic(int, double *, double)
virtual double doFit(double *)
char data[epos_bytes_allocation]
~PulseFitWithFunction() override
uint16_t *__restrict__ uint16_t const *__restrict__ adc