#ifndef ROOT_TSpectrumFit
#define ROOT_TSpectrumFit
#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
class TH1;
class TSpectrumFit : public TNamed {
protected:
Int_t fNPeaks;
Int_t fNumberIterations;
Int_t fXmin;
Int_t fXmax;
Int_t fStatisticType;
Int_t fAlphaOptim;
Int_t fPower;
Int_t fFitTaylor;
Double_t fAlpha;
Double_t fChi;
Double_t *fPositionInit;
Double_t *fPositionCalc;
Double_t *fPositionErr;
Double_t *fAmpInit;
Double_t *fAmpCalc;
Double_t *fAmpErr;
Double_t *fArea;
Double_t *fAreaErr;
Double_t fSigmaInit;
Double_t fSigmaCalc;
Double_t fSigmaErr;
Double_t fTInit;
Double_t fTCalc;
Double_t fTErr;
Double_t fBInit;
Double_t fBCalc;
Double_t fBErr;
Double_t fSInit;
Double_t fSCalc;
Double_t fSErr;
Double_t fA0Init;
Double_t fA0Calc;
Double_t fA0Err;
Double_t fA1Init;
Double_t fA1Calc;
Double_t fA1Err;
Double_t fA2Init;
Double_t fA2Calc;
Double_t fA2Err;
Bool_t *fFixPosition;
Bool_t *fFixAmp;
Bool_t fFixSigma;
Bool_t fFixT;
Bool_t fFixB;
Bool_t fFixS;
Bool_t fFixA0;
Bool_t fFixA1;
Bool_t fFixA2;
public:
enum {
kFitOptimChiCounts =0,
kFitOptimChiFuncValues =1,
kFitOptimMaxLikelihood =2,
kFitAlphaHalving =0,
kFitAlphaOptimal =1,
kFitPower2 =2,
kFitPower4 =4,
kFitPower6 =6,
kFitPower8 =8,
kFitPower10 =10,
kFitPower12 =12,
kFitTaylorOrderFirst =0,
kFitTaylorOrderSecond =1,
kFitNumRegulCycles =100
};
TSpectrumFit(void);
TSpectrumFit(Int_t numberPeaks);
virtual ~TSpectrumFit();
protected:
Double_t Area(Double_t a,Double_t sigma,Double_t t,Double_t b);
Double_t Dera1(Double_t i);
Double_t Dera2(Double_t i);
Double_t Deramp(Double_t i,Double_t i0,Double_t sigma,Double_t t,Double_t s,Double_t b);
Double_t Derb(Int_t num_of_fitted_peaks,Double_t i,const Double_t* parameter,Double_t sigma,Double_t t,Double_t b);
Double_t Derderi0(Double_t i,Double_t amp,Double_t i0,Double_t sigma);
Double_t Derdersigma(Int_t num_of_fitted_peaks,Double_t i,const Double_t* parameter,Double_t sigma);
Double_t Derfc(Double_t x);
Double_t Deri0(Double_t i,Double_t amp,Double_t i0,Double_t sigma,Double_t t,Double_t s,Double_t b);
Double_t Derpa(Double_t sigma,Double_t t,Double_t b);
Double_t Derpb(Double_t a,Double_t sigma,Double_t t,Double_t b);
Double_t Derpsigma(Double_t a,Double_t t,Double_t b);
Double_t Derpt(Double_t a,Double_t sigma,Double_t b);
Double_t Ders(Int_t num_of_fitted_peaks,Double_t i,const Double_t* parameter,Double_t sigma);
Double_t Dersigma(Int_t num_of_fitted_peaks,Double_t i,const Double_t* parameter,Double_t sigma,Double_t t,Double_t s,Double_t b);
Double_t Dert(Int_t num_of_fitted_peaks,Double_t i,const Double_t* parameter,Double_t sigma,Double_t b);
Double_t Erfc(Double_t x);
Double_t Ourpowl(Double_t a,Int_t pw);
Double_t Shape(Int_t num_of_fitted_peaks,Double_t i,const Double_t *parameter,Double_t sigma,Double_t t,Double_t s,Double_t b,Double_t a0,Double_t a1,Double_t a2);
void StiefelInversion(Double_t **a,Int_t rozmer);
public:
void FitAwmi(float *source);
void FitStiefel(float *source);
Double_t *GetAmplitudes() const {return fAmpCalc;}
Double_t *GetAmplitudesErrors() const {return fAmpErr;}
Double_t *GetAreas() const {return fArea;}
Double_t *GetAreasErrors() const {return fAreaErr;}
void GetBackgroundParameters(Double_t &a0, Double_t &a0Err, Double_t &a1, Double_t &a1Err, Double_t &a2, Double_t &a2Err);
Double_t GetChi() const {return fChi;}
Double_t *GetPositions() const {return fPositionCalc;}
Double_t *GetPositionsErrors() const {return fPositionErr;}
void GetSigma(Double_t &sigma, Double_t &sigmaErr);
void GetTailParameters(Double_t &t, Double_t &tErr, Double_t &b, Double_t &bErr, Double_t &s, Double_t &sErr);
void SetBackgroundParameters(Double_t a0Init, Bool_t fixA0, Double_t a1Init, Bool_t fixA1, Double_t a2Init, Bool_t fixA2);
void SetFitParameters(Int_t xmin,Int_t xmax, Int_t numberIterations, Double_t alpha, Int_t statisticType, Int_t alphaOptim, Int_t power, Int_t fitTaylor);
void SetPeakParameters(Double_t sigma, Bool_t fixSigma, const Float_t *positionInit, const Bool_t *fixPosition, const Float_t *ampInit, const Bool_t *fixAmp);
void SetTailParameters(Double_t tInit, Bool_t fixT, Double_t bInit, Bool_t fixB, Double_t sInit, Bool_t fixS);
ClassDef(TSpectrumFit,1)
};
#endif
Last change: Wed Jun 25 08:53:16 2008
Last generated: 2008-06-25 08:53
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.