70 return p[0] +
p[1] *
x[0] +
p[2] *
x[0] *
x[0];
89 for (
int i = 1; i <= Ng; ++i) {
96 int get_gauss_norm_index(
int ig)
const
100 int get_mass_index(
int ig,
int ng)
const
104 int total_number_parameters(
int ng)
const
110 double PIDmin, PIDmax;
111 std::vector<int> Alist;
112 std::vector<double> PIDlist;
113 double min_sigma = 1.e-2;
114 double max_sigma = 1.e-1;
116 double evaluate_gaussian(
int i,
double pid)
const
119 return GetGaussianNorm(i) *
TMath::Gaus(pid, GetCentroid(i), GetGaussianWidth(i), kTRUE);
133 double pidvsa_a0,
double pidvsa_a1,
double pidvsa_a2);
136 void ReleaseCentroids()
144 double GetPIDvsAfit_a0()
const
149 double GetPIDvsAfit_a1()
const
154 double GetPIDvsAfit_a2()
const
162 static void UnDrawGaussian(
int z,
int a,
TVirtualPad* pad = gPad)
166 auto old_fit = pad->FindObject(get_name_of_isotope_gaussian(z, a));
167 if (old_fit)
delete old_fit;
169 static void UnDrawAnyGaussian(
int z,
TVirtualPad* pad = gPad)
173 TIter it(pad->GetListOfPrimitives());
176 while ((ob = it())) {
178 if (obname.
BeginsWith(get_root_name_of_isotope_gaussian(z))) to_delete.
Add(ob);
182 void DrawFitWithGaussians(
Option_t* opt =
"")
const;
184 int GetIsotopeWithMaxYield()
const
188 std::map<double, int> yields;
189 for (
int i = 1; i <= Niso; ++i) yields[GetGaussianNorm(i)] = Alist[i - 1];
192 auto it = yields.rbegin();
195 int GetIsotopeIndexWithMaxYield()
const
199 std::map<double, int> yields;
200 for (
int i = 1; i <= Niso; ++i) yields[GetGaussianNorm(i)] = i;
203 auto it = yields.rbegin();
206 int GetMostProbableA(
double PID,
double& P)
const;
207 double GetMeanA(
double PID)
const;
208 std::map<int, double> GetADistribution(
double PID)
const;
209 int GetA(
double PID,
double& P)
const;
210 double GetProbability(
int A,
double PID)
const;
211 double GetInterpolatedA(
double PID)
const
216 auto a = GetPIDvsAfit_a2();
217 auto b = GetPIDvsAfit_a1();
218 auto c = GetPIDvsAfit_a0() - PID;
222 static TString get_name_of_multifit(
int z)
224 return Form(
"multigauss_fit_Z=%d", z);
226 static TString get_name_of_isotope_gaussian(
int z,
int a)
228 return Form(
"gauss_fit_Z=%d_A=%d", z, a);
230 static TString get_root_name_of_isotope_gaussian(
int z)
232 return Form(
"gauss_fit_Z=%d_", z);
235 double GetBackgroundConstant()
const
240 double GetBackgroundSlope()
const
245 double GetCentroid(
int i)
const
248 assert(i > 0 && i <= Niso);
253 double GetPIDFromInterpolatedA(
double interpA)
262 int GetNGaussians()
const
267 double GetGaussianWidth(
int)
const
272 int GetGaussianA(
int i)
const
277 double GetGaussianNorm(
int i)
const
280 assert(i > 0 && i <= Niso);
283 void SetGaussianNorm(
int i,
double v)
286 assert(i > 0 && i <= Niso);
290 void SetFitRange(
double min,
double max);
292 double GetPIDmin()
const
296 double GetPIDmax()
const
301 double GetMinSigma()
const
305 double GetMaxSigma()
const
309 void SetSigmaLimits(
double smin,
double smax)