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

Detailed Description

This class is used to fit RadWare like peaks in data

Definition at line 30 of file TRWPeak.h.

Public Member Functions

 TRWPeak ()=default
 
 TRWPeak (const TRWPeak &)=default
 
 TRWPeak (Double_t centroid)
 
 TRWPeak (TRWPeak &&) noexcept=default
 
 ~TRWPeak ()=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
 
TRWPeakoperator= (const TRWPeak &)=default
 
TRWPeakoperator= (TRWPeak &&) 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

Double_t BackgroundFunction (Double_t *dim, Double_t *par) override
 
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 TRWPeak:
+ Collaboration diagram for TRWPeak:

Constructor & Destructor Documentation

◆ TRWPeak() [1/4]

TRWPeak::TRWPeak ( )
default

◆ TRWPeak() [2/4]

TRWPeak::TRWPeak ( Double_t centroid)
inlineexplicit

Definition at line 34 of file TRWPeak.h.

References Centroid().

◆ TRWPeak() [3/4]

TRWPeak::TRWPeak ( const TRWPeak & )
default

◆ TRWPeak() [4/4]

TRWPeak::TRWPeak ( TRWPeak && )
defaultnoexcept

◆ ~TRWPeak()

TRWPeak::~TRWPeak ( )
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()

Double_t TRWPeak::BackgroundFunction ( Double_t * dim,
Double_t * par )
overrideprotectedvirtual

Reimplemented from TSinglePeak.

Definition at line 87 of file TRWPeak.cxx.

◆ Centroid() [1/2]

Double_t TRWPeak::Centroid ( ) const
overridevirtual

Implements TSinglePeak.

Definition at line 60 of file TRWPeak.cxx.

References TSinglePeak::GetFitFunction().

Referenced by TRWPeak().

◆ Centroid() [2/2]

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

◆ CentroidErr()

Double_t TRWPeak::CentroidErr ( ) const
overridevirtual

Implements TSinglePeak.

Definition at line 65 of file TRWPeak.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 TRWPeak::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 23 of file TRWPeak.cxx.

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

◆ InitParNames()

void TRWPeak::InitParNames ( )
overridevirtual

Reimplemented from TSinglePeak.

Definition at line 13 of file TRWPeak.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]

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

◆ operator=() [2/2]

TRWPeak & TRWPeak::operator= ( TRWPeak && )
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(), TGauss::InitializeParameters(), and InitializeParameters().

◆ PeakFunction()

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

Reimplemented from TSinglePeak.

Definition at line 70 of file TRWPeak.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 TRWPeak::Sigma ( ) const
inlineoverridevirtual

Implements TSinglePeak.

Definition at line 49 of file TRWPeak.h.

References TSinglePeak::GetFitFunction().

◆ 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 TRWPeak::Width ( ) const
inlineoverridevirtual

Implements TSinglePeak.

Definition at line 48 of file TRWPeak.h.

References TSinglePeak::GetFitFunction().

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