GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
|
This class is used to fit things that resemble "peaks" in data
Definition at line 31 of file TPeakFitter.h.
Public Member Functions | |
TPeakFitter () | |
TPeakFitter (const Double_t &rangeLow, const Double_t &rangeHigh) | |
TPeakFitter (const TPeakFitter &)=default | |
TPeakFitter (TPeakFitter &&) noexcept=default | |
~TPeakFitter ()=default | |
void | AddPeak (TSinglePeak *peak) |
void | DrawPeaks (Option_t *="") const |
TFitResultPtr | Fit (TH1 *fit_hist, Option_t *opt="") |
TF1 * | GetBackground () |
TF1 * | GetFitFunction () |
Int_t | GetNParameters () const |
void | InitializeBackgroundParameters (TH1 *fit_hist) |
void | InitializeParameters (TH1 *fit_hist) |
TPeakFitter & | operator= (const TPeakFitter &)=default |
TPeakFitter & | operator= (TPeakFitter &&) noexcept=default |
void | Print (Option_t *opt="") const override |
void | PrintParameters () const |
void | RemoveAllPeaks () |
void | RemovePeak (TSinglePeak *peak) |
void | ResetInitFlag () |
void | SetBackground (TF1 *bg_to_fit) |
void | SetColorIndex (const int &index) |
void | SetRange (const Double_t &low, const Double_t &high) |
Private Member Functions | |
Double_t | BackgroundFunction (Double_t *dim, Double_t *par) |
Double_t | DefaultBackgroundFunction (Double_t *dim, Double_t *par) |
Double_t | FitFunction (Double_t *dim, Double_t *par) |
void | ResetTotalFitFunction () |
void | UpdateFitterParameters () |
void | UpdatePeakParameters (const TFitResultPtr &fit_res, TH1 *fit_hist) |
Private Attributes | |
TF1 * | fBGToFit {nullptr} |
int | fColorIndex {0} |
bool | fInitFlag {false} |
TH1 * | fLastHistFit {nullptr} |
MultiplePeak_t | fPeaksToFit |
Double_t | fRangeHigh {0.} |
Double_t | fRangeLow {0.} |
TF1 * | fTotalFitFunction {nullptr} |
|
inline |
Definition at line 34 of file TPeakFitter.h.
TPeakFitter::TPeakFitter | ( | const Double_t & | rangeLow, |
const Double_t & | rangeHigh ) |
Definition at line 8 of file TPeakFitter.cxx.
References DefaultBackgroundFunction(), fBGToFit, fColorIndex, fRangeHigh, and fRangeLow.
|
default |
|
defaultnoexcept |
|
default |
|
inline |
Definition at line 42 of file TPeakFitter.h.
References fPeaksToFit, and ResetTotalFitFunction().
Referenced by main(), and TBGSubtraction::PeakComboSelected().
|
private |
Definition at line 324 of file TPeakFitter.cxx.
References fBGToFit, and fPeaksToFit.
Referenced by UpdatePeakParameters().
|
private |
Definition at line 380 of file TPeakFitter.cxx.
Referenced by TPeakFitter().
void TPeakFitter::DrawPeaks | ( | Option_t * | = "" | ) | const |
Definition at line 391 of file TPeakFitter.cxx.
References fColorIndex, fPeaksToFit, and fTotalFitFunction.
TFitResultPtr TPeakFitter::Fit | ( | TH1 * | fit_hist, |
Option_t * | opt = "" ) |
Fit the histogram. Recognized options are "q" for a quiet fit, "retryfit" to retry a fit without parameter limits if one of the parameters got close to its limit. All options (apart from "retryfit") are passed on to the actual call to TH1::Fit.
Definition at line 77 of file TPeakFitter.cxx.
References TGRSIFunctions::CheckParameterErrors(), fBGToFit, fColorIndex, fInitFlag, FitFunction(), fLastHistFit, fPeaksToFit, fRangeHigh, fRangeLow, fTotalFitFunction, GetNParameters(), GREEN, InitializeBackgroundParameters(), InitializeParameters(), Print(), PrintParameters(), RED, RESET_COLOR, UpdateFitterParameters(), UpdatePeakParameters(), and YELLOW.
Referenced by TBGSubtraction::DoPeakFit(), and main().
|
private |
Definition at line 309 of file TPeakFitter.cxx.
References fBGToFit, and fPeaksToFit.
Referenced by Fit().
|
inline |
|
inline |
Definition at line 66 of file TPeakFitter.h.
References fTotalFitFunction.
Int_t TPeakFitter::GetNParameters | ( | ) | const |
Definition at line 58 of file TPeakFitter.cxx.
References fBGToFit, and fPeaksToFit.
Referenced by Fit().
void TPeakFitter::InitializeBackgroundParameters | ( | TH1 * | fit_hist | ) |
Definition at line 338 of file TPeakFitter.cxx.
References fBGToFit, fPeaksToFit, fRangeHigh, and fRangeLow.
Referenced by Fit().
void TPeakFitter::InitializeParameters | ( | TH1 * | fit_hist | ) |
Definition at line 266 of file TPeakFitter.cxx.
References fPeaksToFit, fRangeHigh, and fRangeLow.
Referenced by Fit().
|
default |
|
defaultnoexcept |
|
override |
Print information from the fit, opt is passed along to each individual peaks Print function.
Definition at line 16 of file TPeakFitter.cxx.
References fBGToFit, fPeaksToFit, fRangeHigh, fRangeLow, and fTotalFitFunction.
Referenced by Fit().
void TPeakFitter::PrintParameters | ( | ) | const |
Print the range of the fit and the parameters of each peak on a single line.
Definition at line 46 of file TPeakFitter.cxx.
References fPeaksToFit, fRangeHigh, and fRangeLow.
Referenced by Fit().
|
inline |
Definition at line 52 of file TPeakFitter.h.
References fPeaksToFit, and ResetTotalFitFunction().
|
inline |
Definition at line 47 of file TPeakFitter.h.
References fPeaksToFit, and ResetTotalFitFunction().
Referenced by TBGSubtraction::PeakComboSelected().
|
inline |
Definition at line 72 of file TPeakFitter.h.
References fInitFlag.
Referenced by TBGSubtraction::DoPeakFit(), and TBGSubtraction::PeakComboSelected().
|
inlineprivate |
Definition at line 80 of file TPeakFitter.h.
References fTotalFitFunction.
Referenced by AddPeak(), RemoveAllPeaks(), and RemovePeak().
|
inline |
Definition at line 58 of file TPeakFitter.h.
References fBGToFit.
|
inline |
Definition at line 74 of file TPeakFitter.h.
References fColorIndex.
void TPeakFitter::SetRange | ( | const Double_t & | low, |
const Double_t & | high ) |
Definition at line 71 of file TPeakFitter.cxx.
References fRangeHigh, and fRangeLow.
Referenced by TBGSubtraction::DoPeakFit().
|
private |
This functions gets the parameters and their limits from the peak functions and sets them for the total fit function
Definition at line 273 of file TPeakFitter.cxx.
References fBGToFit, fPeaksToFit, and fTotalFitFunction.
Referenced by Fit().
|
private |
Definition at line 174 of file TPeakFitter.cxx.
References BackgroundFunction(), fBGToFit, fPeaksToFit, fRangeHigh, fRangeLow, and fTotalFitFunction.
Referenced by Fit().
|
private |
Definition at line 89 of file TPeakFitter.h.
Referenced by TPeakFitter(), BackgroundFunction(), Fit(), FitFunction(), GetBackground(), GetNParameters(), InitializeBackgroundParameters(), Print(), SetBackground(), UpdateFitterParameters(), and UpdatePeakParameters().
|
private |
this index is added to the colors kRed for the total function and kMagenta for the individual peaks
Definition at line 103 of file TPeakFitter.h.
Referenced by TPeakFitter(), DrawPeaks(), Fit(), and SetColorIndex().
|
private |
Definition at line 99 of file TPeakFitter.h.
Referenced by Fit(), and ResetInitFlag().
|
private |
Definition at line 101 of file TPeakFitter.h.
Referenced by Fit().
|
private |
Definition at line 88 of file TPeakFitter.h.
Referenced by AddPeak(), BackgroundFunction(), DrawPeaks(), Fit(), FitFunction(), GetNParameters(), InitializeBackgroundParameters(), InitializeParameters(), Print(), PrintParameters(), RemoveAllPeaks(), RemovePeak(), UpdateFitterParameters(), and UpdatePeakParameters().
|
private |
Definition at line 94 of file TPeakFitter.h.
Referenced by TPeakFitter(), Fit(), InitializeBackgroundParameters(), InitializeParameters(), Print(), PrintParameters(), SetRange(), and UpdatePeakParameters().
|
private |
Definition at line 93 of file TPeakFitter.h.
Referenced by TPeakFitter(), Fit(), InitializeBackgroundParameters(), InitializeParameters(), Print(), PrintParameters(), SetRange(), and UpdatePeakParameters().
|
private |
Definition at line 91 of file TPeakFitter.h.
Referenced by DrawPeaks(), Fit(), GetFitFunction(), Print(), ResetTotalFitFunction(), UpdateFitterParameters(), and UpdatePeakParameters().