#include <PulseFitWithFunction.h>
Definition at line 26 of file PulseFitWithFunction.h.
PulseFitWithFunction::PulseFitWithFunction |
( |
| ) |
|
PulseFitWithFunction::~PulseFitWithFunction |
( |
| ) |
|
|
virtual |
double PulseFitWithFunction::doFit |
( |
double * |
adc | ) |
|
|
virtual |
Definition at line 68 of file PulseFitWithFunction.cc.
References amp_max, amp_parab, fFunc_max, Fit_electronic(), Fit_parab(), fNsamples, fNumber_samp_max, fTim_max, fValue_tim_max, imax, and tim_parab.
79 imax = (int)parout[2] ;
int adc(sample_type sample)
get the ADC sample (12 bits)
void Fit_parab(double *, int, int, double *)
double Fit_electronic(int, double *, double)
double PulseFitWithFunction::Electronic_shape |
( |
double |
tim | ) |
|
|
private |
double PulseFitWithFunction::Fit_electronic |
( |
int |
data, |
|
|
double * |
adc_to_fit, |
|
|
double |
sigmas_sample |
|
) |
| |
|
private |
Definition at line 116 of file PulseFitWithFunction.cc.
References delta, dt, Electronic_shape(), fAlpha, fAlpha_beam, fAlpha_laser, fAmp_fitted_max, fBeta, fBeta_beam, fBeta_laser, fFunc_max, fNb_iter, fNum_samp_after_max, fNum_samp_bef_max, fNumber_samp_max, fSigma_ped, fTim_fitted_max, fTim_max, fValue_tim_max, and i.
Referenced by doFit().
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 ;
184 d_beta=
fFunc_max*d_alpha*dt_sur_beta/(alpha_beta*variable) ;
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.) ;
double Electronic_shape(double)
char data[epos_bytes_allocation]
void PulseFitWithFunction::Fit_parab |
( |
double * |
, |
|
|
int |
, |
|
|
int |
, |
|
|
double * |
|
|
) |
| |
|
private |
Definition at line 243 of file PulseFitWithFunction.cc.
References dt, imax, relval_steps::k, and mathSSE::return().
Referenced by doFit().
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 ;
double PulseFitWithFunction::getAmpl |
( |
| ) |
|
|
inline |
double PulseFitWithFunction::getAmpl_parab |
( |
| ) |
|
|
inline |
double PulseFitWithFunction::getMax_parab |
( |
| ) |
|
|
inline |
int PulseFitWithFunction::getSampMax_parab |
( |
| ) |
|
|
inline |
double PulseFitWithFunction::getTime |
( |
| ) |
|
|
inline |
double PulseFitWithFunction::getTime_parab |
( |
| ) |
|
|
inline |
void PulseFitWithFunction::init |
( |
int |
n_samples, |
|
|
int |
samplb, |
|
|
int |
sampla, |
|
|
int |
niter, |
|
|
double |
alfa, |
|
|
double |
beta |
|
) |
| |
|
virtual |
double PulseFitWithFunction::amp_max |
|
private |
double PulseFitWithFunction::amp_parab |
|
private |
double PulseFitWithFunction::fAlpha |
|
private |
double PulseFitWithFunction::fAlpha_beam |
|
private |
double PulseFitWithFunction::fAlpha_laser |
|
private |
double PulseFitWithFunction::fAmp_fitted_max |
double PulseFitWithFunction::fBeta |
|
private |
double PulseFitWithFunction::fBeta_beam |
|
private |
double PulseFitWithFunction::fBeta_laser |
|
private |
double PulseFitWithFunction::fFunc_max |
int PulseFitWithFunction::fNb_iter |
|
private |
int PulseFitWithFunction::fNsamples |
|
private |
int PulseFitWithFunction::fNum_samp_after_max |
|
private |
int PulseFitWithFunction::fNum_samp_bef_max |
|
private |
int PulseFitWithFunction::fNumber_samp_max |
double PulseFitWithFunction::fSigma_ped |
double PulseFitWithFunction::fTim_fitted_max |
double PulseFitWithFunction::fTim_max |
double PulseFitWithFunction::fValue_tim_max |
int PulseFitWithFunction::imax |
|
private |
double PulseFitWithFunction::tim_parab |
|
private |