KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
bayesian_estimator.h
Go to the documentation of this file.
1 
4 #ifndef __bayesian_estimator_H
5 #define __bayesian_estimator_H
6 
7 #include "KVBase.h"
9 
10 #include <vector>
11 #include <numeric>
12 #include <TF2.h>
13 #include <TH1.h>
14 #include <TCanvas.h>
15 #include <TGraph.h>
16 #include <KVValueRange.h>
17 #include "TMath.h"
18 #include "TNamed.h"
19 
20 #include "Math/PdfFuncMathCore.h"
21 
22 namespace KVImpactParameters {
37  class gamma_kernel {
38  public:
39  double operator()(double X, double mean, double reduced_variance)
40  {
42  return ROOT::Math::gamma_pdf(X, mean / reduced_variance, reduced_variance);
43  }
44 
46  };
47 
62  class BD_kernel {
63  public:
64  double operator()(double X, double mean, double reduced_variance)
65  {
67  return ROOT::Math::binomial_pdf(TMath::Nint(X), 1. - reduced_variance, mean / (1. - reduced_variance));
68  }
69 
71  };
72 
87  class NBD_kernel {
88  public:
89  double operator()(double X, double mean, double reduced_variance)
90  {
92  return ROOT::Math::negative_binomial_pdf(TMath::Nint(X), 1. / reduced_variance, mean / (reduced_variance - 1.));
93  }
94 
96  };
97 
98 
212  template
213  <class FittingFunction, class FluctuationKernel>
214  class bayesian_estimator : public KVBase {
215 
216  FittingFunction theFitter;
217  FluctuationKernel theKernel;
218 
221  std::vector<double> sel_rapp;
233 
235 
236  impact_parameter_distribution fIPDist;// used to convert centrality to impact parameter
237 
238  double mean_X_vs_cb(double* x, double* par)
239  {
244 
245  theFitter.fill_params_from_array(par);
246  return theFitter.meanX(x[0]);
247  }
248  double mean_X_vs_b(double* x, double* par)
249  {
254 
255  theFitter.fill_params_from_array(par);
256  return theFitter.meanX(fIPDist.GetCentrality().Eval(x[0]));
257  }
258  double P_X_cb(double X, double cb)
259  {
263  return fIntegerVariable ? theKernel(TMath::Nint(X), theFitter.meanX(cb), theFitter.redVar(cb))
264  : theKernel(X, theFitter.meanX(cb), theFitter.redVar(cb));
265  }
266  double P_X_cb_for_TF2_obs_vs_b(double* x, double*)
267  {
271 
272  auto X = x[1];
273  auto cb = fIPDist.GetCentrality().Eval(x[0]);
274  return x[0] * theKernel(X, theFitter.meanX(cb), theFitter.redVar(cb));
275  }
276  double P_X_cb_for_integral(double* x, double* par)
277  {
284  return P_X_cb(par[0], x[0]);
285  }
286  double P_X_cb_for_X_integral(double* x, double* par)
287  {
295  return P_X_cb(x[0], par[0]);
296  }
297  double P_X_cb_for_X_integral_with_selection(double* x, double* par)
298  {
306 
307  int bin = histo->FindBin(x[0]);
308  if (bin < 1 || bin > histo->GetNbinsX()) return 0;
309  return sel_rapp[bin - 1] * P_X_cb(x[0], par[0]);
310  }
311  double cb_integrated_P_X(double* x, double* p)
312  {
320 
321  theFitter.fill_params_from_array(p);
322  p_X_cb_integrator.SetParameter(0, x[0]); // set value of X in integrand
323  return p_X_cb_integrator.Integral(0, 1, 1.e-4);
324  }
325  double P_X_from_fit(double* x, double* par)
326  {
331  p_X_cb_integrator.SetParameter(0, x[0]); // set value of X in integrand
332  return par[0] * p_X_cb_integrator.Integral(0, 1, 1.e-4);
333  }
334  double cb_dist_for_X_selection(double* x, double* p)
335  {
345 
347  double num = p_X_X_integrator.Integral(p[0], p[1], 1.e-4);
348  double den = fitted_P_X.Integral(p[0], p[1], 1.e-4);
349  if (den > 0) return num / den;
350  return 0;
351  }
352  double cb_dist_for_arb_X_selection(double* x, double* p)
353  {
362 
364  double num = p_X_X_integrator_with_selection.Integral(p[0], p[1], 1.e-4);
366 
367  return num;
368  }
369  double b_dist_for_X_selection(double* x, double* p)
370  {
380 
382  double num = p_X_X_integrator.Integral(p[0], p[1], 1.e-4);
383  return num * fIPDist.GetDifferentialCrossSection(x[0]);
384  }
385  double b_dist_for_arb_X_selection(double* x, double* p)
386  {
395 
397  double num = p_X_X_integrator_with_selection.Integral(p[0], p[1], 1.e-4);
398  return num * fIPDist.GetDifferentialCrossSection(x[0]);
399  }
400 
401  public:
402  bayesian_estimator(Bool_t integer_variable = false)
403  : KVBase(),
404  theFitter(),
405  p_X_cb_integrator("p_X_cb_integrator", this, &bayesian_estimator::P_X_cb_for_integral, 0, 1, 1),
406  P_X_fit_function("P_X_fit_function", this, &bayesian_estimator::cb_integrated_P_X, 0, 1, theFitter.npar()),
407  mean_X_vs_cb_function("mean_X_vs_cb", this, &bayesian_estimator::mean_X_vs_cb, 0, 1, theFitter.npar()),
408  mean_X_vs_b_function("mean_X_vs_b", this, &bayesian_estimator::mean_X_vs_b, 0, 20, theFitter.npar()),
409  p_X_X_integrator("p_X_X_integrator", this, &bayesian_estimator::P_X_cb_for_X_integral, 0, 1000, 1),
410  p_X_X_integrator_with_selection("p_X_X_integrator_with_selection", this, &bayesian_estimator::P_X_cb_for_X_integral_with_selection, 0, 1000, 1),
411  fitted_P_X("fitted_P_X", this, &bayesian_estimator::P_X_from_fit, 0, 1000, 1),
412  Cb_dist_for_X_select("Cb_dist_for_X_select", this, &bayesian_estimator::cb_dist_for_X_selection, 0, 1, 2),
413  Cb_dist_for_arb_X_select("Cb_dist_for_arb_X_select", this, &bayesian_estimator::cb_dist_for_arb_X_selection, 0, 1, 2),
414  B_dist_for_X_select("b_dist_for_X_select", this, &bayesian_estimator::b_dist_for_X_selection, 0, 20, 2),
415  B_dist_for_arb_X_select("b_dist_for_arb_X_select", this, &bayesian_estimator::b_dist_for_arb_X_selection, 0, 20, 2),
416  fIntegerVariable(integer_variable)
417  {
422  theFitter.set_par_names(P_X_fit_function);
423  theFitter.set_par_names(mean_X_vs_cb_function);
424  theFitter.set_par_names(mean_X_vs_b_function);
425  }
426 
427  bayesian_estimator(const FittingFunction& previous_fit, Bool_t integer_variable = false)
428  : KVBase(),
429  theFitter(previous_fit),
430  p_X_cb_integrator("p_X_cb_integrator", this, &bayesian_estimator::P_X_cb_for_integral, 0, 1, 1),
431  P_X_fit_function("P_X_fit_function", this, &bayesian_estimator::cb_integrated_P_X, 0, 1, theFitter.npar()),
432  mean_X_vs_cb_function("mean_X_vs_cb", this, &bayesian_estimator::mean_X_vs_cb, 0, 1, theFitter.npar()),
433  mean_X_vs_b_function("mean_X_vs_b", this, &bayesian_estimator::mean_X_vs_b, 0, 20, theFitter.npar()),
434  p_X_X_integrator("p_X_X_integrator", this, &bayesian_estimator::P_X_cb_for_X_integral, 0, 1000, 1),
435  p_X_X_integrator_with_selection("p_X_X_integrator_with_selection", this, &bayesian_estimator::P_X_cb_for_X_integral_with_selection, 0, 1000, 1),
436  fitted_P_X("fitted_P_X", this, &bayesian_estimator::P_X_from_fit, 0, 1000, 1),
437  Cb_dist_for_X_select("Cb_dist_for_X_select", this, &bayesian_estimator::cb_dist_for_X_selection, 0, 1, 2),
438  Cb_dist_for_arb_X_select("Cb_dist_for_arb_X_select", this, &bayesian_estimator::cb_dist_for_arb_X_selection, 0, 1, 2),
439  B_dist_for_X_select("b_dist_for_X_select", this, &bayesian_estimator::b_dist_for_X_selection, 0, 20, 2),
440  B_dist_for_arb_X_select("b_dist_for_arb_X_select", this, &bayesian_estimator::b_dist_for_arb_X_selection, 0, 20, 2),
441  fIntegerVariable(integer_variable)
442  {
448  theFitter.set_par_names(P_X_fit_function);
449  theFitter.set_par_names(mean_X_vs_cb_function);
450  theFitter.set_par_names(mean_X_vs_b_function);
451  }
452 
453  virtual ~bayesian_estimator() {}
454 
456  {
462 
463  histo = h;
464  histo->Scale(1. / h->Integral("width"));
465  }
466 
467  void FitHisto(TH1* h = nullptr)
468  {
479 
480  if (h) histo = h;
482  theFitter.set_initial_parameters(histo, P_X_fit_function);
484  }
485 
486  void SetIPDistParams(double sigmaR, double deltab)
487  {
504 
506  }
508  {
515  return fIPDist;
516  }
517 
518  void DrawMeanXvsCb(const TString& title = "", Color_t color = -1, Option_t* opt = "")
519  {
528 
529  GetMeanXvsCb().Draw();
530  }
532  {
539 
540  Double_t par[theFitter.npar()];
541  theFitter.fill_array_from_params(par);
543  return mean_X_vs_cb_function;
544  }
545  TGraph* GraphMeanXvsb(int npts = 500)
546  {
556 
557  Double_t par[theFitter.npar()];
558  theFitter.fill_array_from_params(par);
559  KVValueRange<double> brange(0, GetIPDist().GetB0() + 4 * GetIPDist().GetDeltaB());
561  auto gr = new TGraph;
562  for (int i = 0; i <= npts; ++i) gr->SetPoint(i, brange.ValueIofN(i, npts), mean_X_vs_b_function.Eval(brange.ValueIofN(i, npts)));
563  return gr;
564  }
566  {
571 
572  if (!histo) {
573  Warning("update_fit_params", "no histogram set with FitHisto(TH1*)");
574  return;
575  }
576  TF1* fit = (TF1*)histo->FindObject("P_X_fit_function");
577  if (!fit) {
578  Warning("update_fit_params", "no fit function found in histogram");
579  return;
580  }
581  theFitter.fill_params_from_array(fit->GetParameters());
582  }
583  double DrawCbDistForXSelection(double X1, double X2, Option_t* opt = "", Color_t color = kRed, const TString& title = "")
584  {
599  f->SetNpx(500);
600  f->SetLineColor(color);
601  f->SetMarkerColor(color);
602  f->SetLineWidth(2);
603  f->SetTitle(title);
604  return f->GetMaximum();
605  }
606  void DrawCbDistForSelection(TH1* sel, TH1* incl, double& mean_cb, double& sigma_cb, Option_t* opt = "", Color_t color = kRed, const TString& title = "")
607  {
622 
623  assert(sel->GetNbinsX() == incl->GetNbinsX());
624 
627  sel_rapp.assign((std::vector<double>::size_type)incl->GetNbinsX(), 0.0);
628  int first_bin(0), last_bin(0);
629  for (int i = 1; i <= incl->GetNbinsX(); ++i) {
630  if (incl->GetBinContent(i) > 0) {
631  sel_rapp[i - 1] = sel->GetBinContent(i) / incl->GetBinContent(i);
632  if (sel->GetBinContent(i) > 0) {
633  if (!first_bin) first_bin = i;
634  last_bin = i;
635  }
636  }
637  }
638  double Xmin = incl->GetBinLowEdge(first_bin);
639  double Xmax = incl->GetXaxis()->GetBinUpEdge(last_bin);
640 
641  histo = incl;
642  h_selection = sel;
643 
648 
650  double cb_mean(0), cb_sqrmean(0), sum_pcb(0);
651  TGraph* f = new TGraph;
652  for (int i = 0; i < 500; ++i) {//graph with 500 points
653  double cb = i / 499.;
654  double p_cb = Cb_dist_for_arb_X_select.Eval(cb);
655 
656  cb_mean += p_cb * cb;
657  cb_sqrmean += p_cb * cb * cb;
658  sum_pcb += p_cb;
659 
660  f->SetPoint(i, cb, p_cb);
661  }
662 
664  cb_sqrmean /= sum_pcb;
665  cb_mean /= sum_pcb;
666  mean_cb = cb_mean;
667  sigma_cb = TMath::Sqrt(cb_sqrmean - cb_mean * cb_mean);
668 
670  Info("DrawCbDistForSelection", "Xmin=%lf, Xmax=%lf, cb_mean=%lf, sigma_cb=%lf", Xmin, Xmax, cb_mean, sigma_cb);
671 
673  f->SetLineColor(color);
674  f->SetMarkerColor(color);
675  f->SetLineWidth(2);
676  f->SetTitle(title);
677  if (TString(opt) == "same") f->Draw("l");
678  else f->Draw("al");
679  }
680  double DrawBDistForXSelection(KVValueRange<double> Xrange, Option_t* opt = "", Color_t color = kRed, const TString& title = "")
681  {
698 
699  B_dist_for_X_select.SetParameters(Xrange.Min(), Xrange.Max());
700  TGraph* f = new TGraph;
701  double maxS = 0;
702  for (int i = 0; i < 500; ++i) {
703  double b = 2 * i * GetIPDist().GetB0() / 499.;
704  double sig = B_dist_for_X_select.Eval(b);
705  if (sig > maxS) maxS = sig;
706  f->SetPoint(i, b, sig);
707  }
708  f->SetLineColor(color);
709  f->SetMarkerColor(color);
710  f->SetLineWidth(2);
711  f->SetTitle(title);
712  if (TString(opt) == "same") f->Draw("l");
713  else f->Draw("al");
714  return maxS;
715  }
717  {
718  return B_dist_for_X_select;
719  }
721  {
734 
735 
736  B_dist_for_X_select.SetParameters(Xrange.Min(), Xrange.Max());
737  TGraph* f = new TGraph;
738  for (int i = 0; i < npts; ++i) {
739  double b = 2 * i * GetIPDist().GetB0() / 499.;
740  double sig = B_dist_for_X_select.Eval(b);
741  f->SetPoint(i, b, sig);
742  }
743  f->SetLineWidth(2);
744  return f;
745  }
746  void DrawBDistForSelection(TH1* sel, TH1* incl, double& mean, double& sigma, Option_t* opt = "", Color_t color = kRed, const TString& title = "")
747  {
767 
768 
769  assert(sel->GetNbinsX() == incl->GetNbinsX());
770 
771  sel_rapp.assign((std::vector<double>::size_type)incl->GetNbinsX(), 0.0);
772  int first_bin(0), last_bin(0);
773  for (int i = 1; i <= incl->GetNbinsX(); ++i) {
774  if (incl->GetBinContent(i) > 0) {
775  sel_rapp[i - 1] = sel->GetBinContent(i) / incl->GetBinContent(i);
776  if (sel->GetBinContent(i) > 0) {
777  if (!first_bin) first_bin = i;
778  last_bin = i;
779  }
780  }
781  }
782  double Xmin = incl->GetBinLowEdge(first_bin);
783  double Xmax = incl->GetXaxis()->GetBinUpEdge(last_bin);
784 
785  histo = incl;
786  h_selection = sel;
787 
789  B_dist_for_arb_X_select.SetRange(0, 2 * GetIPDist().GetB0());
791 
792  double bmean(0), bsqrmean(0), sigtot(0);
793  TGraph* f = new TGraph;
794  for (int i = 0; i < 500; ++i) {
795  double b = 2 * i * GetIPDist().GetB0() / 499.;
796  double sig = B_dist_for_arb_X_select.Eval(b);
797  bmean += sig * b;
798  bsqrmean += sig * b * b;
799  sigtot += sig;
800  f->SetPoint(i, b, sig);
801  }
802  f->SetLineColor(color);
803  f->SetMarkerColor(color);
804  f->SetLineWidth(2);
805  f->SetTitle(title);
806  mean = bmean / sigtot;
807  bsqrmean /= sigtot;
808  sigma = TMath::Sqrt(bsqrmean - mean * mean);
809  if (TString(opt) == "same") f->Draw("l");
810  else f->Draw("al");
811  }
812 
813  void GetMeanAndSigmaBDistForSelection(TH1* sel, TH1* incl, double& mean, double& sigma)
814  {
831 
832 
833  assert(sel->GetNbinsX() == incl->GetNbinsX());
834 
835  sel_rapp.assign((std::vector<double>::size_type)incl->GetNbinsX(), 0.0);
836  int first_bin(0), last_bin(0);
837  for (int i = 1; i <= incl->GetNbinsX(); ++i) {
838  if (incl->GetBinContent(i) > 0) {
839  sel_rapp[i - 1] = sel->GetBinContent(i) / incl->GetBinContent(i);
840  if (sel->GetBinContent(i) > 0) {
841  if (!first_bin) first_bin = i;
842  last_bin = i;
843  }
844  }
845  }
846  double Xmin = incl->GetBinLowEdge(first_bin);
847  double Xmax = incl->GetXaxis()->GetBinUpEdge(last_bin);
848 
849  histo = incl;
850  h_selection = sel;
851 
853  mean = B_dist_for_arb_X_select.Mean(0, 20);
854  double var = B_dist_for_arb_X_select.Variance(0, 20);
855  sigma = TMath::Sqrt(var);
856  }
857 
858  void GetMeanAndSigmaBDistForXSelection(double X1, double X2, double& mean, double& sigma)
859  {
874 
875 
877  mean = B_dist_for_X_select.Mean(0, 20);
879  }
880  void DrawFittedP_X(double norm = 1.0, Option_t* opt = "", Color_t color = kRed, const TString& title = "")
881  {
888 
889  TF1* f = GetFittedP_X(norm)->DrawCopy(opt);
890  f->SetNpx(500);
891  f->SetLineColor(color);
892  f->SetLineWidth(2);
893  f->SetTitle(title);
894  }
895  TF1* GetFittedP_X(double norm = 1.0)
896  {
901  fitted_P_X.SetParameter(0, norm);
902  return &fitted_P_X;
903  }
904  TGraph* GraphP_XForGivenB(double b, KVValueRange<double> Xrange, int npts = 500)
905  {
912  auto graph = new TGraph;
913  for (int i = 0; i < npts; ++i) graph->SetPoint(i, Xrange.ValueIofN(i, npts), p_X_X_integrator.Eval(Xrange.ValueIofN(i, npts)));
914  return graph;
915  }
916  void Print(Option_t* = "") const
917  {
919  theFitter.print_fit_params();
920  }
921  void DrawNormalisedMeanXvsb(const TString& title, Color_t color, Option_t* opt)
922  {
938 
939 
940  theFitter.backup_params();
941  theFitter.normalise_shape_function();
942  Double_t par[5];
943  theFitter.fill_array_from_params(par);
944  mean_X_vs_b_function.SetRange(0, GetIPDist().GetB0() + 2 * GetIPDist().GetDeltaB());
946  TF1* copy = mean_X_vs_b_function.DrawCopy(opt);
947  if (!title.IsNull()) copy->SetTitle(title);
948  if (color >= 0) copy->SetLineColor(color);
949  theFitter.restore_params();
950  }
951 
953  {
956 
957  auto jpd = new TF2("joint_proba_dist", this, &bayesian_estimator::P_X_cb_for_TF2_obs_vs_b,
958  b_range.Min(), b_range.Max(), X_range.Min(), X_range.Max(), 0);
959  return jpd;
960  }
961 
962  ClassDef(bayesian_estimator, 1) //Estimate impact parameter distribution by fits to data
963  };
964 
965 }
966 
967 #endif
#define b(i)
#define f(i)
bool Bool_t
double Double_t
short Color_t
const char Option_t
#define ClassDef(name, id)
Base class for KaliVeda framework.
Definition: KVBase.h:141
Fluctuation kernel using binomial distribution for use with bayesian_estimator.
double operator()(double X, double mean, double reduced_variance)
Fluctuation kernel using negative binomial distribution for use with bayesian_estimator.
double operator()(double X, double mean, double reduced_variance)
Impact parameter distribution reconstruction from experimental data.
double P_X_cb_for_integral(double *x, double *par)
impact_parameter_distribution fIPDist
void DrawBDistForSelection(TH1 *sel, TH1 *incl, double &mean, double &sigma, Option_t *opt="", Color_t color=kRed, const TString &title="")
void DrawCbDistForSelection(TH1 *sel, TH1 *incl, double &mean_cb, double &sigma_cb, Option_t *opt="", Color_t color=kRed, const TString &title="")
double mean_X_vs_b(double *x, double *par)
void GetMeanAndSigmaBDistForXSelection(double X1, double X2, double &mean, double &sigma)
double DrawBDistForXSelection(KVValueRange< double > Xrange, Option_t *opt="", Color_t color=kRed, const TString &title="")
void GetMeanAndSigmaBDistForSelection(TH1 *sel, TH1 *incl, double &mean, double &sigma)
bayesian_estimator(Bool_t integer_variable=false)
double cb_dist_for_X_selection(double *x, double *p)
void SetIPDistParams(double sigmaR, double deltab)
double P_X_cb_for_TF2_obs_vs_b(double *x, double *)
double P_X_from_fit(double *x, double *par)
double b_dist_for_arb_X_selection(double *x, double *p)
double DrawCbDistForXSelection(double X1, double X2, Option_t *opt="", Color_t color=kRed, const TString &title="")
bayesian_estimator(const FittingFunction &previous_fit, Bool_t integer_variable=false)
double b_dist_for_X_selection(double *x, double *p)
impact_parameter_distribution & GetIPDist()
double cb_integrated_P_X(double *x, double *p)
double P_X_cb_for_X_integral(double *x, double *par)
void DrawNormalisedMeanXvsb(const TString &title, Color_t color, Option_t *opt)
double cb_dist_for_arb_X_selection(double *x, double *p)
double mean_X_vs_cb(double *x, double *par)
TGraph * GraphBDistForXSelection(KVValueRange< double > Xrange, int npts=500)
double P_X_cb_for_X_integral_with_selection(double *x, double *par)
TGraph * GraphP_XForGivenB(double b, KVValueRange< double > Xrange, int npts=500)
TF2 * GetJointProbabilityDistribution(KVValueRange< double > b_range, KVValueRange< double > X_range)
void DrawMeanXvsCb(const TString &title="", Color_t color=-1, Option_t *opt="")
void DrawFittedP_X(double norm=1.0, Option_t *opt="", Color_t color=kRed, const TString &title="")
Fluctuation kernel using gamma distribution for use with bayesian_estimator.
double operator()(double X, double mean, double reduced_variance)
Class implementing parametrizable impact parameter distributions.
void SetDeltaB_WithConstantCrossSection(Double_t deltab, Double_t sigmaR=0)
Range of values specified by minimum, maximum.
Definition: KVValueRange.h:17
ValueType Max() const
Definition: KVValueRange.h:46
ValueType ValueIofN(Int_t i, Int_t n) const
Definition: KVValueRange.h:58
ValueType Min() const
Definition: KVValueRange.h:42
virtual void SetLineColor(Color_t lcolor)
virtual Double_t GetBinLowEdge(Int_t bin) const
virtual Double_t GetBinUpEdge(Int_t bin) const
virtual TH1 * GetHistogram() const
virtual void SetTitle(const char *title="")
virtual void SetRange(Double_t xmin, Double_t xmax)
virtual Double_t Mean(Double_t a, Double_t b, const Double_t *params=0, Double_t epsilon=0.000001)
virtual Double_t Variance(Double_t a, Double_t b, const Double_t *params=0, Double_t epsilon=0.000001)
virtual Double_t Integral(Double_t a, Double_t b, Double_t epsrel=1.e-12)
virtual void Draw(Option_t *option="")
virtual TF1 * DrawCopy(Option_t *option="") const
virtual void SetParameters(const Double_t *params)
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 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 SetPoint(Int_t i, Double_t x, Double_t y)
TAxis * GetXaxis()
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
virtual Int_t GetNbinsX() const
virtual TObject * FindObject(const char *name) const
virtual Double_t GetBinLowEdge(Int_t bin) const
virtual Double_t Integral(Int_t binx1, Int_t binx2, Option_t *option="") const
virtual Double_t GetBinContent(Int_t bin) const
virtual void Scale(Double_t c1=1, Option_t *option="")
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
virtual void Warning(const char *method, const char *msgfmt,...) const
virtual void Info(const char *method, const char *msgfmt,...) const
Bool_t IsNull() const
double binomial_pdf(unsigned int k, double p, unsigned int n)
double negative_binomial_pdf(unsigned int k, double p, double n)
double gamma_pdf(double x, double alpha, double theta, double x0=0)
const Double_t sigma
Double_t x[n]
TGraphErrors * gr
TH1 * h
def fit(model, train_loader, val_loader, num_epochs, batch_size, optimizer, criterion, save_best, scheduler)
Int_t Nint(T x)
Double_t Sqrt(Double_t x)