![]() |
GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
|
![]() |
This is the base class for anything that is used to fit things that resemble "peaks" in data. Any derived classes must implement functions to
Definition at line 36 of file TSinglePeak.h.
Public Member Functions | |
TSinglePeak ()=default | |
TSinglePeak (const TSinglePeak &)=default | |
TSinglePeak (TSinglePeak &&) noexcept=default | |
~TSinglePeak ()=default | |
Double_t | Area () const |
Double_t | AreaErr () const |
virtual Double_t | Centroid () const =0 |
virtual void | Centroid (const Double_t ¢roid)=0 |
virtual Double_t | CentroidErr () const =0 |
void | Draw (Option_t *opt="") override |
virtual void | DrawBackground (Option_t *opt="") |
virtual void | DrawComponents (Option_t *opt="") |
virtual Double_t | FWHM () |
virtual Double_t | FWHMErr () |
TF1 * | GetBackgroundFunction () |
Double_t | GetChi2 () const |
TF1 * | GetFitFunction () const |
TF1 * | GetGlobalBackground () const |
Color_t | GetLineColor () |
Style_t | GetLineStyle () |
Double_t | GetNDF () const |
Int_t | GetNParameters () const |
TF1 * | GetPeakFunction () const |
Double_t | GetReducedChi2 () const |
virtual void | InitializeParameters (TH1 *, const double &, const double &) |
virtual void | InitParNames () |
bool | IsBackgroundParameter (const Int_t &par) const |
bool | IsPeakParameter (const Int_t &par) const |
TSinglePeak & | operator= (const TSinglePeak &)=default |
TSinglePeak & | operator= (TSinglePeak &&) 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 | SetLineColor (Color_t color) |
void | SetLineStyle (Style_t style) |
void | SetListOfBGPar (const std::vector< bool > &list_of_bg_par) |
virtual Double_t | Sigma () const =0 |
virtual Double_t | SigmaErr () const =0 |
void | UpdateBackgroundParameters () |
void | UpdatePeakParameters () |
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 | 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} |
Friends | |
class | TPeakFitter |
|
default |
|
default |
|
defaultnoexcept |
|
default |
|
inline |
Definition at line 57 of file TSinglePeak.h.
References fArea.
Referenced by TSourceTab::Good(), main(), and Print().
|
inline |
Definition at line 58 of file TSinglePeak.h.
References fAreaErr.
Referenced by TSourceTab::Good(), main(), and Print().
|
inlineprotectedvirtual |
Reimplemented in TAB3Peak, TABPeak, and TRWPeak.
Definition at line 105 of file TSinglePeak.h.
Referenced by GetBackgroundFunction(), and TotalFunction().
|
pure virtual |
|
pure virtual |
Implemented in TAB3Peak, TABPeak, TGauss, and TRWPeak.
Referenced by TBGSubtraction::DoPeakFit().
|
pure virtual |
|
override |
Definition at line 106 of file TSinglePeak.cxx.
References fGlobalBackground, fPeakOnGlobal, fTotalFunction, and PeakOnGlobalFunction().
Referenced by TBGSubtraction::DrawPeak().
|
inlinevirtual |
Definition at line 71 of file TSinglePeak.h.
References fGlobalBackground.
|
virtual |
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.
|
virtual |
Return the full width at half-maximum.
Definition at line 77 of file TSinglePeak.cxx.
References Centroid(), fPeakFunction, Sigma(), and UpdatePeakParameters().
Referenced by FWHMErr().
|
virtual |
Return the uncertainty in the full width at half-maximum. Since it is complicated to do this without knowledge of the underlying fit function, we simply assume that the (relative) uncertainty in the FWHM is the same as the uncertainty in sigma.
Definition at line 92 of file TSinglePeak.cxx.
References FWHM(), Sigma(), and SigmaErr().
TF1 * TSinglePeak::GetBackgroundFunction | ( | ) |
Definition at line 28 of file TSinglePeak.cxx.
References BackgroundFunction(), fBackgroundFunction, and fTotalFunction.
|
inline |
Definition at line 91 of file TSinglePeak.h.
References fChi2.
|
inline |
Definition at line 78 of file TSinglePeak.h.
References fTotalFunction.
Referenced by TGauss::TGauss(), TAB3Peak::Centroid(), TAB3Peak::Centroid(), TABPeak::Centroid(), TABPeak::Centroid(), TGauss::Centroid(), TGauss::Centroid(), TRWPeak::Centroid(), TRWPeak::Centroid(), TAB3Peak::CentroidErr(), TABPeak::CentroidErr(), TGauss::CentroidErr(), TRWPeak::CentroidErr(), TAB3Peak::DrawComponents(), TABPeak::DrawComponents(), TAB3Peak::InitializeParameters(), TABPeak::InitializeParameters(), TGauss::InitializeParameters(), TRWPeak::InitializeParameters(), TAB3Peak::InitParNames(), TABPeak::InitParNames(), TGauss::InitParNames(), TRWPeak::InitParNames(), main(), TAB3Peak::OneHitPeakOnGlobalFunction(), TABPeak::OneHitPeakOnGlobalFunction(), TAB3Peak::Sigma(), TABPeak::Sigma(), TGauss::Sigma(), TRWPeak::Sigma(), TAB3Peak::SigmaErr(), TABPeak::SigmaErr(), TGauss::SigmaErr(), TRWPeak::SigmaErr(), TAB3Peak::ThreeHitPeakOnGlobalFunction(), TAB3Peak::TwoHitPeakOnGlobalFunction(), TABPeak::TwoHitPeakOnGlobalFunction(), TAB3Peak::Width(), TABPeak::Width(), and TRWPeak::Width().
|
inline |
Definition at line 80 of file TSinglePeak.h.
References fGlobalBackground.
Referenced by TAB3Peak::DrawComponents(), TABPeak::DrawComponents(), TAB3Peak::OneHitPeakOnGlobalFunction(), TABPeak::OneHitPeakOnGlobalFunction(), TAB3Peak::ThreeHitPeakOnGlobalFunction(), TAB3Peak::TwoHitPeakOnGlobalFunction(), and TABPeak::TwoHitPeakOnGlobalFunction().
|
inline |
Definition at line 100 of file TSinglePeak.h.
References fTotalFunction.
Referenced by TAB3Peak::DrawComponents(), and TABPeak::DrawComponents().
|
inline |
Definition at line 101 of file TSinglePeak.h.
References fTotalFunction.
|
inline |
Definition at line 92 of file TSinglePeak.h.
References fNDF.
Int_t TSinglePeak::GetNParameters | ( | ) | const |
Definition at line 20 of file TSinglePeak.cxx.
References fTotalFunction.
|
inline |
Definition at line 79 of file TSinglePeak.h.
References fPeakFunction.
|
inline |
|
inlinevirtual |
|
inlinevirtual |
bool TSinglePeak::IsBackgroundParameter | ( | const Int_t & | par | ) | const |
Definition at line 4 of file TSinglePeak.cxx.
References fListOfBGPars.
Referenced by IsPeakParameter().
bool TSinglePeak::IsPeakParameter | ( | const Int_t & | par | ) | const |
Definition at line 15 of file TSinglePeak.cxx.
References IsBackgroundParameter().
|
default |
|
defaultnoexcept |
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 129 of file TSinglePeak.cxx.
References fTotalFunction.
Referenced by TAB3Peak::InitializeParameters(), TABPeak::InitializeParameters(), TGauss::InitializeParameters(), and TRWPeak::InitializeParameters().
|
inlineprotectedvirtual |
Reimplemented in TAB3Peak, TABPeak, TGauss, and TRWPeak.
Definition at line 106 of file TSinglePeak.h.
Referenced by PeakOnGlobalFunction(), and TotalFunction().
|
protectedvirtual |
Definition at line 99 of file TSinglePeak.cxx.
References fGlobalBackground, fTotalFunction, and PeakFunction().
Referenced by Draw().
|
override |
Definition at line 37 of file TSinglePeak.cxx.
References Area(), AreaErr(), Centroid(), and CentroidErr().
|
virtual |
Definition at line 45 of file TSinglePeak.cxx.
References fTotalFunction.
|
inline |
Definition at line 54 of file TSinglePeak.h.
References fArea.
|
inline |
Definition at line 55 of file TSinglePeak.h.
References fAreaErr.
|
inlineprotected |
Definition at line 109 of file TSinglePeak.h.
References fChi2.
|
inlineprotected |
Definition at line 112 of file TSinglePeak.h.
References fTotalFunction.
Referenced by TAB3Peak::Centroid(), TABPeak::Centroid(), TGauss::Centroid(), and TRWPeak::Centroid().
|
inline |
Definition at line 82 of file TSinglePeak.h.
References fGlobalBackground.
|
inline |
Definition at line 97 of file TSinglePeak.h.
References fTotalFunction.
Referenced by TSourceTab::Add().
|
inline |
Definition at line 98 of file TSinglePeak.h.
References fTotalFunction.
|
inline |
Definition at line 51 of file TSinglePeak.h.
References fListOfBGPars.
Referenced by TAB3Peak::Centroid(), TABPeak::Centroid(), TGauss::Centroid(), and TRWPeak::Centroid().
|
inlineprotected |
Definition at line 110 of file TSinglePeak.h.
References fNDF.
|
inlineprotected |
Definition at line 113 of file TSinglePeak.h.
References fPeakFunction.
Referenced by TAB3Peak::Centroid(), TABPeak::Centroid(), TGauss::Centroid(), and TRWPeak::Centroid().
|
pure virtual |
|
pure virtual |
|
protected |
Definition at line 56 of file TSinglePeak.cxx.
References BackgroundFunction(), and PeakFunction().
Referenced by TAB3Peak::Centroid(), TABPeak::Centroid(), TGauss::Centroid(), and TRWPeak::Centroid().
void TSinglePeak::UpdateBackgroundParameters | ( | ) |
Definition at line 66 of file TSinglePeak.cxx.
References fBackgroundFunction, and fTotalFunction.
void TSinglePeak::UpdatePeakParameters | ( | ) |
Definition at line 61 of file TSinglePeak.cxx.
References fPeakFunction, and fTotalFunction.
Referenced by FWHM().
|
pure virtual |
|
friend |
Definition at line 38 of file TSinglePeak.h.
|
private |
Definition at line 123 of file TSinglePeak.h.
|
private |
Definition at line 124 of file TSinglePeak.h.
Referenced by AreaErr(), and SetAreaErr().
|
private |
Definition at line 117 of file TSinglePeak.h.
Referenced by GetBackgroundFunction(), and UpdateBackgroundParameters().
|
private |
Definition at line 125 of file TSinglePeak.h.
Referenced by GetChi2(), GetReducedChi2(), and SetChi2().
|
private |
Definition at line 118 of file TSinglePeak.h.
Referenced by Draw(), DrawBackground(), GetGlobalBackground(), PeakOnGlobalFunction(), and SetGlobalBackground().
|
private |
Definition at line 122 of file TSinglePeak.h.
Referenced by IsBackgroundParameter(), and SetListOfBGPar().
|
private |
Definition at line 126 of file TSinglePeak.h.
Referenced by GetNDF(), GetReducedChi2(), and SetNDF().
|
private |
Definition at line 120 of file TSinglePeak.h.
Referenced by FWHM(), GetPeakFunction(), SetPeakFunction(), and UpdatePeakParameters().
|
private |
Definition at line 119 of file TSinglePeak.h.
Referenced by Draw().
|
private |
Definition at line 116 of file TSinglePeak.h.
Referenced by Draw(), GetBackgroundFunction(), GetFitFunction(), GetLineColor(), GetLineStyle(), GetNParameters(), ParameterSetByUser(), PeakOnGlobalFunction(), PrintParameters(), SetFitFunction(), SetLineColor(), SetLineStyle(), UpdateBackgroundParameters(), and UpdatePeakParameters().