GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TLMFitter Class Reference

Detailed Description

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 604 of file TLMFitter.h.

Classes

class  NRMat
 
class  NRMat3d
 
class  NRVec
 

Public Member Functions

 TLMFitter ()=default
 
 TLMFitter (const TLMFitter &)=default
 
 TLMFitter (TLMFitter &&) noexcept=default
 
 ~TLMFitter ()=default
 
void Fit (TH1 *hist, TF1 *func)
 
TLMFitteroperator= (const TLMFitter &)=default
 
TLMFitteroperator= (TLMFitter &&) noexcept=default
 

Protected Member Functions

void covsrt (Mat_IO_double &covar, Vec_I_BOOL &ia, 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 {3}
 
int fIntegrationSteps {100}
 
int fRangeMax {0}
 
int fRangeMin {0}
 
+ Inheritance diagram for TLMFitter:
+ Collaboration diagram for TLMFitter:

Constructor & Destructor Documentation

◆ TLMFitter() [1/3]

TLMFitter::TLMFitter ( )
default

◆ TLMFitter() [2/3]

TLMFitter::TLMFitter ( const TLMFitter & )
default

◆ TLMFitter() [3/3]

TLMFitter::TLMFitter ( TLMFitter && )
defaultnoexcept

◆ ~TLMFitter()

TLMFitter::~TLMFitter ( )
default

Member Function Documentation

◆ covsrt()

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

Definition at line 399 of file TLMFitter.cxx.

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

Referenced by mrqmin().

◆ Fit()

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

Definition at line 35 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 23 of file TLMFitter.cxx.

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

Referenced by integrator().

◆ gaussj()

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

Definition at line 426 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 151 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 310 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 214 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 638 of file TLMFitter.h.

Referenced by gaussj().

◆ operator=() [1/2]

TLMFitter & TLMFitter::operator= ( const TLMFitter & )
default

◆ operator=() [2/2]

TLMFitter & TLMFitter::operator= ( TLMFitter && )
defaultnoexcept

◆ SetFitterRange()

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

Definition at line 632 of file TLMFitter.h.

References fRangeMax, and fRangeMin.

Referenced by Fit().

Member Data Documentation

◆ fFunction

TF1* TLMFitter::fFunction {nullptr}
private

Definition at line 616 of file TLMFitter.h.

Referenced by Fit(), and funcs().

◆ fHist

TH1* TLMFitter::fHist {nullptr}
private

Definition at line 615 of file TLMFitter.h.

Referenced by Fit(), and mrqcof().

◆ fInitChi2Number

int TLMFitter::fInitChi2Number {3}
private

Definition at line 617 of file TLMFitter.h.

Referenced by integrator(), and mrqcof().

◆ fIntegrationSteps

int TLMFitter::fIntegrationSteps {100}
private

Definition at line 614 of file TLMFitter.h.

Referenced by integrator().

◆ fRangeMax

int TLMFitter::fRangeMax {0}
private

Definition at line 619 of file TLMFitter.h.

Referenced by mrqcof(), and SetFitterRange().

◆ fRangeMin

int TLMFitter::fRangeMin {0}
private

Definition at line 618 of file TLMFitter.h.

Referenced by mrqcof(), and SetFitterRange().