Logo ROOT   6.18/05
Reference Guide
TFitter.h
Go to the documentation of this file.
1// @(#)root/minuit:$Id$
2// Author: Rene Brun 31/08/99
3
4/*************************************************************************
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
13
14
15//////////////////////////////////////////////////////////////////////////
16// //
17// TFitter //
18// //
19// The ROOT standard fitter based on TMinuit //
20// //
21//////////////////////////////////////////////////////////////////////////
22
23
24#include "TVirtualFitter.h"
25
26class TMinuit;
27
28class TFitter : public TVirtualFitter {
29
30private:
31 Int_t fNlog; //Number of elements in fSunLog
32 Double_t *fCovar; //Covariance matrix
33 Double_t *fSumLog; //Sum of logs (array of fNlog elements)
34 TMinuit *fMinuit; //pointer to the TMinuit object
35
36 TFitter(const TFitter&); // Not implemented
37 TFitter& operator=(const TFitter&); // Not implemented
38
39public:
40 TFitter(Int_t maxpar = 25);
41 virtual ~TFitter();
42 virtual Double_t Chisquare(Int_t npar, Double_t *params) const ;
43 virtual void Clear(Option_t *option="");
44 virtual Int_t ExecuteCommand(const char *command, Double_t *args, Int_t nargs);
45 // virtual void FitChisquare(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
46 // virtual void FitChisquareI(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
47 // virtual void FitLikelihood(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
48 // virtual void FitLikelihoodI(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
49 virtual void FixParameter(Int_t ipar);
50 virtual void GetConfidenceIntervals(Int_t n, Int_t ndim, const Double_t *x, Double_t *ci, Double_t cl=0.95);
51 virtual void GetConfidenceIntervals(TObject *obj, Double_t cl=0.95);
52 virtual Double_t *GetCovarianceMatrix() const;
54 virtual Int_t GetErrors(Int_t ipar,Double_t &eplus, Double_t &eminus, Double_t &eparab, Double_t &globcc) const;
55 TMinuit *GetMinuit() const {return fMinuit;}
56 virtual Int_t GetNumberTotalParameters() const;
57 virtual Int_t GetNumberFreeParameters() const;
58 virtual Double_t GetParError(Int_t ipar) const;
59 virtual Double_t GetParameter(Int_t ipar) const;
60 virtual Int_t GetParameter(Int_t ipar,char *name,Double_t &value,Double_t &verr,Double_t &vlow, Double_t &vhigh) const;
61 virtual const char *GetParName(Int_t ipar) const;
62 virtual Int_t GetStats(Double_t &amin, Double_t &edm, Double_t &errdef, Int_t &nvpar, Int_t &nparx) const;
63 virtual Double_t GetSumLog(Int_t i);
64 virtual Bool_t IsFixed(Int_t ipar) const;
65 virtual void PrintResults(Int_t level, Double_t amin) const;
66 virtual void ReleaseParameter(Int_t ipar);
67 virtual void SetFCN(void (*fcn)(Int_t &, Double_t *, Double_t &f, Double_t *, Int_t));
68 virtual void SetFitMethod(const char *name);
69 virtual Int_t SetParameter(Int_t ipar,const char *parname,Double_t value,Double_t verr,Double_t vlow, Double_t vhigh);
70
71 ClassDef(TFitter,0) //The ROOT standard fitter based on TMinuit
72};
73
74#endif
#define f(i)
Definition: RSha256.hxx:104
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
char name[80]
Definition: TGX11.cxx:109
virtual void ReleaseParameter(Int_t ipar)
Release parameter ipar.
Definition: TFitter.cxx:541
virtual Double_t GetCovarianceMatrixElement(Int_t i, Int_t j) const
return element i,j from the covariance matrix
Definition: TFitter.cxx:383
virtual void SetFitMethod(const char *name)
ret fit method (chisquare or loglikelihood)
Definition: TFitter.cxx:560
TMinuit * fMinuit
Definition: TFitter.h:34
virtual Double_t GetParameter(Int_t ipar) const
return current value of parameter ipar
Definition: TFitter.cxx:445
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:402
TMinuit * GetMinuit() const
Definition: TFitter.h:55
virtual Int_t GetNumberTotalParameters() const
return the total number of parameters (free + fixed)
Definition: TFitter.cxx:414
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 ipar : parameter number parname : parameter name value : initial p...
Definition: TFitter.cxx:581
Double_t * fCovar
Definition: TFitter.h:32
virtual void FixParameter(Int_t ipar)
Fix parameter ipar.
Definition: TFitter.cxx:96
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 Parameters: n - number of points...
Definition: TFitter.cxx:113
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 amin : chisquare edm : estimated distance to minimum errdef nvpar : numb...
Definition: TFitter.cxx:491
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:85
virtual Bool_t IsFixed(Int_t ipar) const
return kTRUE if parameter ipar is fixed, kFALSE othersise)
Definition: TFitter.cxx:523
Double_t * fSumLog
Definition: TFitter.h:33
virtual Double_t * GetCovarianceMatrix() const
return a pointer to the covariance matrix
Definition: TFitter.cxx:371
virtual void PrintResults(Int_t level, Double_t amin) const
Print fit results.
Definition: TFitter.cxx:533
virtual const char * GetParName(Int_t ipar) const
return name of parameter ipar
Definition: TFitter.cxx:477
virtual void Clear(Option_t *option="")
reset the fitter environment
Definition: TFitter.cxx:69
virtual Double_t Chisquare(Int_t npar, Double_t *params) const
Definition: TFitter.cxx:58
virtual Int_t GetNumberFreeParameters() const
return the number of free parameters
Definition: TFitter.cxx:422
virtual Double_t GetParError(Int_t ipar) const
return error of parameter ipar
Definition: TFitter.cxx:431
virtual Double_t GetSumLog(Int_t i)
return Sum(log(i) i=0,n used by log likelihood fits
Definition: TFitter.cxx:502
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:550
virtual ~TFitter()
Default destructor.
Definition: TFitter.cxx:48
Int_t fNlog
Definition: TFitter.h:31
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 constexpr double eplus