#ifndef ROOT_TFumiliMinimizer
#define ROOT_TFumiliMinimizer
#ifndef ROOT_Math_Minimizer
#include "Math/Minimizer.h"
#endif
#ifndef ROOT_Math_FitMethodFunction
#include "Math/FitMethodFunction.h"
#endif
#ifndef ROOT_Rtypes
#include "Rtypes.h"
#endif
class TFumili;
class TFumiliMinimizer : public ROOT::Math::Minimizer {
public:
TFumiliMinimizer (int dummy=0 );
~TFumiliMinimizer ();
private:
TFumiliMinimizer(const TFumiliMinimizer &);
TFumiliMinimizer & operator = (const TFumiliMinimizer & rhs);
public:
virtual void SetFunction(const ROOT::Math::IMultiGenFunction & func);
virtual void SetFunction(const ROOT::Math::IMultiGradFunction & func);
virtual bool SetVariable(unsigned int ivar, const std::string & name, double val, double step);
virtual bool SetLimitedVariable(unsigned int ivar , const std::string & name , double val , double step , double , double );
#ifdef LATER
virtual bool SetLowerLimitedVariable(unsigned int ivar , const std::string & name , double val , double step , double lower );
virtual bool SetUpperLimitedVariable(unsigned int ivar , const std::string & name , double val , double step , double upper );
#endif
virtual bool SetFixedVariable(unsigned int , const std::string & , double );
virtual bool SetVariableValue(unsigned int ivar, double val );
virtual bool Minimize();
virtual double MinValue() const { return fMinVal; }
virtual double Edm() const { return fEdm; }
virtual const double * X() const { return &fParams.front(); }
virtual const double * MinGradient() const { return 0; }
virtual unsigned int NCalls() const { return 0; }
virtual unsigned int NDim() const { return fDim; }
virtual unsigned int NFree() const { return fNFree; }
virtual bool ProvidesError() const { return true; }
virtual const double * Errors() const { return &fErrors.front(); }
virtual double CovMatrix(unsigned int i, unsigned int j) const {
return fCovar[i + fDim* j];
}
virtual int CovMatrixStatus() const {
if (fCovar.size() == 0) return 0;
return (fStatus ==0) ? 3 : 1;
}
protected:
static void Fcn( int &, double * , double & f, double * , int);
static double EvaluateFCN(const double * x, double * g);
private:
unsigned int fDim;
unsigned int fNFree;
double fMinVal;
double fEdm;
std::vector<double> fParams;
std::vector<double> fErrors;
std::vector<double> fCovar;
TFumili * fFumili;
static ROOT::Math::FitMethodFunction * fgFunc;
static ROOT::Math::FitMethodGradFunction * fgGradFunc;
static TFumili * fgFumili;
ClassDef(TFumiliMinimizer,1)
};
#endif /* ROOT_TFumiliMinimizer */