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

Detailed Description

This Class is used to represent fitted data that is Gaussian like in nature (ie centroid and area).

Definition at line 28 of file TPeak.h.

Public Member Functions

 TPeak ()
 
 TPeak (const TPeak &copy)
 
 TPeak (Double_t cent, Double_t xlow, Double_t xhigh, TF1 *background=nullptr)
 
 TPeak (TPeak &&) noexcept=default
 
 ~TPeak ()
 
Bool_t AddToGlobalList (Bool_t yes=kTRUE) override
 
Double_t Area () const
 
Double_t AreaErr () const
 
TF1 * Background () const
 
Double_t Centroid () const
 
Double_t CentroidErr () const
 
void CheckArea ()
 
void CheckArea (Double_t int_low, Double_t int_high)
 
void Clear (Option_t *opt="") override
 
virtual void ClearParameters (Option_t *opt="")
 
void Copy (TObject &obj) const override
 
virtual void CopyParameters (TF1 *copy) const
 
void DrawBackground (Option_t *opt="SAME") const
 
void DrawResiduals ()
 
Bool_t Fit (TH1 *fitHist, Option_t *opt="")
 
const TF1 * FitFunction () const
 
Double_t FWHM () const
 
Double_t FWHMErr () const
 
Double_t GetArea () const
 
Double_t GetAreaErr () const
 
Double_t GetCentroid () const
 
Double_t GetCentroidErr () const
 
const TF1 * GetFitFunction () const
 
Double_t GetFWHM () const
 
Double_t GetFWHMErr () const
 
virtual TH1 * GetHist () const
 
Double_t GetIntegralArea ()
 
Double_t GetIntegralArea (Double_t int_low, Double_t int_high)
 
Double_t GetIntegralAreaErr ()
 
Double_t GetIntegralAreaErr (Double_t int_low, Double_t int_high)
 
Bool_t InitParams (TH1 *fitHist=nullptr) override
 
Double_t IntegralArea ()
 
Double_t IntegralArea (Double_t int_low, Double_t int_high)
 
Double_t IntegralAreaErr ()
 
Double_t IntegralAreaErr (Double_t int_low, Double_t int_high)
 
Bool_t IsGoodFit () const
 
TPeakoperator= (const TPeak &)=default
 
TPeakoperator= (TPeak &&) noexcept=default
 
void Print (Option_t *opt="") const override
 
void SetCentroid (Double_t cent)
 
virtual void SetHist (TH1 *hist)
 

Static Public Member Functions

static Bool_t AddToGlobalList (TF1 *func, Bool_t yes=kTRUE)
 
static Bool_t CompareArea (const TPeak &lhs, const TPeak &rhs)
 
static Bool_t CompareArea (const TPeak *lhs, const TPeak *rhs)
 
static Bool_t CompareEnergy (const TPeak &lhs, const TPeak &rhs)
 
static Bool_t CompareEnergy (const TPeak *lhs, const TPeak *rhs)
 
static const char * GetDefaultFitType ()
 
static TPeakGetLastFit ()
 
static Bool_t GetLogLikelihoodFlag ()
 
static void SetDefaultFitType (const char *fitType)
 
static void SetLogLikelihoodFlag (Bool_t flag=true)
 

Protected Member Functions

void GoodFit (Bool_t flag=true)
 
void InitNames ()
 
Bool_t IsInitialized () const
 
void SetArea (Double_t area)
 
void SetArea (Double_t area, Double_t areaErr)
 
void SetAreaErr (Double_t areaErr)
 
void SetChi2 (Double_t chi2)
 
void SetInitialized (Bool_t flag=true)
 
void SetNdf (Double_t Ndf)
 

Private Member Functions

bool GoodStatus ()
 

Private Attributes

Double_t fArea {0.}
 
TF1 * fBackground {nullptr}
 
Double_t fChi2 {0.}
 
Double_t fDArea {0.}
 
