80 imax = (int)parout[2] ;
124 double d_alpha, d_beta ;
136 double variation_func_max = 0. ;
137 double variation_tim_max = 0. ;
146 if( sigmas_sample > 0. ) un_sur_sigma = 1./sigmas_sample;
147 else un_sur_sigma = 1.;
151 for (
int iter=0 ; iter <
fNb_iter ; iter ++) {
168 for(
int i = num_fit_min ;
i < num_fit_max+1 ;
i++) {
177 if(dt > -alpha_beta) {
178 double dt_sur_beta = dt/
fBeta ;
180 double variable = (double)1. + dt/alpha_beta ;
181 double expo = TMath::Exp(-dt_sur_beta) ;
183 double puissance = TMath::Power(variable,
fAlpha) ;
184 d_alpha=un_sur_sigma*puissance*expo ;
185 d_beta=
fFunc_max*d_alpha*dt_sur_beta/(alpha_beta*variable) ;
193 d11 += d_alpha*d_alpha ;
194 d12 += d_alpha*d_beta ;
195 d22 += d_beta*d_beta ;
197 delta = (adc_to_fit[
i]-func)*un_sur_sigma ;
199 z1 += delta*d_alpha ;
201 chi2 += delta *
delta ;
203 double denom = d11*d22-d12*d12 ;
213 variation_func_max = (z1*d22-z2*d12)/denom ;
214 variation_tim_max = (-z1*d12+z2*d11)/denom ;
215 chi2 = chi2/((double)nsamp_used - 2.) ;
230 double func_electronic,dtsbeta,variable,puiss;
232 if( albet <= 0 )
return( (Double_t)0. );
236 variable=1.+dt/albet ;
237 puiss=TMath::Power(variable,
fAlpha);
238 func_electronic=
fFunc_max*puiss*TMath::Exp(-dtsbeta);
240 else func_electronic = 0. ;
242 return func_electronic ;
249 double denom,
dt,amp1,amp2,amp3 ;
255 for ( k = nmin ; k < nmax ; k++) {
257 if (ampl[k] > ampmax ) {
262 amp1 = ampl[imax-1] ;
264 amp3 = ampl[imax+1] ;
265 denom=2.*amp2-amp1-amp3 ;
268 dt =0.5*(amp3-amp1)/denom ;
278 parout[0] =amp2+(amp3-amp1)*dt*0.25 ;
279 parout[1] = (double)imax + dt ;
280 parout[2] = (double)imax ;
int adc(sample_type sample)
get the ADC sample (12 bits)
void Fit_parab(double *, int, int, double *)
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]
virtual ~PulseFitWithFunction()