class TFitterMinuit: public TVirtualFitter

Interface to the new C++ Minuit package (MINUIT2) for ROOT.
It implements the TVirtualFitter interface using Minuit2
For more information on the new C++ Minuit, see

Minuit2 can be set as the default fitter to be used in method lik TH1::Fit, by doing

This class can be used also directly by providing for the objective function either a global C function, like in TMinuit, or by passing a function class implementing the ROOT::Minuit2::FCNBase interface and used via the SetMinuitFCN method

Function Members (Methods)

TFitterMinuit(Int_t maxpar)
TFitterMinuit(const TFitterMinuit&)
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
virtual Double_tChisquare(Int_t npar, Double_t* params) const
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidClear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual voidCreateMinimizer(TFitterMinuit::EMinimizerType = kMigrad)
virtual voidTObject::Delete(Option_t* option = "")
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() const
virtual TObject*TObject::DrawClone(Option_t* option = "") const
virtual voidTObject::Dump() const
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual Int_tExecuteCommand(const char* command, Double_t* args, Int_t nargs)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
static TVirtualFitter*TVirtualFitter::Fitter(TObject* obj, Int_t maxpar = 25)
virtual voidFixParameter(Int_t ipar)
virtual voidTVirtualFitter::GetConfidenceIntervals(TObject* obj, Double_t cl = 0.95)
virtual voidTVirtualFitter::GetConfidenceIntervals(Int_t n, Int_t ndim, const Double_t* x, Double_t* ci, Double_t cl = 0.95)
virtual Double_t*GetCovarianceMatrix() const
virtual Double_tGetCovarianceMatrixElement(Int_t i, Int_t j) const
static const char*TVirtualFitter::GetDefaultFitter()
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
static Double_tTVirtualFitter::GetErrorDef()
virtual Int_tGetErrors(Int_t ipar, Double_t& eplus, Double_t& eminus, Double_t& eparab, Double_t& globcc) const
virtual Foption_tTVirtualFitter::GetFitOption() const
static TVirtualFitter*TVirtualFitter::GetFitter()
virtual const char*TObject::GetIconName() const
static Int_tTVirtualFitter::GetMaxIterations()
TMethodCall*TVirtualFitter::GetMethodCall() const
virtual const ROOT::Minuit2::ModularFunctionMinimizer*GetMinimizer() const
virtual const ROOT::Minuit2::FCNBase*GetMinuitFCN() const
virtual const char*TNamed::GetName() const
virtual Int_tGetNumberFreeParameters() const
virtual Int_tGetNumberTotalParameters() const
virtual TObject*TVirtualFitter::GetObjectFit() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual Double_tGetParameter(Int_t ipar) const
virtual Int_tGetParameter(Int_t ipar, char* name, Double_t& value, Double_t& verr, Double_t& vlow, Double_t& vhigh) const
virtual Double_tGetParError(Int_t ipar) const
virtual const char*GetParName(Int_t ipar) const
static Double_tTVirtualFitter::GetPrecision()
virtual Int_tGetStats(Double_t& amin, Double_t& edm, Double_t& errdef, Int_t& nvpar, Int_t& nparx) const
virtual Double_tGetSumLog(Int_t i)
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual TObject*TVirtualFitter::GetUserFunc() const
virtual Int_tTVirtualFitter::GetXfirst() const
virtual Int_tTVirtualFitter::GetXlast() const
virtual Int_tTVirtualFitter::GetYfirst() const
virtual Int_tTVirtualFitter::GetYlast() const
virtual Int_tTVirtualFitter::GetZfirst() const
virtual Int_tTVirtualFitter::GetZlast() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() const
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tIsFixed(Int_t ipar) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual intMinimize(int nfcn = 0, double edmval = 0.1)
doubleMinimumTolerance() const
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
virtual voidPrintResults(Int_t level, Double_t amin) const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidReleaseParameter(Int_t ipar)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") const
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual Double_t*TVirtualFitter::SetCache(Int_t npoints, Int_t psize)
static voidTVirtualFitter::SetDefaultFitter(const char* name = "")
virtual voidTObject::SetDrawOption(Option_t* option = "")
static voidTObject::SetDtorOnly(void* obj)
static voidTVirtualFitter::SetErrorDef(Double_t errdef = 1)
virtual voidSetFCN(void fcn)
virtual voidSetFCN(void*)
virtual voidSetFitMethod(const char* name)
virtual voidTVirtualFitter::SetFitOption(Foption_t option)
static voidTVirtualFitter::SetFitter(TVirtualFitter* fitter, Int_t maxpar = 25)
static voidTVirtualFitter::SetMaxIterations(Int_t niter = 5000)
voidSetMinimumTolerance(double mintol)
virtual voidSetMinuitFCN(ROOT::Minuit2::FCNBase* f)
virtual voidTNamed::SetName(const char* name)
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
virtual voidTVirtualFitter::SetObjectFit(TObject* obj)
static voidTObject::SetObjectStat(Bool_t stat)
virtual Int_tSetParameter(Int_t ipar, const char* parname, Double_t value, Double_t verr, Double_t vlow, Double_t vhigh)
static voidTVirtualFitter::SetPrecision(Double_t prec = 1e-6)
voidSetPrintLevel(int level)
voidSetStrategy(int stra)
virtual voidTNamed::SetTitle(const char* title = "")
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidTVirtualFitter::SetUserFunc(TObject* userfunc)
virtual voidTVirtualFitter::SetXfirst(Int_t first)
virtual voidTVirtualFitter::SetXlast(Int_t last)
virtual voidTVirtualFitter::SetYfirst(Int_t first)
virtual voidTVirtualFitter::SetYlast(Int_t last)
virtual voidTVirtualFitter::SetZfirst(Int_t first)
virtual voidTVirtualFitter::SetZlast(Int_t last)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual Int_tTNamed::Sizeof() const
virtual const ROOT::Minuit2::MnUserParameterState&State() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
virtual voidCreateBinLikelihoodFCN()
virtual voidCreateChi2ExtendedFCN()
virtual voidCreateChi2FCN()
virtual voidCreateUnbinLikelihoodFCN()
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
virtual ROOT::Minuit2::FunctionMinimumDoMinimization(int nfcn = 0, double edmval = 0.1)
virtual intExamineMinimum(const ROOT::Minuit2::FunctionMinimum&)
virtual voidInitialize()
TVirtualFitter&TVirtualFitter::operator=(const TVirtualFitter& tvf)
virtual voidSetMinimizer(ROOT::Minuit2::ModularFunctionMinimizer* m)
virtual ROOT::Minuit2::MnUserParameterState&State()