Bool_t fGoodFitFlag {false}
 
TRef fHist
 
Bool_t fInitFlag {false}
 
Double_t fNdf {0.}
 
Bool_t fOwnBgFlag {false}
 
TGraph * fResiduals {nullptr}
 

Static Private Attributes

static TString fDefaultFitType
 
static TPeakfLastFit = nullptr
 
static bool fLogLikelihoodFlag = true
 

Friends

class TMultiPeak
 
+ Inheritance diagram for TPeak:
+ Collaboration diagram for TPeak:

Constructor & Destructor Documentation

◆ TPeak() [1/4]

TPeak::TPeak ( Double_t cent,
Double_t xlow,
Double_t xhigh,
TF1 * background = nullptr )

◆ TPeak() [2/4]

TPeak::TPeak ( )

Definition at line 69 of file TPeak.cxx.

References TGRSIFit::AddToGlobalList(), fBackground, and InitNames().

Referenced by Fit().

◆ TPeak() [3/4]

TPeak::TPeak ( const TPeak & copy)

Definition at line 87 of file TPeak.cxx.

References Copy().

◆ TPeak() [4/4]

TPeak::TPeak ( TPeak && )
defaultnoexcept

◆ ~TPeak()

TPeak::~TPeak ( )

Definition at line 79 of file TPeak.cxx.

References fBackground, fOwnBgFlag, and fResiduals.

Member Function Documentation

◆ AddToGlobalList() [1/2]

Bool_t TGRSIFit::AddToGlobalList ( Bool_t yes = kTRUE)
overrideinherited

◆ AddToGlobalList() [2/2]

Bool_t TGRSIFit::AddToGlobalList ( TF1 * func,
Bool_t yes = kTRUE )
staticinherited

Definition at line 90 of file TGRSIFit.cxx.

◆ Area()

Double_t TPeak::Area ( ) const
inline

Definition at line 73 of file TPeak.h.

References GetArea().

◆ AreaErr()

Double_t TPeak::AreaErr ( ) const
inline

Definition at line 74 of file TPeak.h.

References GetAreaErr().

◆ Background()

TF1 * TPeak::Background ( ) const
inline

Definition at line 96 of file TPeak.h.

References fBackground.

Referenced by TAngularCorrelation::FitSlices(), GetIntegralArea(), and GetIntegralAreaErr().

◆ Centroid()

Double_t TPeak::Centroid ( ) const
inline

Definition at line 71 of file TPeak.h.

References GetCentroid().

◆ CentroidErr()

Double_t TPeak::CentroidErr ( ) const
inline

Definition at line 72 of file TPeak.h.

References GetCentroidErr().

◆ CheckArea() [1/2]

void TPeak::CheckArea ( )

◆ CheckArea() [2/2]

void TPeak::CheckArea ( Double_t int_low,
Double_t int_high )

◆ Clear()

void TPeak::Clear ( Option_t * opt = "")
override

Definition at line 356 of file TPeak.cxx.

References TGRSIFit::Clear(), fArea, fChi2, fDArea, and fNdf.

Referenced by TPeak().

◆ ClearParameters()

void TGRSIFit::ClearParameters ( Option_t * opt = "")
virtualinherited

Definition at line 43 of file TGRSIFit.cxx.

◆ CompareArea() [1/2]

static Bool_t TPeak::CompareArea ( const TPeak & lhs,
const TPeak & rhs )
inlinestatic

Definition at line 106 of file TPeak.h.

References GetArea().

◆ CompareArea() [2/2]

static Bool_t TPeak::CompareArea ( const TPeak * lhs,
const TPeak * rhs )
inlinestatic

Definition at line 108 of file TPeak.h.

References GetArea().

◆ CompareEnergy() [1/2]

static Bool_t TPeak::CompareEnergy ( const TPeak & lhs,
const TPeak & rhs )
inlinestatic

Definition at line 105 of file TPeak.h.

References GetCentroid().

◆ CompareEnergy() [2/2]

static Bool_t TPeak::CompareEnergy ( const TPeak * lhs,
const TPeak * rhs )
inlinestatic

Definition at line 107 of file TPeak.h.

References GetCentroid().

◆ Copy()

void TPeak::Copy ( TObject & obj) const
override

Definition at line 106 of file TPeak.cxx.

References TGRSIFit::Copy(), fArea, fBackground, fChi2, fDArea, fNdf, fOwnBgFlag, fResiduals, TGRSIFit::GetHist(), and TGRSIFit::SetHist().

Referenced by TPeak(), and Fit().

◆ CopyParameters()

void TGRSIFit::CopyParameters ( TF1 * copy) const
virtualinherited

Definition at line 50 of file TGRSIFit.cxx.

Referenced by TMultiPeak::Fit().

◆ DrawBackground()

void TPeak::DrawBackground ( Option_t * opt = "SAME") const

Definition at line 383 of file TPeak.cxx.

References fBackground.

◆ DrawResiduals()

void TPeak::DrawResiduals ( )

GetHist()->GetBinError(i));// + GetParameter("Height") + 10.;

Definition at line 388 of file TPeak.cxx.

References fChi2, fResiduals, and TGRSIFit::GetHist().

◆ Fit()

◆ FitFunction()

const TF1 * TPeak::FitFunction ( ) const
inline

Definition at line 81 of file TPeak.h.

References GetFitFunction().

◆ FWHM()

Double_t TPeak::FWHM ( ) const
inline

Definition at line 75 of file TPeak.h.

References GetFWHM().

◆ FWHMErr()

Double_t TPeak::FWHMErr ( ) const
inline

Definition at line 76 of file TPeak.h.

References GetFWHMErr().

◆ GetArea()

◆ GetAreaErr()

Double_t TPeak::GetAreaErr ( ) const
inline

◆ GetCentroid()

◆ GetCentroidErr()

Double_t TPeak::GetCentroidErr ( ) const
inline

◆ GetDefaultFitType()

static const char * TGRSIFit::GetDefaultFitType ( )
inlinestaticinherited

Definition at line 58 of file TGRSIFit.h.

References TGRSIFit::fDefaultFitType.

◆ GetFitFunction()

const TF1 * TPeak::GetFitFunction ( ) const
inline

Definition at line 66 of file TPeak.h.

Referenced by FitFunction().

◆ GetFWHM()

Double_t TPeak::GetFWHM ( ) const
inline

Definition at line 55 of file TPeak.h.

Referenced by FWHM().

◆ GetFWHMErr()

Double_t TPeak::GetFWHMErr ( ) const
inline

Definition at line 56 of file TPeak.h.

Referenced by FWHMErr().

◆ GetHist()

virtual TH1 * TGRSIFit::GetHist ( ) const
inlinevirtualinherited

◆ GetIntegralArea() [1/2]

Double_t TPeak::GetIntegralArea ( )

Definition at line 439 of file TPeak.cxx.

References GetIntegralArea(), and GoodStatus().

Referenced by CheckArea(), CheckArea(), GetIntegralArea(), IntegralArea(), and IntegralArea().

◆ GetIntegralArea() [2/2]

Double_t TPeak::GetIntegralArea ( Double_t int_low,
Double_t int_high )

Definition at line 452 of file TPeak.cxx.

References Background(), TGRSIFit::GetHist(), GoodStatus(), and hist.

◆ GetIntegralAreaErr() [1/2]

Double_t TPeak::GetIntegralAreaErr ( )

◆ GetIntegralAreaErr() [2/2]

Double_t TPeak::GetIntegralAreaErr ( Double_t int_low,
Double_t int_high )

Definition at line 476 of file TPeak.cxx.

References Background(), TGRSIFit::GetHist(), GoodStatus(), and hist.

◆ GetLastFit()

static TPeak * TPeak::GetLastFit ( )
inlinestatic

