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

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 (const TPeak &copy)
 
 TPeak (Double_t cent, Double_t xlow, Double_t xhigh)
 
 TPeak (Double_t cent, Double_t xlow, Double_t xhigh, TF1 *background)
 
 TPeak ()
 
 ~TPeak () override
 
Bool_t AddToGlobalList (Bool_t on=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
 
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 on=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 a)
 
void SetArea (Double_t a, Double_t dA)
 
void SetAreaErr (Double_t d_a)
 
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
 
Double_t fChi2 {0.}
 
Double_t fDArea {0.}
 
Double_t fNdf {0.}
 
Bool_t fOwnBgFlag {false}
 
TGraph * fResiduals
 

Static Private Attributes

static TPeakfLastFit = nullptr
 
static bool fLogLikelihoodFlag = true
 

Friends

class TMultiPeak
 

#include <TPeak.h>

+ Inheritance diagram for TPeak:
+ Collaboration diagram for TPeak:

Constructor & Destructor Documentation

◆ ~TPeak()

TPeak::~TPeak ( )
override

Definition at line 154 of file TPeak.cxx.

References fBackground, fOwnBgFlag, and fResiduals.

◆ TPeak() [1/4]

TPeak::TPeak ( const TPeak copy)

Definition at line 164 of file TPeak.cxx.

References Copy(), fBackground, and fResiduals.

◆ TPeak() [2/4]

TPeak::TPeak ( Double_t  cent,
Double_t  xlow,
Double_t  xhigh 
)

◆ TPeak() [3/4]

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

◆ TPeak() [4/4]

TPeak::TPeak ( )

Definition at line 139 of file TPeak.cxx.

References TGRSIFit::AddToGlobalList(), fBackground, fOwnBgFlag, fResiduals, InitNames(), and TGRSIFunctions::StepBG().

Referenced by Fit().

Member Function Documentation

◆ AddToGlobalList() [1/2]

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

Definition at line 66 of file TGRSIFit.cxx.

Referenced by TMultiPeak::Copy(), TMultiPeak::TMultiPeak(), TPeak(), and TGRSIFit::~TGRSIFit().

◆ AddToGlobalList() [2/2]

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

Definition at line 96 of file TGRSIFit.cxx.

◆ Area()

Double_t TPeak::Area ( ) const
inline

Definition at line 71 of file TPeak.h.

References GetArea().

◆ AreaErr()

Double_t TPeak::AreaErr ( ) const
inline

Definition at line 72 of file TPeak.h.

References GetAreaErr().

◆ Background()

TF1* TPeak::Background ( ) const
inline

Definition at line 94 of file TPeak.h.

References fBackground.

Referenced by GetIntegralArea(), and GetIntegralAreaErr().

◆ Centroid()

Double_t TPeak::Centroid ( ) const
inline

Definition at line 69 of file TPeak.h.

References GetCentroid().

◆ CentroidErr()

Double_t TPeak::CentroidErr ( ) const
inline

Definition at line 70 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 433 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 47 of file TGRSIFit.cxx.

◆ CompareArea() [1/2]

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

Definition at line 104 of file TPeak.h.

References GetArea().

◆ CompareArea() [2/2]

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

Definition at line 106 of file TPeak.h.

References GetArea().

◆ CompareEnergy() [1/2]

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

Definition at line 103 of file TPeak.h.

References GetCentroid().

◆ CompareEnergy() [2/2]

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

Definition at line 105 of file TPeak.h.

References GetCentroid().

◆ Copy()

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

Definition at line 185 of file TPeak.cxx.

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

Referenced by Fit(), and TPeak().

◆ CopyParameters()

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

Definition at line 54 of file TGRSIFit.cxx.

Referenced by TMultiPeak::Fit().

◆ DrawBackground()

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

Definition at line 460 of file TPeak.cxx.

References fBackground.

◆ DrawResiduals()

void TPeak::DrawResiduals ( )

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

Definition at line 465 of file TPeak.cxx.

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

◆ Fit()

◆ FitFunction()

const TF1* TPeak::FitFunction ( ) const
inline

Definition at line 79 of file TPeak.h.

References GetFitFunction().

◆ FWHM()

Double_t TPeak::FWHM ( ) const
inline

Definition at line 73 of file TPeak.h.

References GetFWHM().

◆ FWHMErr()

Double_t TPeak::FWHMErr ( ) const
inline

Definition at line 74 of file TPeak.h.

References GetFWHMErr().

◆ GetArea()

Double_t TPeak::GetArea ( ) const
inline

◆ 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 60 of file TGRSIFit.h.

References TGRSIFit::fDefaultFitType.

◆ GetFitFunction()

const TF1* TPeak::GetFitFunction ( ) const
inline

Definition at line 64 of file TPeak.h.

Referenced by FitFunction().

◆ GetFWHM()

Double_t TPeak::GetFWHM ( ) const
inline

Definition at line 53 of file TPeak.h.

Referenced by TMultiPeak::DrawPeaks(), FWHM(), and TAngularCorrelation::UpdateDiagnostics().

◆ GetFWHMErr()

Double_t TPeak::GetFWHMErr ( ) const
inline

Definition at line 54 of file TPeak.h.

Referenced by FWHMErr(), and TAngularCorrelation::UpdateDiagnostics().

◆ GetHist()

