34 TPaveStats* stats = (TPaveStats*) pHist->FindObject(
"stats");
39 TVirtualPad* padsav = gPad;
40 auto styleSave = gStyle->GetOptStat();
44 pHist->SetStats(
true);
46 gStyle->SetOptStat(1);
50 TAxis*
x = pHist->GetXaxis();
51 TAxis*
y = pHist->GetYaxis();
52 TAxis* z = pHist->GetZaxis();
56 double rx[2]{
x->GetXmin(),
x->GetXmax()};
57 double ry[2]{
y->GetXmin(),
y->GetXmax()};
58 double rz[2]{z->GetXmin(), z->GetXmax()};
68 x->SetLimits(rx[0], rx[1]);
69 y->SetLimits(ry[0], ry[1]);
70 z->SetLimits(rz[0], rz[1]);
73 gStyle->SetOptStat(styleSave);
75 if (padsav) padsav->cd();
77 stats = (TPaveStats*) pHist->FindObject(
"stats");
108 auto retValue = std::tuple(0., -1.);
110 double xMin = pHist->GetXaxis()->GetXmin();
111 double xMax = pHist->GetXaxis()->GetXmax();
113 TF1 fit(
"FitKaniadakisGaussian",
"[2] * TMath::Exp(TMath::ASinH(-0.5*[4]*((x-[0])/[3])**2)/[4]) + 0.0*[1]", xMin,
116 fit.SetParName(0,
"fit_Mean");
117 fit.SetParName(1,
"fit_StdDev");
118 fit.SetParName(2,
"fit_Peak");
119 fit.SetParName(3,
"fit_Hwhm");
120 fit.SetParName(4,
"fit_k");
124 double mean = pHist->GetMean();
125 double peak = pHist->GetBinContent(pHist->GetMaximumBin());
126 double hwhm = pHist->GetStdDev();
128 fit.SetParameters(mean, hwhm, peak, hwhm, .001);
132 fit.SetParLimits(4, 0.00001, 5.);
136 for (
int i = 1; i <= pHist->GetNbinsX(); ++i) {
137 if (fabs(pHist->GetBinContent(i)) > 0.) {
144 pHist->Fit(&fit,
"Q");
145 TF1* f = pHist->GetFunction(
"FitKaniadakisGaussian");
151 f->SetParameter(1,
sqrt(f->CentralMoment(2, xMin, xMax)));
154 f->SetParameter(1, f->GetParameter(3));
156 f->SetParError(1, f->GetParError(3));
160 f->FixParameter(2, f->GetParameter(2));
161 f->FixParameter(3, f->GetParameter(3));
162 f->FixParameter(4, f->GetParameter(4));
163 retValue = std::tuple(f->GetParameter(0), f->GetParameter(1));
168 stats->SetX1NDC(0.7);
169 stats->SetY1NDC(0.5);
170 stats->SetOptStat(111110);
171 stats->SetOptFit(100001);