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 ~TFitter() override;
33 Double_t Chisquare(Int_t npar, Double_t *params) const override ;
34 void Clear(Option_t *option="") override;
35 Int_t ExecuteCommand(const char *command, Double_t *args, Int_t nargs) override;
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 void FixParameter(Int_t ipar) override;
41 void GetConfidenceIntervals(Int_t n, Int_t ndim, const Double_t *x, Double_t *ci, Double_t cl=0.95) override;
42 void GetConfidenceIntervals(TObject *obj, Double_t cl=0.95) override;
43 Double_t *GetCovarianceMatrix() const override;
45 Int_t GetErrors(Int_t ipar,Double_t &eplus, Double_t &eminus, Double_t &eparab, Double_t &globcc) const override;
46 TMinuit *GetMinuit() const {return fMinuit;}
47 Int_t GetNumberTotalParameters() const override;
48 Int_t GetNumberFreeParameters() const override;
49 Double_t GetParError(Int_t ipar) const override;
50 Double_t GetParameter(Int_t ipar) const override;
51 Int_t GetParameter(Int_t ipar,char *name,Double_t &value,Double_t &verr,Double_t &vlow, Double_t &vhigh) const override;
52 const char *GetParName(Int_t ipar) const override;
53 Int_t GetStats(Double_t &amin, Double_t &edm, Double_t &errdef, Int_t &nvpar, Int_t &nparx) const override;
54 Double_t GetSumLog(Int_t i) override;
55 Bool_t IsFixed(Int_t ipar) const override;
56 void PrintResults(Int_t level, Double_t amin) const override;
57 void ReleaseParameter(Int_t ipar) override;
58 void SetFCN(void (*fcn)(Int_t &, Double_t *, Double_t &f, Double_t *, Int_t)) override;
59 void SetFitMethod(const char *name) override;
60 Int_t SetParameter(Int_t ipar,const char *parname,Double_t value,Double_t verr,Double_t vlow, Double_t vhigh) override;
61
62 ClassDefOverride(TFitter,0) //The ROOT standard fitter based on TMinuit
63};
64
65#endif
#define f(i)
Definition RSha256.hxx:104
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
double Double_t
Definition RtypesCore.h:59
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
char name[80]
Definition TGX11.cxx:110
<div class="legacybox"><h2>Legacy Code</h2> TFitter is a legacy interface: there will be no bug fixes...
Definition TFitter.h:19
Int_t GetNumberTotalParameters() const override
return the total number of parameters (free + fixed)
Definition TFitter.cxx:422
~TFitter() override
Default destructor.
Definition TFitter.cxx:51
const char * GetParName(Int_t ipar) const override
return name of parameter ipar
Definition TFitter.cxx:487
void SetFCN(void(*fcn)(Int_t &, Double_t *, Double_t &f, Double_t *, Int_t)) override
Specify the address of the fitting algorithm.
Definition TFitter.cxx:561
void ReleaseParameter(Int_t ipar) override
Release parameter ipar.
Definition TFitter.cxx:552
TMinuit * fMinuit
Definition TFitter.h:25
Double_t * GetCovarianceMatrix() const override
return a pointer to the covariance matrix
Definition TFitter.cxx:379
TMinuit * GetMinuit() const
Definition TFitter.h:46
Double_t GetParError(Int_t ipar) const override
return error of parameter ipar
Definition TFitter.cxx:439
Double_t * fCovar
Definition TFitter.h:23
Bool_t IsFixed(Int_t ipar) const override
return kTRUE if parameter ipar is fixed, kFALSE otherwise)
Definition TFitter.cxx:534
Double_t GetSumLog(Int_t i) override
return Sum(log(i) i=0,n used by log likelihood fits
Definition TFitter.cxx:513
void Clear(Option_t *option="") override
reset the fitter environment
Definition TFitter.cxx:73
TFitter(const TFitter &)
void PrintResults(Int_t level, Double_t amin) const override
Print fit results.
Definition TFitter.cxx:544
Double_t GetParameter(Int_t ipar) const override
return current value of parameter ipar
Definition TFitter.cxx:453
void GetConfidenceIntervals(Int_t n, Int_t ndim, const Double_t *x, Double_t *ci, Double_t cl=0.95) override
Computes point-by-point confidence intervals for the fitted function.
Definition TFitter.cxx:119
Double_t * fSumLog
Definition TFitter.h:24
Int_t GetErrors(Int_t ipar, Double_t &eplus, Double_t &eminus, Double_t &eparab, Double_t &globcc) const override
return current errors for a parameter ipar : parameter number eplus : upper error eminus : lower erro...
Definition TFitter.cxx:410
Int_t ExecuteCommand(const char *command, Double_t *args, Int_t nargs) override
Execute a fitter command; command : command string args : list of nargs command arguments.
Definition TFitter.cxx:89
void SetFitMethod(const char *name) override
ret fit method (chisquare or log-likelihood)
Definition TFitter.cxx:571
Int_t GetStats(Double_t &amin, Double_t &edm, Double_t &errdef, Int_t &nvpar, Int_t &nparx) const override
return global fit parameters
Definition TFitter.cxx:502
Double_t Chisquare(Int_t npar, Double_t *params) const override
Definition TFitter.cxx:64
void FixParameter(Int_t ipar) override
Fix parameter ipar.
Definition TFitter.cxx:100
Double_t GetCovarianceMatrixElement(Int_t i, Int_t j) const override
return element i,j from the covariance matrix
Definition TFitter.cxx:391
TFitter & operator=(const TFitter &)
Int_t SetParameter(Int_t ipar, const char *parname, Double_t value, Double_t verr, Double_t vlow, Double_t vhigh) override
set initial values for a parameter
Definition TFitter.cxx:588
Int_t GetNumberFreeParameters() const override
return the number of free parameters
Definition TFitter.cxx:430
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