1 #ifndef __KVMULTIGAUSSISOTOPEFIT_H
2 #define __KVMULTIGAUSSISOTOPEFIT_H
66 return p[0] + p[1] *
x[0] + p[2] *
x[0] *
x[0];
83 double background =
TMath::Exp(p[fit_param_index::bkg_cst] + p[fit_param_index::bkg_slp] *
x[0]);
84 for (
int i = 1; i <= Ng; ++i) {
87 &p[fit_param_index::pidvsA_a0]), p[fit_param_index::gauss_wid],
kTRUE);
128 double pidvsa_a0,
double pidvsa_a1,
double pidvsa_a2);
162 if (old_fit)
delete old_fit;
168 TIter it(pad->GetListOfPrimitives());
171 while ((ob = it())) {
182 int GetA(
double PID,
double& P)
const;
197 return Form(
"multigauss_fit_Z=%d", z);
201 return Form(
"gauss_fit_Z=%d_A=%d", z,
a);
205 return Form(
"gauss_fit_Z=%d_", z);
221 assert(i > 0 && i <=
Niso);
234 assert(i > 0 && i <=
Niso);
240 assert(i > 0 && i <=
Niso);
#define ClassDef(name, id)
char * Form(const char *fmt,...)
Extended TList class which owns its objects by default.
Function for fitting PID mass spectra.
double FitFunc(double *x, double *p)
static TString get_name_of_isotope_gaussian(int z, int a)
double GetPIDvsAfit_a1() const
static TString get_name_of_multifit(int z)
int get_mass_index(int ig, int ng) const
double GetMinSigma() const
double GetGaussianWidth(int) const
static TString get_root_name_of_isotope_gaussian(int z)
double evaluate_gaussian(int i, double pid) const
double GetCentroid(int i) const
int Z
atomic number of the isotopes
KVMultiGaussIsotopeFit(int z, std::vector< int > alist)
void SetSigmaLimits(double smin, double smax)
int get_gauss_norm_index(int ig) const
std::map< int, double > GetADistribution(double PID) const
void SetFitRange(double min, double max)
Change range of fit.
double GetPIDvsAfit_a2() const
void SetGaussianNorm(int i, double v)
double GetInterpolatedA(double PID) const
int GetA(double PID, double &P) const
int total_number_parameters(int ng) const
int GetMostProbableA(double PID, double &P) const
double GetBackgroundSlope() const
double GetProbability(int A, double PID) const
double GetPIDvsAfit_a0() const
double GetGaussianNorm(int i) const
double GetBackgroundConstant() const
static void UnDrawAnyGaussian(int z, TVirtualPad *pad=gPad)
double centroid_fit(double *x, double *p)
int Niso
number of isotopes to fit = number of gaussians
double PIDmax
PID limits for current set of isotopes.
void UnDraw(TVirtualPad *pad=gPad) const
Remove the graphical representation of this fit from the given pad.
static void UnDrawGaussian(int z, int a, TVirtualPad *pad=gPad)
double GetMeanA(double PID) const
void DrawFitWithGaussians(Option_t *opt="") const
Draw the overall fit plus the individual gaussians for each isotope.
std::vector< int > Alist
list of masses of isotopes (in increasing order)
double GetMaxSigma() const
std::vector< double > PIDlist
list of initial centroid (PID) of each isotope (in increasing order)
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Strings used to represent a set of ranges of values.
virtual void Add(TObject *obj)
virtual Double_t GetParameter(const TString &name) const
virtual void SetParLimits(Int_t ipar, Double_t parmin, Double_t parmax)
virtual void SetParameter(const TString &name, Double_t value)
virtual const char * GetName() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Double_t Gaus(Double_t x, Double_t mean=0, Double_t sigma=1, Bool_t norm=kFALSE)
Double_t Sqrt(Double_t x)