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

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

Definition at line 32 of file TMultiPeak.h.

Public Member Functions

 TMultiPeak (Double_t xlow, Double_t xhigh, const std::vector< Double_t > &centroids, Option_t *type="gsc")
 
 TMultiPeak (const TMultiPeak &copy)
 
 TMultiPeak ()
 
 ~TMultiPeak () override
 
Bool_t AddToGlobalList (Bool_t on=kTRUE) override
 
TF1 * Background () const
 
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 DrawPeaks ()
 
Bool_t Fit (TH1 *fithist, Option_t *opt="")
 
virtual TH1 * GetHist () const
 
TPeakGetPeak (UInt_t idx)
 
TPeakGetPeakClosestTo (Double_t energy)
 
bool InitParams (TH1 *fithist) override
 
Bool_t IsGoodFit () const
 
void Print (Option_t *opt="") const override
 
virtual void SetHist (TH1 *hist)
 
void SortPeaks (Bool_t(*SortFunction)(const TPeak *, const TPeak *)=TPeak::CompareEnergy)
 

Static Public Member Functions

static Bool_t AddToGlobalList (TF1 *func, Bool_t on=kTRUE)
 
static const char * GetDefaultFitType ()
 
static bool GetLogLikelihoodFlag ()
 
static void SetDefaultFitType (const char *fitType)
 
static void SetLogLikelihoodFlag (bool flag)
 

Protected Member Functions

void GoodFit (Bool_t flag=true)
 
void InitNames ()
 
Bool_t IsInitialized () const
 
void SetInitialized (Bool_t flag=true)
 

Private Member Functions

Double_t MultiPhotoPeakBG (Double_t *dim, Double_t *par)
 
Double_t MultiStepBG (Double_t *dim, Double_t *par)
 
Double_t SinglePeakBG (Double_t *dim, Double_t *par)
 

Private Attributes

TF1 * fBackground
 
bool fConstrainWidths
 
std::vector< TPeak * > fPeakVec
 

Static Private Attributes

static bool fLogLikelihoodFlag = false
 

#include <TMultiPeak.h>

+ Inheritance diagram for TMultiPeak:
+ Collaboration diagram for TMultiPeak:

Constructor & Destructor Documentation

◆ ~TMultiPeak()

TMultiPeak::~TMultiPeak ( )
override

Definition at line 64 of file TMultiPeak.cxx.

References fBackground, and fPeakVec.

◆ TMultiPeak() [1/3]

TMultiPeak::TMultiPeak ( Double_t  xlow,
Double_t  xhigh,
const std::vector< Double_t > &  centroids,
Option_t *  type = "gsc" 
)

◆ TMultiPeak() [2/3]

TMultiPeak::TMultiPeak ( const TMultiPeak copy)

Definition at line 101 of file TMultiPeak.cxx.

References Copy().

◆ TMultiPeak() [3/3]

TMultiPeak::TMultiPeak ( )

Definition at line 52 of file TMultiPeak.cxx.

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

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 Copy(), TMultiPeak(), TPeak::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.

◆ Background()

TF1* TMultiPeak::Background ( ) const
inline

Definition at line 53 of file TMultiPeak.h.

References fBackground.

◆ Clear()

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

Definition at line 336 of file TMultiPeak.cxx.

References TGRSIFit::Clear(), and fPeakVec.

Referenced by TMultiPeak().

◆ ClearParameters()

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

Definition at line 47 of file TGRSIFit.cxx.

◆ Copy()

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

Definition at line 106 of file TMultiPeak.cxx.

References TGRSIFit::AddToGlobalList(), TGRSIFit::Copy(), fBackground, and fPeakVec.

Referenced by TMultiPeak().

◆ CopyParameters()

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

Definition at line 54 of file TGRSIFit.cxx.

Referenced by Fit().

◆ DrawPeaks()

void TMultiPeak::DrawPeaks ( )

Definition at line 447 of file TMultiPeak.cxx.

References fPeakVec, TPeak::GetCentroid(), TPeak::GetFWHM(), and SinglePeakBG().

◆ Fit()

◆ GetDefaultFitType()

static const char* TGRSIFit::GetDefaultFitType ( )
inlinestaticinherited

Definition at line 60 of file TGRSIFit.h.

References TGRSIFit::fDefaultFitType.

◆ GetHist()

virtual TH1* TGRSIFit::GetHist ( ) const
inlinevirtualinherited

◆ GetLogLikelihoodFlag()

static bool TMultiPeak::GetLogLikelihoodFlag ( )
inlinestatic

Definition at line 56 of file TMultiPeak.h.

References fLogLikelihoodFlag.

Referenced by Fit().

◆ GetPeak()

TPeak * TMultiPeak::GetPeak ( UInt_t  idx)

Definition at line 423 of file TMultiPeak.cxx.

References fPeakVec.

Referenced by GetPeakClosestTo().

◆ GetPeakClosestTo()

TPeak * TMultiPeak::GetPeakClosestTo ( Double_t  energy)

Definition at line 433 of file TMultiPeak.cxx.

References fPeakVec, and GetPeak().

◆ GoodFit()

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

Definition at line 71 of file TGRSIFit.h.

References TGRSIFit::fGoodFitFlag.

◆ InitNames()

void TMultiPeak::InitNames ( )
protected

Definition at line 82 of file TMultiPeak.cxx.

References fPeakVec.

Referenced by TMultiPeak().

◆ InitParams()

Bool_t TMultiPeak::InitParams ( TH1 *  fithist)
overridevirtual

Implements TGRSIFit.

Definition at line 126 of file TMultiPeak.cxx.

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

Referenced by Fit().

◆ 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 TPeak::Fit(), and Fit().

◆ MultiPhotoPeakBG()

Double_t TMultiPeak::MultiPhotoPeakBG ( Double_t *  dim,
Double_t *  par 
)
private

◆ MultiStepBG()

Double_t TMultiPeak::MultiStepBG ( Double_t *  dim,
Double_t *  par 
)
private

Definition at line 381 of file TMultiPeak.cxx.

References TGRSIFunctions::PolyBg(), and TGRSIFunctions::StepFunction().

Referenced by TMultiPeak().

◆ Print()

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

Prints TMultiPeak properties. To see More properties use the option "+"

Definition at line 348 of file TMultiPeak.cxx.

References fPeakVec.

◆ 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 TPeak::Copy(), TPeak::Fit(), and Fit().

◆ SetInitialized()

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

Definition at line 70 of file TGRSIFit.h.

References TGRSIFit::fInitFlag.

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

◆ SetLogLikelihoodFlag()

static void TMultiPeak::SetLogLikelihoodFlag ( bool  flag)
inlinestatic

Definition at line 55 of file TMultiPeak.h.

References fLogLikelihoodFlag.

◆ SinglePeakBG()

Double_t TMultiPeak::SinglePeakBG ( Double_t *  dim,
Double_t *  par 
)
private

◆ SortPeaks()

void TMultiPeak::SortPeaks ( Bool_t(*)(const TPeak *, const TPeak *)  SortFunction = TPeak::CompareEnergy)

Definition at line 77 of file TMultiPeak.cxx.

References fPeakVec.

Referenced by TMultiPeak().

Member Data Documentation

◆ fBackground

TF1* TMultiPeak::fBackground
private

Definition at line 65 of file TMultiPeak.h.

Referenced by Background(), Copy(), Fit(), TMultiPeak(), and ~TMultiPeak().

◆ fConstrainWidths

bool TMultiPeak::fConstrainWidths
private

Definition at line 66 of file TMultiPeak.h.

◆ fLogLikelihoodFlag

Bool_t TMultiPeak::fLogLikelihoodFlag = false
staticprivate

!

Definition at line 63 of file TMultiPeak.h.

Referenced by GetLogLikelihoodFlag(), and SetLogLikelihoodFlag().

◆ fPeakVec

std::vector<TPeak*> TMultiPeak::fPeakVec
private