Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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#include "TVirtualFitter.h"
16
17class TMinuit;
18
19class TFitter : public TVirtualFitter {
20
21private:
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
26
27 TFitter(const TFitter&); // Not implemented
28 TFitter& operator=(const TFitter&); // Not implemented
29
30public:
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);
61
62 ClassDef(TFitter,0) //The ROOT standard fitter based on TMinuit
63};
64
65#endif
#define f(i)
Definition RSha256.hxx:104
int Int_t
Definition RtypesCore.h:45
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
char name[80]
Definition TGX11.cxx:110
<div class="legacybox"><h2>Legacy Code</h2> TFitter is a legacy interface: it is not recommended to u...
Definition TFitter.h:19
virtual void ReleaseParameter(Int_t ipar)
Release parameter ipar.
Definition TFitter.cxx:552
virtual Double_t GetCovarianceMatrixElement(Int_t i, Int_t j) const
return element i,j from the covariance matrix
Definition TFitter.cxx:391
virtual void SetFitMethod(const char *name)
ret fit method (chisquare or log-likelihood)
Definition TFitter.cxx:571
TMinuit * fMinuit
Definition TFitter.h:25
virtual Double_t GetParameter(Int_t ipar) const
return current value of parameter ipar
Definition TFitter.cxx:453
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:410
TMinuit * GetMinuit() const
Definition TFitter.h:46
virtual Int_t GetNumberTotalParameters() const
return the total number of parameters (free + fixed)
Definition TFitter.cxx:422
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:588
Double_t * fCovar
Definition TFitter.h:23
virtual void FixParameter(Int_t ipar)
Fix parameter ipar.
Definition TFitter.cxx:100
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:119
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:502
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:89
virtual Bool_t IsFixed(Int_t ipar) const
return kTRUE if parameter ipar is fixed, kFALSE otherwise)
Definition TFitter.cxx:534
Double_t * fSumLog
Definition TFitter.h:24
virtual Double_t * GetCovarianceMatrix() const
return a pointer to the covariance matrix
Definition TFitter.cxx:379
virtual void PrintResults(Int_t level, Double_t amin) const
Print fit results.
Definition TFitter.cxx:544
virtual const char * GetParName(Int_t ipar) const
return name of parameter ipar
Definition TFitter.cxx:487
virtual void Clear(Option_t *option="")
reset the fitter environment
Definition TFitter.cxx:73
virtual Double_t Chisquare(Int_t npar, Double_t *params) const
Definition TFitter.cxx:64
virtual Int_t GetNumberFreeParameters() const
return the number of free parameters
Definition TFitter.cxx:430
virtual Double_t GetParError(Int_t ipar) const
return error of parameter ipar
Definition TFitter.cxx:439
virtual Double_t GetSumLog(Int_t i)
return Sum(log(i) i=0,n used by log likelihood fits
Definition TFitter.cxx:513
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:561
virtual ~TFitter()
Default destructor.
Definition TFitter.cxx:51
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:41
Abstract Base Class for Fitting.
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16