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

This class is used to fit things that resemble "peaks" in data

Definition at line 31 of file TSinglePeak.h.

Public Member Functions

 TSinglePeak ()
 
 ~TSinglePeak () override
 
Double_t Area () const
 
Double_t AreaErr () const
 
virtual void Centroid (const Double_t &centroid)=0
 
virtual Double_t Centroid () const =0
 
virtual Double_t CentroidErr () const =0
 
virtual void Draw (Option_t *opt="") override
 
virtual void DrawBackground (Option_t *opt="")
 
virtual void DrawComponents (Option_t *opt="")
 
TF1 * GetBackgroundFunction ()
 
Double_t GetChi2 () const
 
TF1 * GetFitFunction ()
 
Double_t GetNDF () const
 
Int_t GetNParameters () const
 
Double_t GetReducedChi2 () const
 
virtual void InitializeParameters (TH1 *=nullptr)
 
virtual void InitParNames ()
 
bool IsBackgroundParameter (const Int_t &par) const
 
bool IsPeakParameter (const Int_t &par) const
 
bool ParameterSetByUser (int par)
 
virtual 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 *bg)
 
void SetListOfBGPar (std::vector< bool > list_of_bg_par)
 
void UpdateBackgroundParameters ()
 
virtual Double_t Width () const =0
 

Protected Member Functions

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

Protected 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 * fPeakOnGlobal {nullptr}
 
TF1 * fTotalFunction {nullptr}
 

Friends

class TPeakFitter
 

#include <TSinglePeak.h>

+ Inheritance diagram for TSinglePeak:
+ Collaboration diagram for TSinglePeak:

Constructor & Destructor Documentation

◆ ~TSinglePeak()

TSinglePeak::~TSinglePeak ( )
inlineoverride

Definition at line 35 of file TSinglePeak.h.

◆ TSinglePeak()

TSinglePeak::TSinglePeak ( )

Definition at line 8 of file TSinglePeak.cxx.

Member Function Documentation

◆ Area()

Double_t TSinglePeak::Area ( ) const
inline

Definition at line 48 of file TSinglePeak.h.

References fArea.

Referenced by Print().

◆ AreaErr()

Double_t TSinglePeak::AreaErr ( ) const
inline

Definition at line 49 of file TSinglePeak.h.

References fAreaErr.

Referenced by Print().

◆ BackgroundFunction()

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

Reimplemented in TRWPeak, TAB3Peak, and TABPeak.

Definition at line 77 of file TSinglePeak.h.

Referenced by GetBackgroundFunction(), and TotalFunction().

◆ Centroid() [1/2]

virtual void TSinglePeak::Centroid ( const Double_t &  centroid)
pure virtual

Implemented in TGauss, TRWPeak, TAB3Peak, and TABPeak.

Referenced by TBGSubtraction::DoPeakFit().

◆ Centroid() [2/2]

virtual Double_t TSinglePeak::Centroid ( ) const
pure virtual

Implemented in TGauss, TRWPeak, TAB3Peak, and TABPeak.

Referenced by Print().

◆ CentroidErr()

virtual Double_t TSinglePeak::CentroidErr ( ) const
pure virtual

Implemented in TGauss, TRWPeak, TAB3Peak, and TABPeak.

Referenced by Print().

◆ Draw()

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

◆ DrawBackground()

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

Definition at line 58 of file TSinglePeak.h.

References fGlobalBackground.

◆ DrawComponents()

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

Reimplemented in TAB3Peak, and TABPeak.

Definition at line 67 of file TSinglePeak.cxx.

◆ GetBackgroundFunction()

TF1 * TSinglePeak::GetBackgroundFunction ( )

Definition at line 33 of file TSinglePeak.cxx.

References BackgroundFunction(), fBackgroundFunction, and fTotalFunction.

◆ GetChi2()

Double_t TSinglePeak::GetChi2 ( ) const
inline

Definition at line 69 of file TSinglePeak.h.

References fChi2.

◆ GetFitFunction()

TF1* TSinglePeak::GetFitFunction ( )
inline

Definition at line 62 of file TSinglePeak.h.

References fTotalFunction.

◆ GetNDF()

Double_t TSinglePeak::GetNDF ( ) const
inline

Definition at line 70 of file TSinglePeak.h.

References fNDF.

◆ GetNParameters()

Int_t TSinglePeak::GetNParameters ( ) const

Definition at line 26 of file TSinglePeak.cxx.

References fTotalFunction.

◆ GetReducedChi2()

Double_t TSinglePeak::GetReducedChi2 ( ) const
inline

Definition at line 71 of file TSinglePeak.h.

References fChi2, and fNDF.

◆ InitializeParameters()

virtual void TSinglePeak::InitializeParameters ( TH1 *  = nullptr)
inlinevirtual

