library: libMinuit #include "TFitter.h"

# TFitter

class description - source file - inheritance tree (.ps)

## class TFitter : public TVirtualFitter

| Inheritance Chart:

`TObject`

<-

`TNamed`

<-

`TVirtualFitter`

<-

`TFitter`

        public:

                            TFitter(Int_t maxpar = 25)
                            TFitter(const TFitter&)
                    virtual ~TFitter()
           virtual Double_t Chisquare(Int_t npar, Double_t* params)
             static TClass* Class()
               virtual void Clear(Option_t* option)
              virtual Int_t ExecuteCommand(const char* command, Double_t* args, Int_t nargs)
               virtual void FixParameter(Int_t ipar)
          virtual Double_t* GetCovarianceMatrix()
              virtual Int_t GetErrors(Int_t ipar, Double_t& eplus, Double_t& eminus, Double_t& eparab, Double_t& globcc)
           virtual Double_t GetParameter(Int_t ipar) const
              virtual Int_t GetParameter(Int_t ipar, char* name, Double_t& value, Double_t& verr, Double_t& vlow, Double_t& vhigh)
           virtual Double_t GetParError(Int_t ipar) const
              virtual Int_t GetStats(Double_t& amin, Double_t& edm, Double_t& errdef, Int_t& nvpar, Int_t& nparx)
           virtual Double_t GetSumLog(Int_t i)
            virtual TClass* IsA() const
                   TFitter& operator=(const TFitter&)
               virtual void PrintResults(Int_t level, Double_t amin) const
               virtual void ReleaseParameter(Int_t ipar)
               virtual void SetFCN(void* fcn)
               virtual void SetFCN(void (*)(Int_t&, Double_t*, Double_t&f, Double_t*, Int_t) fcn)
               virtual void SetFitMethod(const char* name)
              virtual Int_t SetParameter(Int_t ipar, const char* parname, Double_t value, Double_t verr, Double_t vlow, Double_t vhigh)
               virtual void ShowMembers(TMemberInspector& insp, char* parent)
               virtual void Streamer(TBuffer& b)
                       void StreamerNVirtual(TBuffer& b)

### Data Members

        private:

              Int_t fNlog    Number of elements in fSunLog
          Double_t* fCovar   Covariance matrix
          Double_t* fSumLog  Sum of logs (array of fNlog elements)
           TMinuit* fMinuit  pointer to the TMinuit object

## Class Description

TFitter(Int_t maxpar)

    *-*-*-*-*-*-*-*-*-*-*default constructor*-*-*-*-*-*-*-*-*-*-*-*-*
    *-*                  ===================

~TFitter()

    *-*-*-*-*-*-*-*-*-*-*default destructor*-*-*-*-*-*-*-*-*-*-*-*-*-*
    *-*                  ==================

Double_t Chisquare(Int_t npar, Double_t *params)

     return a chisquare equivalent

void Clear(Option_t *)

     reset the fitter environment

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

void FixParameter(Int_t ipar)

     Fix parameter ipar.

Double_t* GetCovarianceMatrix()

     return a pointer to the covariance matrix

Int_t GetErrors(Int_t ipar,Double_t &eplus, Double_t &eminus, Double_t &eparab, Double_t &globcc)

     return current errors for a parameter
       ipar     : parameter number
       eplus    : upper error
       eminus   : lower error
       eparab   : parabolic error
       globcc   : global correlation coefficient

Double_t GetParError(Int_t ipar) const

     return error of parameter ipar

Double_t GetParameter(Int_t ipar) const

     return current value of parameter ipar

Int_t GetParameter(Int_t ipar,char *parname,Double_t &value,Double_t &verr,Double_t &vlow, Double_t &vhigh)

     return current values for a parameter
       ipar     : parameter number
       parname  : parameter name
       value    : initial parameter value
       verr     : initial error for this parameter
       vlow     : lower value for the parameter
       vhigh    : upper value for the parameter

Int_t GetStats(Double_t &amin, Double_t &edm, Double_t &errdef, Int_t &nvpar, Int_t &nparx)

     return global fit parameters
       amin     : chisquare
       edm      : estimated distance to minimum
       errdef
       nvpar    : number of variable parameters
       nparx    : total number of parameters

Double_t GetSumLog(Int_t n)

     return Sum(log(i) i=0,n
     used by log likelihood fits

void PrintResults(Int_t level, Double_t amin) const

     Print fit results

void ReleaseParameter(Int_t ipar)

     Release parameter ipar.

void SetFCN(void *fcn)

     Specify the address of the fitting algorithm (from the interpreter)

void SetFCN(void (*fcn)(Int_t &, Double_t *, Double_t &f, Double_t *, Int_t))

     Specify the address of the fitting algorithm

void SetFitMethod(const char *name)

     ret fit method (chisquare or loglikelihood)

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 parameter value
       verr     : initial error for this parameter
       vlow     : lower value for the parameter
       vhigh    : upper value for the parameter

### Inline Functions

                TClass* Class()
                TClass* IsA() const
                   void ShowMembers(TMemberInspector& insp, char* parent)
                   void Streamer(TBuffer& b)
                   void StreamerNVirtual(TBuffer& b)
                TFitter TFitter(const TFitter&)
               TFitter& operator=(const TFitter&)

Author: Rene Brun 31/08/99
Last update: root/minuit:$Name: $:$Id: TFitter.cxx,v 1.19 2004/07/09 08:14:42 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *