KaliVeda
Toolkit for HIC analysis
KVMultiGaussIsotopeFit Class Reference

Detailed Description

Function for fitting PID mass spectra.

This class is used by KVIDZAFromZGrid (and in the GUI for determining identified isotopes with such grids, KVItvFinderDialog) in order to fit PID mass spectra for a given \(Z\) with a set of gaussians and a background function. The fit can then be used to calculate yields of each isotope, probability that a given PID value is associated with a certain \(A\), mean/most probable \(A\) for a given PID, mass distribution \(P(A|PID)\) for given PID, etc. etc.

The function used to fit the PID spectrum is

\[ N(PID) = \exp(b_0 + b_1*PID) + \sum_{i=1}^{N_{iso}} N_i \mathcal{G}(PID,f(A_i),\sigma) \]

where:

  • \(N_{iso}\) is the number of isotopes \(A_i\) in the spectrum;
  • \(b_0 , b_1\) are the parameters of the exponential background;
  • \(\mathcal{G}(x,\bar{x},\sigma)\) is a normalized gaussian distribution with mean \(\bar{x}\) and standard deviation \(\sigma\);
  • \(N_i\) is the yield of each isotope;
  • \(f(A_i)\) is a function which parameterizes the PID coordinate of the centroid of the gaussian for mass \(A_i\),

\[ f(A_i) = a_0 + a_1 A_i + a_2 A_i^2 \]

Note that the same width \(\sigma\) is used for all isotopes \(A_i\) of a given element \(Z\).

The probability that a given PID value is associated with the mass number \(A_i\) is then given by

\[ P(A_i|PID) = \frac{N_i \mathcal{G}(PID,f(A_i),\sigma)}{N(PID)} \]

Author
eindra
Date
Wed Jun 15 10:56:41 2022

Definition at line 51 of file KVMultiGaussIsotopeFit.h.

#include <KVMultiGaussIsotopeFit.h>

Inheritance diagram for KVMultiGaussIsotopeFit:

Public Member Functions

 KVMultiGaussIsotopeFit ()
 
 KVMultiGaussIsotopeFit (int z, const KVNameValueList &)
 initialize from previous fit with parameters stored in KVNameValueList More...
 
 KVMultiGaussIsotopeFit (int z, int Ngauss, double PID_min, double PID_max, const KVNumberList &alist, double bkg_cst, double bkg_slp, double gaus_wid, double pidvsa_a0, double pidvsa_a1, double pidvsa_a2)
 
 KVMultiGaussIsotopeFit (int z, int Ngauss, double PID_min, double PID_max, const KVNumberList &alist, std::vector< double > pidlist)
 
 KVMultiGaussIsotopeFit (int z, std::vector< int > alist)
 
void DrawFitWithGaussians (Option_t *opt="", const TString &fit_title="") const
 
void FitCentroids ()
 
std::optional< int > GetA (double PID, double &P) const
 
std::optional< std::map< int, double > > GetADistribution (double PID) const
 
std::vector< int > GetAlist () const
 
double GetBackgroundConstant () const
 
double GetBackgroundSlope () const
 
double GetCentroid (int i) const
 
int GetGaussianA (int i) const
 
double GetGaussianNorm (int i) const
 
double GetGaussianWidth (int) const
 
double GetInterpolatedA (double PID) const
 
int GetIsotopeIndexWithMaxYield () const
 
std::vector< int > GetIsotopeIndicesRankedByYield () const
 
std::vector< int > GetIsotopesRankedByYield () const
 
int GetIsotopeWithMaxYield () const
 
double GetMaxSigma () const
 
std::optional< double > GetMeanA (double PID) const
 
double GetMinSigma () const
 
std::optional< int > GetMostProbableA (double PID, double &P) const
 
int GetNGaussians () const
 
double GetPIDFromInterpolatedA (double interpA)
 
std::vector< double > GetPIDlist () const
 
double GetPIDmax () const
 
double GetPIDmin () const
 
double GetPIDvsAfit_a0 () const
 
double GetPIDvsAfit_a1 () const
 
double GetPIDvsAfit_a2 () const
 
double GetProbability (int A, double PID) const
 
std::vector< double > GetRankedYields () const
 
auto GetZ () const
 
void InitializeParameterLimitsForNewFit ()
 
void PositiveBkgSlope (bool yes=true)
 
void ReleaseCentroids ()
 Release the constraint on the positions of the centroids. More...
 
void SetAlist (const std::vector< int > alist)
 
void SetFitRange (double min, double max)
 Change range of fit. More...
 
void SetGaussianNorm (int i, double v)
 
void SetPIDlist (const std::vector< double > pidlist)
 
void SetSigmaLimits (double smin, double smax)
 
void UnDraw (TVirtualPad *pad=gPad) const
 Remove the graphical representation of this fit from the given pad. More...
 
void UpdateGaussianCentroidParameters ()
 Required in case the attribution of masses to the gaussians changes. More...
 
- Public Member Functions inherited from TF1
 TF1 ()
 
 TF1 (const char *name, const char *formula, Double_t xmin, Double_t xmax, Option_t *option)
 
 TF1 (const char *name, const char *formula, Double_t xmin=0, Double_t xmax=1, EAddToList addToGlobList=EAddToList::kDefault, bool vectorize=false)
 
 TF1 (const char *name, const PtrObj &p, MemFn memFn, Double_t xmin, Double_t xmax, Int_t npar, const char *, const char *, EAddToList addToGlobList=EAddToList::kDefault)
 
 TF1 (const char *name, const PtrObj &p, MemFn memFn, Double_t xmin, Double_t xmax, Int_t npar, Int_t ndim=1, EAddToList addToGlobList=EAddToList::kDefault)
 
 TF1 (const char *name, Double_t xmin, Double_t xmax, Int_t npar, Int_t ndim=1, EAddToList addToGlobList=EAddToList::kDefault)
 
 TF1 (const char *name, Double_t(*fcn)(const Double_t *, const Double_t *), Double_t xmin=0, Double_t xmax=1, Int_t npar=0, Int_t ndim=1, EAddToList addToGlobList=EAddToList::kDefault)
 
 TF1 (const char *name, Double_t(*fcn)(Double_t *, Double_t *), Double_t xmin=0, Double_t xmax=1, Int_t npar=0, Int_t ndim=1, EAddToList addToGlobList=EAddToList::kDefault)
 
 TF1 (const char *name, Func f, Double_t xmin, Double_t xmax, Int_t npar, const char *, EAddToList addToGlobList=EAddToList::kDefault)
 
 TF1 (const char *name, Func f, Double_t xmin, Double_t xmax, Int_t npar, Int_t ndim=1, EAddToList addToGlobList=EAddToList::kDefault)
 
 TF1 (const char *name, ROOT::Math::ParamFunctor f, Double_t xmin=0, Double_t xmax=1, Int_t npar=0, Int_t ndim=1, EAddToList addToGlobList=EAddToList::kDefault)
 
 TF1 (const char *name, std::function< T(const T *data, const Double_t *param)> &fcn, Double_t xmin=0, Double_t xmax=1, Int_t npar=0, Int_t ndim=1, EAddToList addToGlobList=EAddToList::kDefault)
 
 TF1 (const char *name, T(*fcn)(const T *, const Double_t *), Double_t xmin=0, Double_t xmax=1, Int_t npar=0, Int_t ndim=1, EAddToList addToGlobList=EAddToList::kDefault)
 
 TF1 (const TF1 &f1)
 
 ~TF1 () override
 
virtual void AddParameter (const TString &name, Double_t value)
 
virtual Bool_t AddToGlobalList (Bool_t on=kTRUE)
 
void Browse (TBrowser *b) override
 
virtual Double_t CentralMoment (Double_t n, Double_t a, Double_t b, const Double_t *params=nullptr, Double_t epsilon=0.000001)
 
TObject * Clone (const char *newname=nullptr) const override
 
void Copy (TObject &f1) const override
 
virtual TH1 * CreateHistogram ()
 
virtual Double_t Derivative (Double_t x, Double_t *params=nullptr, Double_t epsilon=0.001) const
 
virtual Double_t Derivative2 (Double_t x, Double_t *params=nullptr, Double_t epsilon=0.001) const
 
virtual Double_t Derivative3 (Double_t x, Double_t *params=nullptr, Double_t epsilon=0.001) const
 
Int_t DistancetoPrimitive (Int_t px, Int_t py) override
 
void Draw (Option_t *option="") override
 
virtual TF1 * DrawCopy (Option_t *option="") const
 
virtual TObject * DrawDerivative (Option_t *option="al")
 
virtual void DrawF1 (Double_t xmin, Double_t xmax, Option_t *option="")
 
virtual TObject * DrawIntegral (Option_t *option="al")
 
