#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 69 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.
80 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 117 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().
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.) ;
double Electronic_shape(double)
char data[epos_bytes_allocation]
void PulseFitWithFunction::Fit_parab |
( |
double * |
, |
|
|
int |
, |
|
|
int |
, |
|
|
double * |
|
|
) |
| |
|
private |
Definition at line 244 of file PulseFitWithFunction.cc.
References dt, imax, gen::k, and hitfit::return.
Referenced by doFit().
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 ;
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 |