14 TF1Fitter(
const char *name=
"",
int nPars=0);
16 void SetHist(TH1 *hist);
17 virtual void Init()=0 ;
18 virtual double operator()(
const double* x,
const double*
params = 0);
19 virtual double operator()(
double x,
double y = 0,
double z = 0,
double t = 0)
const
20 {
return TF1::operator()(x,y,z,t);}
21 virtual void Copy(TObject& f1)
const;
22 virtual double EvalPar(
const double *x,
const double *par);
23 virtual void Draw (
const char *opt=
"same");
31 typedef Double_t(*DummyFuncPtr_t)(Double_t *, Double_t *) ;
44 virtual double EvalPar(
const double *x,
const double *par);
56 virtual double EvalPar(
const double *x,
const double *par);
67 virtual double EvalPar(
const double *x,
const double *par);
100 class TF1Gaus :
public TF1
103 TF1Gaus(
const char *name=
"Gaus"):TF1(name,(void*)0,0,0,3) {}
106 virtual double EvalPar(
const double *x,
const double *par)
108 double p1 = 1./(par[1]*par[1]);
109 return par[2]*exp(-0.5*p1*(x[0]-par[0])*(x[0]-par[0]));
116 class TF1TwoGaus :
public TF1
119 TF1TwoGaus(
const char *name=
"TwoGaus"):TF1(name,(void*)1,0,0,6) {}
121 virtual double EvalPar(
const double *x,
const double *par)
123 double p1 = 1./(par[1]*par[1]);
124 double p4 = 1./(par[1]+par[4])*par[1]+par[4]);
125 return par[2]*exp(-0.5*p1*(x[0]-par[0])*(x[0]-par[0]))
126 +par[5]*exp(-0.5*p4*(x[0]-par[3])*(x[0]-par[3]))
144 class TF1AuxFitter:
public TF1
147 TF1AuxFitter(
int nPars,
int nTF,TF1 **tfList):TF1(
"AuxH1Fitter",(void*)1,0,0,nPars)
148 { mNTF=nTF; mTFList = tfList;}
151 virtual void Copy(TObject& f1)
const;
152 virtual double EvalPar(
const double *x,
const double *par);
157 KlassDef(TF1AuxFitter,0)
160 class TH1Fitter:
public TNamed
163 TH1Fitter(TH1 *th,
const char *name=
"");
164 ~TH1Fitter() {
delete mTF1;}
165 void SetRange(
double xMin,
double xMax) {mXmin=xMin; mXmax=xMax;}
169 virtual double Fit (
const char *opt=
"IRV");
170 virtual void Draw(
const char *opt=
"");
171 int GetNPars()
const {
return mNPars;}
172 double *GetPars() {
return mPars ;}
189 KlassDef(TH1Fitter,0)
194 class TwoGausFitter:
public TH1Fitter
197 TwoGausFitter(TH1 *th,
const char *name=
"TwoGauss");
200 double Fit(
const char *opt);
203 KlassDef(TwoGausFitter,0)