123 double d_alpha, d_beta ;
135 double variation_func_max = 0. ;
136 double variation_tim_max = 0. ;
145 if( sigmas_sample > 0. ) un_sur_sigma = 1./sigmas_sample;
146 else un_sur_sigma = 1.;
150 for (
int iter=0 ; iter <
fNb_iter ; iter ++) {
167 for(
int i = num_fit_min ;
i < num_fit_max+1 ;
i++) {
176 if(dt > -alpha_beta) {
177 double dt_sur_beta = dt/
fBeta ;
179 double variable = (double)1. + dt/alpha_beta ;
180 double expo = TMath::Exp(-dt_sur_beta) ;
182 double puissance = TMath::Power(variable,
fAlpha) ;
183 d_alpha=un_sur_sigma*puissance*expo ;
192 d11 += d_alpha*d_alpha ;
193 d12 += d_alpha*d_beta ;
194 d22 += d_beta*d_beta ;
196 delta = (adc_to_fit[
i]-
func)*un_sur_sigma ;
198 z1 += delta*d_alpha ;
200 chi2 += delta *
delta ;
202 double denom = d11*d22-d12*d12 ;
212 variation_func_max = (z1*d22-z2*d12)/denom ;
213 variation_tim_max = (-z1*d12+z2*d11)/denom ;
214 chi2 = chi2/((double)nsamp_used - 2.) ;
229 double func_electronic,dtsbeta,
variable,puiss;
231 if( albet <= 0 )
return( (Double_t)0. );
235 variable=1.+dt/albet ;
236 puiss=TMath::Power(variable,
fAlpha);
237 func_electronic=
fFunc_max*puiss*TMath::Exp(-dtsbeta);
239 else func_electronic = 0. ;
241 return func_electronic ;
248 double denom,
dt,amp1,amp2,amp3 ;
254 for ( k = nmin ; k < nmax ; k++) {
256 if (ampl[k] > ampmax ) {
261 amp1 = ampl[imax-1] ;
263 amp3 = ampl[imax+1] ;
264 denom=2.*amp2-amp1-amp3 ;
267 dt =0.5*(amp3-amp1)/denom ;
277 parout[0] =amp2+(amp3-amp1)*dt*0.25 ;
278 parout[1] = (double)imax + dt ;
279 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 *)
return(e1-e2)*(e1-e2)+dp *dp
char data[epos_bytes_allocation]
virtual ~PulseFitWithFunction()