Logo ROOT  
Reference Guide
Go to the documentation of this file.
1// @(#)root/minuit:$Id$
2// Author: Rene Brun 31/08/99
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11#ifndef ROOT_TFitter
12#define ROOT_TFitter
15#include "TVirtualFitter.h"
17class TMinuit;
19class TFitter : public TVirtualFitter {
22 Int_t fNlog; //Number of elements in fSunLog
23 Double_t *fCovar; //Covariance matrix
24 Double_t *fSumLog; //Sum of logs (array of fNlog elements)
25 TMinuit *fMinuit; //pointer to the TMinuit object
27 TFitter(const TFitter&); // Not implemented
28 TFitter& operator=(const TFitter&); // Not implemented
31 TFitter(Int_t maxpar = 25);
32 virtual ~TFitter();
33 virtual Double_t Chisquare(Int_t npar, Double_t *params) const ;
34 virtual void Clear(Option_t *option="");
35 virtual Int_t ExecuteCommand(const char *command, Double_t *args, Int_t nargs);
36 // virtual void FitChisquare(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
37 // virtual void FitChisquareI(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
38 // virtual void FitLikelihood(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
39 // virtual void FitLikelihoodI(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
40 virtual void FixParameter(Int_t ipar);
41 virtual void GetConfidenceIntervals(Int_t n, Int_t ndim, const Double_t *x, Double_t *ci, Double_t cl=0.95);
42 virtual void GetConfidenceIntervals(TObject *obj, Double_t cl=0.95);
43 virtual Double_t *GetCovarianceMatrix() const;
45 virtual Int_t GetErrors(Int_t ipar,Double_t &eplus, Double_t &eminus, Double_t &eparab, Double_t &globcc) const;
46 TMinuit *GetMinuit() const {return fMinuit;}
47 virtual Int_t GetNumberTotalParameters() const;
48 virtual Int_t GetNumberFreeParameters() const;
49 virtual Double_t GetParError(Int_t ipar) const;
50 virtual Double_t GetParameter(Int_t ipar) const;
51 virtual Int_t GetParameter(Int_t ipar,char *name,Double_t &value,Double_t &verr,Double_t &vlow, Double_t &vhigh) const;
52 virtual const char *GetParName(Int_t ipar) const;
53 virtual Int_t GetStats(Double_t &amin, Double_t &edm, Double_t &errdef, Int_t &nvpar, Int_t &nparx) const;
54 virtual Double_t GetSumLog(Int_t i);
55 virtual Bool_t IsFixed(Int_t ipar) const;
56 virtual void PrintResults(Int_t level, Double_t amin) const;
57 virtual void ReleaseParameter(Int_t ipar);
58 virtual void SetFCN(void (*fcn)(Int_t &, Double_t *, Double_t &f, Double_t *, Int_t));
59 virtual void SetFitMethod(const char *name);
60 virtual Int_t SetParameter(Int_t ipar,const char *parname,Double_t value,Double_t verr,Double_t vlow, Double_t vhigh);
62 ClassDef(TFitter,0) //The ROOT standard fitter based on TMinuit
int Int_t
Definition: CPyCppyy.h:43
#define f(i)
Definition: RSha256.hxx:104
bool Bool_t
Definition: RtypesCore.h:63
double Double_t
Definition: RtypesCore.h:59
const char Option_t
Definition: RtypesCore.h:66
#define ClassDef(name, id)
Definition: Rtypes.h:325
The ROOT standard fitter based on TMinuit.
Definition: TFitter.h:19
virtual void ReleaseParameter(Int_t ipar)
Release parameter ipar.
Definition: TFitter.cxx:555
virtual Double_t GetCovarianceMatrixElement(Int_t i, Int_t j) const
return element i,j from the covariance matrix
Definition: TFitter.cxx:394
virtual void SetFitMethod(const char *name)
ret fit method (chisquare or loglikelihood)
Definition: TFitter.cxx:574
TMinuit * fMinuit
Definition: TFitter.h:25
virtual Double_t GetParameter(Int_t ipar) const
return current value of parameter ipar
Definition: TFitter.cxx:456
virtual Int_t GetErrors(Int_t ipar, Double_t &eplus, Double_t &eminus, Double_t &eparab, Double_t &globcc) const
return current errors for a parameter ipar : parameter number eplus : upper error eminus : lower erro...
Definition: TFitter.cxx:413
virtual Int_t GetNumberTotalParameters() const
return the total number of parameters (free + fixed)
Definition: TFitter.cxx:425
virtual Int_t SetParameter(Int_t ipar, const char *parname, Double_t value, Double_t verr, Double_t vlow, Double_t vhigh)
set initial values for a parameter
Definition: TFitter.cxx:596
Double_t * fCovar
Definition: TFitter.h:23
virtual void FixParameter(Int_t ipar)
Fix parameter ipar.
Definition: TFitter.cxx:103
virtual void GetConfidenceIntervals(Int_t n, Int_t ndim, const Double_t *x, Double_t *ci, Double_t cl=0.95)
Computes point-by-point confidence intervals for the fitted function.
Definition: TFitter.cxx:122
TFitter(const TFitter &)
virtual Int_t GetStats(Double_t &amin, Double_t &edm, Double_t &errdef, Int_t &nvpar, Int_t &nparx) const
return global fit parameters
Definition: TFitter.cxx:505
virtual Int_t ExecuteCommand(const char *command, Double_t *args, Int_t nargs)
Execute a fitter command; command : command string args : list of nargs command arguments.
Definition: TFitter.cxx:92
virtual Bool_t IsFixed(Int_t ipar) const
return kTRUE if parameter ipar is fixed, kFALSE othersise)
Definition: TFitter.cxx:537
Double_t * fSumLog
Definition: TFitter.h:24
virtual Double_t * GetCovarianceMatrix() const
return a pointer to the covariance matrix
Definition: TFitter.cxx:382
virtual void PrintResults(Int_t level, Double_t amin) const
Print fit results.
Definition: TFitter.cxx:547
TMinuit * GetMinuit() const
Definition: TFitter.h:46
virtual const char * GetParName(Int_t ipar) const
return name of parameter ipar
Definition: TFitter.cxx:490
virtual void Clear(Option_t *option="")
reset the fitter environment
Definition: TFitter.cxx:76
virtual Double_t Chisquare(Int_t npar, Double_t *params) const
Definition: TFitter.cxx:65
virtual Int_t GetNumberFreeParameters() const
return the number of free parameters
Definition: TFitter.cxx:433
virtual Double_t GetParError(Int_t ipar) const
return error of parameter ipar
Definition: TFitter.cxx:442
virtual Double_t GetSumLog(Int_t i)
return Sum(log(i) i=0,n used by log likelihood fits
Definition: TFitter.cxx:516
TFitter & operator=(const TFitter &)
virtual void SetFCN(void(*fcn)(Int_t &, Double_t *, Double_t &f, Double_t *, Int_t))
Specify the address of the fitting algorithm.
Definition: TFitter.cxx:564
virtual ~TFitter()
Default destructor.
Definition: TFitter.cxx:55
Int_t fNlog
Definition: TFitter.h:22
Implementation in C++ of the Minuit package written by Fred James.
Definition: TMinuit.h:27
Mother of all ROOT objects.
Definition: TObject.h:37
Abstract Base Class for Fitting.
Double_t x[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16
static const std::string name("name")
static constexpr double eplus