549 class DifferentDimension:
public std::exception {};
550 class DifferentNumberOfBins:
public std::exception {};
551 class DifferentAxisLimits:
public std::exception {};
552 class DifferentBinLimits:
public std::exception {};
553 class DifferentLabels:
public std::exception {};
564 fFunctions =
new TList;
570 fTsumw = fTsumw2=fTsumwx=fTsumwx2=0;
575 fBinStatErrOpt = kNormal;
577 fYaxis.SetName(
"yaxis");
578 fZaxis.SetName(
"zaxis");
579 fXaxis.SetParent(
this);
580 fYaxis.SetParent(
this);
581 fZaxis.SetParent(
this);
591 if (!TestBit(kNotDeleted)) {
608 while ((obj = fFunctions->First())) {
609 while(fFunctions->Remove(obj)) { }
610 if (!obj->
TestBit(kNotDeleted)) {
620 fDirectory->Remove(
this);
650 if (nbins <= 0) {
Warning(
"TH1",
"nbins is <=0 - set to nbins = 1"); nbins = 1; }
671 if (nbins <= 0) {
Warning(
"TH1",
"nbins is <=0 - set to nbins = 1"); nbins = 1; }
694 if (nbins <= 0) {
Warning(
"TH1",
"nbins is <=0 - set to nbins = 1"); nbins = 1; }
788 Error(
"Add",
"Attempt to add a non-existing function");
808 for (
Int_t i = 0; i < 10; ++i) s1[i] = 0;
814 Int_t bin, binx, biny, binz;
819 for (binz = 0; binz < ncellsz; ++binz) {
821 for (biny = 0; biny < ncellsy; ++biny) {
823 for (binx = 0; binx < ncellsx; ++binx) {
827 bin = binx + ncellsx * (biny + ncellsy * binz);
874 Error(
"Add",
"Attempt to add a non-existing histogram");
885 }
catch(DifferentNumberOfBins&) {
887 Info(
"Add",
"Attempt to add histograms with different number of bins - trying to use TH1::Merge");
889 Error(
"Add",
"Attempt to add histograms with different number of bins : nbins h1 = %d , nbins h2 = %d",
GetNbinsX(), h1->
GetNbinsX());
892 }
catch(DifferentAxisLimits&) {
894 Info(
"Add",
"Attempt to add histograms with different axis limits - trying to use TH1::Merge");
896 Warning(
"Add",
"Attempt to add histograms with different axis limits");
897 }
catch(DifferentBinLimits&) {
899 Info(
"Add",
"Attempt to add histograms with different bin limits - trying to use TH1::Merge");
901 Warning(
"Add",
"Attempt to add histograms with different bin limits");
902 }
catch(DifferentLabels&) {
905 Info(
"Add",
"Attempt to add histograms with different labels - trying to use TH1::Merge");
907 Info(
"Warning",
"Attempt to add histograms with different labels");
912 l.
Add(const_cast<TH1*>(h1));
913 auto iret =
Merge(&l);
925 Bool_t resetStats = (c1 < 0);
955 if (e1sq) w1 = 1. / e1sq;
960 double sf = (s2[0] != 0) ? s2[1]/s2[0] : 1;
964 if (e2sq) w2 = 1. / e2sq;
969 double sf = (s1[0] != 0) ? s1[1]/s1[0] : 1;
974 double y = (w1*y1 + w2*y2)/(w1 + w2);
977 double err2 = 1./(w1 + w2);
978 if (err2 < 1.
E-200) err2 = 0;
994 if (i == 1) s1[i] += c1*c1*s2[i];
995 else s1[i] += c1*s2[i];
1035 Error(
"Add",
"Attempt to add a non-existing histogram");
1043 if (h1 == h2 && c2 < 0) {c2 = 0; normWidth =
kTRUE;}
1052 }
catch(DifferentNumberOfBins&) {
1054 Info(
"Add",
"Attempt to add histograms with different number of bins - trying to use TH1::Merge");
1056 Error(
"Add",
"Attempt to add histograms with different number of bins : nbins h1 = %d , nbins h2 = %d",
GetNbinsX(), h1->
GetNbinsX());
1059 }
catch(DifferentAxisLimits&) {
1061 Info(
"Add",
"Attempt to add histograms with different axis limits - trying to use TH1::Merge");
1063 Warning(
"Add",
"Attempt to add histograms with different axis limits");
1064 }
catch(DifferentBinLimits&) {
1066 Info(
"Add",
"Attempt to add histograms with different bin limits - trying to use TH1::Merge");
1068 Warning(
"Add",
"Attempt to add histograms with different bin limits");
1069 }
catch(DifferentLabels&) {
1072 Info(
"Add",
"Attempt to add histograms with different labels - trying to use TH1::Merge");
1074 Info(
"Warning",
"Attempt to add histograms with different labels");
1080 l.
Add(const_cast<TH1*>(h1));
1081 l.
Add(const_cast<TH1*>(h2));
1083 auto iret =
Merge(&l);
1103 Bool_t resetStats = (c1*c2 < 0) || normWidth;
1110 if (i == 1) s3[i] = c1*c1*s1[i] + c2*c2*s2[i];
1112 else s3[i] = c1*s1[i] + c2*s2[i];
1128 Int_t bin, binx, biny, binz;
1129 for (binz = 0; binz < nbinsz; ++binz) {
1131 for (biny = 0; biny < nbinsy; ++biny) {
1133 for (binx = 0; binx < nbinsx; ++binx) {
1135 bin =
GetBin(binx, biny, binz);
1156 if (e1sq) w1 = 1./ e1sq;
1160 double sf = (s1[0] != 0) ? s1[1]/s1[0] : 1;
1164 if (e2sq) w2 = 1./ e2sq;
1168 double sf = (s2[0] != 0) ? s2[1]/s2[0] : 1;
1173 double y = (w1*y1 + w2*y2)/(w1 + w2);
1176 double err2 = 1./(w1 + w2);
1177 if (err2 < 1.
E-200) err2 = 0;
1264 if (nbentries == 0) {
1274 if (nbentries < 0 && action == 0)
return 0;
1277 if (nbentries < 0) {
1278 nbentries = -nbentries;
1290 for (
Int_t i=1;i<nbentries;i++) {
1292 if (x < xmin) xmin =
x;
1293 if (x > xmax) xmax =
x;
1311 DoFillN(nbentries,&buffer[2],&buffer[1],2);
1345 if (nbentries < 0) {
1348 nbentries = -nbentries;
1380 if ( h2Array->
fN != fN ) {
1381 throw DifferentBinLimits();
1385 for (
int i = 0; i < fN; ++i ) {
1387 throw DifferentBinLimits();
1409 throw DifferentLabels();
1414 throw DifferentLabels();
1417 for (
int i = 1; i <= a1->
GetNbins(); ++i) {
1420 if (label1 != label2) {
1421 throw DifferentLabels();
1438 throw DifferentAxisLimits();
1452 ::Info(
"CheckEqualAxes",
"Axes have different number of bins : nbin1 = %d nbin2 = %d",a1->
GetNbins(),a2->
GetNbins() );
1457 }
catch (DifferentAxisLimits&) {
1458 ::Info(
"CheckEqualAxes",
"Axes have different limits");
1463 }
catch (DifferentBinLimits&) {
1464 ::Info(
"CheckEqualAxes",
"Axes have different bin limits");
1471 }
catch (DifferentLabels&) {
1472 ::Info(
"CheckEqualAxes",
"Axes have different labels");
1488 Int_t nbins1 = lastBin1-firstBin1 + 1;
1496 if (firstBin2 < lastBin2) {
1498 nbins2 = lastBin1-firstBin1 + 1;
1503 if (nbins1 != nbins2 ) {
1504 ::Info(
"CheckConsistentSubAxes",
"Axes have different number of bins");
1510 ::Info(
"CheckConsistentSubAxes",
"Axes have different limits");
1523 if (h1 == h2)
return true;
1526 throw DifferentDimension();
1538 (dim > 1 && nbinsy != h2->
GetNbinsY()) ||
1539 (dim > 2 && nbinsz != h2->
GetNbinsZ()) ) {
1540 throw DifferentNumberOfBins();
1857 Int_t ndf = 0, igood = 0;
1865 printf(
"Chi2 = %f, Prob = %g, NDF = %d, igood = %d\n", chi2,prob,ndf,igood);
1868 if (ndf == 0)
return 0;
1916 Int_t i_start, i_end;
1917 Int_t j_start, j_end;
1918 Int_t k_start, k_end;
1947 Error(
"Chi2TestX",
"Histograms have different dimensions.");
1952 if (nbinx1 != nbinx2) {
1953 Error(
"Chi2TestX",
"different number of x channels");
1955 if (nbiny1 != nbiny2) {
1956 Error(
"Chi2TestX",
"different number of y channels");
1958 if (nbinz1 != nbinz2) {
1959 Error(
"Chi2TestX",
"different number of z channels");
1963 i_start = j_start = k_start = 1;
1994 ndf = (i_end - i_start + 1) * (j_end - j_start + 1) * (k_end - k_start + 1) - 1;
2001 if (scaledHistogram && !comparisonUU) {
2002 Info(
"Chi2TestX",
"NORM option should be used together with UU option. It is ignored");
2009 Double_t effEntries1 = (s[1] ? s[0] * s[0] / s[1] : 0.0);
2013 Double_t effEntries2 = (s[1] ? s[0] * s[0] / s[1] : 0.0);
2015 if (!comparisonUU && !comparisonUW && !comparisonWW ) {
2017 if (
TMath::Abs(sumBinContent1 - effEntries1) < 1) {
2018 if (
TMath::Abs(sumBinContent2 - effEntries2) < 1) comparisonUU =
true;
2019 else comparisonUW =
true;
2021 else comparisonWW =
true;
2025 if (
TMath::Abs(sumBinContent1 - effEntries1) >= 1) {
2026 Warning(
"Chi2TestX",
"First histogram is not unweighted and option UW has been requested");
2029 if ( (!scaledHistogram && comparisonUU) ) {
2030 if ( (
TMath::Abs(sumBinContent1 - effEntries1) >= 1) || (
TMath::Abs(sumBinContent2 - effEntries2) >= 1) ) {
2031 Warning(
"Chi2TestX",
"Both histograms are not unweighted and option UU has been requested");
2037 if (comparisonUU && scaledHistogram) {
2038 for (
Int_t i = i_start; i <= i_end; ++i) {
2039 for (
Int_t j = j_start; j <= j_end; ++j) {
2040 for (
Int_t k = k_start; k <= k_end; ++k) {
2049 if (e1sq > 0.0) cnt1 =
TMath::Floor(cnt1 * cnt1 / e1sq + 0.5);
2052 if (e2sq > 0.0) cnt2 =
TMath::Floor(cnt2 * cnt2 / e2sq + 0.5);
2063 if (sumw1 <= 0.0 || sumw2 <= 0.0) {
2064 Error(
"Chi2TestX",
"Cannot use option NORM when one histogram has all zero errors");
2069 for (
Int_t i = i_start; i <= i_end; ++i) {
2070 for (
Int_t j = j_start; j <= j_end; ++j) {
2071 for (
Int_t k = k_start; k <= k_end; ++k) {
2085 if (sum1 == 0.0 || sum2 == 0.0) {
2086 Error(
"Chi2TestX",
"one histogram is empty");
2090 if ( comparisonWW && ( sumw1 <= 0.0 && sumw2 <= 0.0 ) ){
2091 Error(
"Chi2TestX",
"Hist1 and Hist2 have both all zero errors\n");
2101 for (
Int_t i = i_start; i <= i_end; ++i) {
2102 for (
Int_t j = j_start; j <= j_end; ++j) {
2103 for (
Int_t k = k_start; k <= k_end; ++k) {
2110 if (scaledHistogram) {
2115 if (e1sq > 0) cnt1 =
TMath::Floor(cnt1 * cnt1 / e1sq + 0.5);
2118 if (e2sq > 0) cnt2 =
TMath::Floor(cnt2 * cnt2 / e2sq + 0.5);
2122 if (
Int_t(cnt1) == 0 &&
Int_t(cnt2) == 0) --ndf;
2126 Double_t nexp1 = cntsum * sum1 / sum;
2129 if (res) res[i - i_start] = (cnt1 - nexp1) /
TMath::Sqrt(nexp1);
2135 Double_t correc = (1. - sum1 / sum) * (1. - cntsum / sum);
2138 Double_t delta = sum2 * cnt1 - sum1 * cnt2;
2139 chi2 += delta * delta / cntsum;
2144 chi2 /= sum1 * sum2;
2149 Info(
"Chi2TestX",
"There is a bin in h1 with less than 1 event.\n");
2153 Info(
"Chi2TestX",
"There is a bin in h2 with less than 1 event.\n");
2164 if ( comparisonUW ) {
2165 for (
Int_t i = i_start; i <= i_end; ++i) {
2166 for (
Int_t j = j_start; j <= j_end; ++j) {
2167 for (
Int_t k = k_start; k <= k_end; ++k) {
2176 if (cnt1 * cnt1 == 0 && cnt2 * cnt2 == 0) {
2182 if (cnt2 * cnt2 == 0 && e2sq == 0) {
2186 e2sq = sumw2 / sum2;
2191 Error(
"Chi2TestX",
"Hist2 has in bin (%d,%d,%d) zero content and zero errors\n", i, j, k);
2197 if (e2sq > 0 && cnt2 * cnt2 / e2sq < 10)
n++;
2199 Double_t var1 = sum2 * cnt2 - sum1 * e2sq;
2200 Double_t var2 = var1 * var1 + 4. * sum2 * sum2 * cnt1 * e2sq;
2205 while (var1 * var1 + cnt1 == 0 || var1 + var2 == 0) {
2208 var1 = sum2 * cnt2 - sum1 * e2sq;
2209 var2 = var1 * var1 + 4. * sum2 * sum2 * cnt1 * e2sq;
2213 while (var1 + var2 == 0) {
2216 var1 = sum2 * cnt2 - sum1 * e2sq;
2217 var2 = var1 * var1 + 4. * sum2 * sum2 * cnt1 * e2sq;
2218 while (var1 * var1 + cnt1 == 0 || var1 + var2 == 0) {
2221 var1 = sum2 * cnt2 - sum1 * e2sq;
2222 var2 = var1 * var1 + 4. * sum2 * sum2 * cnt1 * e2sq;
2227 Double_t probb = (var1 + var2) / (2. * sum2 * sum2);
2235 chi2 += delta1 * delta1 / nexp1;
2238 chi2 += delta2 * delta2 / e2sq;
2243 Double_t temp1 = sum2 * e2sq / var2;
2244 Double_t temp2 = 1.0 + (sum1 * e2sq - sum2 * cnt2) / var2;
2245 temp2 = temp1 * temp1 * sum1 * probb * (1.0 - probb) + temp2 * temp2 * e2sq / 4.0;
2258 Info(
"Chi2TestX",
"There is a bin in h1 with less than 1 event.\n");
2262 Info(
"Chi2TestX",
"There is a bin in h2 with less than 10 effective events.\n");
2272 for (
Int_t i = i_start; i <= i_end; ++i) {
2273 for (
Int_t j = j_start; j <= j_end; ++j) {
2274 for (
Int_t k = k_start; k <= k_end; ++k) {
2284 if (cnt1 * cnt1 == 0 && cnt2 * cnt2 == 0) {
2289 if (e1sq == 0 && e2sq == 0) {
2291 Error(
"Chi2TestX",
"h1 and h2 both have bin %d,%d,%d with all zero errors\n", i,j,k);
2295 Double_t sigma = sum1 * sum1 * e2sq + sum2 * sum2 * e1sq;
2296 Double_t delta = sum2 * cnt1 - sum1 * cnt2;
2297 chi2 += delta * delta / sigma;
2300 Double_t temp = cnt1 * sum1 * e2sq + cnt2 * sum2 * e1sq;
2305 Double_t s1 = e1sq * ( 1. - e2sq * sum1 * sum1 / sigma );
2310 Double_t s2 = e2sq * ( 1. - e1sq * sum2 * sum2 / sigma );
2313 res[i - i_start] = z;
2316 if (e1sq > 0 && cnt1 * cnt1 / e1sq < 10) m++;
2317 if (e2sq > 0 && cnt2 * cnt2 / e2sq < 10)
n++;
2323 Info(
"Chi2TestX",
"There is a bin in h1 with less than 10 effective events.\n");
2327 Info(
"Chi2TestX",
"There is a bin in h2 with less than 10 effective events.\n");
2343 Error(
"Chisquare",
"Function pointer is Null - return -1");
2393 for (
Int_t binz=1; binz <= nbinsz; ++binz) {
2394 for (
Int_t biny=1; biny <= nbinsy; ++biny) {
2395 for (
Int_t binx=1; binx <= nbinsx; ++binx) {
2398 if (onlyPositive && y < 0) {
2399 Error(
"ComputeIntegral",
"Bin content is negative - return a NaN value");
2410 Error(
"ComputeIntegral",
"Integral = zero");
return 0;
2455 hintegrated->
Reset();
2458 for (
Int_t binz = 1; binz <= nbinsz; ++binz) {
2459 for (
Int_t biny = 1; biny <= nbinsy; ++biny) {
2460 for (
Int_t binx = 1; binx <= nbinsx; ++binx) {
2461 const Int_t bin = hintegrated->
GetBin(binx, biny, binz);
2469 for (
Int_t binz = nbinsz; binz >= 1; --binz) {
2470 for (
Int_t biny = nbinsy; biny >= 1; --biny) {
2471 for (
Int_t binx = nbinsx; binx >= 1; --binx) {
2472 const Int_t bin = hintegrated->
GetBin(binx, biny, binz);
2498 ((
TH1&)obj).fDirectory->Remove(&obj);
2499 ((
TH1&)obj).fDirectory = 0;
2513 delete [] ((
TH1&)obj).fBuffer;
2514 ((
TH1&)obj).fBuffer = 0;
2520 ((
TH1&)obj).fBuffer = buf;
2525 if (a) a->
Set(fNcells);
2546 ((
TH1&)obj).fXaxis.SetParent(&obj);
2547 ((
TH1&)obj).fYaxis.SetParent(&obj);
2548 ((
TH1&)obj).fZaxis.SetParent(&obj);
2560 ((
TH1&)obj).fDirectory = 0;
2579 if(newname && strlen(newname) ) {
2637 Error(
"Add",
"Attempt to divide by a non-existing function");
2655 Int_t bin, binx, biny, binz;
2660 for (binz = 0; binz < nz; ++binz) {
2662 for (biny = 0; biny <
ny; ++biny) {
2664 for (binx = 0; binx <
nx; ++binx) {
2668 bin = binx + nx * (biny + ny * binz);
2706 Error(
"Divide",
"Input histogram passed does not exist (NULL).");
2715 }
catch(DifferentNumberOfBins&) {
2716 Error(
"Divide",
"Cannot divide histograms with different number of bins");
2718 }
catch(DifferentAxisLimits&) {
2719 Warning(
"Divide",
"Dividing histograms with different axis limits");
2720 }
catch(DifferentBinLimits&) {
2721 Warning(
"Divide",
"Dividing histograms with different bin limits");
2722 }
catch(DifferentLabels&) {
2723 Warning(
"Divide",
"Dividing histograms with different labels");
2779 Error(
"Divide",
"At least one of the input histograms passed does not exist (NULL).");
2789 }
catch(DifferentNumberOfBins&) {
2790 Error(
"Divide",
"Cannot divide histograms with different number of bins");
2792 }
catch(DifferentAxisLimits&) {
2793 Warning(
"Divide",
"Dividing histograms with different axis limits");
2794 }
catch(DifferentBinLimits&) {
2795 Warning(
"Divide",
"Dividing histograms with different bin limits");
2796 }
catch(DifferentLabels&) {
2797 Warning(
"Divide",
"Dividing histograms with different labels");
2802 Error(
"Divide",
"Coefficient of dividing histogram cannot be zero");
2839 fSumw2.
fArray[i] = c1sq * c2sq * (e1sq * b2sq + e2sq * b1sq) / (c2sq * c2sq * b2sq * b2sq);
2893 if (index>indb && index<indk) index = -1;
2899 if (!
gPad->IsEditable())
gROOT->MakeDefCanvas();
2901 if (
gPad->GetX1() == 0 &&
gPad->GetX2() == 1 &&
2902 gPad->GetY1() == 0 &&
gPad->GetY2() == 1 &&
2903 gPad->GetListOfPrimitives()->GetSize()==0) opt2.
Remove(index,4);
2911 if (index>=0) opt2.
Remove(index,4);
2962 Error(
"DrawNormalized",
"Sum of weights is null. Cannot normalize histogram: %s",
GetName());
2974 if (opt.
IsNull() || opt ==
"SAME") opt +=
"HIST";
3011 Int_t range, stat, add;
3031 for (
Int_t binz = 1; binz <= nbinsz; ++binz) {
3033 for (
Int_t biny = 1; biny <= nbinsy; ++biny) {
3035 for (
Int_t binx = 1; binx <= nbinsx; ++binx) {
3038 if (range && !f1->
IsInside(x))
continue;
3137 for (
Int_t binx = 1; binx<=ndim[0]; binx++) {
3138 for (
Int_t biny=1; biny<=ndim[1]; biny++) {
3139 for (
Int_t binz=1; binz<=ndim[2]; binz++) {
3170 if (bin <0)
return -1;
3204 if (bin <0)
return -1;
3238 if (bin <0)
return -1;
3275 for (i=0;i<ntimes;i+=stride) {
3282 DoFillN((ntimes-i)/stride,&x[i],&w[i],stride);
3286 DoFillN(ntimes, x, w, stride);
3301 for (i=0;i<ntimes;i+=stride) {
3303 if (bin <0)
continue;
3308 if (bin == 0 || bin > nbins) {
3340 if (!f1) {
Error(
"FillRandom",
"Unknown function: %s",fname);
return; }
3350 Info(
"FillRandom",
"Using function axis and range [%g,%g]",xmin, xmax);
3356 Int_t nbinsx = last-first+1;
3360 for (binx=1;binx<=nbinsx;binx++) {
3362 integral[binx] = integral[binx-1] + fint;
3366 if (integral[nbinsx] == 0 ) {
3368 Error(
"FillRandom",
"Integral = zero");
return;
3370 for (bin=1;bin<=nbinsx;bin++) integral[bin] /= integral[nbinsx];
3373 for (loop=0;loop<ntimes;loop++) {
3379 +xAxis->
GetBinWidth(ibin+first)*(r1-integral[ibin])/(integral[ibin+1] - integral[ibin]);
3403 if (!h) {
Error(
"FillRandom",
"Null histogram");
return; }
3405 Error(
"FillRandom",
"Histograms with different dimensions");
return;
3412 Int_t nbins = last-first+1;
3413 if (ntimes > 10*nbins) {
3417 if (sumw == 0)
return;
3419 for (
Int_t bin=first;bin<=last;bin++) {
3431 if (sumgen < ntimes) {
3433 for (i =
Int_t(sumgen+0.5); i < ntimes; ++i)
3439 else if (sumgen > ntimes) {
3441 i =
Int_t(sumgen+0.5);
3442 while( i > ntimes) {
3457 catch(std::exception&) {}
3464 for (loop=0;loop<ntimes;loop++) {
3491 return binx + nx*biny;
3499 return binx + nx*(biny +ny*binz);
3525 return binx + nx*biny;
3533 return binx + nx*(biny +ny*binz);
3548 Warning(
"FindFirstBinAbove",
"Invalid axis number : %d, axis x assumed\n",axis);
3568 Warning(
"FindLastBinAbove",
"Invalid axis number : %d, axis x assumed\n",axis);
3572 for (
Int_t bin=nbins;bin>=1;bin--) {
3614 linear= (
char*)strstr(fname,
"++");
3621 f1=
new TF1(fname, fname, xxmin, xxmax);
3622 return Fit(f1,option,goption,xxmin,xxmax);
3625 f2=
new TF2(fname, fname);
3626 return Fit(f2,option,goption,xxmin,xxmax);
3629 f3=
new TF3(fname, fname);
3630 return Fit(f3,option,goption,xxmin,xxmax);
3635 f1 = (
TF1*)
gROOT->GetFunction(fname);
3636 if (!f1) {
Printf(
"Unknown function: %s",fname);
return -1; }
3637 return Fit(f1,option,goption,xxmin,xxmax);
3919 gROOT->MakeDefCanvas();
3922 Error(
"FitPanel",
"Unable to create a default canvas");
3929 if (handler && handler->
LoadPlugin() != -1) {
3931 Error(
"FitPanel",
"Unable to create the FitPanel");
3934 Error(
"FitPanel",
"Unable to find the FitPanel plug-in");
3976 asym->SetTitle(title);
3986 top->
Add(h1,h2,1,-c2);
3987 bottom->
Add(h1,h2,1,c2);
3988 asym->Divide(top,bottom);
3992 Int_t zmax = asym->GetNbinsZ();
4002 for(
Int_t k=1; k<= zmax; k++){
4018 Double_t error = 2*
TMath::Sqrt(a*a*c2*c2*dbsq + c2*c2*b*b*dasq+a*a*b*b*dc2*dc2)/(bot*bot);
4019 asym->SetBinError(i,j,k,error);
4081 return (s[1] ? s[0]*s[0]/s[1] :
TMath::Abs(s[0]) );
4092 return ((
TH1*)
this)->GetPainter()->GetObjectInfo(px,py);
4189 Error(
"GetQuantiles",
"Only available for 1-d histograms");
4199 Int_t nq = nprobSum;
4204 for (i=1;i<nq;i++) {
4209 for (i = 0; i < nq; i++) {
4211 while (ibin < nbins-1 &&
fIntegral[ibin+1] == prob[i]) {
4212 if (
fIntegral[ibin+2] == prob[i]) ibin++;
4217 if (dint > 0) q[i] +=
GetBinWidth(ibin+1)*(prob[i]-fIntegral[ibin])/dint;
4220 if (!probSum)
delete [] prob;
4251 allcha = sumx = sumx2 = 0;
4252 for (bin=hxfirst;bin<=hxlast;bin++) {
4255 if (val > valmax) valmax = val;
4260 if (allcha == 0)
return;
4262 stddev = sumx2/allcha - mean*mean;
4265 if (stddev == 0) stddev = binwidx*(hxlast-hxfirst+1)/4;
4272 Double_t constant = 0.5*(valmax+binwidx*allcha/(sqrtpi*stddev));
4280 if ((mean < xmin || mean > xmax) && stddev > (xmax-xmin)) {
4281 mean = 0.5*(xmax+
xmin);
4282 stddev = 0.5*(xmax-
xmin);
4302 Int_t nchanx = hxlast - hxfirst + 1;
4324 Int_t nchanx = hxlast - hxfirst + 1;
4327 if (nchanx <=1 || npar == 1) {
4351 const Int_t idim = 20;
4362 if (m > idim || m > n)
return;
4365 for (l = 2; l <=
m; ++
l) {
4367 b[m + l*20 - 21] = zero;
4374 for (k = hxfirst; k <= hxlast; ++k) {
4379 for (l = 2; l <=
m; ++
l) {
4382 da[l-1] += power*yk;
4384 for (l = 2; l <=
m; ++
l) {
4386 b[m + l*20 - 21] += power;
4389 for (i = 3; i <=
m; ++i) {
4390 for (k = i; k <=
m; ++k) {
4391 b[k - 1 + (i-1)*20 - 21] = b[k + (i-2)*20 - 21];
4396 for (i=0; i<
m; ++i) a[i] = da[i];
4417 xbar = ybar = x2bar = xybar = 0;
4422 for (i = hxfirst; i <= hxlast; ++i) {
4426 if (yk <= 0) yk = 1e-9;
4435 det = fn*x2bar - xbar*xbar;
4443 a0 = (x2bar*ybar - xbar*xybar) / det;
4444 a1 = (fn*xybar - xbar*ybar) / det;
4456 Int_t a_dim1, a_offset, b_dim1, b_offset;
4458 Int_t im1, jp1, nm1, nmi;
4464 b_offset = b_dim1 + 1;
4467 a_offset = a_dim1 + 1;
4470 if (idim < n)
return;
4473 for (j = 1; j <=
n; ++j) {
4474 if (a[j + j*a_dim1] <= 0) { ifail = -1;
return; }
4475 a[j + j*a_dim1] = one / a[j + j*a_dim1];
4476 if (j == n)
continue;
4478 for (l = jp1; l <=
n; ++
l) {
4479 a[j + l*a_dim1] = a[j + j*a_dim1] * a[l + j*a_dim1];
4480 s1 = -a[l + (j+1)*a_dim1];
4481 for (i = 1; i <= j; ++i) { s1 = a[l + i*a_dim1] * a[i + (j+1)*a_dim1] + s1; }
4482 a[l + (j+1)*a_dim1] = -s1;
4487 for (l = 1; l <= k; ++
l) {
4488 b[l*b_dim1 + 1] = a[a_dim1 + 1]*b[l*b_dim1 + 1];
4491 for (l = 1; l <= k; ++
l) {
4492 for (i = 2; i <=
n; ++i) {
4494 s21 = -b[i + l*b_dim1];
4495 for (j = 1; j <= im1; ++j) {
4496 s21 = a[i + j*a_dim1]*b[j + l*b_dim1] + s21;
4498 b[i + l*b_dim1] = -a[i + i*a_dim1]*s21;
4501 for (i = 1; i <= nm1; ++i) {
4503 s22 = -b[nmi + l*b_dim1];
4504 for (j = 1; j <= i; ++j) {
4506 s22 = a[nmi + nmjp1*a_dim1]*b[nmjp1 + l*b_dim1] + s22;
4508 b[nmi + l*b_dim1] = -s22;
4542 if (binx < 0) binx = 0;
4543 if (binx > ofx) binx = ofx;
4559 binx = binglobal%
nx;
4565 binx = binglobal%
nx;
4566 biny = ((binglobal-binx)/nx)%
ny;
4571 binx = binglobal%
nx;
4572 biny = ((binglobal-binx)/nx)%
ny;
4573 binz = ((binglobal-binx)/nx -biny)/
ny;
4590 Error(
"GetRandom",
"Function only valid for 1-d histograms");
4600 integral = ((
TH1*)
this)->ComputeIntegral(
true);
4602 if (integral == 0)
return 0;
4636 if (bin < 0) bin = 0;
4637 if (bin >= fNcells) bin = fNcells-1;
4661 Error(
"GetBinWithContent",
"function is only valid for 1-D histograms");
4667 if (firstx <= 0) firstx = 1;
4671 for (
Int_t i=firstx;i<=lastx;i++) {
4673 if (diff <= 0) {binx = i;
return diff;}
4674 if (diff < curmax && diff <= maxdiff) {curmax = diff, binminx=i;}
4709 return y0 + (x-x0)*((y1-y0)/(x1-x0));
4719 Error(
"Interpolate",
"This function must be called with 1 argument for a TH1");
4729 Error(
"Interpolate",
"This function must be called with 1 argument for a TH1");
4739 Int_t binx, biny, binz;
4761 Int_t binx, biny, binz;
4767 return (binx <= 0 || biny <= 0);
4769 return (binx <= 0 || biny <= 0 || binz <= 0);
4788 Error(
"LabelsDeflate",
"Invalid axis option %s",ax);
4799 while ((obj = next())) {
4801 if (ibin > nbins) nbins = ibin;
4803 if (nbins < 1) nbins = 1;
4804 TH1 *hold = (
TH1*)IsA()->New();
4812 if (xmax <= xmin) xmax = xmin +
nbins;
4814 axis->
Set(nbins,xmin,xmax);
4827 Int_t bin,binx,biny,binz;
4828 for (bin=0; bin < hold->
fNcells; ++bin) {
4856 TH1 *hold = (
TH1*)IsA()->New();;
4864 xmax = xmin + 2*(xmax-
xmin);
4867 axis->
Set(2*nbins,xmin,xmax);
4877 Int_t bin,ibin,binx,biny,binz;
4878 for (ibin =0; ibin <
fNcells; ibin++) {
4880 bin = hold->
GetBin(binx,biny,binz);
4915 Warning(
"LabelsOption",
"Cannot sort. No labels");
4948 if (sort < 0)
return;
4950 Error(
"LabelsOption",
"Sorting by value not implemented for 3-D histograms");
4956 std::vector<Int_t>
a(n+2);
4959 std::vector<Double_t> cont;
4960 std::vector<Double_t> errors;
4962 TIter nextold(labels);
4964 while ((obj=nextold())) {
4973 for (i=1;i<=
n;i++) {
4975 if (!errors.empty()) errors[i-1] =
GetBinError(i);
4979 for (i=1;i<=
n;i++) {
4981 if (!errors.empty())
SetBinError(i,errors[a[i-1]]);
4983 for (i=1;i<=
n;i++) {
4984 obj = labold->
At(a[i-1]);
4989 std::vector<Double_t> pcont(n+2);
4992 cont.resize( (nx+2)*(ny+2));
4993 if (
fSumw2.
fN) errors.resize( (nx+2)*(ny+2));
4994 for (i=1;i<=
nx;i++) {
4995 for (j=1;j<=
ny;j++) {
4997 if (!errors.empty()) errors[i+nx*j] =
GetBinError(i,j);
5000 pcont[k-1] += cont[i+nx*j];
5006 obj = labold->
At(a[i]);
5011 for (i=1;i<=
n;i++) {
5012 for (j=1;j<=
ny;j++) {
5014 if (!errors.empty())
SetBinError(i,j,errors[a[i-1]+1+nx*j]);
5020 for (i=1;i<=
nx;i++) {
5021 for (j=1;j<=
n;j++) {
5023 if (!errors.empty())
SetBinError(i,j,errors[i+nx*(a[j-1]+1)]);
5032 const UInt_t kUsed = 1<<18;
5036 for (i=1;i<=
n;i++) {
5037 const char *label =
"zzzzzzzzzzzz";
5038 for (j=1;j<=
n;j++) {
5039 obj = labold->
At(j-1);
5041 if (obj->
TestBit(kUsed))
continue;
5043 if (strcmp(label,obj->
GetName()) < 0)
continue;
5054 for (i=1;i<=
n;i++) {
5055 obj = labels->
At(i-1);
5063 for (i=1;i<=
n;i++) {
5065 if (!errors.empty()) errors[i] =
GetBinError(a[i]);
5067 for (i=1;i<=
n;i++) {
5075 if (
fSumw2.
fN) errors.resize(nx*ny);
5076 for (i=0;i<
nx;i++) {
5077 for (j=0;j<
ny;j++) {
5079 if (!errors.empty()) errors[i+nx*j] =
GetBinError(i,j);
5083 for (i=1;i<=
n;i++) {
5084 for (j=0;j<
ny;j++) {
5086 if (!errors.empty())
SetBinError(i,j,errors[a[i]+nx*j]);
5090 for (i=0;i<
nx;i++) {
5091 for (j=1;j<=
n;j++) {
5093 if (!errors.empty())
SetBinError(i,j,errors[i+nx*a[j]]);
5101 cont.resize(nx*ny*nz);
5102 if (
fSumw2.
fN) errors.resize(nx*ny*nz);
5103 for (i=0;i<
nx;i++) {
5104 for (j=0;j<
ny;j++) {
5105 for (k=0;k<nz;k++) {
5107 if (!errors.empty()) errors[i+nx*(j+ny*k)] =
GetBinError(i,j,k);
5113 for (i=1;i<=
n;i++) {
5114 for (j=0;j<
ny;j++) {
5115 for (k=0;k<nz;k++) {
5117 if (!errors.empty())
SetBinError(i,j,k,errors[a[i]+nx*(j+ny*k)]);
5124 for (i=0;i<
nx;i++) {
5125 for (j=1;j<=
n;j++) {
5126 for (k=0;k<nz;k++) {
5128 if (!errors.empty())
SetBinError(i,j,k,errors[i+nx*(a[j]+ny*k)]);
5135 for (i=0;i<
nx;i++) {
5136 for (j=0;j<
ny;j++) {
5137 for (k=1;k<=
n;k++) {
5139 if (!errors.empty())
SetBinError(i,j,k,errors[i+nx*(j+ny*a[k])]);
5172 bool isEquidistant =
true;
5174 for (
int i = 1; i < axis.
GetNbins(); ++i) {
5177 isEquidistant &= match;
5181 return isEquidistant;
5209 if (width1 == 0 || width2 == 0)
5240 delta = (xmax - destAxis.
GetXmax())/width1;
5245 delta = (xmax - anAxis.
GetXmax())/width2;
5250 delta = (xmax - destAxis.
GetXmax())/width1;
5255 printf(
"TH1::RecomputeAxisLimits - Impossible\n");
5329 TIter next(&inlist);
5337 allHaveLimits = allHaveLimits && hasLimits;
5345 if (firstHistWithLimits ) {
5351 firstHistWithLimits =
kFALSE;
5357 if (!initialLimitsFound) {
5358 initialLimitsFound =
kTRUE;
5370 Error(
"Merge",
"Cannot merge histograms - limits are inconsistent:\n " 5371 "first: (%d, %f, %f), second: (%d, %f, %f)",
5380 if (allHaveLabels) {
5382 Bool_t haveOneLabel = (hlabels != 0);
5384 if (foundLabelHist && allHaveLabels && !haveOneLabel) {
5385 Warning(
"Merge",
"Not all histograms have labels. I will ignore labels," 5386 " falling back to bin numbering mode.");
5389 allHaveLabels &= (haveOneLabel);
5391 if (haveOneLabel) foundLabelHist =
kTRUE;
5404 Int_t non_zero_bins = 0;
5412 if (non_zero_bins > hlabels->
GetEntries() ) {
5413 Warning(
"Merge",
"Histogram %s contains non-empty bins without labels - falling back to bin numbering mode",h->
GetName() );
5425 }
while ( ( h = dynamic_cast<TH1*> ( next() ) ) !=
NULL );
5427 if (!h && (*next) ) {
5428 Error(
"Merge",
"Attempt to merge object of class: %s to a %s",
5429 (*next)->ClassName(),this->
ClassName());
5440 if (!allSameLimits) {
5445 hclone = (
TH1*)IsA()->New();
5457 if (initialLimitsFound && (!allSameLimits || !allHaveLimits )) {
5467 if (!allHaveLimits && !allHaveLabels) {
5469 while (
TH1* hist = (
TH1*)next()) {
5471 if ( (hist->GetXaxis()->GetXmin() >= hist->GetXaxis()->GetXmax() ) && hist->fBuffer ) {
5474 for (
Int_t i = 0; i < nbentries; i++)
5475 Fill(hist->fBuffer[2*i + 2], hist->fBuffer[2*i + 1]);
5482 if (!initialLimitsFound ) {
5504 for (
Int_t i=0;i<
kNstat;i++) {totstats[i] = stats[i] = 0;}
5510 while (
TH1* hist=(
TH1*)next()) {
5517 Double_t histEntries = hist->GetEntries();
5518 if (hist->fTsumw == 0 && histEntries == 0)
continue;
5522 if (allHaveLabels || (hist->GetXaxis()->GetXmin() < hist->GetXaxis()->GetXmax()) ) {
5524 hist->GetStats(stats);
5526 totstats[i] += stats[i];
5527 nentries += histEntries;
5529 Int_t nx = hist->GetXaxis()->GetNbins();
5531 for (
Int_t binx = 0; binx <= nx + 1; binx++) {
5533 Double_t cu = hist->RetrieveBinContent(binx);
5536 if (
fSumw2.
fN) e1sq= hist->GetBinErrorSqUnchecked(binx);
5541 if (!allHaveLabels) {
5543 if (!allSameLimits) {
5544 if ( binx==0 || binx== nx+1) {
5545 Error(
"Merge",
"Cannot merge histograms - the histograms have" 5546 " different limits and undeflows/overflows are present." 5547 " The initial histogram is now broken!");
5562 const char* label=hist->GetXaxis()->GetBinLabel(binx);
5566 Error(
"Merge",
"Histogram %s with labels has NULL label pointer for bin %d",
5567 hist->GetName(),binx );
5571 if (label[0] == 0 && (binx == 0 || binx ==(nx+1)) ) {
5581 Warning(
"Merge",
"Histogram %s has labels but CanExtendAllAxes() is false - label %s is lost",
GetName(), label);
5590 Fatal(
"Merge",
"Fatal error merging histogram %s - bin number is %d and array size is %d",
GetName(), ix,fNcells);
5627 Error(
"Add",
"Attempt to multiply by a non-existing function");
5649 for (
Int_t binz = 0; binz < nz; ++binz) {
5651 for (
Int_t biny = 0; biny <
ny; ++biny) {
5653 for (
Int_t binx = 0; binx <
nx; ++binx) {
5657 Int_t bin = binx + nx * (biny + ny *binz);
5690 Error(
"Multiply",
"Attempt to multiply by a non-existing histogram");
5699 }
catch(DifferentNumberOfBins&) {
5700 Error(
"Multiply",
"Attempt to multiply histograms with different number of bins");
5702 }
catch(DifferentAxisLimits&) {
5703 Warning(
"Multiply",
"Attempt to multiply histograms with different axis limits");
5704 }
catch(DifferentBinLimits&) {
5705 Warning(
"Multiply",
"Attempt to multiply histograms with different bin limits");
5706 }
catch(DifferentLabels&) {
5707 Warning(
"Multiply",
"Attempt to multiply histograms with different labels");
5753 Error(
"Multiply",
"Attempt to multiply by a non-existing histogram");
5763 }
catch(DifferentNumberOfBins&) {
5764 Error(
"Multiply",
"Attempt to multiply histograms with different number of bins");
5766 }
catch(DifferentAxisLimits&) {
5767 Warning(
"Multiply",
"Attempt to multiply histograms with different axis limits");
5768 }
catch(DifferentBinLimits&) {
5769 Warning(
"Multiply",
"Attempt to multiply histograms with different bin limits");
5770 }
catch(DifferentLabels&) {
5771 Warning(
"Multiply",
"Attempt to multiply histograms with different labels");
5868 if ((ngroup <= 0) || (ngroup > nbins)) {
5869 Error(
"Rebin",
"Illegal value of ngroup=%d",ngroup);
5874 Error(
"Rebin",
"Operation valid on 1-D histograms only");
5877 if (!newname && xbins) {
5878 Error(
"Rebin",
"if xbins is specified, newname must be given");
5882 Int_t newbins = nbins/ngroup;
5884 Int_t nbg = nbins/ngroup;
5885 if (nbg*ngroup != nbins) {
5886 Warning(
"Rebin",
"ngroup=%d is not an exact divider of nbins=%d.",ngroup,nbins);
5906 for (bin=0;bin<nbins+2;bin++) oldErrors[bin] =
GetBinError(bin);
5911 Warning(
"Rebin",
"underflow entries will not be used when rebinning");
5912 if (xbins[newbins] >
fXaxis.
GetXmax() && oldBins[nbins+1] != 0 )
5913 Warning(
"Rebin",
"overflow entries will not be used when rebinning");
5919 if ((newname && strlen(newname) > 0) || xbins) {
5929 bool resetStat =
false;
5931 if(!xbins && (newbins*ngroup != nbins)) {
5956 hnew->
SetBins(newbins,xmin,xmax);
5979 Int_t oldbin = startbin;
5981 for (bin = 1;bin<=newbins;bin++) {
5984 Int_t imax = ngroup;
5986 for (i=0;i<ngroup;i++) {
5987 if( (oldbin+i > nbins) ||
5992 binContent += oldBins[oldbin+i];
5993 if (oldErrors) binError += oldErrors[oldbin+i]*oldErrors[oldbin+i];
6003 for (i = 0; i < startbin; ++i) {
6004 binContent += oldBins[i];
6005 if (oldErrors) binError += oldErrors[i]*oldErrors[i];
6012 for (i = oldbin; i <= nbins+1; ++i) {
6013 binContent += oldBins[i];
6014 if (oldErrors) binError += oldErrors[i]*oldErrors[i];
6023 if (!resetStat) hnew->
PutStats(stat);
6025 if (oldErrors)
delete [] oldErrors;
6045 if (xmin >= xmax)
return kFALSE;
6051 while (point < xmin) {
6054 xmin = xmin - range;
6063 while (point >= xmax) {
6066 xmax = xmax + range;
6111 TH1 *hold = (
TH1*)IsA()->New();
6124 Int_t ix,iy,iz,ibin,binx,biny,binz,bin;
6126 for (binz=1;binz<=nbinsz;binz++) {
6129 for (biny=1;biny<=nbinsy;biny++) {
6132 for (binx=1;binx<=nbinsx;binx++) {
6135 bin = hold->
GetBin(binx,biny,binz);
6182 if (opt.
Contains(
"width"))
Add(
this,
this, c1, -1);
6192 if (ncontours == 0)
return;
6194 for (
Int_t i = 0; i < ncontours; ++i) levels[i] *= c1;
6235 return oldExtendBitMask;
6284 str1 = str1(isc+1, lns);
6285 isc = str1.
Index(
";");
6288 str2.ReplaceAll(
"#semicolon",10,
";",1);
6291 str1 = str1(isc+1, lns);
6292 isc = str1.
Index(
";");
6295 str2.ReplaceAll(
"#semicolon",10,
";",1);
6298 str1 = str1(isc+1, lns);
6325 ::Error(
"SmoothArray",
"Need at least 3 points for smoothing: n = %d",nn);
6332 std::vector<double> yy(nn);
6333 std::vector<double> zz(nn);
6334 std::vector<double> rr(nn);
6336 for (
Int_t pass=0;pass<ntimes;pass++) {
6338 std::copy(xx, xx+nn, zz.begin() );
6342 for (
int noent = 0; noent < 2; ++noent) {
6345 for (
int kk = 0; kk < 3; kk++) {
6346 std::copy(zz.begin(), zz.end(), yy.begin());
6347 int medianType = (kk != 1) ? 3 : 5;
6348 int ifirst = (kk != 1 ) ? 1 : 2;
6349 int ilast = (kk != 1 ) ? nn-1 : nn -2;
6353 for ( ii = ifirst; ii < ilast; ii++) {
6354 assert(ii - ifirst >= 0);
6355 for (
int jj = 0; jj < medianType; jj++) {
6356 hh[jj] = yy[ii - ifirst + jj ];
6365 hh[2] = 3*zz[1] - 2*zz[2];
6370 hh[2] = 3*zz[nn - 2] - 2*zz[nn - 3];
6376 for (ii = 0; ii < 3; ii++) {
6381 for (ii = 0; ii < 3; ii++) {
6382 hh[ii] = yy[nn - 3 + ii];
6389 std::copy ( zz.begin(), zz.end(), yy.begin() );
6392 for (ii = 2; ii < (nn - 2); ii++) {
6393 if (zz[ii - 1] != zz[ii])
continue;
6394 if (zz[ii] != zz[ii + 1])
continue;
6395 hh[0] = zz[ii - 2] - zz[ii];
6396 hh[1] = zz[ii + 2] - zz[ii];
6397 if (hh[0] * hh[1] <= 0)
continue;
6400 yy[ii] = -0.5*zz[ii - 2*jk] + zz[ii]/0.75 + zz[ii + 2*jk] /6.;
6401 yy[ii + jk] = 0.5*(zz[ii + 2*jk] - zz[ii - 2*jk]) + zz[ii];
6406 for (ii = 1; ii < nn - 1; ii++) {
6407 zz[ii] = 0.25*yy[ii - 1] + 0.5*yy[ii] + 0.25*yy[ii + 1];
6410 zz[nn - 1] = yy[nn - 1];
6415 std::copy(zz.begin(), zz.end(), rr.begin());
6418 for (ii = 0; ii < nn; ii++) {
6419 zz[ii] = xx[ii] - zz[ii];
6427 for (ii = 0; ii < nn; ii++) {
6428 if (xmin < 0) xx[ii] = rr[ii] + zz[ii];
6430 else xx[ii] =
TMath::Max((rr[ii] + zz[ii]),0.0 );
6447 Error(
"Smooth",
"Smooth only supported for 1-d histograms");
6452 Error(
"Smooth",
"Smooth only supported for histograms with >= 3 bins. Nbins = %d",nbins);
6466 nbins = lastbin - firstbin + 1;
6470 for (i=0;i<
nbins;i++) {
6476 for (i=0;i<
nbins;i++) {
6500 void TH1::Streamer(
TBuffer &b)
6516 while ((obj=next())) {
6522 TNamed::Streamer(b);
6523 TAttLine::Streamer(b);
6524 TAttFill::Streamer(b);
6525 TAttMarker::Streamer(b);
6585 else if (opt.
Contains(
"range")) all = 1;
6586 else if (opt.
Contains(
"base")) all = 2;
6589 Int_t bin, binx, biny, binz;
6590 Int_t firstx=0,lastx=0,firsty=0,lasty=0,firstz=0,lastz=0;
6602 printf(
" Title = %s\n",
GetTitle());
6613 for (binx=firstx;binx<=lastx;binx++) {
6617 if(
fSumw2.
fN) printf(
" fSumw[%d]=%g, x=%g, error=%g\n",binx,w,x,e);
6618 else printf(
" fSumw[%d]=%g, x=%g\n",binx,w,x);
6622 for (biny=firsty;biny<=lasty;biny++) {
6624 for (binx=firstx;binx<=lastx;binx++) {
6629 if(
fSumw2.
fN) printf(
" fSumw[%d][%d]=%g, x=%g, y=%g, error=%g\n",binx,biny,w,x,y,e);
6630 else printf(
" fSumw[%d][%d]=%g, x=%g, y=%g\n",binx,biny,w,x,y);
6635 for (binz=firstz;binz<=lastz;binz++) {
6637 for (biny=firsty;biny<=lasty;biny++) {
6639 for (binx=firstx;binx<=lastx;binx++) {
6640 bin =
GetBin(binx,biny,binz);
6644 if(
fSumw2.
fN) printf(
" fSumw[%d][%d][%d]=%g, x=%g, y=%g, z=%g, error=%g\n",binx,biny,binz,w,x,y,z,e);
6645 else printf(
" fSumw[%d][%d][%d]=%g, x=%g, y=%g, z=%g\n",binx,biny,binz,w,x,y,z);
6705 if (opt ==
"ICES")
return;
6736 static Int_t nxaxis = 0;
6737 static Int_t nyaxis = 0;
6738 static Int_t nzaxis = 0;
6739 TString sxaxis=
"xAxis",syaxis=
"yAxis",szaxis=
"zAxis";
6750 if (i != 0) out <<
", ";
6753 out <<
"}; " << std::endl;
6766 if (i != 0) out <<
", ";
6769 out <<
"}; " << std::endl;
6782 if (i != 0) out <<
", ";
6785 out <<
"}; " << std::endl;
6789 out <<
" "<<std::endl;
6799 static Int_t hcounter = 0;
6806 histName += hcounter;
6809 const char *hname = histName.
Data();
6810 if (!strlen(hname)) hname =
"unnamed";
6813 t.ReplaceAll(
"\\",
"\\\\");
6814 t.ReplaceAll(
"\"",
"\\\"");
6815 out << hname <<
" = new " <<
ClassName() <<
"(" << quote
6816 << hname << quote <<
"," << quote<< t.Data() << quote
6819 out <<
", "<<sxaxis;
6826 out <<
", "<<syaxis;
6834 out <<
", "<<szaxis;
6839 out <<
");" << std::endl;
6843 for (bin=0;bin<
fNcells;bin++) {
6846 out<<
" "<<hname<<
"->SetBinContent("<<bin<<
","<<bc<<
");"<<std::endl;
6852 for (bin=0;bin<
fNcells;bin++) {
6855 out<<
" "<<hname<<
"->SetBinError("<<bin<<
","<<be<<
");"<<std::endl;
6872 out<<
" "<<hname<<
"->SetBarOffset("<<
GetBarOffset()<<
");"<<std::endl;
6875 out<<
" "<<hname<<
"->SetBarWidth("<<
GetBarWidth()<<
");"<<std::endl;
6878 out<<
" "<<hname<<
"->SetMinimum("<<
fMinimum<<
");"<<std::endl;
6881 out<<
" "<<hname<<
"->SetMaximum("<<
fMaximum<<
");"<<std::endl;
6884 out<<
" "<<hname<<
"->SetNormFactor("<<
fNormFactor<<
");"<<std::endl;
6887 out<<
" "<<hname<<
"->SetEntries("<<
fEntries<<
");"<<std::endl;
6890 out<<
" "<<hname<<
"->SetDirectory(0);"<<std::endl;
6893 out<<
" "<<hname<<
"->SetStats(0);"<<std::endl;
6896 out<<
" "<<hname<<
"->SetOption("<<quote<<
fOption.
Data()<<quote<<
");"<<std::endl;
6901 if (ncontours > 0) {
6902 out<<
" "<<hname<<
"->SetContour("<<ncontours<<
");"<<std::endl;
6904 for (
Int_t bin=0;bin<ncontours;bin++) {
6905 if (
gPad->GetLogz()) {
6910 out<<
" "<<hname<<
"->SetContourLevel("<<bin<<
","<<zlevel<<
");"<<std::endl;
6917 static Int_t funcNumber = 0;
6922 out<<
" "<<hname<<
"->GetListOfFunctions()->Add(" 6923 <<
Form(
"%s%d",obj->
GetName(),funcNumber)<<
");"<<std::endl;
6925 out<<
" "<<hname<<
"->GetListOfFunctions()->Add(ptstats);"<<std::endl;
6926 out<<
" ptstats->SetParent("<<hname<<
");"<<std::endl;
6928 out<<
" "<<hname<<
"->GetListOfFunctions()->Add(" 6930 <<
","<<quote<<lnk->
GetOption()<<quote<<
");"<<std::endl;
6945 out<<
" "<<hname<<
"->Draw(" 6946 <<quote<<option<<quote<<
");"<<std::endl;
6990 while ((obj = next())) {
7020 if (axis<1 || (axis>3 && axis<11) || axis>13)
return 0;
7024 if (stats[0] == 0)
return 0;
7026 Int_t ax[3] = {2,4,7};
7027 return stats[ax[axis-1]]/stats[0];
7032 return ( neff > 0 ? stddev/
TMath::Sqrt(neff) : 0. );
7073 if (axis<1 || (axis>3 && axis<11) || axis>13)
return 0;
7078 if (stats[0] == 0)
return 0;
7079 Int_t ax[3] = {2,4,7};
7080 Int_t axm = ax[axis%10 - 1];
7081 x = stats[axm]/stats[0];
7082 stddev2 =
TMath::Abs(stats[axm+1]/stats[0] -x*x);
7089 return ( neff > 0 ?
TMath::Sqrt(stddev2/(2*neff) ) : 0. );
7125 if (axis > 0 && axis <= 3){
7129 Double_t stddev3 = stddev*stddev*stddev;
7140 if (firstBinX == 1) firstBinX = 0;
7144 if (firstBinY == 1) firstBinY = 0;
7148 if (firstBinZ == 1) firstBinZ = 0;
7156 for (
Int_t binx = firstBinX; binx <= lastBinX; binx++) {
7157 for (
Int_t biny = firstBinY; biny <= lastBinY; biny++) {
7158 for (
Int_t binz = firstBinZ; binz <= lastBinZ; binz++) {
7164 sum+=w*(x-mean)*(x-mean)*(x-mean);
7171 else if (axis > 10 && axis <= 13) {
7178 Error(
"GetSkewness",
"illegal value of parameter");
7194 if (axis > 0 && axis <= 3){
7198 Double_t stddev4 = stddev*stddev*stddev*stddev;
7209 if (firstBinX == 1) firstBinX = 0;
7213 if (firstBinY == 1) firstBinY = 0;
7217 if (firstBinZ == 1) firstBinZ = 0;
7225 for (
Int_t binx = firstBinX; binx <= lastBinX; binx++) {
7226 for (
Int_t biny = firstBinY; biny <= lastBinY; biny++) {
7227 for (
Int_t binz = firstBinZ; binz <= lastBinZ; binz++) {
7233 sum+=w*(x-mean)*(x-mean)*(x-mean)*(x-mean);
7240 }
else if (axis > 10 && axis <= 13) {
7244 return ( neff > 0 ?
TMath::Sqrt(24./neff ) : 0. );
7247 Error(
"GetKurtosis",
"illegal value of parameter");
7291 for (bin=0;bin<4;bin++) stats[bin] = 0;
7297 if (firstBinX == 1) firstBinX = 0;
7300 for (binx = firstBinX; binx <= lastBinX; binx++) {
7307 stats[1] += err*err;
7362 Int_t bin,binx,biny,binz;
7367 bin =
GetBin(binx,biny,binz);
7397 return DoIntegral(binx1,binx2,0,-1,0,-1,err,option);
7425 if (binx1 < 0) binx1 = 0;
7426 if (binx2 >= nx || binx2 < binx1) binx2 = nx - 1;
7430 if (biny1 < 0) biny1 = 0;
7431 if (biny2 >= ny || biny2 < biny1) biny2 = ny - 1;
7433 biny1 = 0; biny2 = 0;
7438 if (binz1 < 0) binz1 = 0;
7439 if (binz2 >= nz || binz2 < binz1) binz2 = nz - 1;
7441 binz1 = 0; binz2 = 0;
7454 for (
Int_t binx = binx1; binx <= binx2; ++binx) {
7456 for (
Int_t biny = biny1; biny <= biny2; ++biny) {
7458 for (
Int_t binz = binz1; binz <= binz2; ++binz) {
7509 printf(
" AndersonDarlingTest Prob = %g, AD TestStatistic = %g\n",pvalue,advalue);
7511 if (opt.
Contains(
"T") )
return advalue;
7522 Error(
"AndersonDarlingTest",
"Histograms must be 1-D");
7621 if (h2 == 0)
return 0;
7629 Error(
"KolmogorovTest",
"Histograms must be 1-D\n");
7635 Error(
"KolmogorovTest",
"Number of channels is different, %d and %d\n",ncx1,ncx2);
7646 if (diff1 > difprec || diff2 > difprec) {
7647 Error(
"KolmogorovTest",
"histograms with different binning");
7660 if (opt.
Contains(
"O")) ilast = ncx1 +1;
7661 for (bin = ifirst; bin <= ilast; bin++) {
7670 Error(
"KolmogorovTest",
"Histogram1 %s integral is zero\n",h1->
GetName());
7674 Error(
"KolmogorovTest",
"Histogram2 %s integral is zero\n",h2->
GetName());
7683 esum1 = sum1 * sum1 / w1;
7688 esum2 = sum2 * sum2 / w2;
7692 if (afunc2 && afunc1) {
7693 Error(
"KolmogorovTest",
"Errors are zero for both histograms\n");
7702 Double_t dfmax =0, rsum1 = 0, rsum2 = 0;
7704 for (bin=ifirst;bin<=ilast;bin++) {
7711 Double_t z, prb1=0, prb2=0, prb3=0;
7726 if (opt.
Contains(
"N") && !(afunc1 || afunc2 ) ) {
7730 Double_t chi2 = d12*d12/(esum1+esum2);
7733 if (prob > 0 && prb2 > 0) prob *= prb2*(1-
TMath::Log(prob*prb2));
7737 const Int_t nEXPT = 1000;
7738 if (opt.
Contains(
"X") && !(afunc1 || afunc2 ) ) {
7743 for (
Int_t i=0; i < nEXPT; i++) {
7747 if (dSEXPT>dfmax) prb3 += 1.0;
7755 printf(
" Kolmo Prob h1 = %s, sum bin content =%g effective entries =%g\n",h1->
GetName(),sum1,esum1);
7756 printf(
" Kolmo Prob h2 = %s, sum bin content =%g effective entries =%g\n",h2->
GetName(),sum2,esum2);
7757 printf(
" Kolmo Prob = %g, Max Dist = %g\n",prob,dfmax);
7759 printf(
" Kolmo Prob = %f for shape alone, =%f for normalisation alone\n",prb1,prb2);
7761 printf(
" Kolmo Prob = %f with %d pseudo-experiments\n",prb3,nEXPT);
7767 if(opt.
Contains(
"M"))
return dfmax;
7768 else if(opt.
Contains(
"X"))
return prb3;
7831 if (zlevel <= 0)
return 0;
7848 if (buffersize <= 0) {
7852 if (buffersize < 100) buffersize = 100;
7880 for (level=0; level<nlevels; level++)
fContour.
fArray[level] = levels[level];
7885 if ((zmin == zmax) && (zmin != 0)) {
7891 if (zmax <= 0)
return;
7892 if (zmin <= 0) zmin = 0.001*zmax;
7895 dz = (zmax-zmin)/
Double_t(nlevels);
7897 for (level=0; level<nlevels; level++) {
7932 Int_t bin, binx, biny, binz;
7940 for (binz=zfirst;binz<=zlast;binz++) {
7941 for (biny=yfirst;biny<=ylast;biny++) {
7942 for (binx=xfirst;binx<=xlast;binx++) {
7943 bin =
GetBin(binx,biny,binz);
7945 if (value > maximum && value < maxval) maximum =
value;
7971 Int_t bin, binx, biny, binz;
7980 locm = locmax = locmay = locmaz = 0;
7981 for (binz=zfirst;binz<=zlast;binz++) {
7982 for (biny=yfirst;biny<=ylast;biny++) {
7983 for (binx=xfirst;binx<=xlast;binx++) {
7984 bin =
GetBin(binx,biny,binz);
7986 if (value > maximum) {
8017 Int_t bin, binx, biny, binz;
8025 for (binz=zfirst;binz<=zlast;binz++) {
8026 for (biny=yfirst;biny<=ylast;biny++) {
8027 for (binx=xfirst;binx<=xlast;binx++) {
8028 bin =
GetBin(binx,biny,binz);
8030 if (value < minimum && value > minval) minimum =
value;
8056 Int_t bin, binx, biny, binz;
8065 locm = locmix = locmiy = locmiz = 0;
8066 for (binz=zfirst;binz<=zlast;binz++) {
8067 for (biny=yfirst;biny<=ylast;biny++) {
8068 for (binx=xfirst;binx<=xlast;binx++) {
8069 bin =
GetBin(binx,biny,binz);
8071 if (value < minimum) {
8097 Error(
"SetBins",
"Operation only valid for 1-d histograms");
8125 Error(
"SetBins",
"Operation only valid for 1-d histograms");
8152 Error(
"SetBins",
"Operation only valid for 2-D histograms");
8160 fNcells = (nx+2)*(ny+2);
8181 Error(
"SetBins",
"Operation only valid for 2-D histograms");
8189 fNcells = (nx+2)*(ny+2);
8209 Error(
"SetBins",
"Operation only valid for 3-D histograms");
8218 fNcells = (nx+2)*(ny+2)*(nz+2);
8240 Error(
"SetBins",
"Operation only valid for 3-D histograms");
8249 fNcells = (nx+2)*(ny+2)*(nz+2);
8364 Warning(
"Sumw2",
"Sum of squares of weights structure already created");
8401 if (bin < 0) bin = 0;
8402 if (bin >= fNcells) bin = fNcells-1;
8419 if (bin < 0) bin = 0;
8420 if (bin >= fNcells) bin = fNcells-1;
8429 Warning(
"GetBinErrorLow",
"Histogram has negative bin content-force usage to normal errors");
8434 if (n == 0)
return 0;
8448 if (bin < 0) bin = 0;
8449 if (bin >= fNcells) bin = fNcells-1;
8458 Warning(
"GetBinErrorUp",
"Histogram has negative bin content-force usage to normal errors");
8477 Error(
"GetBinCenter",
"Invalid method for a %d-d histogram - return a NaN",
fDimension);
8488 Error(
"GetBinLowEdge",
"Invalid method for a %d-d histogram - return a NaN",
fDimension);
8499 Error(
"GetBinWidth",
"Invalid method for a %d-d histogram - return a NaN",
fDimension);
8526 Error(
"GetLowEdge",
"Invalid method for a %d-d histogram ",
fDimension);
8535 if (bin < 0 || bin>=
fSumw2.
fN)
return;
8551 if (bin < 0)
return;
8552 if (bin >= fNcells-1) {
8619 return (
TH1*)
gROOT->ProcessLineFast(
Form(
"TSpectrum::StaticBackground((TH1*)0x%lx,%d,\"%s\")",
8620 (
ULong_t)
this, niter, option));
8634 return (
Int_t)
gROOT->ProcessLineFast(
Form(
"TSpectrum::StaticSearch((TH1*)0x%lx,%g,\"%s\",%g)",
8635 (
ULong_t)
this, sigma, option, threshold));
8654 ::Error(
"TransformHisto",
"Invalid FFT transform class");
8659 ::Error(
"TransformHisto",
"Only 1d and 2D transform are supported");
8673 hout =
new TH1D(name, name,n[0], 0, n[0]);
8675 hout =
new TH2D(name, name, n[0], 0, n[0], n[1], 0, n[1]);
8683 for (binx = 1; binx<=hout->
GetNbinsX(); binx++) {
8684 for (biny=1; biny<=hout->
GetNbinsY(); biny++) {
8685 ind[0] = binx-1; ind[1] = biny-1;
8691 for (binx = 1; binx<=hout->
GetNbinsX(); binx++) {
8692 for (biny=1; biny<=hout->
GetNbinsY(); biny++) {
8693 ind[0] = binx-1; ind[1] = biny-1;
8702 for (binx = 1; binx<=hout->
GetNbinsX(); binx++) {
8703 for (biny=1; biny<=hout->
GetNbinsY(); biny++) {
8704 ind[0] = binx-1; ind[1] = biny-1;
8710 ::Error(
"TransformHisto",
"No complex numbers in the output");
8717 for (binx = 1; binx<=hout->
GetNbinsX(); binx++) {
8718 for (biny=1; biny<=hout->
GetNbinsY(); biny++) {
8719 ind[0] = binx-1; ind[1] = biny-1;
8725 for (binx = 1; binx<=hout->
GetNbinsX(); binx++) {
8726 for (biny=1; biny<=hout->
GetNbinsY(); biny++) {
8727 ind[0] = binx-1; ind[1] = biny-1;
8736 for (binx = 1; binx<=hout->
GetNbinsX(); binx++){
8737 for (biny=1; biny<=hout->
GetNbinsY(); biny++){
8738 ind[0] = binx-1; ind[1] = biny-1;
8759 printf(
"Pure real output, no phase");
8792 std::ostringstream strm;
8822 : TH1(name,title,nbins,xlow,xup)
8837 :
TH1(name,title,nbins,xbins)
8850 :
TH1(name,title,nbins,xbins)
8890 if (newval > -128 && newval < 128) {
fArray[bin] =
Char_t(newval);
return;}
8891 if (newval < -127)
fArray[bin] = -127;
8892 if (newval > 127)
fArray[bin] = 127;
9023 : TH1(name,title,nbins,xlow,xup)
9038 :
TH1(name,title,nbins,xbins)
9051 :
TH1(name,title,nbins,xbins)
9091 if (newval > -32768 && newval < 32768) {
fArray[bin] =
Short_t(newval);
return;}
9092 if (newval < -32767)
fArray[bin] = -32767;
9093 if (newval > 32767)
fArray[bin] = 32767;
9222 : TH1(name,title,nbins,xlow,xup)
9237 :
TH1(name,title,nbins,xbins)
9250 :
TH1(name,title,nbins,xbins)
9290 if (newval > -2147483647 && newval < 2147483647) {
fArray[bin] =
Int_t(newval);
return;}
9291 if (newval < -2147483647)
fArray[bin] = -2147483647;
9292 if (newval > 2147483647)
fArray[bin] = 2147483647;
9422 : TH1(name,title,nbins,xlow,xup)
9437 :
TH1(name,title,nbins,xbins)
9450 :
TH1(name,title,nbins,xbins)
9468 for (
Int_t i=0;i<fNcells-2;i++) {
9619 : TH1(name,title,nbins,xlow,xup)
9634 :
TH1(name,title,nbins,xbins)
9647 :
TH1(name,title,nbins,xbins)
9665 for (
Int_t i=0;i<fNcells-2;i++) {
9799 if(hid >= 0) hname.
Form(
"h%d",hid);
9800 else hname.
Form(
"h_%d",hid);
9808 TH1 *
R__H(
const char * hname)
static void StatOverflows(Bool_t flag=kTRUE)
if flag=kTRUE, underflows and overflows are used by the Fill functions in the computation of statisti...
Abstract array base class.
virtual void Browse(TBrowser *b)
Browe the Histogram object.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title Offset is a correction factor with respect to the "s...
virtual const char * GetName() const
Returns name of object.
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
virtual void Print(Option_t *option="") const
Print some global quantities for this histogram.
virtual void SetNameTitle(const char *name, const char *title)
Change the name and title of this histogram.
virtual void SetLineWidth(Width_t lwidth)
virtual UInt_t GetUniqueID() const
Return the unique object id.
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
Return Global bin number corresponding to x,y,z.
virtual Float_t GetTickLength() const
virtual void SetBarOffset(Float_t offset=0.25)
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
virtual Int_t ShowPeaks(Double_t sigma=2, Option_t *option="", Double_t threshold=0.05)
Interface to TSpectrum::Search.
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
TH1D & operator=(const TH1D &h1)
Operator =.
virtual Double_t IntegralAndError(Int_t binx1, Int_t binx2, Double_t &err, Option_t *option="") const
Return integral of bin contents in range [binx1,binx2] and its error By default the integral is compu...
void SetBarWidth(Float_t barwidth=0.5)
virtual void SaveAttributes(std::ostream &out, const char *name, const char *subname)
Save axis attributes as C++ statement(s) on output stream out.
virtual Double_t GetEffectiveEntries() const
number of effective entries of the histogram, neff = (Sum of weights )^2 / (Sum of weight^2 ) In case...
virtual void Paint(Option_t *option="")
Control routine to paint any kind of histograms.
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
virtual Double_t GetBinCenter(Int_t bin) const
return bin center for 1D historam Better to use h1.GetXaxis().GetBinCenter(bin)
const char * GetBinLabel(Int_t bin) const
Return label for bin.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual Double_t PoissonD(Double_t mean)
Generates a random number according to a Poisson law.
Double_t Floor(Double_t x)
void Set(Int_t n)
Set size of this array to n chars.
virtual ~TH1I()
Destructor.
Int_t GetFirst() const
Return first bin on the axis i.e.
virtual void SetMaximum(Double_t maximum=-1111)
void UseCurrentStyle()
Copy current attributes from/to current style.
virtual void LabelsOption(Option_t *option="h", Option_t *axis="X")
Set option(s) to draw axis with labels.
virtual void SetLimits(Double_t xmin, Double_t xmax)
static Bool_t fgDefaultSumw2
flag to use under/overflows in statistics
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)=0
Computes distance from point (px,py) to the object.
TVirtualHistPainter * GetPainter(Option_t *option="")
return pointer to painter if painter does not exist, it is created
virtual void FitPanel()
Display a panel with all histogram fit options.
virtual Double_t Rndm(Int_t i=0)
Machine independent random number generator.
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
virtual TF1 * GetFunction(const char *name) const
Return pointer to function with name.
virtual Float_t GetLabelOffset() const
virtual Float_t GetBarOffset() const
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
Double_t KolmogorovProb(Double_t z)
Calculates the Kolmogorov distribution function, which gives the probability that Kolmogorov's test ...
virtual void Set(Int_t n)=0
virtual void ResetAttAxis(Option_t *option="")
Reset axis attributes.
virtual void SetError(const Double_t *error)
Replace bin errors by values in array error.
virtual Double_t GetNormFactor() const
TString & ReplaceAll(const TString &s1, const TString &s2)
virtual Int_t BufferFill(Double_t x, Double_t w)
accumulate arguments in buffer.
virtual void SetContour(Int_t nlevels, const Double_t *levels=0)
Set the number and values of contour levels.
R__EXTERN TStyle * gStyle
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
void SetHistLineWidth(Width_t width=1)
const Double_t * GetArray() const
virtual Int_t FindLastBinAbove(Double_t threshold=0, Int_t axis=1) const
Find last bin with content > threshold for axis (1=x, 2=y, 3=z) if no bins with content > threshold i...
Bool_t TestBit(UInt_t f) const
virtual void SetBins(Int_t nx, Double_t xmin, Double_t xmax)
Redefine x axis parameters.
virtual Int_t GetXfirst() const
virtual void SetName(const char *name)
Change (i.e.
virtual Color_t GetAxisColor() const
TH1 * GetAsymmetry(TH1 *h2, Double_t c2=1, Double_t dc2=0)
Return an histogram containing the asymmetry of this histogram with h2, where the asymmetry is define...
static Bool_t fgStatOverflows
flag to add histograms to the directory
virtual TH1 * DrawNormalized(Option_t *option="", Double_t norm=1) const
Draw a normalized copy of this histogram.
static Bool_t SameLimitsAndNBins(const TAxis &axis1, const TAxis &axis2)
Same limits and bins.
virtual ~TH1F()
Destructor.
virtual void SetLabelColor(Color_t color=1, Float_t alpha=1.)
Set color of labels.
void Build()
Creates histogram basic data structure.
virtual Double_t GetSumOfWeights() const
Return the sum of weights excluding under/overflows.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual void SetNdivisions(Int_t n=510, Bool_t optim=kTRUE)
Set the number of divisions for this axis.
virtual Int_t GetEntries() const
virtual void Copy(TObject &hnew) const
Copy this to newth1.
virtual Int_t GetQuantiles(Int_t nprobSum, Double_t *q, const Double_t *probSum=0)
Compute Quantiles for this histogram Quantile x_q of a probability distribution Function F is defined...
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
virtual void AddFirst(TObject *obj)
Add object at the beginning of the list.
void ToUpper()
Change string to upper case.
virtual void Reset(Option_t *option="")
Reset.
friend TH1D operator/(const TH1D &h1, const TH1D &h2)
Operator /.
static bool CheckAxisLimits(const TAxis *a1, const TAxis *a2)
Check that the axis limits of the histograms are the same if a first and last bin is passed the axis ...
virtual void AddAll(const TCollection *col)
Add all objects from collection col to this collection.
Buffer base class used for serializing objects.
friend TH1S operator+(const TH1S &h1, const TH1S &h2)
Operator +.
virtual Double_t GetMeanError(Int_t axis=1) const
Return standard error of mean of this histogram along the X axis.
virtual Int_t GetNbinsZ() const
virtual void SetMinimum(Double_t minimum=-1111)
static THLimitsFinder * GetLimitsFinder()
Return pointer to the current finder.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual Double_t GetMean(Int_t axis=1) const
For axis = 1,2 or 3 returns the mean value of the histogram along X,Y or Z axis.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual void Copy(TObject &hnew) const
Copy this to newth1.
Int_t LoadPlugin()
Load the plugin library for this handler.
virtual void GetBinXYZ(Int_t binglobal, Int_t &binx, Int_t &biny, Int_t &binz) const
return binx, biny, binz corresponding to the global bin number globalbin see TH1::GetBin function abo...
Option_t * GetOption() const
double gamma_quantile_c(double z, double alpha, double theta)
Inverse ( ) of the cumulative distribution function of the upper tail of the gamma distribution (gamm...
virtual void Copy(TObject &hnew) const
Copy this to newth1.
static Bool_t AddDirectoryStatus()
static function: cannot be inlined on Windows/NT
1-D histogram with a float per channel (see TH1 documentation)}
1-D histogram with a short per channel (see TH1 documentation)
void H1InitExpo()
Compute Initial values of parameters for an exponential.
Array of floats (32 bits per element).
virtual void SetTitleFont(Style_t font=62)
Set the title font.
Short_t Min(Short_t a, Short_t b)
void ToLower()
Change string to lower-case.
void SetBarOffset(Float_t baroff=0.5)
R__EXTERN TVirtualMutex * gROOTMutex
void Copy(TAttMarker &attmarker) const
Copy this marker attributes to a new TAttMarker.
virtual TH1 * DrawCopy(Option_t *option="", const char *name_postfix="_copy") const
Copy this histogram and Draw in the current pad.
virtual void SetFillStyle(Style_t fstyle)
virtual void Smooth(Int_t ntimes=1, Option_t *option="")
Smooth bin contents of this histogram.
virtual void UseCurrentStyle()
Set current style settings in this object This function is called when either TCanvas::UseCurrentStyl...
virtual void Copy(TObject &axis) const
Copy axis structure to another axis.
virtual Float_t GetLabelSize() const
virtual Double_t GetBinLowEdge(Int_t bin) const
return bin lower edge for 1D historam Better to use h1.GetXaxis().GetBinLowEdge(bin) ...
static Bool_t AlmostInteger(Double_t a, Double_t epsilon=0.00000001)
virtual void Copy(TObject &hnew) const
Copy this to newth1.
virtual Double_t Integral(Double_t a, Double_t b, Double_t epsrel=1.e-12)
IntegralOneDim or analytical integral.
virtual Int_t FindGoodLimits(TH1 *h, Double_t xmin, Double_t xmax)
compute the best axis limits for the X axis.
static Bool_t RecomputeAxisLimits(TAxis &destAxis, const TAxis &anAxis)
Finds new limits for the axis for the Merge function.
virtual Bool_t Multiply(TF1 *h1, Double_t c1=1)
Performs the operation: this = this*c1*f1 if errors are defined (see TH1::Sumw2), errors are also rec...
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
virtual TObject * Clone(const char *newname="") const
Make a clone of an collection using the Streamer facility.
virtual Double_t GetContourLevel(Int_t level) const
Return value of contour number level use GetContour to return the array of all contour levels...
virtual void SetLabelOffset(Float_t offset=0.005)
Set distance between the axis and the labels The distance is expressed in per cent of the pad width...
virtual Width_t GetLineWidth() const
friend TH1D operator+(const TH1D &h1, const TH1D &h2)
Operator +.
Double_t Prob(Double_t chi2, Int_t ndf)
Computation of the probability for a certain Chi-squared (chi2) and number of degrees of freedom (ndf...
static bool CheckBinLimits(const TAxis *a1, const TAxis *a2)
Array of integers (32 bits per element).
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void SetBuffer(Int_t buffersize, Option_t *option="")
set the maximum number of entries to be kept in the buffer
virtual void GetStats(Double_t *stats) const
fill the array stats from the contents of this histogram The array stats must be correctly dimensione...
virtual Bool_t CanExtendAllAxes() const
returns true if all axes are extendable
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
friend TH1S operator-(const TH1S &h1, const TH1S &h2)
Operator -.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Width_t GetHistLineWidth() const
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
virtual void SetBarWidth(Float_t width=0.5)
virtual void SetLabelFont(Style_t font=62)
Set labels' font.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
static TVirtualHistPainter * HistPainter(TH1 *obj)
Static function returning a pointer to the current histogram painter.
virtual void SetPoint(Int_t ipoint, Double_t re, Double_t im=0)=0
virtual Style_t GetMarkerStyle() const
static void SetDefaultSumw2(Bool_t sumw2=kTRUE)
static function.
virtual Style_t GetTitleFont() const
static bool CheckConsistentSubAxes(const TAxis *a1, Int_t firstBin1, Int_t lastBin1, const TAxis *a2, Int_t firstBin2=0, Int_t lastBin2=0)
Check that two sub axis are the same the limits are defined by first bin and last bin N...
virtual Style_t GetLineStyle() const
virtual Int_t GetDimension() const
virtual Double_t Interpolate(Double_t x)
Given a point x, approximates the value via linear interpolation based on the two nearest bin centers...
virtual Int_t GetContour(Double_t *levels=0)
Return contour values into array levels if pointer levels is non zero.
TH1C & operator=(const TH1C &h1)
Operator =.
virtual void Paint(Option_t *option="")=0
This method must be overridden if a class wants to paint itself.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Fill Area Attributes class.
static Int_t FitOptionsMake(Option_t *option, Foption_t &Foption)
flag to call TH1::Sumw2 automatically at histogram creation time
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
virtual void Eval(TF1 *f1, Option_t *option="")
Evaluate function f1 at the center of bins of this histogram.
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
static Bool_t GetDefaultSumw2()
return kTRUE if TH1::Sumw2 must be called when creating new histograms.
void SetHistFillColor(Color_t color=1)
virtual Bool_t GetTimeDisplay() const
static void SetDefaultBufferSize(Int_t buffersize=1000)
static function to set the default buffer size for automatic histograms.
void Copy(TAttLine &attline) const
Copy this line attributes to a new TAttLine.
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
virtual Double_t Chi2Test(const TH1 *h2, Option_t *option="UU", Double_t *res=0) const
chi^{2} test for comparing weighted and unweighted histograms
The TNamed class is the base class for all named ROOT classes.
virtual ~TH1()
Histogram default destructor.
THashList * GetLabels() const
friend TH1D operator-(const TH1D &h1, const TH1D &h2)
Operator -.
Double_t Log10(Double_t x)
virtual void SetContourLevel(Int_t level, Double_t value)
Set value for one contour level.
virtual void GetCenter(Double_t *center) const
Return an array with the center of all bins.
Abstract interface to a histogram painter.
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
virtual void SetMarkerColor(Color_t mcolor=1)
Style_t GetHistFillStyle() const
TString & Append(const char *cs)
virtual void GetLowEdge(Double_t *edge) const
Return an array with the lod edge of all bins.
void Sort(Index n, const Element *a, Index *index, Bool_t down=kTRUE)
void H1InitGaus()
Compute Initial values of parameters for a gaussian.
virtual Size_t GetMarkerSize() const
virtual void DrawPanel()=0
friend TH1I operator-(const TH1I &h1, const TH1I &h2)
Operator -.
virtual void SaveMarkerAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
Save line attributes as C++ statement(s) on output stream out.
virtual Int_t * GetN() const =0
Float_t GetBarWidth() const
virtual Bool_t FindNewAxisLimits(const TAxis *axis, const Double_t point, Double_t &newMin, Double_t &newMax)
finds new limits for the axis so that point is within the range and the limits are compatible with th...
virtual void SetContent(const Double_t *content)
Replace bin contents by the contents of array content.
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
friend TH1C operator*(Double_t c1, const TH1C &h1)
Operator *.
virtual void ResetStats()
Reset the statistics including the number of entries and replace with values calculates from bin cont...
void Set(Int_t n)
Set size of this array to n ints.
virtual void SetBinError(Int_t bin, Double_t error)
see convention for numbering bins in TH1::GetBin
Int_t AxisChoice(Option_t *axis) const
Choose an axis according to "axis".
virtual Double_t ComputeIntegral(Bool_t onlyPositive=false)
Compute integral (cumulative sum of bins) The result stored in fIntegral is used by the GetRandom fun...
virtual void LabelsInflate(Option_t *axis="X")
Double the number of bins for axis.
virtual Color_t GetLabelColor() const
virtual Double_t GetSkewness(Int_t axis=1) const
For axis = 1, 2 or 3 returns skewness of the histogram along x, y or z axis.
virtual void SetTimeDisplay(Int_t value)
void H1LeastSquareFit(Int_t n, Int_t m, Double_t *a)
Least squares lpolynomial fitting without weights.
virtual Bool_t Divide(TF1 *f1, Double_t c1=1)
Performs the operation: this = this/(c1*f1) if errors are defined (see TH1::Sumw2), errors are also recalculated.
virtual Int_t GetNdivisions() const
Bool_t IsBinUnderflow(Int_t bin) const
static Bool_t fgAddDirectory
default buffer size for automatic histograms
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
void Set(Int_t n)
Set size of this array to n shorts.
virtual Double_t GetStdDevError(Int_t axis=1) const
Return error of standard deviation estimation for Normal distribution.
virtual Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const
Statistical test of compatibility in shape between this histogram and h2, using Kolmogorov test...
virtual void ExtendAxis(Double_t x, TAxis *axis)
Histogram is resized along axis such that x is in the axis range.
Bool_t AreEqualRel(Double_t af, Double_t bf, Double_t relPrec)
TH1 * GetCumulative(Bool_t forward=kTRUE, const char *suffix="_cumulative") const
Return a pointer to an histogram containing the cumulative The cumulative can be computed both in the...
virtual TH1 * FFT(TH1 *h_output, Option_t *option)
This function allows to do discrete Fourier transforms of TH1 and TH2.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a line.
std::string printValue(const TDatime &val)
Print a TDatime at the prompt.
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
virtual void SetLineColor(Color_t lcolor)
friend TH1S operator/(const TH1S &h1, const TH1S &h2)
Operator /.
Using a TBrowser one can browse all ROOT objects.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
virtual Double_t * GetIntegral()
Return a pointer to the array of bins integral.
virtual void SetRange(Int_t first=0, Int_t last=0)
Set the viewing range for the axis from bin first to last.
void Clear(Option_t *option="")
Remove all objects from the list.
virtual void SetParLimits(Int_t ipar, Double_t parmin, Double_t parmax)
Set limits for parameter ipar.
friend TH1C operator-(const TH1C &h1, const TH1C &h2)
Operator -.
friend TH1C operator+(const TH1C &h1, const TH1C &h2)
Operator +.
void FillData(BinData &dv, const TH1 *hist, TF1 *func=0)
fill the data vector from a TH1.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
void SetHistFillStyle(Style_t styl=0)
Int_t GetLast() const
Return last bin on the axis i.e.
static void SmoothArray(Int_t NN, Double_t *XX, Int_t ntimes=1)
smooth array xx, translation of Hbook routine hsmoof.F based on algorithm 353QH twice presented by J...
Class to manage histogram axis.
virtual Double_t GetKurtosis(Int_t axis=1) const
For axis =1, 2 or 3 returns kurtosis of the histogram along x, y or z axis.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
static bool CheckBinLabels(const TAxis *a1, const TAxis *a2)
check that axis have same labels
Array of shorts (16 bits per element).
virtual Double_t GetPointReal(Int_t ipoint, Bool_t fromInput=kFALSE) const =0
TH1 * R__H(Int_t hid)
return pointer to histogram with name hid if id >=0 h_id if id <0
virtual void SetFillColor(Color_t fcolor)
A 3-Dim function with parameters.
virtual Double_t GetBinWithContent(Double_t c, Int_t &binx, Int_t firstx=0, Int_t lastx=0, Double_t maxdiff=0) const
compute first binx in the range [firstx,lastx] for which diff = abs(bin_content-c) <= maxdiff In case...
friend TH1I operator+(const TH1I &h1, const TH1I &h2)
Operator +.
void SetCanExtend(Bool_t canExtend)
1-D histogram with an int per channel (see TH1 documentation)}
Long_t ExecPlugin(int nargs, const T &... params)
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)=0
Execute action corresponding to an event at (px,py).
unsigned int r1[N_CITIES]
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...
static TH1 * TransformHisto(TVirtualFFT *fft, TH1 *h_output, Option_t *option)
For a given transform (first parameter), fills the histogram (second parameter) with the transform ou...
static TVirtualFFT * FFT(Int_t ndim, Int_t *n, Option_t *option)
Returns a pointer to the FFT of requested size and type.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
Collection abstract base class.
static Int_t fgBufferSize
virtual TH1 * Rebin(Int_t ngroup=2, const char *newname="", const Double_t *xbins=0)
Rebin this histogram.
virtual Double_t AndersonDarlingTest(const TH1 *h2, Option_t *option="") const
Statistical test of compatibility in shape between this histogram and h2, using the Anderson-Darling ...
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
Save fill attributes as C++ statement(s) on output stream out.
virtual Float_t GetTitleOffset() const
virtual void LabelsDeflate(Option_t *axis="X")
Reduce the number of bins for the axis passed in the option to the number of bins having a label...
virtual void DoFillN(Int_t ntimes, const Double_t *x, const Double_t *w, Int_t stride=1)
internal method to fill histogram content from a vector called directly by TH1::BufferEmpty ...
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
char * Form(const char *fmt,...)
virtual void Transform()=0
virtual Double_t Chisquare(TF1 *f1, Option_t *option="") const
Compute and return the chisquare of this histogram with respect to a function The chisquare is comput...
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
static TVirtualFitter * GetFitter()
static: return the current Fitter
virtual void Copy(TObject &hnew) const
Copy this histogram structure to newth1.
virtual TH1 * ShowBackground(Int_t niter=20, Option_t *option="same")
This function calculates the background spectrum in this histogram.
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
virtual ~TH1C()
Destructor.
static void RejectPoint(Bool_t reject=kTRUE)
Static function to set the global flag to reject points the fgRejectPoint global flag is tested by al...
virtual void Copy(TObject &hnew) const
Copy this to newth1.
virtual void SetMarkerStyle(Style_t mstyle=1)
virtual Double_t GetContourLevelPad(Int_t level) const
Return the value of contour number "level" in Pad coordinates ie: if the Pad is in log scale along Z ...
double Chisquare(const TH1 &h1, TF1 &f1, bool useRange)
compute the chi2 value for an histogram given a function (see TH1::Chisquare for the documentation) ...
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
virtual Color_t GetTitleColor() const
Double_t * fIntegral
Histogram dimension (1, 2 or 3 dim)
static bool CheckConsistency(const TH1 *h1, const TH1 *h2)
Check histogram compatibility.
void SetName(const char *name)
A 2-Dim function with parameters.
void H1LeastSquareSeqnd(Int_t n, Double_t *a, Int_t idim, Int_t &ifail, Int_t k, Double_t *b)
Extracted from CERN Program library routine DSEQN.
TH1()
Histogram default constructor.
R__EXTERN TRandom * gRandom
1-D histogram with a double per channel (see TH1 documentation)}
virtual Int_t GetBin(Int_t binx, Int_t biny=0, Int_t binz=0) const
Return Global bin number corresponding to binx,y,z.
static Int_t GetDefaultBufferSize()
static function return the default buffer size for automatic histograms the parameter fgBufferSize ma...
virtual void SetAxisColor(Color_t color=1, Float_t alpha=1.)
Set color of the line axis and tick marks.
virtual TObject * FindObject(const char *name) const
search object named name in the list of functions
virtual void Rebuild(Option_t *option="")
Using the current bin info, recompute the arrays for contents and errors.
virtual Int_t FindFirstBinAbove(Double_t threshold=0, Int_t axis=1) const
Find first bin with content > threshold for axis (1=x, 2=y, 3=z) if no bins with content > threshold ...
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels The size is expressed in per cent of the pad width.
virtual void SetMarkerSize(Size_t msize=1)
friend TH1I operator/(const TH1I &h1, const TH1I &h2)
Operator /.
virtual void SetTitleColor(Color_t color=1)
Set color of axis title.
virtual TObjLink * FirstLink() const
virtual void SetTitleSize(Float_t size=0.04)
Set size of axis title The size is expressed in per cent of the pad width.
virtual void RecursiveRemove(TObject *obj)
Recursively remove object from the list of functions.
EBinErrorOpt fBinStatErrOpt
pointer to histogram painter
virtual Double_t RetrieveBinContent(Int_t bin) const
raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::Get...
virtual Double_t GetMinimum(Double_t minval=-FLT_MAX) const
Return minimum value larger than minval of bins in the range, unless the value has been overridden by...
#define R__LOCKGUARD2(mutex)
TVirtualFFT is an interface class for Fast Fourier Transforms.
virtual Color_t GetLineColor() const
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
virtual void SetName(const char *name)
Change the name of this histogram.
friend TH1I operator*(Double_t c1, const TH1I &h1)
Operator *.
static TVirtualFFT * SineCosine(Int_t ndim, Int_t *n, Int_t *r2rkind, Option_t *option)
Returns a pointer to a sine or cosine transform of requested size and kind.
TString & Remove(Ssiz_t pos)
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Int_t GetSumw2N() const
Color_t GetHistFillColor() const
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
virtual void GetPointComplex(Int_t ipoint, Double_t &re, Double_t &im, Bool_t fromInput=kFALSE) const =0
virtual Bool_t IsEmpty() const
virtual Double_t GetBinWidth(Int_t bin) const
return bin width for 1D historam Better to use h1.GetXaxis().GetBinWidth(bin)
static const double x1[5]
virtual TObject * Remove(TObject *)
Remove an object from the in-memory list.
class describing the range in the coordinates it supports multiple range in a coordinate.
Bool_t IsBinOverflow(Int_t bin) const
virtual Double_t GetBinErrorLow(Int_t bin) const
Return lower error associated to bin number bin.
void SetHistLineStyle(Style_t styl=0)
virtual void SavePrimitiveHelp(std::ostream &out, const char *hname, Option_t *option="")
helper function for the SavePrimitive functions from TH1 or classes derived from TH1, eg TProfile, TProfile2D.
Color_t GetHistLineColor() const
friend TH1D operator*(Double_t c1, const TH1D &h1)
Operator *.
Describe directory structure in memory.
Double_t Median(Long64_t n, const T *a, const Double_t *w=0, Long64_t *work=0)
double func(double *x, double *p)
virtual Color_t GetFillColor() const
TH1I & operator=(const TH1I &h1)
Operator =.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual Double_t GetEntries() const
return the current number of entries
virtual Float_t GetTitleSize() const
virtual Double_t Chi2TestX(const TH1 *h2, Double_t &chi2, Int_t &ndf, Int_t &igood, Option_t *option="UU", Double_t *res=0) const
The computation routine of the Chisquare test.
static bool IsEquidistantBinning(const TAxis &axis)
virtual void SetLineStyle(Style_t lstyle)
Array of doubles (64 bits per element).
void FitOptionsMake(EFitObjectType type, const char *option, Foption_t &fitOption)
Decode list of options into fitOption.
virtual void InitArgs(const Double_t *x, const Double_t *params)
Initialize parameters addresses.
virtual Bool_t Add(TF1 *h1, Double_t c1=1, Option_t *option="")
Performs the operation: this = this + c1*f1 if errors are defined (see TH1::Sumw2), errors are also recalculated.
Abstract Base Class for Fitting.
virtual UInt_t SetCanExtend(UInt_t extendBitMask)
make the histogram axes extendable / not extendable according to the bit mask returns the previous bi...
virtual Int_t FindFixBin(Double_t x, Double_t y=0, Double_t z=0) const
Return Global bin number corresponding to x,y,z.
Mother of all ROOT objects.
virtual Int_t FindFixBin(Double_t x) const
Find bin number corresponding to abscissa x.
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
virtual void ClearUnderflowAndOverflow()
Remove all the content from the underflow and overflow bins, without changing the number of entries A...
virtual Bool_t IsInside(const Double_t *x) const
return kTRUE if the point is inside the function range
TObject * GetObject() const
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Redefines TObject::GetObjectInfo.
TH1S & operator=(const TH1S &h1)
Operator =.
virtual Int_t GetNpar() const
Style_t GetHistLineStyle() const
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
virtual void DirectoryAutoAdd(TDirectory *)
Perform the automatic addition of the histogram to the given directory.
TVirtualHistPainter * fPainter
Integral of bins used by GetRandom.
virtual void Copy(TObject &named) const
Copy this to obj.
friend TH1C operator/(const TH1C &h1, const TH1C &h2)
Operator /.
friend TH1S operator*(Double_t c1, const TH1S &h1)
Operator *.
static Bool_t RejectedPoint()
See TF1::RejectPoint above.
virtual void DrawPanel()
Display a panel with all histogram drawing options.
virtual void Add(TObject *obj)
double f2(const double *x)
virtual void RecursiveRemove(TObject *obj)
Remove object from this collection and recursively remove the object from all other objects (and coll...
virtual Int_t GetMinimumBin() const
Return location of bin with minimum value in the range.
virtual Double_t GetBinErrorSqUnchecked(Int_t bin) const
virtual void GetRange(Double_t *xmin, Double_t *xmax) const
Return range of a generic N-D function.
virtual Double_t DoIntegral(Int_t ix1, Int_t ix2, Int_t iy1, Int_t iy2, Int_t iz1, Int_t iz2, Double_t &err, Option_t *opt, Bool_t doerr=kFALSE) const
internal function compute integral and optionally the error between the limits specified by the bin n...
virtual void FillN(Int_t ntimes, const Double_t *x, const Double_t *w, Int_t stride=1)
Fill this histogram with an array x and weights w.
Short_t Max(Short_t a, Short_t b)
virtual void SetBinsLength(Int_t=-1)
1-D histogram with a byte per channel (see TH1 documentation)
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
Double_t GetAt(Int_t i) const
Double_t Ceil(Double_t x)
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
Int_t fDimension
Pointer to directory holding this histogram.
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length The length is expressed in per cent of the pad width.
virtual Int_t GetXlast() const
virtual Double_t GetBinErrorUp(Int_t bin) const
Return upper error associated to bin number bin.
virtual Int_t BufferEmpty(Int_t action=0)
Fill histogram with all entries in the buffer.
virtual void SetParent(TObject *obj)
void Set(Int_t n)
Set size of this array to n floats.
virtual ~TH1D()
Destructor.
virtual void SetEntries(Double_t n)
Float_t GetBarOffset() const
virtual TH1 * GetHistogram() const
Return a pointer to the histogram used to vusualize the function.
virtual void SetParameter(Int_t param, Double_t value)
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
virtual void SetTitle(const char *title)
Change (i.e.
TFitResultPtr FitObject(TH1 *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
fitting function for a TH1 (called from TH1::Fit)
virtual Int_t GetNdim() const =0
virtual Color_t GetMarkerColor() const
virtual Int_t GetNbinsX() const
Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
virtual Int_t Poisson(Double_t mean)
Generates a random integer N according to a Poisson law.
virtual Style_t GetFillStyle() const
Double_t Sqrt(Double_t x)
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Bool_t GetCanvasPreferGL() const
virtual const char * GetName() const
Returns name of object.
virtual Int_t GetSize() const
virtual void Set(Int_t nbins, Double_t xmin, Double_t xmax)
Initialize axis with fix bins.
static Bool_t AlmostEqual(Double_t a, Double_t b, Double_t epsilon=0.00000001)
virtual Double_t EvalPar(const Double_t *x, const Double_t *params=0)
Evaluate function with given coordinates and parameters.
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
TList * GetListOfFunctions() const
void SetHistLineColor(Color_t color=1)
virtual TObject * GetUserFunc() const
virtual TObject * GetObjectFit() const
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
Fit histogram with function fname.
double norm(double *x, double *p)
void AbstractMethod(const char *method) const
Use this method to implement an "abstract" method that you don't want to leave purely abstract...
virtual void UpdateBinContent(Int_t bin, Double_t content)
raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin...
virtual Double_t GetStdDev(Int_t axis=1) const
Returns the Standard Deviation (Sigma).
void Set(Int_t n)
Set size of this array to n doubles.
virtual Double_t GetRandom() const
return a random number distributed according the histogram bin contents.
static bool CheckEqualAxes(const TAxis *a1, const TAxis *a2)
Check that the axis are the same.
double gamma_quantile(double z, double alpha, double theta)
Inverse ( ) of the cumulative distribution function of the lower tail of the gamma distribution (gamm...
virtual ~TH1S()
Destructor.
void Copy(TArrayD &array) const
virtual Int_t GetMaximumBin() const
Return location of bin with maximum value in the range.
virtual void GetCenter(Double_t *center) const
Fill array with center of bins for 1D histogram Better to use h1.GetXaxis().GetCenter(center) ...
void H1InitPolynom()
Compute Initial values of parameters for a polynom.
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
TH1F & operator=(const TH1F &h1)
Operator =.
virtual Float_t GetBarWidth() const
Long64_t BinarySearch(Long64_t n, const T *array, T value)
const TArrayD * GetXbins() const
virtual void GetLowEdge(Double_t *edge) const
Fill array with low edge of bins for 1D histogram Better to use h1.GetXaxis().GetLowEdge(edge) ...
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
virtual Style_t GetLabelFont() const
virtual Long64_t Merge(TCollection *list)
Add all histograms in the collection to this histogram.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual const char * GetTitle() const
Returns title of object.
virtual Int_t GetNbinsY() const
virtual Option_t * GetType() const =0
virtual Double_t GetBinError(Int_t bin) const
Return value of error associated to bin number bin.
virtual Int_t ReadArray(Bool_t *&b)=0
void Copy(TAttFill &attfill) const
Copy this fill attributes to a new TAttFill.
void AndersonDarling2SamplesTest(Double_t &pvalue, Double_t &testStat) const
T MinElement(Long64_t n, const T *a)
void H1LeastSquareLinearFit(Int_t ndata, Double_t &a0, Double_t &a1, Int_t &ifail)
Least square linear fit without weights.
const char * Data() const
Array of chars or bytes (8 bits per element).
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".