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

Detailed Description

This class is used to fit simple gaussian peaks in data

Definition at line 30 of file TGauss.h.

Public Member Functions

 TGauss ()=default
 
 TGauss (const TGauss &)=default
 
 TGauss (Double_t centroid, Double_t relativeLimit=-1.)
 
 TGauss (TGauss &&) noexcept=default
 
 ~TGauss ()=default
 
Double_t Area () const
 
Double_t AreaErr () const
 
Double_t Centroid () const override
 
void Centroid (const Double_t &centroid) override
 
Double_t CentroidErr () const override
 
void Draw (Option_t *opt="") override
 
virtual void DrawBackground (Option_t *opt="")
 
virtual void DrawComponents (Option_t *opt="")
 
virtual Double_t FWHM ()
 
TF1 * GetBackgroundFunction ()
 
Double_t GetChi2 () const
 
TF1 * GetFitFunction () const
 
TF1 * GetGlobalBackground () const
 
Double_t GetNDF () const
 
Int_t GetNParameters () const
 
TF1 * GetPeakFunction () const
 
Double_t GetReducedChi2 () const
 
void InitializeParameters (TH1 *hist, const double &rangeLow, const double &rangeHigh) override
 
void InitParNames () override
 
bool IsBackgroundParameter (const Int_t &par) const
 
bool IsPeakParameter (const Int_t &par) const
 
TGaussoperator= (const TGauss &)=default
 
TGaussoperator= (TGauss &&) noexcept=default
 
bool ParameterSetByUser (int par)
 
void Print (Option_t *="") const override
 
virtual void PrintParameters () const
 
void SetArea (const Double_t &area)
 
void SetAreaErr (const Double_t &area_err)
 
void SetGlobalBackground (TF1 *background)
 
void SetListOfBGPar (const std::vector< bool > &list_of_bg_par)
 
Double_t Sigma () const override
 
void UpdateBackgroundParameters ()
 
void UpdatePeakParameters ()
 
Double_t Width () const override
 

Protected Member Functions

virtual Double_t BackgroundFunction (Double_t *, Double_t *)
 
Double_t PeakFunction (Double_t *dim, Double_t *par) override
 
virtual Double_t PeakOnGlobalFunction (Double_t *dim, Double_t *par)
 
void SetChi2 (const Double_t &chi2)
 
void SetFitFunction (TF1 *function)
 
void SetNDF (const Int_t &ndf)
 
void SetPeakFunction (TF1 *function)
 
Double_t TotalFunction (Double_t *dim, Double_t *par)
 

Private Attributes

Double_t fArea {-0.1}
 
Double_t fAreaErr {0.0}
 
TF1 * fBackgroundFunction {nullptr}
 
Double_t fChi2 {std::numeric_limits<Double_t>::quiet_NaN()}
 
TF1 * fGlobalBackground {nullptr}
 
std::vector< bool > fListOfBGPars
 
Int_t fNDF {0}
 
TF1 * fPeakFunction {nullptr}
 
TF1 * fPeakOnGlobal {nullptr}
 
TF1 * fTotalFunction {nullptr}
 
+ Inheritance diagram for TGauss:
+ Collaboration diagram for TGauss:

Constructor & Destructor Documentation

◆ TGauss() [1/4]

TGauss::TGauss ( )
default

◆ TGauss() [2/4]

TGauss::TGauss ( Double_t centroid,
Double_t relativeLimit = -1. )
explicit

Definition at line 3 of file TGauss.cxx.

References Centroid(), and TSinglePeak::GetFitFunction().

◆ TGauss() [3/4]

TGauss::TGauss ( const TGauss & )
default

◆ TGauss() [4/4]

TGauss::TGauss ( TGauss && )
defaultnoexcept

◆ ~TGauss()

TGauss::~TGauss ( )
default

Member Function Documentation

◆ Area()

Double_t TSinglePeak::Area ( ) const
inlineinherited

Definition at line 57 of file TSinglePeak.h.

References TSinglePeak::fArea.

Referenced by main(), and TSinglePeak::Print().

◆ AreaErr()

Double_t TSinglePeak::AreaErr ( ) const
inlineinherited

Definition at line 58 of file TSinglePeak.h.

References TSinglePeak::fAreaErr.

Referenced by main(), and TSinglePeak::Print().

◆ BackgroundFunction()

virtual Double_t TSinglePeak::BackgroundFunction ( Double_t * ,
Double_t *  )
inlineprotectedvirtualinherited

Reimplemented in TAB3Peak, TABPeak, and TRWPeak.

Definition at line 97 of file TSinglePeak.h.

Referenced by TSinglePeak::GetBackgroundFunction(), and TSinglePeak::TotalFunction().

◆ Centroid() [1/2]

Double_t TGauss::Centroid ( ) const
overridevirtual

Implements TSinglePeak.

Definition at line 52 of file TGauss.cxx.

References TSinglePeak::GetFitFunction().

Referenced by TGauss().

◆ Centroid() [2/2]

void TGauss::Centroid ( const Double_t & centroid)
overridevirtual

◆ CentroidErr()

Double_t TGauss::CentroidErr ( ) const
overridevirtual

Implements TSinglePeak.

Definition at line 57 of file TGauss.cxx.

References TSinglePeak::GetFitFunction().

◆ Draw()

void TSinglePeak::Draw ( Option_t * opt = "")
overrideinherited

◆ DrawBackground()

virtual void TSinglePeak::DrawBackground ( Option_t * opt = "")
inlinevirtualinherited

Definition at line 69 of file TSinglePeak.h.

References TSinglePeak::fGlobalBackground.

◆ DrawComponents()

void TSinglePeak::DrawComponents ( Option_t * opt = "")
virtualinherited

This behaves like the draw function except each daughter class decides how to break the draw into multiple components. This means that we should delegate this task to the daughter class.

Reimplemented in TAB3Peak, and TABPeak.

Definition at line 71 of file TSinglePeak.cxx.

◆ FWHM()

Double_t TSinglePeak::FWHM ( )
virtualinherited

Return the full width at half-maximum.

Definition at line 77 of file TSinglePeak.cxx.

References TSinglePeak::Centroid(), TSinglePeak::fPeakFunction, TSinglePeak::Sigma(), and TSinglePeak::UpdatePeakParameters().

◆ GetBackgroundFunction()

TF1 * TSinglePeak::GetBackgroundFunction ( )
inherited

◆ GetChi2()

Double_t TSinglePeak::GetChi2 ( ) const
inlineinherited

Definition at line 89 of file TSinglePeak.h.

References TSinglePeak::fChi2.

◆ GetFitFunction()

◆ GetGlobalBackground()

◆ GetNDF()

Double_t TSinglePeak::GetNDF ( ) const
inlineinherited

Definition at line 90 of file TSinglePeak.h.

References TSinglePeak::fNDF.

◆ GetNParameters()

Int_t TSinglePeak::GetNParameters ( ) const
inherited

Definition at line 20 of file TSinglePeak.cxx.

References TSinglePeak::fTotalFunction.

◆ GetPeakFunction()

TF1 * TSinglePeak::GetPeakFunction ( ) const
inlineinherited

Definition at line 77 of file TSinglePeak.h.

References TSinglePeak::fPeakFunction.

◆ GetReducedChi2()

Double_t TSinglePeak::GetReducedChi2 ( ) const
inlineinherited

Definition at line 91 of file TSinglePeak.h.

References TSinglePeak::fChi2, and TSinglePeak::fNDF.

Referenced by main().

◆ InitializeParameters()

void TGauss::InitializeParameters ( TH1 * hist,
const double & rangeLow,
const double & rangeHigh )
overridevirtual

Makes initial guesses at parameters for the fit base on the histogram.

Reimplemented from TSinglePeak.

Definition at line 28 of file TGauss.cxx.

References TSinglePeak::GetFitFunction(), and TSinglePeak::ParameterSetByUser().

◆ InitParNames()

void TGauss::InitParNames ( )
overridevirtual

Reimplemented from TSinglePeak.

Definition at line 21 of file TGauss.cxx.

References TSinglePeak::GetFitFunction().

Referenced by Centroid().

◆ IsBackgroundParameter()

bool TSinglePeak::IsBackgroundParameter ( const Int_t & par) const
inherited

Definition at line 4 of file TSinglePeak.cxx.

References TSinglePeak::fListOfBGPars.

Referenced by TSinglePeak::IsPeakParameter().

◆ IsPeakParameter()

bool TSinglePeak::IsPeakParameter ( const Int_t & par) const
inherited

Definition at line 15 of file TSinglePeak.cxx.

References TSinglePeak::IsBackgroundParameter().

◆ operator=() [1/2]

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

◆ operator=() [2/2]

TGauss & TGauss::operator= ( TGauss && )
defaultnoexcept

◆ ParameterSetByUser()

bool TSinglePeak::ParameterSetByUser ( int par)
inherited

This function checks if a parameter or its limits have been set to a non-zero value. In case that the user fixed a parameter to be zero, the limits are non-zero, so this case is covered as well.

Definition at line 122 of file TSinglePeak.cxx.

References TSinglePeak::fTotalFunction.

Referenced by TAB3Peak::InitializeParameters(), TABPeak::InitializeParameters(), InitializeParameters(), and TRWPeak::InitializeParameters().

