00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TFumili
00013 #define ROOT_TFumili
00014
00015 #ifndef ROOT_TVirtualFitter
00016 #include "TVirtualFitter.h"
00017 #endif
00018
00019 class TF1;
00020
00021 class TFumili : public TVirtualFitter {
00022 private:
00023 Int_t fMaxParam;
00024 Int_t fMaxParam2;
00025 Int_t fNlog;
00026 Int_t fNfcn;
00027 Int_t fNED1;
00028 Int_t fNED2;
00029 Int_t fNED12;
00030 Int_t fNpar;
00031 Int_t fNstepDec;
00032 Int_t fNlimMul;
00033 Int_t fNmaxIter;
00034 Int_t fLastFixed;
00035 Int_t fENDFLG;
00036 Int_t fINDFLG[5];
00037
00038
00039 Bool_t fGRAD;
00040 Bool_t fWARN;
00041 Bool_t fDEBUG;
00042 Bool_t fLogLike;
00043 Bool_t fNumericDerivatives;
00044
00045 Double_t *fZ0;
00046
00047
00048 Double_t *fZ;
00049 Double_t *fGr;
00050 Double_t *fParamError;
00051 Double_t *fSumLog;
00052 Double_t *fEXDA;
00053
00054
00055 Double_t *fA;
00056 Double_t *fPL0;
00057 Double_t *fPL;
00058
00059
00060 Double_t *fDA;
00061 Double_t *fAMX;
00062 Double_t *fAMN;
00063 Double_t *fR;
00064
00065 Double_t *fDF;
00066 Double_t *fCmPar;
00067
00068 Double_t fS;
00069 Double_t fEPS;
00070 Double_t fRP;
00071 Double_t fAKAPPA;
00072 Double_t fGT;
00073 TString *fANames;
00074 TString fCword;
00075
00076
00077
00078
00079
00080
00081
00082 public:
00083
00084 TFumili(Int_t maxpar=25);
00085 virtual ~TFumili();
00086
00087 void BuildArrays();
00088 virtual Double_t Chisquare(Int_t npar, Double_t *params) const;
00089 virtual void Clear(Option_t *opt="");
00090 void DeleteArrays();
00091 void Derivatives(Double_t*,Double_t*);
00092 Int_t Eval(Int_t& npar, Double_t *grad, Double_t &fval, Double_t *par, Int_t flag);
00093 Double_t EvalTFN(Double_t *,Double_t*);
00094 virtual Int_t ExecuteCommand(const char *command, Double_t *args, Int_t nargs);
00095 Int_t ExecuteSetCommand(Int_t );
00096 virtual void FitChisquare(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
00097 virtual void FitChisquareI(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
00098 virtual void FitLikelihood(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
00099 virtual void FitLikelihoodI(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
00100 virtual void FixParameter(Int_t ipar);
00101 virtual Double_t *GetCovarianceMatrix() const;
00102 virtual Double_t GetCovarianceMatrixElement(Int_t i, Int_t j) const;
00103 virtual Int_t GetErrors(Int_t ipar,Double_t &eplus, Double_t &eminus, Double_t &eparab, Double_t &globcc) const;
00104 virtual Int_t GetNumberTotalParameters() const;
00105 virtual Int_t GetNumberFreeParameters() const;
00106 Double_t* GetPL0() const { return fPL0;}
00107 virtual Double_t GetParError(Int_t ipar) const;
00108 virtual Double_t GetParameter(Int_t ipar) const ;
00109 virtual Int_t GetParameter(Int_t ipar,char *name,Double_t &value,Double_t &verr,Double_t &vlow, Double_t &vhigh) const;
00110 virtual const char *GetParName(Int_t ipar) const;
00111 virtual Int_t GetStats(Double_t &amin, Double_t &edm, Double_t &errdef, Int_t &nvpar, Int_t &nparx) const;
00112 virtual Double_t GetSumLog(Int_t );
00113 Double_t* GetZ() const { return fZ;}
00114 void InvertZ(Int_t);
00115 virtual Bool_t IsFixed(Int_t ipar) const;
00116 Int_t Minimize();
00117 virtual void PrintResults(Int_t k,Double_t p) const;
00118 virtual void ReleaseParameter(Int_t ipar);
00119 Int_t SGZ();
00120 void SetData(Double_t *,Int_t,Int_t);
00121 virtual void SetFitMethod(const char *name);
00122 virtual Int_t SetParameter(Int_t ipar,const char *parname,Double_t value,Double_t verr,Double_t vlow, Double_t vhigh);
00123 void SetParNumber(Int_t ParNum) { fNpar = ParNum;};
00124
00125 ClassDef(TFumili,0)
00126 };
00127
00128 R__EXTERN TFumili * gFumili;
00129 #endif
00130
00131
00132
00133