14 PIDmin{PID_min}, PIDmax{PID_max},
15 Alist{alist.GetArray()},
25 SetParName(fit_param_index::bkg_slp,
"Bkg. slope");
26 SetParName(fit_param_index::gauss_wid,
"Sigma");
31 for (
int ig = 1; ig <=
Niso; ++ig) {
38 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,24,0)
53 pid_vs_a.
Fit(¢roidFit,
"N");
55 for (
int i = 0; i < 3; ++i) {
73 const KVNumberList& alist,
double bkg_cst,
double bkg_slp,
74 double gaus_wid,
double pidvsa_a0,
double pidvsa_a1,
double pidvsa_a2)
78 PIDmin{PID_min}, PIDmax{PID_max},
79 Alist{alist.GetArray()}
94 SetParName(fit_param_index::bkg_slp,
"Bkg. slope");
95 SetParName(fit_param_index::gauss_wid,
"Sigma");
97 for (
int ig = 1; ig <=
Niso; ++ig) {
102 for (
int i = 0; i < 3; ++i)
103 SetParName(fit_param_index::pidvsA_a0 + i,
Form(
"PIDvsA_a%d", i));
117 fitparams.GetDoubleValue(
"PIDmax"), fitparams.GetStringValue(
"Alist"),
118 fitparams.GetDoubleValue(
"Bkg_cst"), fitparams.GetDoubleValue(
"Bkg_slp"),
119 fitparams.GetDoubleValue(
"GausWid"),
120 fitparams.GetDoubleValue(
"PIDvsA_a0"),
121 fitparams.GetDoubleValue(
"PIDvsA_a1"),
122 fitparams.GetDoubleValue(
"PIDvsA_a2"))
125 for (
int ig = 1; ig <= fitparams.
GetIntValue(
"Ng"); ++ig)
139 if (old_fit)
delete old_fit;
184 auto total =
Eval(PID);
185 std::map<double, int> probabilities;
193 auto it = probabilities.rbegin();
211 auto total =
Eval(PID);
213 double amean(0), totprob(0);
220 return totprob > 0 ? amean / totprob : -1.;
238 auto total =
Eval(PID);
239 std::map<int, double> Adist;
277 auto total =
Eval(PID);
310 auto it = std::find(std::begin(
Alist), std::end(
Alist), A);
311 if (it != std::end(
Alist)) {
312 int ig = std::distance(std::begin(
Alist), it);
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
Function for fitting PID mass spectra.
static TString get_name_of_isotope_gaussian(int z, int a)
static TString get_name_of_multifit(int z)
int get_mass_index(int ig, int ng) const
double GetGaussianWidth(int) const
double evaluate_gaussian(int i, double pid) const
double GetCentroid(int i) const
int Z
atomic number of the isotopes
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.
void SetGaussianNorm(int i, double v)
int GetA(double PID, double &P) const
int GetMostProbableA(double PID, double &P) const
double GetProbability(int A, double PID) const
double GetGaussianNorm(int i) const
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)
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.
Int_t GetIntValue(const Char_t *name) const
Double_t GetDoubleValue(const Char_t *name) const
Strings used to represent a set of ranges of values.
virtual void SetLineStyle(Style_t lstyle)
virtual void SetLineWidth(Width_t lwidth)
virtual void SetLineColor(Color_t lcolor)
static const TArrayI & GetPalette()
virtual Double_t GetParameter(const TString &name) const
virtual void SetRange(Double_t xmin, Double_t xmax)
virtual void SetNpx(Int_t npx=100)
virtual void SetParLimits(Int_t ipar, Double_t parmin, Double_t parmax)
virtual void SetParName(Int_t ipar, const char *name)
virtual TF1 * DrawCopy(Option_t *option="") const
virtual void SetParameters(const Double_t *params)
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
virtual void SetParameter(const TString &name, Double_t value)
virtual void FixParameter(Int_t ipar, Double_t value)
virtual void AddPoint(Double_t x, Double_t y)
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0)
virtual void SetName(const char *name)
virtual TObject * FindObject(const char *name) const
virtual Double_t Uniform(Double_t x1, Double_t x2)