Data Members

enum EMinimizerType { kMigrad
enum TObject::EStatusBits { kCanDelete
enum TObject::[unnamed] { kIsOnHeap
Double_t*TVirtualFitter::fCache[fCacheSize] array of points data (fNpoints*fPointSize < fCacheSize words)
Int_tTVirtualFitter::fCacheSizeSize of the fCache array
TMethodCall*TVirtualFitter::fMethodCallPointer to MethodCall in case of interpreted function
TStringTNamed::fNameobject identifier
Int_tTVirtualFitter::fNpointsNumber of points to fit
TObject*TVirtualFitter::fObjectFitpointer to object being fitted
Foption_tTVirtualFitter::fOptionstruct with the fit options
Int_tTVirtualFitter::fPointSizeNumber of words per point in the cache
TStringTNamed::fTitleobject title
TObject*TVirtualFitter::fUserFuncpointer to user theoretical function (a TF1*)
Int_tTVirtualFitter::fXfirstfirst bin on X axis
Int_tTVirtualFitter::fXlastlast bin on X axis
Int_tTVirtualFitter::fYfirstfirst bin on Y axis
Int_tTVirtualFitter::fYlastlast bin on Y axis
Int_tTVirtualFitter::fZfirstfirst bin on Z axis
Int_tTVirtualFitter::fZlastlast bin on Z axis
static TStringTVirtualFitter::fgDefaultname of the default fitter ("Minuit","Fumili",etc)
static Double_tTVirtualFitter::fgErrorDefError definition (default=1)
static TVirtualFitter*TVirtualFitter::fgFitterCurrent fitter (default TFitter)
static Int_tTVirtualFitter::fgMaxiterMaximum number of iterations
static Int_tTVirtualFitter::fgMaxparMaximum number of fit parameters for current fitter
static Double_tTVirtualFitter::fgPrecisionmaximum precision
vector<double>fCovarcached covariance matrix (NxN)

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

