#ifndef ROOT_TBackCompFitter_H_
#define ROOT_TBackCompFitter_H_
#ifndef ROOT_TVirtualFitter
#include "TVirtualFitter.h"
#endif
#ifndef ROOT_Fit_Fitter
#include "Fit/Fitter.h"
#endif
#ifndef ROOT_Fit_DataVector
#include "Fit/DataVector.h"
#endif
#ifndef ROOT_Math_IFunctionfwd
#include "Math/IFunctionfwd.h"
#endif
#include <vector>
class TGraph;
class TFitResult;
namespace ROOT {
namespace Fit {
class FitData;
}
namespace Math {
class Minimizer;
}
}
class TBackCompFitter : public TVirtualFitter {
public:
TBackCompFitter();
TBackCompFitter( std::auto_ptr<ROOT::Fit::Fitter> fitter, std::auto_ptr<ROOT::Fit::FitData> data );
virtual ~TBackCompFitter();
public:
enum {
kCanDeleteLast = BIT(9)
};
virtual Double_t Chisquare(Int_t npar, Double_t *params) const;
virtual void Clear(Option_t *option="");
virtual Int_t ExecuteCommand(const char *command, Double_t *args, Int_t nargs);
virtual void FixParameter(Int_t ipar);
virtual void GetConfidenceIntervals(Int_t n, Int_t ndim, const Double_t *x, Double_t *ci, Double_t cl=0.95);
virtual void GetConfidenceIntervals(TObject *obj, Double_t cl=0.95);
virtual Double_t *GetCovarianceMatrix() const;
virtual Double_t GetCovarianceMatrixElement(Int_t i, Int_t j) const;
virtual Int_t GetErrors(Int_t ipar,Double_t &eplus, Double_t &eminus, Double_t &eparab, Double_t &globcc) const;
virtual Int_t GetNumberTotalParameters() const;
virtual Int_t GetNumberFreeParameters() const;
virtual Double_t GetParError(Int_t ipar) const;
virtual Double_t GetParameter(Int_t ipar) const;
virtual Int_t GetParameter(Int_t ipar,char *name,Double_t &value,Double_t &verr,Double_t &vlow, Double_t &vhigh) const;
virtual const char *GetParName(Int_t ipar) const;
virtual Int_t GetStats(Double_t &amin, Double_t &edm, Double_t &errdef, Int_t &nvpar, Int_t &nparx) const;
virtual Double_t GetSumLog(Int_t i);
virtual Bool_t IsFixed(Int_t ipar) const ;
virtual void PrintResults(Int_t level, Double_t amin) const;
virtual void ReleaseParameter(Int_t ipar);
virtual void SetFitMethod(const char *name);
virtual Int_t SetParameter(Int_t ipar,const char *parname,Double_t value,Double_t verr,Double_t vlow, Double_t vhigh);
virtual void SetFCN(void (*fcn)(Int_t &, Double_t *, Double_t &f, Double_t *, Int_t) );
virtual void SetFCN(void * );
virtual void SetMethodCall(TMethodCall * m) { fMethodCall = m; }
ROOT::Fit::FitConfig & GetFitConfig() { return fFitter->Config(); }
const ROOT::Fit::FitResult & GetFitResult() const { return fFitter->Result(); }
TFitResult * GetTFitResult() const;
const ROOT::Fit::FitData & GetFitData() const { return *fFitData; }
ROOT::Math::Minimizer * GetMinimizer() const;
ROOT::Math::IMultiGenFunction * GetObjFunction() const;
bool Scan(unsigned int ipar, TGraph * gr, double xmin = 0, double xmax = 0);
bool Contour(unsigned int ipar, unsigned int jpar, TGraph * gr , double confLevel = 0.683);
virtual void SetObjFunction( ROOT::Math::IMultiGenFunction * f);
void ReCreateMinimizer();
protected:
bool ValidParameterIndex(int ipar) const;
void DoSetDimension();
private:
std::auto_ptr<ROOT::Fit::FitData> fFitData;
std::auto_ptr<ROOT::Fit::Fitter> fFitter;
ROOT::Math::Minimizer * fMinimizer;
ROOT::Math::IMultiGenFunction * fObjFunc;
ROOT::Math::IParamMultiFunction * fModelFunc;
mutable std::vector<double> fCovar;
ClassDef(TBackCompFitter,1)
};
#endif //ROOT_TBackCompFitter_H_