70 imax = (int)parout[2];
110 double d_alpha, d_beta;
122 double variation_func_max = 0.;
123 double variation_tim_max = 0.;
132 if (sigmas_sample > 0.)
133 un_sur_sigma = 1. / sigmas_sample;
139 for (
int iter = 0; iter <
fNb_iter; iter++) {
154 for (
int i = num_fit_min;
i < num_fit_max + 1;
i++) {
163 if (dt > -alpha_beta) {
164 double dt_sur_beta = dt /
fBeta;
166 double variable = (double)1. + dt / alpha_beta;
167 double expo = TMath::Exp(-dt_sur_beta);
169 double puissance = TMath::Power(variable,
fAlpha);
170 d_alpha = un_sur_sigma * puissance * expo;
171 d_beta =
fFunc_max * d_alpha * dt_sur_beta / (alpha_beta * variable);
178 d11 += d_alpha * d_alpha;
179 d12 += d_alpha * d_beta;
180 d22 += d_beta * d_beta;
182 delta = (adc_to_fit[
i] -
func) * un_sur_sigma;
184 z1 += delta * d_alpha;
185 z2 += delta * d_beta;
186 chi2 += delta *
delta;
188 double denom = d11 * d22 - d12 * d12;
193 if (nsamp_used < 3) {
198 variation_func_max = (z1 * d22 - z2 * d12) / denom;
199 variation_tim_max = (-z1 * d12 + z2 * d11) / denom;
200 chi2 = chi2 / ((double)nsamp_used - 2.);
214 double func_electronic, dtsbeta, variable, puiss;
217 return ((Double_t)0.);
220 dtsbeta = dt /
fBeta;
221 variable = 1. + dt / albet;
222 puiss = TMath::Power(variable,
fAlpha);
223 func_electronic =
fFunc_max * puiss * TMath::Exp(-dtsbeta);
225 func_electronic = 0.;
227 return func_electronic;
233 double denom,
dt, amp1, amp2, amp3;
239 for (k = nmin; k < nmax; k++) {
241 if (ampl[k] > ampmax) {
246 amp1 = ampl[imax - 1];
248 amp3 = ampl[imax + 1];
249 denom = 2. * amp2 - amp1 - amp3;
252 dt = 0.5 * (amp3 - amp1) / denom;
261 parout[0] = amp2 + (amp3 - amp1) * dt * 0.25;
262 parout[1] = (double)imax + dt;
263 parout[2] = (double)imax;
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t Func __host__ __device__ V int Func func
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