virtual TH1* TGRSIFit::GetHist ( ) const
inlinevirtualinherited

◆ GetIntegralArea() [1/2]

Double_t TPeak::GetIntegralArea ( )

Definition at line 515 of file TPeak.cxx.

References GoodStatus().

Referenced by CheckArea(), and IntegralArea().

◆ GetIntegralArea() [2/2]

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

Definition at line 528 of file TPeak.cxx.

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

◆ GetIntegralAreaErr() [1/2]

Double_t TPeak::GetIntegralAreaErr ( )

Definition at line 576 of file TPeak.cxx.

References GoodStatus().

Referenced by CheckArea(), and IntegralAreaErr().

◆ GetIntegralAreaErr() [2/2]

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

Definition at line 552 of file TPeak.cxx.

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

◆ GetLastFit()

static TPeak* TPeak::GetLastFit ( )
inlinestatic

Definition at line 108 of file TPeak.h.

References fLastFit.

◆ GetLogLikelihoodFlag()

static Bool_t TPeak::GetLogLikelihoodFlag ( )
inlinestatic

Definition at line 101 of file TPeak.h.

References fLogLikelihoodFlag.

Referenced by Fit().

◆ GoodFit()

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

Definition at line 71 of file TGRSIFit.h.

References TGRSIFit::fGoodFitFlag.

◆ GoodStatus()

bool TPeak::GoodStatus ( )
private

Definition at line 502 of file TPeak.cxx.

References fChi2, and TGRSIFit::GetHist().

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

◆ InitNames()

void TPeak::InitNames ( )
protected

Definition at line 171 of file TPeak.cxx.

Referenced by TPeak().

◆ InitParams()

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

Implements TGRSIFit.

Definition at line 210 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 75 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 76 of file TPeak.h.

References GetIntegralArea().

◆ IntegralAreaErr() [1/2]

Double_t TPeak::IntegralAreaErr ( )
inline

Definition at line 77 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 78 of file TPeak.h.

References GetIntegralAreaErr().

◆ IsGoodFit()

Bool_t TGRSIFit::IsGoodFit ( ) const
inlineinherited

Definition at line 54 of file TGRSIFit.h.

References TGRSIFit::fGoodFitFlag.

◆ IsInitialized()

Bool_t TGRSIFit::IsInitialized ( ) const
inlineprotectedinherited

Definition at line 69 of file TGRSIFit.h.

References TGRSIFit::fInitFlag.

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

◆ Print()

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

Definition at line 446 of file TPeak.cxx.

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

Referenced by Fit().

◆ SetArea() [1/2]

void TPeak::SetArea ( Double_t  a)
inlineprotected

Definition at line 82 of file TPeak.h.

References fArea.

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

◆ SetArea() [2/2]

void TPeak::SetArea ( Double_t  a,
Double_t  dA 
)
inlineprotected

Definition at line 84 of file TPeak.h.

References SetArea(), and SetAreaErr().

◆ SetAreaErr()

void TPeak::SetAreaErr ( Double_t  d_a)
inlineprotected

Definition at line 83 of file TPeak.h.

References fDArea.

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

◆ SetCentroid()

void TPeak::SetCentroid ( Double_t  cent)
inline

Definition at line 44 of file TPeak.h.

◆ SetChi2()

void TPeak::SetChi2 ( Double_t  chi2)
inlineprotected

Definition at line 89 of file TPeak.h.

References fChi2.

Referenced by TMultiPeak::Fit().

◆ SetDefaultFitType()

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

Definition at line 61 of file TGRSIFit.h.

References TGRSIFit::fDefaultFitType.

◆ SetHist()

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

Definition at line 55 of file TGRSIFit.h.

References TGRSIFit::fHist, and hist.

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

◆ SetInitialized()

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

Definition at line 70 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 100 of file TPeak.h.

References fLogLikelihoodFlag.

Referenced by TAngularCorrelation::FitSlices().

◆ SetNdf()

void TPeak::SetNdf ( Double_t  Ndf)
inlineprotected

Definition at line 90 of file TPeak.h.

References fNdf.

Referenced by TMultiPeak::Fit().

Friends And Related Function 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 117 of file TPeak.h.

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

◆ fBackground

TF1* TPeak::fBackground
private

Definition at line 126 of file TPeak.h.

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

◆ fChi2

Double_t TPeak::fChi2 {0.}
private

Definition at line 119 of file TPeak.h.

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

◆ fDArea

Double_t TPeak::fDArea {0.}
private

Definition at line 118 of file TPeak.h.

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

◆ fLastFit

TPeak * TPeak::fLastFit = nullptr
staticprivate

!

Definition at line 124 of file TPeak.h.

Referenced by Fit(), and GetLastFit().

◆ fLogLikelihoodFlag

Bool_t TPeak::fLogLikelihoodFlag = true
staticprivate

!

Definition at line 123 of file TPeak.h.

Referenced by GetLogLikelihoodFlag(), and SetLogLikelihoodFlag().

◆ fNdf

Double_t TPeak::fNdf {0.}
private

Definition at line 120 of file TPeak.h.

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

◆ fOwnBgFlag

Bool_t TPeak::fOwnBgFlag {false}
private

Definition at line 121 of file TPeak.h.

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

◆ fResiduals

TGraph* TPeak::fResiduals
private

Definition at line 127 of file TPeak.h.

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