Definition at line 110 of file TPeak.h.

References fLastFit.

◆ GetLogLikelihoodFlag()

static Bool_t TPeak::GetLogLikelihoodFlag ( )
inlinestatic

Definition at line 103 of file TPeak.h.

References fLogLikelihoodFlag.

Referenced by Fit().

◆ GoodFit()

void TGRSIFit::GoodFit ( Bool_t flag = true)
inlineprotectedinherited

Definition at line 69 of file TGRSIFit.h.

References TGRSIFit::fGoodFitFlag.

◆ GoodStatus()

bool TPeak::GoodStatus ( )
private

◆ InitNames()

void TPeak::InitNames ( )
protected

Definition at line 92 of file TPeak.cxx.

Referenced by TPeak(), and TPeak().

◆ InitParams()

Bool_t TPeak::InitParams ( TH1 * fitHist = nullptr)
overridevirtual

Implements TGRSIFit.

Definition at line 131 of file TPeak.cxx.

References TGRSIFit::GetHist(), and TGRSIFit::SetInitialized().

Referenced by Fit(), and TAngularCorrelation::FitSlices().

◆ IntegralArea() [1/2]

Double_t TPeak::IntegralArea ( )
inline

Definition at line 77 of file TPeak.h.

References GetIntegralArea().

◆ IntegralArea() [2/2]

Double_t TPeak::IntegralArea ( Double_t int_low,
Double_t int_high )
inline

Definition at line 78 of file TPeak.h.

References GetIntegralArea().

◆ IntegralAreaErr() [1/2]

Double_t TPeak::IntegralAreaErr ( )
inline

Definition at line 79 of file TPeak.h.

References GetIntegralAreaErr().

◆ IntegralAreaErr() [2/2]

Double_t TPeak::IntegralAreaErr ( Double_t int_low,
Double_t int_high )
inline

Definition at line 80 of file TPeak.h.

References GetIntegralAreaErr().

◆ IsGoodFit()

Bool_t TGRSIFit::IsGoodFit ( ) const
inlineinherited

Definition at line 52 of file TGRSIFit.h.

References TGRSIFit::fGoodFitFlag.

◆ IsInitialized()

Bool_t TGRSIFit::IsInitialized ( ) const
inlineprotectedinherited

Definition at line 67 of file TGRSIFit.h.

References TGRSIFit::fInitFlag.

Referenced by TMultiPeak::Fit(), and Fit().

◆ operator=() [1/2]

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

◆ operator=() [2/2]

TPeak & TPeak::operator= ( TPeak && )
defaultnoexcept

◆ Print()

void TPeak::Print ( Option_t * opt = "") const
override

Definition at line 369 of file TPeak.cxx.

References fArea, fChi2, fDArea, fNdf, and TGRSIFit::Print().

Referenced by Fit().

◆ SetArea() [1/2]

void TPeak::SetArea ( Double_t area)
inlineprotected

Definition at line 84 of file TPeak.h.

References fArea.

Referenced by TMultiPeak::Fit(), and SetArea().

◆ SetArea() [2/2]

void TPeak::SetArea ( Double_t area,
Double_t areaErr )
inlineprotected

Definition at line 86 of file TPeak.h.

References SetArea(), and SetAreaErr().

◆ SetAreaErr()

void TPeak::SetAreaErr ( Double_t areaErr)
inlineprotected

Definition at line 85 of file TPeak.h.

References fDArea.

Referenced by TMultiPeak::Fit(), and SetArea().

◆ SetCentroid()

void TPeak::SetCentroid ( Double_t cent)
inline

Definition at line 46 of file TPeak.h.

◆ SetChi2()

void TPeak::SetChi2 ( Double_t chi2)
inlineprotected

Definition at line 91 of file TPeak.h.

References fChi2.

Referenced by TMultiPeak::Fit().

◆ SetDefaultFitType()

static void TGRSIFit::SetDefaultFitType ( const char * fitType)
inlinestaticinherited