◆ PeakFunction()

Double_t TGauss::PeakFunction ( Double_t * dim,
Double_t * par )
overrideprotectedvirtual

Reimplemented from TSinglePeak.

Definition at line 62 of file TGauss.cxx.

Referenced by Centroid().

◆ PeakOnGlobalFunction()

Double_t TSinglePeak::PeakOnGlobalFunction ( Double_t * dim,
Double_t * par )
protectedvirtualinherited

◆ Print()

void TSinglePeak::Print ( Option_t * = "") const
overrideinherited

◆ PrintParameters()

void TSinglePeak::PrintParameters ( ) const
virtualinherited

Definition at line 45 of file TSinglePeak.cxx.

References TSinglePeak::fTotalFunction.

◆ SetArea()

void TSinglePeak::SetArea ( const Double_t & area)
inlineinherited

Definition at line 54 of file TSinglePeak.h.

References TSinglePeak::fArea.

◆ SetAreaErr()

void TSinglePeak::SetAreaErr ( const Double_t & area_err)
inlineinherited

Definition at line 55 of file TSinglePeak.h.

References TSinglePeak::fAreaErr.

◆ SetChi2()

void TSinglePeak::SetChi2 ( const Double_t & chi2)
inlineprotectedinherited

Definition at line 101 of file TSinglePeak.h.

References TSinglePeak::fChi2.

◆ SetFitFunction()

void TSinglePeak::SetFitFunction ( TF1 * function)
inlineprotectedinherited

◆ SetGlobalBackground()

void TSinglePeak::SetGlobalBackground ( TF1 * background)
inlineinherited

Definition at line 80 of file TSinglePeak.h.

References TSinglePeak::fGlobalBackground.

◆ SetListOfBGPar()

void TSinglePeak::SetListOfBGPar ( const std::vector< bool > & list_of_bg_par)
inlineinherited

◆ SetNDF()

void TSinglePeak::SetNDF ( const Int_t & ndf)
inlineprotectedinherited

Definition at line 102 of file TSinglePeak.h.

References TSinglePeak::fNDF.

◆ SetPeakFunction()

void TSinglePeak::SetPeakFunction ( TF1 * function)
inlineprotectedinherited

◆ Sigma()

Double_t TGauss::Sigma ( ) const
inlineoverridevirtual

Implements TSinglePeak.

Definition at line 49 of file TGauss.h.

References TSinglePeak::GetFitFunction().

Referenced by Width().

◆ TotalFunction()

Double_t TSinglePeak::TotalFunction ( Double_t * dim,
Double_t * par )
protectedinherited

◆ UpdateBackgroundParameters()

void TSinglePeak::UpdateBackgroundParameters ( )
inherited

◆ UpdatePeakParameters()

void TSinglePeak::UpdatePeakParameters ( )
inherited

Definition at line 61 of file TSinglePeak.cxx.

References TSinglePeak::fPeakFunction, and TSinglePeak::fTotalFunction.

Referenced by TSinglePeak::FWHM().

◆ Width()

Double_t TGauss::Width ( ) const
inlineoverridevirtual

Implements TSinglePeak.

Definition at line 48 of file TGauss.h.

References Sigma().

Member Data Documentation

◆ fArea

Double_t TSinglePeak::fArea {-0.1}
privateinherited

Definition at line 115 of file TSinglePeak.h.

Referenced by TSinglePeak::Area(), and TSinglePeak::SetArea().

◆ fAreaErr

Double_t TSinglePeak::fAreaErr {0.0}
privateinherited

Definition at line 116 of file TSinglePeak.h.

Referenced by TSinglePeak::AreaErr(), and TSinglePeak::SetAreaErr().

◆ fBackgroundFunction

TF1* TSinglePeak::fBackgroundFunction {nullptr}
privateinherited

◆ fChi2

Double_t TSinglePeak::fChi2 {std::numeric_limits<Double_t>::quiet_NaN()}
privateinherited

◆ fGlobalBackground

TF1* TSinglePeak::fGlobalBackground {nullptr}
privateinherited

◆ fListOfBGPars

std::vector<bool> TSinglePeak::fListOfBGPars
privateinherited

◆ fNDF

Int_t TSinglePeak::fNDF {0}
privateinherited

◆ fPeakFunction

TF1* TSinglePeak::fPeakFunction {nullptr}
privateinherited

◆ fPeakOnGlobal

TF1* TSinglePeak::fPeakOnGlobal {nullptr}
privateinherited

Definition at line 111 of file TSinglePeak.h.

Referenced by TSinglePeak::Draw().

◆ fTotalFunction