GRSISort
Created by P.C. Bender
Developement Team: P.C. Bender, R. Dunlop, V. Bildstein
An extension of the ROOT analysis Framework
TLMFitter Class Reference

This Class can be used to fit weighted-poisson distributed data. It is originally from Numerical recipes, and adapted by G.F Grinyer. It is based on the non-linear Levenberg-Marquardt minimization algorithm.

Definition at line 559 of file TLMFitter.h.

Classes

class  NRMat
 
class  NRMat3d
 
class  NRVec
 

Public Member Functions

 TLMFitter ()
 
 ~TLMFitter () override=default
 
 ClassDefOverride (TLMFitter, 1)
 
void Fit (TH1 *hist, TF1 *func)
 

Protected Member Functions

void covsrt (Mat_IO_double &covar, Vec_I_BOOL &ia, const int mfit)
 
void funcs (const double &x, Vec_IO_double &a, double &y, Vec_O_double &dyda)
 
void gaussj (Mat_IO_double &a, Mat_IO_double &b)
 
int integrator (Vec_I_double &x, Vec_I_double &y, Vec_double &sig, Vec_I_double &W, Vec_IO_double &a, Vec_double &dyda, int chisqnumber, const double &bin_width, Vec_double &yfit, const int &bin)
 
void mrqcof (Vec_I_double &x, Vec_I_double &y, Vec_double &sig, Vec_IO_double &a, Vec_I_BOOL &ia, Mat_O_double &alpha, Vec_O_double &beta, double &chisq, Vec_I_double &W, double &chisqexp)
 
void mrqmin (Vec_I_double &x, Vec_I_double &y, Vec_double &sig, Vec_IO_double &a, Vec_I_BOOL &ia, Mat_O_double &covar, Mat_O_double &alpha, double &chisq, Vec_I_double &W, double &alamda)
 
void nrerror (const std::string &error_text)
 
void SetFitterRange (int min, int max)
 

Private Attributes

TF1 * fFunction {nullptr}
 
TH1 * fHist {nullptr}
 
int fInitChi2Number
 
int fIntegrationSteps
 
int fRangeMax {0}
 
int fRangeMin {0}
 

#include <TLMFitter.h>

+ Inheritance diagram for TLMFitter:
+ Collaboration diagram for TLMFitter:

Constructor & Destructor Documentation

◆ TLMFitter()

TLMFitter::TLMFitter ( )
inline

Definition at line 561 of file TLMFitter.h.

◆ ~TLMFitter()

TLMFitter::~TLMFitter ( )
overridedefault

Member Function Documentation

◆ ClassDefOverride()

TLMFitter::ClassDefOverride ( TLMFitter  ,
 
)

◆ covsrt()

void TLMFitter::covsrt ( Mat_IO_double covar,
Vec_I_BOOL ia,
const int  mfit 
)
protected

Definition at line 391 of file TLMFitter.cxx.

References NRVec< T >::size(), and SWAP().

Referenced by mrqmin().

◆ Fit()

void TLMFitter::Fit ( TH1 *  hist,
TF1 *  func 
)

Definition at line 39 of file TLMFitter.cxx.

References fFunction, fHist, hist, mrqmin(), and SetFitterRange().

Referenced by TDecay::Fit().

◆ funcs()

void TLMFitter::funcs ( const double &  x,
Vec_IO_double a,
double &  y,
Vec_O_double dyda 
)
protected

Definition at line 27 of file TLMFitter.cxx.

Referenced by integrator().

◆ gaussj()

void TLMFitter::gaussj ( Mat_IO_double a,
Mat_IO_double b 
)
protected

Definition at line 420 of file TLMFitter.cxx.

References NRMat< T >::ncols(), nrerror(), NRMat< T >::nrows(), and SWAP().

Referenced by mrqmin().

◆ integrator()

int TLMFitter::integrator ( Vec_I_double x,
Vec_I_double y,
Vec_double sig,
Vec_I_double W,
Vec_IO_double a,
Vec_double dyda,
int  chisqnumber,
const double &  bin_width,
Vec_double yfit,
const int &  bin 
)
protected

Definition at line 145 of file TLMFitter.cxx.

References fInitChi2Number, fIntegrationSteps, funcs(), and NRVec< T >::size().

Referenced by mrqcof().

◆ mrqcof()

void TLMFitter::mrqcof ( Vec_I_double x,
Vec_I_double y,
Vec_double sig,
Vec_IO_double a,
Vec_I_BOOL ia,
Mat_O_double alpha,
Vec_O_double beta,
double &  chisq,
Vec_I_double W,
double &  chisqexp 
)
protected

Definition at line 300 of file TLMFitter.cxx.

References fHist, fInitChi2Number, fRangeMax, fRangeMin, integrator(), and NRVec< T >::size().

Referenced by mrqmin().

◆ mrqmin()

void TLMFitter::mrqmin ( Vec_I_double x,
Vec_I_double y,
Vec_double sig,
Vec_IO_double a,
Vec_I_BOOL ia,
Mat_O_double covar,
Mat_O_double alpha,
double &  chisq,
Vec_I_double W,
double &  alamda 
)
protected

*******************************************************************/

Definition at line 207 of file TLMFitter.cxx.

References covsrt(), gaussj(), mrqcof(), and NRVec< T >::size().

Referenced by Fit().

◆ nrerror()

void TLMFitter::nrerror ( const std::string &  error_text)
inlineprotected

Definition at line 590 of file TLMFitter.h.

Referenced by gaussj().

◆ SetFitterRange()

void TLMFitter::SetFitterRange ( int  min,
int  max 
)
inlineprotected

Definition at line 584 of file TLMFitter.h.

References fRangeMax, and fRangeMin.

Referenced by Fit().

Member Data Documentation

◆ fFunction

TF1* TLMFitter::fFunction {nullptr}
private

Definition at line 567 of file TLMFitter.h.

Referenced by Fit().

◆ fHist

TH1* TLMFitter::fHist {nullptr}
private

Definition at line 566 of file TLMFitter.h.

Referenced by Fit(), and mrqcof().

◆ fInitChi2Number

int TLMFitter::fInitChi2Number
private

Definition at line 568 of file TLMFitter.h.

Referenced by integrator(), and mrqcof().

◆ fIntegrationSteps

int TLMFitter::fIntegrationSteps
private

Definition at line 565 of file TLMFitter.h.

Referenced by integrator().

◆ fRangeMax

int TLMFitter::fRangeMax {0}
private

Definition at line 570 of file TLMFitter.h.

Referenced by mrqcof(), and SetFitterRange().

◆ fRangeMin

int TLMFitter::fRangeMin {0}
private

Definition at line 569 of file TLMFitter.h.

Referenced by mrqcof(), and SetFitterRange().