Definition at line 59 of file TGRSIFit.h.

References TGRSIFit::fDefaultFitType.

◆ SetHist()

virtual void TGRSIFit::SetHist ( TH1 * hist)
inlinevirtualinherited

Definition at line 53 of file TGRSIFit.h.

References TGRSIFit::fHist, and hist.

Referenced by Copy(), TMultiPeak::Fit(), and Fit().

◆ SetInitialized()

void TGRSIFit::SetInitialized ( Bool_t flag = true)
inlineprotectedinherited

Definition at line 68 of file TGRSIFit.h.

References TGRSIFit::fInitFlag.

Referenced by TMultiPeak::InitParams(), and InitParams().

◆ SetLogLikelihoodFlag()

static void TPeak::SetLogLikelihoodFlag ( Bool_t flag = true)
inlinestatic

Definition at line 102 of file TPeak.h.

References fLogLikelihoodFlag.

Referenced by TAngularCorrelation::FitSlices().

◆ SetNdf()

void TPeak::SetNdf ( Double_t Ndf)
inlineprotected

Definition at line 92 of file TPeak.h.

References fNdf.

Referenced by TMultiPeak::Fit().

Friends And Related Symbol Documentation

◆ TMultiPeak

friend class TMultiPeak
friend

Definition at line 29 of file TPeak.h.

Member Data Documentation

◆ fArea

Double_t TPeak::fArea {0.}
private

Definition at line 118 of file TPeak.h.

Referenced by CheckArea(), CheckArea(), Clear(), Copy(), Fit(), GetArea(), Print(), and SetArea().

◆ fBackground

TF1* TPeak::fBackground {nullptr}
private

Definition at line 127 of file TPeak.h.

Referenced by TPeak(), TPeak(), ~TPeak(), Background(), Copy(), DrawBackground(), and Fit().

◆ fChi2

Double_t TPeak::fChi2 {0.}
private

Definition at line 120 of file TPeak.h.

Referenced by Clear(), Copy(), DrawResiduals(), Fit(), GoodStatus(), Print(), and SetChi2().

◆ fDArea

Double_t TPeak::fDArea {0.}
private

Definition at line 119 of file TPeak.h.

Referenced by CheckArea(), CheckArea(), Clear(), Copy(), Fit(), GetAreaErr(), Print(), and SetAreaErr().

◆ fDefaultFitType

TString TGRSIFit::fDefaultFitType
staticprivateinherited

◆ fGoodFitFlag

Bool_t TGRSIFit::fGoodFitFlag {false}
privateinherited

◆ fHist

TRef TGRSIFit::fHist
privateinherited

Definition at line 74 of file TGRSIFit.h.

Referenced by TGRSIFit::GetHist(), and TGRSIFit::SetHist().

◆ fInitFlag

Bool_t TGRSIFit::fInitFlag {false}
privateinherited

◆ fLastFit

TPeak * TPeak::fLastFit = nullptr
staticprivate

!

Definition at line 125 of file TPeak.h.

Referenced by Fit(), and GetLastFit().

◆ fLogLikelihoodFlag

Bool_t TPeak::fLogLikelihoodFlag = true
staticprivate

!

Definition at line 124 of file TPeak.h.

Referenced by GetLogLikelihoodFlag(), and SetLogLikelihoodFlag().

◆ fNdf

Double_t TPeak::fNdf {0.}
private

Definition at line 121 of file TPeak.h.

Referenced by Clear(), Copy(), Fit(), Print(), and SetNdf().

◆ fOwnBgFlag

Bool_t TPeak::fOwnBgFlag {false}
private

Definition at line 122 of file TPeak.h.

Referenced by TPeak(), ~TPeak(), and Copy().

◆ fResiduals

TGraph* TPeak::fResiduals {nullptr}
private

Definition at line 128 of file TPeak.h.

Referenced by ~TPeak(), Copy(), and DrawResiduals().