 Default constructor . Srategy and tolerance set to default values.
TFitterMinuit(Int_t /* maxpar */)
 Constructur needed by TVirtualFitter interface. Same behavior as default constructor.
void Initialize()
 initialize setting name and the global pointer
void CreateMinimizer(TFitterMinuit::EMinimizerType = kMigrad)
 create the minimizer engine and register the plugin in ROOT
 destructor - deletes the minimizer and minuit fcn
 if using TVirtualFitter one should use Clear() and not delete()
Double_t Chisquare(Int_t npar, Double_t* params) const
 do chisquare calculations in case of likelihood fits
void Clear(Option_t* option = "")
 clear resources for consecutive fits
FunctionMinimum DoMinimization(int nfcn = 0, double edmval = 0.1)
 perform minimization using Minuit2 function
 use always strategy 1 (2 is not yet fully tested)
int Minimize(int nfcn = 0, double edmval = 0.1)
 minimize (call DoMinimization() and analyze the result
Int_t ExecuteCommand(const char* command, Double_t* args, Int_t nargs)
 execute the command (Fortran Minuit compatible interface)
int ExamineMinimum(const ROOT::Minuit2::FunctionMinimum& )
 study the function minimum
void FixParameter(Int_t ipar)
 fix the paramter
Double_t* GetCovarianceMatrix()
 get the error matrix in a pointer to a NxN array.
 Since Minuit2 stores only the independent element need to copy in a
 cached vector
Double_t GetCovarianceMatrixElement(Int_t i, Int_t j) const
 get error matrix element
Int_t GetErrors(Int_t ipar, Double_t& eplus, Double_t& eminus, Double_t& eparab, Double_t& globcc) const
 get fit errors
Int_t GetNumberTotalParameters()
 number of total parameters (ugly interface)
Int_t GetNumberFreeParameters()
 number of variable parameters
Double_t GetParError(Int_t ipar) const
 parameter error
Double_t GetParameter(Int_t ipar) const
 parameter value
Int_t GetParameter(Int_t ipar, char* name, Double_t& value, Double_t& verr, Double_t& vlow, Double_t& vhigh) const
 get all parameter info (name, value, errors)
   std::cout<<"GetParameter(Int_t ipar,char"<<std::endl;
const char * GetParName(Int_t ipar) const
   return name of parameter ipar
Int_t GetStats(Double_t& amin, Double_t& edm, Double_t& errdef, Int_t& nvpar, Int_t& nparx) const
 get fit statistical information
Double_t GetSumLog(Int_t i)
Bool_t IsFixed(Int_t ipar) const
 query if parameter ipar is fixed
void PrintResults(Int_t level, Double_t amin) const
 print the fit result
void ReleaseParameter(Int_t ipar)
 release a fit parameter
void SetFitMethod(const char* name)
 set fit method (i.e. chi2 or likelihood)
 according to the method the appropriate FCN function will be created
Int_t SetParameter(Int_t ipar, const char* parname, Double_t value, Double_t verr, Double_t vlow, Double_t vhigh)
 set (add) a new fit parameter passing initial value,  step size (verr) and parametr limits
 if vlow > vhigh the parameter is unbounded
 if the stepsize (verr) == 0 the parameter is treated as fixed
void SetFCN(void (*fcn)(Int_t &, Double_t *, Double_t &f, Double_t *, Int_t))
 override setFCN to use the Adapter to Minuit2 FCN interface
To set the address of the minimization function*-
*-*          ===============================================
void SetFCN(void *fcn)
To set the address of the minimization function*-
*-*          ===============================================
     this function is called by CINT instead of the function above
void SetMinuitFCN(ROOT::Minuit2::FCNBase* f)
 class takes the ownership of the passed pointer
 so needs to delete previous one
void CreateChi2FCN()
 create a chi2 FCN object
void CreateChi2ExtendedFCN()
 create an extended chi2 FCN object
 used in the case of errors both on the coordinates and the value (case of a graph fit)
void CreateBinLikelihoodFCN()
 create a binned likelihood FCN
const ROOT::Minuit2::FCNBase * GetMinuitFCN()
{ return fMinuitFCN; }
const ROOT::Minuit2::ModularFunctionMinimizer * GetMinimizer()
{ return fMinimizer; }
int GetStrategy()
{ return fStrategy; }
int PrintLevel()
{ return fDebug; }
void SetStrategy(int stra)
{ fStrategy = stra; }
void SetPrintLevel(int level)
{ fDebug = level; }
void SetMinimumTolerance(double mintol)
 set minimum tolerance to avoid having clients (as TGraf::Fit) setting tolerances too small
{ fMinTolerance = mintol; }
double MinimumTolerance()
{ return fMinTolerance; }
void SetMinimizer(ROOT::Minuit2::ModularFunctionMinimizer* m)
{ fMinimizer = m; }
void CreateUnbinLikelihoodFCN()

Author: L. Moneta 10/2005
Last update: root/minuit2:$Id: TFitterMinuit.h 20880 2007-11-19 11:23:41Z rdm $
Copyright (c) 2005 ROOT Foundation, CERN/PH-SFT *

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.