virtual Double_t Eval (Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
 
virtual Double_t EvalPar (const Double_t *x, const Double_t *params=nullptr)
 
T EvalPar (const T *x, const Double_t *params=nullptr)
 
void ExecuteEvent (Int_t event, Int_t px, Int_t py) override
 
virtual void FixParameter (Int_t ipar, Double_t value)
 
Double_t GetChisquare () const
 
virtual TString GetExpFormula (Option_t *option="") const
 
virtual TFormula * GetFormula ()
 
virtual const TFormula * GetFormula () const
 
virtual TH1 * GetHistogram () const
 
virtual const TObject * GetLinearPart (Int_t i) const
 
virtual Double_t GetMaximum (Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
 
virtual Double_t GetMaximumStored () const
 
virtual Double_t GetMaximumX (Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
 
TMethodCall * GetMethodCall () const
 
virtual Double_t GetMinimum (Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
 
virtual Double_t GetMinimumStored () const
 
virtual Double_t GetMinimumX (Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
 
virtual Int_t GetNDF () const
 
virtual Int_t GetNdim () const
 
virtual Int_t GetNpar () const
 
virtual Int_t GetNpx () const
 
virtual Int_t GetNumber () const
 
virtual Int_t GetNumberFitPoints () const
 
virtual Int_t GetNumberFreeParameters () const
 
char * GetObjectInfo (Int_t px, Int_t py) const override
 
virtual Double_t GetParameter (const TString &name) const
 
virtual Double_t GetParameter (Int_t ipar) const
 
virtual Double_t * GetParameters () const
 
virtual void GetParameters (Double_t *params)
 
TObject * GetParent () const
 
virtual Double_t GetParError (Int_t ipar) const
 
virtual const Double_t * GetParErrors () const
 
virtual void GetParLimits (Int_t ipar, Double_t &parmin, Double_t &parmax) const
 
virtual const char * GetParName (Int_t ipar) const
 
virtual Int_t GetParNumber (const char *name) const
 
virtual Double_t GetProb () const
 
virtual Int_t GetQuantiles (Int_t nprobSum, Double_t *q, const Double_t *probSum)
 
virtual Double_t GetRandom (Double_t xmin, Double_t xmax, TRandom *rng=nullptr, Option_t *opt=nullptr)
 
virtual Double_t GetRandom (TRandom *rng=nullptr, Option_t *opt=nullptr)
 
virtual void GetRange (Double_t &xmin, Double_t &xmax) const
 
virtual void GetRange (Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const
 
virtual void GetRange (Double_t &xmin, Double_t &ymin, Double_t &zmin, Double_t &xmax, Double_t &ymax, Double_t &zmax) const
 
virtual Double_t GetSave (const Double_t *x)
 
virtual Double_t GetVariable (const TString &name)
 
virtual Double_t GetX (Double_t y, Double_t xmin=0, Double_t xmax=0, Double_t epsilon=1.E-10, Int_t maxiter=100, Bool_t logx=false) const
 
TAxis * GetXaxis () const
 
virtual Double_t GetXmax () const
 
virtual Double_t GetXmin () const
 
TAxis * GetYaxis () const
 
TAxis * GetZaxis () const
 
virtual void GradientPar (const Double_t *x, Double_t *grad, Double_t eps=0.01)
 
void GradientPar (const T *x, T *grad, Double_t eps=0.01)
 
virtual Double_t GradientPar (Int_t ipar, const Double_t *x, Double_t eps=0.01)
 
T GradientPar (Int_t ipar, const T *x, Double_t eps=0.01)
 
void GradientParTempl (const T *x, T *grad, Double_t eps=0.01)
 
T GradientParTempl (Int_t ipar, const T *x, Double_t eps=0.01)
 
virtual void InitArgs (const Double_t *x, const Double_t *params)
 
virtual Double_t Integral (Double_t a, Double_t b, Double_t epsrel=1.e-12)
 
virtual Double_t IntegralError (Double_t a, Double_t b, const Double_t *params=nullptr, const Double_t *covmat=nullptr, Double_t epsilon=1.E-2)
 
virtual Double_t IntegralError (Int_t n, const Double_t *a, const Double_t *b, const Double_t *params=nullptr, const Double_t *covmat=nullptr, Double_t epsilon=1.E-2)
 
virtual Double_t IntegralFast (Int_t num, Double_t *x, Double_t *w, Double_t a, Double_t b, Double_t *params=nullptr, Double_t epsilon=1e-12)
 
virtual Double_t IntegralMultiple (Int_t n, const Double_t *a, const Double_t *b, Double_t epsrel, Double_t &relerr)
 
virtual Double_t IntegralMultiple (Int_t n, const Double_t *a, const Double_t *b, Int_t maxpts, Double_t epsrel, Double_t epsabs, Double_t &relerr, Int_t &nfnevl, Int_t &ifail)
 
virtual Double_t IntegralMultiple (Int_t n, const Double_t *a, const Double_t *b, Int_t, Int_t maxpts, Double_t epsrel, Double_t &relerr, Int_t &nfnevl, Int_t &ifail)
 
virtual Double_t IntegralOneDim (Double_t a, Double_t b, Double_t epsrel, Double_t epsabs, Double_t &err)
 
TClass * IsA () const override
 
virtual Bool_t IsEvalNormalized () const
 
virtual Bool_t IsInside (const Double_t *x) const
 
virtual Bool_t IsLinear () const
 
virtual Bool_t IsValid () const
 
bool IsVectorized ()
 
virtual Double_t Mean (Double_t a, Double_t b, const Double_t *params=nullptr, Double_t epsilon=0.000001)
 
virtual Double_t Moment (Double_t n, Double_t a, Double_t b, const Double_t *params=nullptr, Double_t epsilon=0.000001)
 
T operator() (const T *x, const Double_t *params=nullptr)
 
virtual Double_t operator() (Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
 
TF1 & operator= (const TF1 &rhs)
 
void Paint (Option_t *option="") override
 
void Print (Option_t *option="") const override
 
virtual void ReleaseParameter (Int_t ipar)
 
virtual void Save (Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax)
 
void SavePrimitive (std::ostream &out, Option_t *option="") override
 
virtual void SetChisquare (Double_t chi2)
 
virtual void SetFitResult (const ROOT::Fit::FitResult &result, const Int_t *indpar=nullptr)
 
void SetFunction (Func f)
 
void SetFunction (PtrObj &p, MemFn memFn)
 
virtual void SetMaximum (Double_t maximum=-1111)
 
virtual void SetMinimum (Double_t minimum=-1111)
 
virtual void SetNDF (Int_t ndf)
 
virtual void SetNormalized (Bool_t flag)
 
virtual void SetNpx (Int_t npx=100)
 
virtual void SetNumberFitPoints (Int_t npfits)
 
virtual void SetParameter (const TString &name, Double_t value)
 
virtual void SetParameter (Int_t param, Double_t value)
 
virtual void SetParameters (const Double_t *params)
 
virtual void SetParameters (double p0, double p1=0.0, double p2=0.0, double p3=0.0, double p4=0.0, double p5=0.0, double p6=0.0, double p7=0.0, double p8=0.0, double p9=0.0, double p10=0.0)
 
virtual void SetParent (TObject *p=nullptr)
 
virtual void SetParError (Int_t ipar, Double_t error)
 
virtual void SetParErrors (const Double_t *errors)
 
virtual void SetParLimits (Int_t ipar, Double_t parmin, Double_t parmax)
 
virtual void SetParName (Int_t ipar, const char *name)
 
virtual void SetParNames (const char *name0="p0", const char *name1="p1", const char *name2="p2", const char *name3="p3", const char *name4="p4", const char *name5="p5", const char *name6="p6", const char *name7="p7", const char *name8="p8", const char *name9="p9", const char *name10="p10")
 
virtual void SetRange (Double_t xmin, Double_t xmax)
 
virtual void SetRange (Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax)
 
virtual void SetRange (Double_t xmin, Double_t ymin, Double_t zmin, Double_t xmax, Double_t ymax, Double_t zmax)
 
virtual void SetSavedPoint (Int_t point, Double_t value)
 
void SetTitle (const char *title="") override
 
virtual void SetVectorized (Bool_t vectorized)
 
void Streamer (TBuffer &) override
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
virtual void Update ()
 
virtual Double_t Variance (Double_t a, Double_t b, const Double_t *params=nullptr, Double_t epsilon=0.000001)
 
- Public Member Functions inherited from TNamed
 TNamed ()
 
 TNamed (const char *name, const char *title)
 
 TNamed (const TNamed &named)
 
 TNamed (const TString &name, const TString &title)
 
virtual ~TNamed ()
 
void Clear (Option_t *option="") override
 
TObject * Clone (const char *newname="") const override
 
Int_t Compare (const TObject *obj) const override
 
void Copy (TObject &named) const override
 
virtual void FillBuffer (char *&buffer)
 
const char * GetName () const override
 
const char * GetTitle () const override
 
ULong_t Hash () const override
 
TClass * IsA () const override
 
Bool_t IsSortable () const override
 
void ls (Option_t *option="") const override
 
TNamed & operator= (const TNamed &rhs)
 
void Print (Option_t *option="") const override
 
virtual void SetName (const char *name)
 
virtual void SetNameTitle (const char *name, const char *title)
 
virtual Int_t Sizeof () const
 
void Streamer (TBuffer &) override
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from TObject
 TObject ()
 
 TObject (const TObject &object)
 
virtual ~TObject ()
 
void AbstractMethod (const char *method) const
 
virtual void AppendPad (Option_t *option="")
 
ULong_t CheckedHash ()
 
virtual const char * ClassName () const
 
virtual void Delete (Option_t *option="")
 
virtual void DrawClass () const
 
virtual TObject * DrawClone (Option_t *option="") const
 
virtual void Dump () const
 
virtual void Error (const char *method, const char *msgfmt,...) const
 
virtual void Execute (const char *method, const char *params, Int_t *error=nullptr)
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr)
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 
virtual TObject * FindObject (const char *name) const
 
virtual TObject * FindObject (const TObject *obj) const
 
virtual Option_t * GetDrawOption () const
 
virtual const char * GetIconName () const
 
virtual Option_t * GetOption () const
 
virtual UInt_t GetUniqueID () const
 
virtual Bool_t HandleTimer (TTimer *timer)
 
Bool_t HasInconsistentHash () const
 
virtual void Info (const char *method, const char *msgfmt,...) const
 
virtual Bool_t InheritsFrom (const char *classname) const
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 
virtual void Inspect () const
 
void InvertBit (UInt_t f)
 
Bool_t IsDestructed () const
 
virtual Bool_t IsEqual (const TObject *obj) const
 
virtual Bool_t IsFolder () const
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
void MayNotUse (const char *method) const
 
virtual Bool_t Notify ()
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, void *vp)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, void *vp)
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *vp)
 
void * operator new[] (size_t sz)
 
void * operator new[] (size_t sz, void *vp)
 
TObject & operator= (const TObject &rhs)
 
virtual void Pop ()
 
virtual Int_t Read (const char *name)
 
virtual void RecursiveRemove (TObject *obj)
 
void ResetBit (UInt_t f)
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 
virtual void SetDrawOption (Option_t *option="")
 
virtual void SetUniqueID (UInt_t uid)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void UseCurrentStyle ()
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const
 
- Public Member Functions inherited from TAttLine
 TAttLine ()
 
 TAttLine (Color_t lcolor, Style_t lstyle, Width_t lwidth)
 
virtual ~TAttLine ()
 
void Copy (TAttLine &attline) const
 
Int_t DistancetoLine (Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
 
virtual Color_t GetLineColor () const
 
virtual Style_t GetLineStyle () const
 
virtual Width_t GetLineWidth () const
 
virtual void Modify ()
 
virtual void ResetAttLine (Option_t *option="")
 
virtual void SaveLineAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
 
virtual void SetLineAttributes ()
 
virtual void SetLineColor (Color_t lcolor)
 
virtual void SetLineColorAlpha (Color_t lcolor, Float_t lalpha)
 
virtual void SetLineStyle (Style_t lstyle)
 
virtual void SetLineWidth (Width_t lwidth)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from TAttFill
 TAttFill ()
 
 TAttFill (Color_t fcolor, Style_t fstyle)
 
virtual ~TAttFill ()
 
void Copy (TAttFill &attfill) const
 
virtual Color_t GetFillColor () const
 
virtual Style_t GetFillStyle () const
 
virtual Bool_t IsTransparent () const
 
virtual void Modify ()
 
virtual void ResetAttFill (Option_t *option="")
 
virtual void SaveFillAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
 
virtual void SetFillAttributes ()
 
virtual void SetFillColor (Color_t fcolor)
 
virtual void SetFillColorAlpha (Color_t fcolor, Float_t falpha)
 
virtual void SetFillStyle (Style_t fstyle)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from TAttMarker
 TAttMarker ()
 
 TAttMarker (Color_t color, Style_t style, Size_t msize)
 
virtual ~TAttMarker ()
 
void Copy (TAttMarker &attmarker) const
 
virtual Color_t GetMarkerColor () const
 
virtual Size_t GetMarkerSize () const
 
virtual Style_t GetMarkerStyle () const
 
virtual void Modify ()
 
virtual void ResetAttMarker (Option_t *toption="")
 
virtual void SaveMarkerAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
 
virtual void SetMarkerAttributes ()
 
virtual void SetMarkerColor (Color_t mcolor=1)
 
virtual void SetMarkerColorAlpha (Color_t mcolor, Float_t malpha)
 
virtual void SetMarkerSize (Size_t msize=1)
 
virtual void SetMarkerStyle (Style_t mstyle=1)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 

Static Public Member Functions

static TString get_name_of_isotope_gaussian (int z, int a)
 
static TString get_name_of_multifit (int z)
 
static TString get_root_name_of_isotope_gaussian (int z)
 
static void UnDrawAnyGaussian (int z, TVirtualPad *pad=gPad)
 Remove the graphical representation of any gaussian for this Z from the given pad. More...
 
static void UnDrawGaussian (int z, int a, TVirtualPad *pad=gPad)
 
- Static Public Member Functions inherited from TF1
static void AbsValue (Bool_t reject=kTRUE)
 
static void CalcGaussLegendreSamplingPoints (Int_t num, Double_t *x, Double_t *w, Double_t eps=3.0e-11)
 
static TClass * Class ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static Bool_t DefaultAddToGlobalList (Bool_t on=kTRUE)
 
static Double_t DerivativeError ()
 
static TF1 * GetCurrent ()
 
static void InitStandardFunctions ()
 
static Bool_t RejectedPoint ()
 
static void RejectPoint (Bool_t reject=kTRUE)
 
static void SetCurrent (TF1 *f1)
 
- Static Public Member Functions inherited from TNamed
static TClass * Class ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from TObject
static TClass * Class ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static Longptr_t GetDtorOnly ()
 
static Bool_t GetObjectStat ()
 
static void SetDtorOnly (void *obj)
 
static void SetObjectStat (Bool_t stat)
 
- Static Public Member Functions inherited from TAttLine
static TClass * Class ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from TAttFill
static TClass * Class ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from TAttMarker
static TClass * Class ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static Width_t GetMarkerLineWidth (Style_t style)
 
static Style_t GetMarkerStyleBase (Style_t style)
 

Additional Inherited Members

- Public Types inherited from TF1
enum class  EAddToList { kDefault , kAdd , kNo }
 
enum  EStatusBits
 
- Public Types inherited from TObject
enum  EDeprecatedStatusBits
 
enum  EStatusBits
 
- Public Attributes inherited from TF1
 kNotDraw
 
 kNotGlobal
 
- Public Attributes inherited from TObject
 kBitMask
 
 kCanDelete
 
 kCannotPick
 
 kHasUUID
 
 kInconsistent
 
 kInvalidObject
 
 kIsOnHeap
 
 kIsReferenced
 
 kMustCleanup
 
 kNoContextMenu
 
 kNotDeleted
 
 kObjInCanvas
 
 kOverwrite
 
 kSingleKey
 
 kWriteDelete
 
 kZombie
 
- Protected Types inherited from TF1
enum  EFType
 
- Protected Member Functions inherited from TF1
 TF1 (EFType functionType, const char *name, Double_t xmin, Double_t xmax, Int_t npar, Int_t ndim, EAddToList addToGlobList, TF1Parameters *params=nullptr, TF1FunctorPointer *functor=nullptr)
 
Bool_t ComputeCdfTable (Option_t *opt)
 
virtual TH1 * DoCreateHistogram (Double_t xmin, Double_t xmax, Bool_t recreate=kFALSE)
 
void DoInitialize (EAddToList addToGlobList)
 
virtual Double_t GetMinMaxNDim (Double_t *x, Bool_t findmax, Double_t epsilon=0, Int_t maxiter=0) const
 
virtual void GetRange (Double_t *xmin, Double_t *xmax) const
 
void IntegrateForNormalization ()
 
- Protected Member Functions inherited from TObject
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 
void MakeZombie ()
 
- Protected Attributes inherited from TF1
std::vector< Double_t > fAlpha
 
std::vector< Double_t > fBeta
 
Double_t fChisquare
 
std::unique_ptr< TF1AbsComposition > fComposition
 
std::unique_ptr< TFormula > fFormula
 
std::unique_ptr< TF1FunctorPointer > fFunctor
 
std::vector< Double_t > fGamma
 
TH1 * fHistogram
 
std::vector< Double_t > fIntegral
 
Double_t fMaximum
 
std::unique_ptr< TMethodCall > fMethodCall
 
Double_t fMinimum
 
Int_t fNDF
 
Int_t fNdim
 
Bool_t fNormalized
 
Double_t fNormIntegral
 
Int_t fNpar
 
Int_t fNpfits
 
Int_t fNpx
 
std::unique_ptr< TF1Parameters > fParams
 
TObject * fParent
 
std::vector< Double_t > fParErrors
 
std::vector< Double_t > fParMax
 
std::vector< Double_t > fParMin
 
std::vector< Double_t > fSave
 
EFType fType
 
Double_t fXmax
 
Double_t fXmin
 
 kCompositionFcn
 
 kFormula
 
 kInterpreted
 
 kPtrScalarFreeFcn
 
 kTemplScalar
 
 kTemplVec
 
- Protected Attributes inherited from TNamed
TString fName
 
TString fTitle
 
- Protected Attributes inherited from TObject
 kOnlyPrepStep
 
- Protected Attributes inherited from TAttLine
Color_t fLineColor
 
Style_t fLineStyle
 
Width_t fLineWidth
 
- Protected Attributes inherited from TAttFill
Color_t fFillColor
 
Style_t fFillStyle
 
- Protected Attributes inherited from TAttMarker
Color_t fMarkerColor
 
Size_t fMarkerSize
 
Style_t fMarkerStyle
 
- Static Protected Attributes inherited from TF1
static std::atomic< Bool_t > fgAbsValue
 
static std::atomic< Bool_t > fgAddToGlobList
 
static TF1 * fgCurrent
 
static Bool_t fgRejectPoint
 

Constructor & Destructor Documentation

◆ KVMultiGaussIsotopeFit() [1/5]

KVMultiGaussIsotopeFit::KVMultiGaussIsotopeFit ( )
inline

Definition at line 108 of file KVMultiGaussIsotopeFit.h.

◆ KVMultiGaussIsotopeFit() [2/5]

KVMultiGaussIsotopeFit::KVMultiGaussIsotopeFit ( int  z,
std::vector< int >  alist 
)
inline

This constructor cannot be used to perform fits, but can be used to UnDraw() an existing fit

Definition at line 109 of file KVMultiGaussIsotopeFit.h.

◆ KVMultiGaussIsotopeFit() [3/5]

KVMultiGaussIsotopeFit::KVMultiGaussIsotopeFit ( int  z,
int  Ngauss,
double  PID_min,
double  PID_max,
const KVNumberList &  alist,
std::vector< double >  pidlist 
)

Constructor used to initialize and prepare a new fit of isotope PID spectrum

Parameters
[in]zatomic number \(Z\) of element to fit
[in]Ngaussnumber of gaussians to use in the fit (corresponds to number of isotopes in PID spectrum)
[in]PID_min,PID_maxlimits of PID spectrum to which fit is performed
[in]alistordered list of increasing \(A\)-values of isotopes in PID spectrum
[in]pidlistcorresponding initial values of PID for centroid of each isotope-gaussian in PID spectrum

Definition at line 113 of file KVMultiGaussIsotopeFit.cpp.

◆ KVMultiGaussIsotopeFit() [4/5]

KVMultiGaussIsotopeFit::KVMultiGaussIsotopeFit ( int  z,
int  Ngauss,
double  PID_min,
double  PID_max,
const KVNumberList &  alist,
double  bkg_cst,
double  bkg_slp,
double  gaus_wid,
double  pidvsa_a0,
double  pidvsa_a1,
double  pidvsa_a2 
)

Constructor which can be used with existing fit results (not to perform new fits)

Use SetGaussianNorm() to set the normalisation parameters for each gaussian

Parameters
[in]zatomic number \(Z\) of element in fit
[in]Ngaussnumber of gaussians used in the fit (corresponds to number of isotopes in PID spectrum)
[in]PID_min,PID_maxlimits of PID spectrum to which fit was performed
[in]alistordered list of increasing \(A\)-values of isotopes in PID spectrum
[in]bkg_cst,bkg_slpconstant and slope of fitted exponential background function
[in]gaus_widwidth of gaussians used in fit
[in]pidvsa_a0,pidvsa_a1,pidvsa_a2parameters of polynomial fit to PID-coordinate \(A\)-dependence

Definition at line 184 of file KVMultiGaussIsotopeFit.cpp.

◆ KVMultiGaussIsotopeFit() [5/5]

KVMultiGaussIsotopeFit::KVMultiGaussIsotopeFit ( int  z,
const KVNameValueList &  fitparams 
)

initialize from previous fit with parameters stored in KVNameValueList

Definition at line 232 of file KVMultiGaussIsotopeFit.cpp.

Member Function Documentation

◆ DrawFitWithGaussians()

void KVMultiGaussIsotopeFit::DrawFitWithGaussians ( Option_t *  opt = "",
const TString &  fit_title = "" 
) const

Draw the overall fit plus the individual gaussians for each isotope

Parameters
[in]optdrawing option, will be used for main fit (could be "same")
[in]fit_titleoptional, if given will be used as title of fit function (displayed in TLegend and also above frame in TPad with option 'show histogram title')

Definition at line 344 of file KVMultiGaussIsotopeFit.cpp.

◆ FitCentroids()

void KVMultiGaussIsotopeFit::FitCentroids ( )

Definition at line 265 of file KVMultiGaussIsotopeFit.cpp.

◆ get_name_of_isotope_gaussian()

static TString KVMultiGaussIsotopeFit::get_name_of_isotope_gaussian ( int  z,
int  a 
)
inlinestatic

Definition at line 219 of file KVMultiGaussIsotopeFit.h.

◆ get_name_of_multifit()

static TString KVMultiGaussIsotopeFit::get_name_of_multifit ( int  z)
inlinestatic

Definition at line 215 of file KVMultiGaussIsotopeFit.h.

◆ get_root_name_of_isotope_gaussian()

static TString KVMultiGaussIsotopeFit::get_root_name_of_isotope_gaussian ( int  z)
inlinestatic

Definition at line 223 of file KVMultiGaussIsotopeFit.h.

◆ GetA()

std::optional< int > KVMultiGaussIsotopeFit::GetA ( double  PID,
double &  P 
) const

Probabilistic method to determine \(A\) from PID.

The A returned will be drawn at random from the probability distribution given by the sum of all gaussians (and the background) for the given PID.

The result of the draw may be that this PID is part of the background noise: in this case we do not return a value (returns std::nullopt : returned value will evaluate as false).

P is the probability of the chosen result.

Parameters
[in]PIDPID value from \(Z\) identification
[out]Pprobablility the returned value of \(A\) is correct
Returns
randomly drawn \(A\) for given PID
Note
The identification functional is fitted to histogrammed data, therefore the resulting complete function should always evaluate to some finite value \(\geq 1\). If this is not the case for certain values of PID, it suggests that the 'background' is not well fitted and the functional cannot be used for identification (gives garbage results). In this case we do not return a value.

Definition at line 512 of file KVMultiGaussIsotopeFit.cpp.

◆ GetADistribution()

std::optional< std::map< int, double > > KVMultiGaussIsotopeFit::GetADistribution ( double  PID) const

For the given PID, the map is filled with all possible values of \(A\)

Note
The identification functional is fitted to histogrammed data, therefore the resulting complete function should always evaluate to some finite value \(\geq 1\). If this is not the case for certain values of PID, it suggests that the 'background' is not well fitted and the functional cannot be used for identification (gives garbage results). In this case we do not return a value.
Returns
std::map containing probability distribution \(P(A|PID)\)

Definition at line 465 of file KVMultiGaussIsotopeFit.cpp.

◆ GetAlist()

std::vector<int> KVMultiGaussIsotopeFit::GetAlist ( ) const
inline
Returns
vector of ordered increasing \(A\)-values of isotopes in fit

Definition at line 126 of file KVMultiGaussIsotopeFit.h.

◆ GetBackgroundConstant()

double KVMultiGaussIsotopeFit::GetBackgroundConstant ( ) const
inline
Returns
fitted parameter constant term \(b_0\) in exponential background

Definition at line 228 of file KVMultiGaussIsotopeFit.h.

◆ GetBackgroundSlope()

double KVMultiGaussIsotopeFit::GetBackgroundSlope ( ) const
inline
Returns
fitted parameter slope term \(b_1\) in exponential background

Definition at line 233 of file KVMultiGaussIsotopeFit.h.

◆ GetCentroid()

double KVMultiGaussIsotopeFit::GetCentroid ( int  i) const
Returns
the fitted centroid position of the ith gaussian (i=1,2,...,Niso) i.e. \(f(A_i) = a_0 + a_1 A_i + a_2 A_i^2\)

Definition at line 599 of file KVMultiGaussIsotopeFit.cpp.

◆ GetGaussianA()

int KVMultiGaussIsotopeFit::GetGaussianA ( int  i) const
inline

Definition at line 250 of file KVMultiGaussIsotopeFit.h.

◆ GetGaussianNorm()

double KVMultiGaussIsotopeFit::GetGaussianNorm ( int  i) const
inline

Definition at line 255 of file KVMultiGaussIsotopeFit.h.

◆ GetGaussianWidth()

double KVMultiGaussIsotopeFit::GetGaussianWidth ( int  ) const
inline
Returns
the fitted width

Definition at line 245 of file KVMultiGaussIsotopeFit.h.

◆ GetInterpolatedA()

double KVMultiGaussIsotopeFit::GetInterpolatedA ( double  PID) const
Returns
interpolated A from PID using the quadratic fit parameters analytic inversion of \(f(A_i) = a_0 + a_1 A_i + a_2 A_i^2\)

Definition at line 583 of file KVMultiGaussIsotopeFit.cpp.

◆ GetIsotopeIndexWithMaxYield()

int KVMultiGaussIsotopeFit::GetIsotopeIndexWithMaxYield ( ) const
inline
Returns
index of isotope with largest yield

Definition at line 203 of file KVMultiGaussIsotopeFit.h.

◆ GetIsotopeIndicesRankedByYield()

std::vector<int> KVMultiGaussIsotopeFit::GetIsotopeIndicesRankedByYield ( ) const
inline
Returns
vector of indices of gaussians ranked in order of decreasing yield

Definition at line 196 of file KVMultiGaussIsotopeFit.h.

◆ GetIsotopesRankedByYield()

std::vector<int> KVMultiGaussIsotopeFit::GetIsotopesRankedByYield ( ) const
inline
Returns
vector of \(A\) values of isotopes ranked in order of decreasing yield

Definition at line 183 of file KVMultiGaussIsotopeFit.h.

◆ GetIsotopeWithMaxYield()

int KVMultiGaussIsotopeFit::GetIsotopeWithMaxYield ( ) const
inline
Returns
\(A\) corresponding to isotope with largest yield

Definition at line 178 of file KVMultiGaussIsotopeFit.h.

◆ GetMaxSigma()

double KVMultiGaussIsotopeFit::GetMaxSigma ( ) const
inline

Definition at line 283 of file KVMultiGaussIsotopeFit.h.

◆ GetMeanA()

std::optional< double > KVMultiGaussIsotopeFit::GetMeanA ( double  PID) const

for a given PID, calculate the mean value of \(A\) from the weighted sum of all gaussians

Returns
mean value of \(A\)
Note
The identification functional is fitted to histogrammed data, therefore the resulting complete function should always evaluate to some finite value \(\geq 1\). If this is not the case for certain values of PID, it suggests that the 'background' is not well fitted and the functional cannot be used for identification (gives garbage results). In this case we do not return a value.

Definition at line 426 of file KVMultiGaussIsotopeFit.cpp.

◆ GetMinSigma()

double KVMultiGaussIsotopeFit::GetMinSigma ( ) const
inline

Definition at line 279 of file KVMultiGaussIsotopeFit.h.

◆ GetMostProbableA()

std::optional< int > KVMultiGaussIsotopeFit::GetMostProbableA ( double  PID,
double &  P 
) const

For a given PID, calculate the most probable value of \(A\), P is its probability.

Returns
most probable \(A\)
Note
The identification functional is fitted to histogrammed data, therefore the resulting complete function should always evaluate to some finite value \(\geq 1\). If this is not the case for certain values of PID, it suggests that the 'background' is not well fitted and the functional cannot be used for identification (gives garbage results). In this case we do not return a value.

Definition at line 385 of file KVMultiGaussIsotopeFit.cpp.

◆ GetNGaussians()

int KVMultiGaussIsotopeFit::GetNGaussians ( ) const
inline
Returns
number of gaussians used in fit (= number of identified isotopes)

Definition at line 240 of file KVMultiGaussIsotopeFit.h.

◆ GetPIDFromInterpolatedA()

double KVMultiGaussIsotopeFit::GetPIDFromInterpolatedA ( double  interpA)

The PID value stored in the KVIdentificationResult corresponding to this identification is the interpolated value of \(A\) calculated using GetInterpolatedA(). Calling this method with that value returns the actual PID value which can be compared with the gaussians of the fit.

Definition at line 615 of file KVMultiGaussIsotopeFit.cpp.

◆ GetPIDlist()

std::vector<double> KVMultiGaussIsotopeFit::GetPIDlist ( ) const
inline
Returns
vector of initial PID values corresponding to centroids of isotopes in fit

Definition at line 135 of file KVMultiGaussIsotopeFit.h.

◆ GetPIDmax()

double KVMultiGaussIsotopeFit::GetPIDmax ( ) const
inline

Definition at line 274 of file KVMultiGaussIsotopeFit.h.

◆ GetPIDmin()

double KVMultiGaussIsotopeFit::GetPIDmin ( ) const
inline

Definition at line 270 of file KVMultiGaussIsotopeFit.h.

◆ GetPIDvsAfit_a0()

double KVMultiGaussIsotopeFit::GetPIDvsAfit_a0 ( ) const
inline
Returns
constant term \(a_0\) in PID vs. A relation

Definition at line 149 of file KVMultiGaussIsotopeFit.h.

◆ GetPIDvsAfit_a1()

double KVMultiGaussIsotopeFit::GetPIDvsAfit_a1 ( ) const
inline
Returns
coefficient \(a_1\) of linear term in PID vs. A relation

Definition at line 154 of file KVMultiGaussIsotopeFit.h.

◆ GetPIDvsAfit_a2()

double KVMultiGaussIsotopeFit::GetPIDvsAfit_a2 ( ) const
inline
Returns
coefficient \(a_2\) of quadratic term in PID vs. A relation

Definition at line 159 of file KVMultiGaussIsotopeFit.h.

◆ GetProbability()

double KVMultiGaussIsotopeFit::GetProbability ( int  A,
double  PID 
) const
Parameters
[in]Aisotope mass number
[in]PIDvalue of PID associated with A
Returns
the probability that A is the correct mass number for a given PID value
zero if A is not associated with a Gaussian in the fit

Definition at line 562 of file KVMultiGaussIsotopeFit.cpp.

◆ GetRankedYields()

std::vector<double> KVMultiGaussIsotopeFit::GetRankedYields ( ) const
inline
Returns
vector of isotope yields ranked in order of decreasing yield

Definition at line 189 of file KVMultiGaussIsotopeFit.h.

◆ GetZ()

auto KVMultiGaussIsotopeFit::GetZ ( ) const
inline

Definition at line 122 of file KVMultiGaussIsotopeFit.h.

◆ InitializeParameterLimitsForNewFit()

void KVMultiGaussIsotopeFit::InitializeParameterLimitsForNewFit ( )

Definition at line 158 of file KVMultiGaussIsotopeFit.cpp.

◆ PositiveBkgSlope()

void KVMultiGaussIsotopeFit::PositiveBkgSlope ( bool  yes = true)

if yes=true, only explore positive values for background slope

if yes=false, only explore negative values

Definition at line 648 of file KVMultiGaussIsotopeFit.cpp.

◆ ReleaseCentroids()

void KVMultiGaussIsotopeFit::ReleaseCentroids ( )

Release the constraint on the positions of the centroids.

Definition at line 294 of file KVMultiGaussIsotopeFit.cpp.

◆ SetAlist()

void KVMultiGaussIsotopeFit::SetAlist ( const std::vector< int >  alist)
inline

Definition at line 131 of file KVMultiGaussIsotopeFit.h.

◆ SetFitRange()

void KVMultiGaussIsotopeFit::SetFitRange ( double  min,
double  max 
)

Change range of fit.

Definition at line 632 of file KVMultiGaussIsotopeFit.cpp.

◆ SetGaussianNorm()

void KVMultiGaussIsotopeFit::SetGaussianNorm ( int  i,
double  v 
)
inline

Definition at line 261 of file KVMultiGaussIsotopeFit.h.

◆ SetPIDlist()

void KVMultiGaussIsotopeFit::SetPIDlist ( const std::vector< double >  pidlist)
inline

Definition at line 140 of file KVMultiGaussIsotopeFit.h.

◆ SetSigmaLimits()

void KVMultiGaussIsotopeFit::SetSigmaLimits ( double  smin,
double  smax 
)
inline

Definition at line 287 of file KVMultiGaussIsotopeFit.h.

◆ UnDraw()

void KVMultiGaussIsotopeFit::UnDraw ( TVirtualPad *  pad = gPad) const

Remove the graphical representation of this fit from the given pad.

Definition at line 307 of file KVMultiGaussIsotopeFit.cpp.

◆ UnDrawAnyGaussian()

void KVMultiGaussIsotopeFit::UnDrawAnyGaussian ( int  z,
TVirtualPad *  pad = gPad 
)
static

Remove the graphical representation of any gaussian for this Z from the given pad.

Definition at line 323 of file KVMultiGaussIsotopeFit.cpp.

◆ UnDrawGaussian()

static void KVMultiGaussIsotopeFit::UnDrawGaussian ( int  z,
int  a,
TVirtualPad *  pad = gPad 
)
inlinestatic

Remove the graphical representation of the given gaussian from the given pad

Definition at line 167 of file KVMultiGaussIsotopeFit.h.

◆ UpdateGaussianCentroidParameters()

void KVMultiGaussIsotopeFit::UpdateGaussianCentroidParameters ( )

Required in case the attribution of masses to the gaussians changes.

Definition at line 251 of file KVMultiGaussIsotopeFit.cpp.