Reimplemented in TGauss, TRWPeak, TAB3Peak, and TABPeak.

Definition at line 39 of file TSinglePeak.h.

◆ InitParNames()

virtual void TSinglePeak::InitParNames ( )
inlinevirtual

Reimplemented in TGauss, TRWPeak, TAB3Peak, and TABPeak.

Definition at line 38 of file TSinglePeak.h.

◆ IsBackgroundParameter()

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

Definition at line 11 of file TSinglePeak.cxx.

References fListOfBGPars.

Referenced by IsPeakParameter().

◆ IsPeakParameter()

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

Definition at line 22 of file TSinglePeak.cxx.

References IsBackgroundParameter().

◆ ParameterSetByUser()

bool TSinglePeak::ParameterSetByUser ( int  par)

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 102 of file TSinglePeak.cxx.

References fTotalFunction.

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

◆ PeakFunction()

virtual Double_t TSinglePeak::PeakFunction ( Double_t *  ,
Double_t *   
)
inlineprotectedvirtual

Reimplemented in TGauss, TRWPeak, TAB3Peak, and TABPeak.

Definition at line 78 of file TSinglePeak.h.

Referenced by PeakOnGlobalFunction(), and TotalFunction().

◆ PeakOnGlobalFunction()

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

Definition at line 72 of file TSinglePeak.cxx.

References fGlobalBackground, fTotalFunction, and PeakFunction().

Referenced by Draw().

◆ Print()

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

Definition at line 41 of file TSinglePeak.cxx.

References Area(), AreaErr(), Centroid(), and CentroidErr().

◆ PrintParameters()

void TSinglePeak::PrintParameters ( ) const
virtual

Definition at line 49 of file TSinglePeak.cxx.

References fTotalFunction.

◆ SetArea()

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

Definition at line 45 of file TSinglePeak.h.

References fArea.

◆ SetAreaErr()

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

Definition at line 46 of file TSinglePeak.h.

References fAreaErr.

◆ SetChi2()

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

Definition at line 81 of file TSinglePeak.h.

References fChi2.

◆ SetGlobalBackground()

void TSinglePeak::SetGlobalBackground ( TF1 *  bg)
inline

Definition at line 64 of file TSinglePeak.h.

References fGlobalBackground.

◆ SetListOfBGPar()

void TSinglePeak::SetListOfBGPar ( std::vector< bool >  list_of_bg_par)
inline

Definition at line 42 of file TSinglePeak.h.

References fListOfBGPars.

Referenced by TAB3Peak::Centroid(), TABPeak::Centroid(), TGauss::Centroid(), and TRWPeak::Centroid().

◆ SetNDF()

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

Definition at line 82 of file TSinglePeak.h.

References fNDF.

◆ TotalFunction()

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

◆ UpdateBackgroundParameters()

void TSinglePeak::UpdateBackgroundParameters ( )

Definition at line 63 of file TSinglePeak.cxx.

References fBackgroundFunction, and fTotalFunction.

◆ Width()

virtual Double_t TSinglePeak::Width ( ) const
pure virtual

Implemented in TGauss, TRWPeak, TAB3Peak, and TABPeak.

Friends And Related Function Documentation

◆ TPeakFitter

friend class TPeakFitter
friend

Definition at line 33 of file TSinglePeak.h.

Member Data Documentation

◆ fArea

Double_t TSinglePeak::fArea {-0.1}
protected

Definition at line 91 of file TSinglePeak.h.

Referenced by Area(), and SetArea().

◆ fAreaErr

Double_t TSinglePeak::fAreaErr {0.0}
protected

Definition at line 92 of file TSinglePeak.h.

Referenced by AreaErr(), and SetAreaErr().

◆ fBackgroundFunction

TF1* TSinglePeak::fBackgroundFunction {nullptr}
protected

Definition at line 86 of file TSinglePeak.h.

Referenced by GetBackgroundFunction(), and UpdateBackgroundParameters().

◆ fChi2

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

Definition at line 93 of file TSinglePeak.h.

Referenced by GetChi2(), GetReducedChi2(), and SetChi2().

◆ fGlobalBackground

◆ fListOfBGPars

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

Definition at line 90 of file TSinglePeak.h.

Referenced by IsBackgroundParameter(), and SetListOfBGPar().

◆ fNDF

Int_t TSinglePeak::fNDF {0}
protected

Definition at line 94 of file TSinglePeak.h.

Referenced by GetNDF(), GetReducedChi2(), and SetNDF().

◆ fPeakOnGlobal

TF1* TSinglePeak::fPeakOnGlobal {nullptr}
protected

Definition at line 88 of file TSinglePeak.h.

Referenced by Draw().

◆ fTotalFunction