537 class DifferentDimension:
public std::exception {};
538 class DifferentNumberOfBins:
public std::exception {};
539 class DifferentAxisLimits:
public std::exception {};
540 class DifferentBinLimits:
public std::exception {};
541 class DifferentLabels:
public std::exception {};
551 fFunctions =
new TList;
557 fTsumw = fTsumw2=fTsumwx=fTsumwx2=0;
562 fBinStatErrOpt = kNormal;
564 fYaxis.SetName(
"yaxis");
565 fZaxis.SetName(
"zaxis");
566 fXaxis.SetParent(
this);
567 fYaxis.SetParent(
this);
568 fZaxis.SetParent(
this);
638 if (nbins <= 0) {
Warning(
"TH1",
"nbins is <=0 - set to nbins = 1"); nbins = 1; }
660 if (nbins <= 0) {
Warning(
"TH1",
"nbins is <=0 - set to nbins = 1"); nbins = 1; }
682 if (nbins <= 0) {
Warning(
"TH1",
"nbins is <=0 - set to nbins = 1"); nbins = 1; }
773 Error(
"Add",
"Attempt to add a non-existing function");
793 for (
Int_t i = 0; i < 10; ++i) s1[i] = 0;
799 Int_t bin, binx, biny, binz;
804 for (binz = 0; binz < ncellsz; ++binz) {
806 for (biny = 0; biny < ncellsy; ++biny) {
808 for (binx = 0; binx < ncellsx; ++binx) {
812 bin = binx + ncellsx * (biny + ncellsy * binz);
860 Error(
"Add",
"Attempt to add a non-existing histogram");
871 }
catch(DifferentNumberOfBins&) {
873 Info(
"Add",
"Attempt to add histograms with different number of bins - trying to use TH1::Merge");
875 Error(
"Add",
"Attempt to add histograms with different number of bins : nbins h1 = %d , nbins h2 = %d",
GetNbinsX(), h1->
GetNbinsX());
878 }
catch(DifferentAxisLimits&) {
880 Info(
"Add",
"Attempt to add histograms with different axis limits - trying to use TH1::Merge");
882 Warning(
"Add",
"Attempt to add histograms with different axis limits");
883 }
catch(DifferentBinLimits&) {
885 Info(
"Add",
"Attempt to add histograms with different bin limits - trying to use TH1::Merge");
887 Warning(
"Add",
"Attempt to add histograms with different bin limits");
888 }
catch(DifferentLabels&) {
891 Info(
"Add",
"Attempt to add histograms with different labels - trying to use TH1::Merge");
893 Info(
"Warning",
"Attempt to add histograms with different labels");
898 l.
Add(const_cast<TH1*>(h1));
899 auto iret =
Merge(&l);
911 Bool_t resetStats = (c1 < 0);
941 if (e1sq) w1 = 1. / e1sq;
946 double sf = (s2[0] != 0) ? s2[1]/s2[0] : 1;
950 if (e2sq) w2 = 1. / e2sq;
955 double sf = (s1[0] != 0) ? s1[1]/s1[0] : 1;
960 double y = (w1*y1 + w2*y2)/(w1 + w2);
963 double err2 = 1./(w1 + w2);
964 if (err2 < 1.
E-200) err2 = 0;
980 if (i == 1) s1[i] += c1*c1*s2[i];
981 else s1[i] += c1*s2[i];
1022 Error(
"Add",
"Attempt to add a non-existing histogram");
1030 if (h1 == h2 && c2 < 0) {c2 = 0; normWidth =
kTRUE;}
1039 }
catch(DifferentNumberOfBins&) {
1041 Info(
"Add",
"Attempt to add histograms with different number of bins - trying to use TH1::Merge");
1043 Error(
"Add",
"Attempt to add histograms with different number of bins : nbins h1 = %d , nbins h2 = %d",
GetNbinsX(), h1->
GetNbinsX());
1046 }
catch(DifferentAxisLimits&) {
1048 Info(
"Add",
"Attempt to add histograms with different axis limits - trying to use TH1::Merge");
1050 Warning(
"Add",
"Attempt to add histograms with different axis limits");
1051 }
catch(DifferentBinLimits&) {
1053 Info(
"Add",
"Attempt to add histograms with different bin limits - trying to use TH1::Merge");
1055 Warning(
"Add",
"Attempt to add histograms with different bin limits");
1056 }
catch(DifferentLabels&) {
1059 Info(
"Add",
"Attempt to add histograms with different labels - trying to use TH1::Merge");
1061 Info(
"Warning",
"Attempt to add histograms with different labels");
1067 l.
Add(const_cast<TH1*>(h1));
1068 l.
Add(const_cast<TH1*>(h2));
1070 auto iret =
Merge(&l);
1090 Bool_t resetStats = (c1*c2 < 0) || normWidth;
1097 if (i == 1) s3[i] = c1*c1*s1[i] + c2*c2*s2[i];
1099 else s3[i] = c1*s1[i] + c2*s2[i];
1115 Int_t bin, binx, biny, binz;
1116 for (binz = 0; binz < nbinsz; ++binz) {
1118 for (biny = 0; biny < nbinsy; ++biny) {
1120 for (binx = 0; binx < nbinsx; ++binx) {
1122 bin =
GetBin(binx, biny, binz);
1143 if (e1sq) w1 = 1./ e1sq;
1147 double sf = (s1[0] != 0) ? s1[1]/s1[0] : 1;
1151 if (e2sq) w2 = 1./ e2sq;
1155 double sf = (s2[0] != 0) ? s2[1]/s2[0] : 1;
1160 double y = (w1*y1 + w2*y2)/(w1 + w2);
1163 double err2 = 1./(w1 + w2);
1164 if (err2 < 1.
E-200) err2 = 0;
1246 if (nbentries == 0) {
1256 if (nbentries < 0 && action == 0)
return 0;
1259 if (nbentries < 0) {
1260 nbentries = -nbentries;
1272 for (
Int_t i=1;i<nbentries;i++) {
1274 if (x < xmin) xmin =
x;
1275 if (x > xmax) xmax =
x;
1293 DoFillN(nbentries,&buffer[2],&buffer[1],2);
1327 if (nbentries < 0) {
1330 nbentries = -nbentries;
1362 if ( h2Array->
fN != fN ) {
1363 throw DifferentBinLimits();
1367 for (
int i = 0; i < fN; ++i ) {
1369 throw DifferentBinLimits();
1390 throw DifferentLabels();
1395 throw DifferentLabels();
1398 for (
int i = 1; i <= a1->
GetNbins(); ++i) {
1401 if (label1 != label2) {
1402 throw DifferentLabels();
1418 throw DifferentAxisLimits();
1431 ::Info(
"CheckEqualAxes",
"Axes have different number of bins : nbin1 = %d nbin2 = %d",a1->
GetNbins(),a2->
GetNbins() );
1436 }
catch (DifferentAxisLimits&) {
1437 ::Info(
"CheckEqualAxes",
"Axes have different limits");
1442 }
catch (DifferentBinLimits&) {
1443 ::Info(
"CheckEqualAxes",
"Axes have different bin limits");
1450 }
catch (DifferentLabels&) {
1451 ::Info(
"CheckEqualAxes",
"Axes have different labels");
1466 Int_t nbins1 = lastBin1-firstBin1 + 1;
1474 if (firstBin2 < lastBin2) {
1476 nbins2 = lastBin1-firstBin1 + 1;
1481 if (nbins1 != nbins2 ) {
1482 ::Info(
"CheckConsistentSubAxes",
"Axes have different number of bins");
1488 ::Info(
"CheckConsistentSubAxes",
"Axes have different limits");
1500 if (h1 == h2)
return true;
1503 throw DifferentDimension();
1515 (dim > 1 && nbinsy != h2->
GetNbinsY()) ||
1516 (dim > 2 && nbinsz != h2->
GetNbinsZ()) ) {
1517 throw DifferentNumberOfBins();
1833 Int_t ndf = 0, igood = 0;
1841 printf(
"Chi2 = %f, Prob = %g, NDF = %d, igood = %d\n", chi2,prob,ndf,igood);
1844 if (ndf == 0)
return 0;
1892 Int_t i_start, i_end;
1893 Int_t j_start, j_end;
1894 Int_t k_start, k_end;
1923 Error(
"Chi2TestX",
"Histograms have different dimensions.");
1928 if (nbinx1 != nbinx2) {
1929 Error(
"Chi2TestX",
"different number of x channels");
1931 if (nbiny1 != nbiny2) {
1932 Error(
"Chi2TestX",
"different number of y channels");
1934 if (nbinz1 != nbinz2) {
1935 Error(
"Chi2TestX",
"different number of z channels");
1939 i_start = j_start = k_start = 1;
1970 ndf = (i_end - i_start + 1) * (j_end - j_start + 1) * (k_end - k_start + 1) - 1;
1977 if (scaledHistogram && !comparisonUU) {
1978 Info(
"Chi2TestX",
"NORM option should be used together with UU option. It is ignored");
1985 Double_t effEntries1 = (s[1] ? s[0] * s[0] / s[1] : 0.0);
1989 Double_t effEntries2 = (s[1] ? s[0] * s[0] / s[1] : 0.0);
1991 if (!comparisonUU && !comparisonUW && !comparisonWW ) {
1993 if (
TMath::Abs(sumBinContent1 - effEntries1) < 1) {
1994 if (
TMath::Abs(sumBinContent2 - effEntries2) < 1) comparisonUU =
true;
1995 else comparisonUW =
true;
1997 else comparisonWW =
true;
2001 if (
TMath::Abs(sumBinContent1 - effEntries1) >= 1) {
2002 Warning(
"Chi2TestX",
"First histogram is not unweighted and option UW has been requested");
2005 if ( (!scaledHistogram && comparisonUU) ) {
2006 if ( (
TMath::Abs(sumBinContent1 - effEntries1) >= 1) || (
TMath::Abs(sumBinContent2 - effEntries2) >= 1) ) {
2007 Warning(
"Chi2TestX",
"Both histograms are not unweighted and option UU has been requested");
2013 if (comparisonUU && scaledHistogram) {
2014 for (
Int_t i = i_start; i <= i_end; ++i) {
2015 for (
Int_t j = j_start; j <= j_end; ++j) {
2016 for (
Int_t k = k_start; k <= k_end; ++k) {
2025 if (e1sq > 0.0) cnt1 =
TMath::Floor(cnt1 * cnt1 / e1sq + 0.5);
2028 if (e2sq > 0.0) cnt2 =
TMath::Floor(cnt2 * cnt2 / e2sq + 0.5);
2039 if (sumw1 <= 0.0 || sumw2 <= 0.0) {
2040 Error(
"Chi2TestX",
"Cannot use option NORM when one histogram has all zero errors");
2045 for (
Int_t i = i_start; i <= i_end; ++i) {
2046 for (
Int_t j = j_start; j <= j_end; ++j) {
2047 for (
Int_t k = k_start; k <= k_end; ++k) {
2061 if (sum1 == 0.0 || sum2 == 0.0) {
2062 Error(
"Chi2TestX",
"one histogram is empty");
2066 if ( comparisonWW && ( sumw1 <= 0.0 && sumw2 <= 0.0 ) ){
2067 Error(
"Chi2TestX",
"Hist1 and Hist2 have both all zero errors\n");
2077 for (
Int_t i = i_start; i <= i_end; ++i) {
2078 for (
Int_t j = j_start; j <= j_end; ++j) {
2079 for (
Int_t k = k_start; k <= k_end; ++k) {
2086 if (scaledHistogram) {
2091 if (e1sq > 0) cnt1 =
TMath::Floor(cnt1 * cnt1 / e1sq + 0.5);
2094 if (e2sq > 0) cnt2 =
TMath::Floor(cnt2 * cnt2 / e2sq + 0.5);
2098 if (
Int_t(cnt1) == 0 &&
Int_t(cnt2) == 0) --ndf;
2105 if (res) res[i - i_start] = (cnt1 - nexp1) /
TMath::Sqrt(nexp1);
2111 Double_t correc = (1. - sum1 /
sum) * (1. - cntsum / sum);
2114 Double_t delta = sum2 * cnt1 - sum1 * cnt2;
2115 chi2 += delta * delta / cntsum;
2120 chi2 /= sum1 * sum2;
2125 Info(
"Chi2TestX",
"There is a bin in h1 with less than 1 event.\n");
2129 Info(
"Chi2TestX",
"There is a bin in h2 with less than 1 event.\n");
2140 if ( comparisonUW ) {
2141 for (
Int_t i = i_start; i <= i_end; ++i) {
2142 for (
Int_t j = j_start; j <= j_end; ++j) {
2143 for (
Int_t k = k_start; k <= k_end; ++k) {
2152 if (cnt1 * cnt1 == 0 && cnt2 * cnt2 == 0) {
2158 if (cnt2 * cnt2 == 0 && e2sq == 0) {
2162 e2sq = sumw2 / sum2;
2167 Error(
"Chi2TestX",
"Hist2 has in bin (%d,%d,%d) zero content and zero errors\n", i, j, k);
2173 if (e2sq > 0 && cnt2 * cnt2 / e2sq < 10)
n++;
2175 Double_t var1 = sum2 * cnt2 - sum1 * e2sq;
2176 Double_t var2 = var1 * var1 + 4. * sum2 * sum2 * cnt1 * e2sq;
2181 while (var1 * var1 + cnt1 == 0 || var1 + var2 == 0) {
2184 var1 = sum2 * cnt2 - sum1 * e2sq;
2185 var2 = var1 * var1 + 4. * sum2 * sum2 * cnt1 * e2sq;
2189 while (var1 + var2 == 0) {
2192 var1 = sum2 * cnt2 - sum1 * e2sq;
2193 var2 = var1 * var1 + 4. * sum2 * sum2 * cnt1 * e2sq;
2194 while (var1 * var1 + cnt1 == 0 || var1 + var2 == 0) {
2197 var1 = sum2 * cnt2 - sum1 * e2sq;
2198 var2 = var1 * var1 + 4. * sum2 * sum2 * cnt1 * e2sq;
2203 Double_t probb = (var1 + var2) / (2. * sum2 * sum2);
2211 chi2 += delta1 * delta1 / nexp1;
2214 chi2 += delta2 * delta2 / e2sq;
2219 Double_t temp1 = sum2 * e2sq / var2;
2220 Double_t temp2 = 1.0 + (sum1 * e2sq - sum2 * cnt2) / var2;
2221 temp2 = temp1 * temp1 * sum1 * probb * (1.0 - probb) + temp2 * temp2 * e2sq / 4.0;
2234 Info(
"Chi2TestX",
"There is a bin in h1 with less than 1 event.\n");
2238 Info(
"Chi2TestX",
"There is a bin in h2 with less than 10 effective events.\n");
2248 for (
Int_t i = i_start; i <= i_end; ++i) {
2249 for (
Int_t j = j_start; j <= j_end; ++j) {
2250 for (
Int_t k = k_start; k <= k_end; ++k) {
2260 if (cnt1 * cnt1 == 0 && cnt2 * cnt2 == 0) {
2265 if (e1sq == 0 && e2sq == 0) {
2267 Error(
"Chi2TestX",
"h1 and h2 both have bin %d,%d,%d with all zero errors\n", i,j,k);
2272 Double_t delta = sum2 * cnt1 - sum1 * cnt2;
2273 chi2 += delta * delta /
sigma;
2276 Double_t temp = cnt1 * sum1 * e2sq + cnt2 * sum2 * e1sq;
2289 res[i - i_start] =
z;
2292 if (e1sq > 0 && cnt1 * cnt1 / e1sq < 10) m++;
2293 if (e2sq > 0 && cnt2 * cnt2 / e2sq < 10)
n++;
2299 Info(
"Chi2TestX",
"There is a bin in h1 with less than 10 effective events.\n");
2303 Info(
"Chi2TestX",
"There is a bin in h2 with less than 10 effective events.\n");
2320 Error(
"Chisquare",
"Function pointer is Null - return -1");
2371 for (
Int_t binz=1; binz <= nbinsz; ++binz) {
2372 for (
Int_t biny=1; biny <= nbinsy; ++biny) {
2373 for (
Int_t binx=1; binx <= nbinsx; ++binx) {
2376 if (onlyPositive && y < 0) {
2377 Error(
"ComputeIntegral",
"Bin content is negative - return a NaN value");
2388 Error(
"ComputeIntegral",
"Integral = zero");
return 0;
2431 hintegrated->
Reset();
2434 for (
Int_t binz = 1; binz <= nbinsz; ++binz) {
2435 for (
Int_t biny = 1; biny <= nbinsy; ++biny) {
2436 for (
Int_t binx = 1; binx <= nbinsx; ++binx) {
2437 const Int_t bin = hintegrated->
GetBin(binx, biny, binz);
2445 for (
Int_t binz = nbinsz; binz >= 1; --binz) {
2446 for (
Int_t biny = nbinsy; biny >= 1; --biny) {
2447 for (
Int_t binx = nbinsx; binx >= 1; --binx) {
2448 const Int_t bin = hintegrated->
GetBin(binx, biny, binz);
2474 ((
TH1&)obj).fDirectory->Remove(&obj);
2475 ((
TH1&)obj).fDirectory = 0;
2489 delete [] ((
TH1&)obj).fBuffer;
2490 ((
TH1&)obj).fBuffer = 0;
2496 ((
TH1&)obj).fBuffer = buf;
2501 if (a) a->
Set(fNcells);
2522 ((
TH1&)obj).fXaxis.SetParent(&obj);
2523 ((
TH1&)obj).fYaxis.SetParent(&obj);
2524 ((
TH1&)obj).fZaxis.SetParent(&obj);
2536 ((
TH1&)obj).fDirectory = 0;
2554 if(newname && strlen(newname) ) {
2609 Error(
"Add",
"Attempt to divide by a non-existing function");
2627 Int_t bin, binx, biny, binz;
2632 for (binz = 0; binz < nz; ++binz) {
2633 xx[2] = fZaxis.GetBinCenter(binz);
2634 for (biny = 0; biny <
ny; ++biny) {
2635 xx[1] = fYaxis.GetBinCenter(biny);
2636 for (binx = 0; binx <
nx; ++binx) {
2637 xx[0] = fXaxis.GetBinCenter(binx);
2640 bin = binx + nx * (biny + ny * binz);
2648 else fSumw2.fArray[bin] = 0;
2677 Error(
"Divide",
"Input histogram passed does not exist (NULL).");
2686 }
catch(DifferentNumberOfBins&) {
2687 Error(
"Divide",
"Cannot divide histograms with different number of bins");
2689 }
catch(DifferentAxisLimits&) {
2690 Warning(
"Divide",
"Dividing histograms with different axis limits");
2691 }
catch(DifferentBinLimits&) {
2692 Warning(
"Divide",
"Dividing histograms with different bin limits");
2693 }
catch(DifferentLabels&) {
2694 Warning(
"Divide",
"Dividing histograms with different labels");
2708 if (c1 == 0) { fSumw2.fArray[i] = 0;
continue; }
2749 Error(
"Divide",
"At least one of the input histograms passed does not exist (NULL).");
2759 }
catch(DifferentNumberOfBins&) {
2760 Error(
"Divide",
"Cannot divide histograms with different number of bins");
2762 }
catch(DifferentAxisLimits&) {
2763 Warning(
"Divide",
"Dividing histograms with different axis limits");
2764 }
catch(DifferentBinLimits&) {
2765 Warning(
"Divide",
"Dividing histograms with different bin limits");
2766 }
catch(DifferentLabels&) {
2767 Warning(
"Divide",
"Dividing histograms with different labels");
2772 Error(
"Divide",
"Coefficient of dividing histogram cannot be zero");
2790 if (b2 == 0) { fSumw2.fArray[i] = 0;
continue; }
2802 fSumw2.fArray[i] =
TMath::Abs( ( (1. - 2.* b1 / b2) * e1sq + b1sq * e2sq / b2sq ) / b2sq );
2806 fSumw2.fArray[i] = 0;
2809 fSumw2.fArray[i] = c1sq * c2sq * (e1sq * b2sq + e2sq * b1sq) / (c2sq * c2sq * b2sq * b2sq);
2862 if (index>indb && index<indk) index = -1;
2868 if (!
gPad->IsEditable())
gROOT->MakeDefCanvas();
2870 if (
gPad->GetX1() == 0 &&
gPad->GetX2() == 1 &&
2871 gPad->GetY1() == 0 &&
gPad->GetY2() == 1 &&
2872 gPad->GetListOfPrimitives()->GetSize()==0) opt2.
Remove(index,4);
2880 if (index>=0) opt2.
Remove(index,4);
2929 Error(
"DrawNormalized",
"Sum of weights is null. Cannot normalize histogram: %s",
GetName());
2938 if (fSumw2.fN == 0) {
2941 if (opt.
IsNull() || opt ==
"SAME") opt +=
"HIST";
2976 Int_t range, stat, add;
2991 Int_t nbinsx = fXaxis.GetNbins();
2992 Int_t nbinsy = fYaxis.GetNbins();
2993 Int_t nbinsz = fZaxis.GetNbins();
2996 for (
Int_t binz = 1; binz <= nbinsz; ++binz) {
2997 x[2] = fZaxis.GetBinCenter(binz);
2998 for (
Int_t biny = 1; biny <= nbinsy; ++biny) {
2999 x[1] = fYaxis.GetBinCenter(biny);
3000 for (
Int_t binx = 1; binx <= nbinsx; ++binx) {
3002 x[0] = fXaxis.GetBinCenter(binx);
3003 if (range && !f1->
IsInside(x))
continue;
3007 if (fSumw2.fN) fSumw2.fArray[bin] +=
TMath::Abs(fu);
3100 for (
Int_t binx = 1; binx<=ndim[0]; binx++) {
3101 for (
Int_t biny=1; biny<=ndim[1]; biny++) {
3102 for (
Int_t binz=1; binz<=ndim[2]; binz++) {
3131 bin =fXaxis.FindBin(x);
3132 if (bin <0)
return -1;
3134 if (fSumw2.fN) ++fSumw2.fArray[bin];
3135 if (bin == 0 || bin > fXaxis.GetNbins()) {
3164 bin =fXaxis.FindBin(x);
3165 if (bin <0)
return -1;
3167 if (fSumw2.fN) fSumw2.fArray[bin] += w*w;
3169 if (bin == 0 || bin > fXaxis.GetNbins()) {
3197 bin =fXaxis.FindBin(namex);
3198 if (bin <0)
return -1;
3200 if (fSumw2.fN) fSumw2.fArray[bin] += w*w;
3202 if (bin == 0 || bin > fXaxis.GetNbins())
return -1;
3208 Double_t x = fXaxis.GetBinCenter(bin);
3234 for (i=0;i<ntimes;i+=stride) {
3241 DoFillN((ntimes-i)/stride,&x[i],&w[i],stride);
3245 DoFillN(ntimes, x, w, stride);
3258 Int_t nbins = fXaxis.GetNbins();
3260 for (i=0;i<ntimes;i+=stride) {
3261 bin =fXaxis.FindBin(x[i]);
3262 if (bin <0)
continue;
3265 if (fSumw2.fN) fSumw2.fArray[bin] += ww*ww;
3267 if (bin == 0 || bin > nbins) {
3299 if (!f1) {
Error(
"FillRandom",
"Unknown function: %s",fname);
return; }
3306 if (fXaxis.GetXmax() <= fXaxis.GetXmin()) {
3309 Info(
"FillRandom",
"Using function axis and range [%g,%g]",xmin, xmax);
3315 Int_t nbinsx = last-first+1;
3319 for (binx=1;binx<=nbinsx;binx++) {
3321 integral[binx] = integral[binx-1] + fint;
3325 if (integral[nbinsx] == 0 ) {
3327 Error(
"FillRandom",
"Integral = zero");
return;
3329 for (bin=1;bin<=nbinsx;bin++) integral[bin] /= integral[nbinsx];
3332 for (loop=0;loop<ntimes;loop++) {
3338 +xAxis->
GetBinWidth(ibin+first)*(r1-integral[ibin])/(integral[ibin+1] - integral[ibin]);
3362 if (!h) {
Error(
"FillRandom",
"Null histogram");
return; }
3364 Error(
"FillRandom",
"Histograms with different dimensions");
return;
3369 Int_t first = fXaxis.GetFirst();
3370 Int_t last = fXaxis.GetLast();
3371 Int_t nbins = last-first+1;
3372 if (ntimes > 10*nbins) {
3376 if (sumw == 0)
return;
3378 for (
Int_t bin=first;bin<=last;bin++) {
3383 if (fSumw2.fN) fSumw2.fArray[bin] += cont;
3390 if (sumgen < ntimes) {
3392 for (i =
Int_t(sumgen+0.5); i < ntimes; ++i)
3398 else if (sumgen > ntimes) {
3400 i =
Int_t(sumgen+0.5);
3401 while( i > ntimes) {
3403 Int_t ibin = fXaxis.FindBin(x);
3416 catch(std::exception&) {}
3423 for (loop=0;loop<ntimes;loop++) {
3443 return fXaxis.FindBin(x);
3446 Int_t nx = fXaxis.GetNbins()+2;
3447 Int_t binx = fXaxis.FindBin(x);
3448 Int_t biny = fYaxis.FindBin(y);
3449 return binx + nx*biny;
3452 Int_t nx = fXaxis.GetNbins()+2;
3453 Int_t ny = fYaxis.GetNbins()+2;
3454 Int_t binx = fXaxis.FindBin(x);
3455 Int_t biny = fYaxis.FindBin(y);
3456 Int_t binz = fZaxis.FindBin(z);
3457 return binx + nx*(biny +ny*binz);
3476 return fXaxis.FindFixBin(x);
3479 Int_t nx = fXaxis.GetNbins()+2;
3480 Int_t binx = fXaxis.FindFixBin(x);
3481 Int_t biny = fYaxis.FindFixBin(y);
3482 return binx + nx*biny;
3485 Int_t nx = fXaxis.GetNbins()+2;
3486 Int_t ny = fYaxis.GetNbins()+2;
3487 Int_t binx = fXaxis.FindFixBin(x);
3488 Int_t biny = fYaxis.FindFixBin(y);
3489 Int_t binz = fZaxis.FindFixBin(z);
3490 return binx + nx*(biny +ny*binz);
3504 Warning(
"FindFirstBinAbove",
"Invalid axis number : %d, axis x assumed\n",axis);
3507 Int_t nbins = fXaxis.GetNbins();
3523 Warning(
"FindLastBinAbove",
"Invalid axis number : %d, axis x assumed\n",axis);
3526 Int_t nbins = fXaxis.GetNbins();
3527 for (
Int_t bin=nbins;bin>=1;bin--) {
3566 linear= (
char*)strstr(fname,
"++");
3573 f1=
new TF1(fname, fname, xxmin, xxmax);
3574 return Fit(f1,option,goption,xxmin,xxmax);
3577 f2=
new TF2(fname, fname);
3578 return Fit(f2,option,goption,xxmin,xxmax);
3581 f3=
new TF3(fname, fname);
3582 return Fit(f3,option,goption,xxmin,xxmax);
3587 f1 = (
TF1*)
gROOT->GetFunction(fname);
3588 if (!f1) {
Printf(
"Unknown function: %s",fname);
return -1; }
3589 return Fit(f1,option,goption,xxmin,xxmax);
3917 gROOT->MakeDefCanvas();
3920 Error(
"FitPanel",
"Unable to create a default canvas");
3927 if (handler && handler->
LoadPlugin() != -1) {
3929 Error(
"FitPanel",
"Unable to create the FitPanel");
3932 Error(
"FitPanel",
"Unable to find the FitPanel plug-in");
3977 asym->SetTitle(title);
3987 top->
Add(h1,h2,1,-c2);
3988 bottom->
Add(h1,h2,1,c2);
3989 asym->Divide(top,bottom);
3991 Int_t xmax = asym->GetNbinsX();
3993 Int_t zmax = asym->GetNbinsZ();
4003 for(
Int_t k=1; k<= zmax; k++){
4019 Double_t error = 2*
TMath::Sqrt(a*a*c2*c2*dbsq + c2*c2*b*b*dasq+a*a*b*b*dc2*dc2)/(bot*bot);
4020 asym->SetBinError(i,j,k,error);
4082 return (s[1] ? s[0]*s[0]/s[1] :
TMath::Abs(s[0]) );
4092 return ((
TH1*)
this)->GetPainter()->GetObjectInfo(px,py);
4193 Error(
"GetQuantiles",
"Only available for 1-d histograms");
4203 Int_t nq = nprobSum;
4208 for (i=1;i<nq;i++) {
4213 for (i = 0; i < nq; i++) {
4215 while (ibin < nbins-1 &&
fIntegral[ibin+1] == prob[i]) {
4216 if (
fIntegral[ibin+2] == prob[i]) ibin++;
4221 if (dint > 0) q[i] +=
GetBinWidth(ibin+1)*(prob[i]-fIntegral[ibin])/dint;
4224 if (!probSum)
delete [] prob;
4253 allcha = sumx = sumx2 = 0;
4254 for (bin=hxfirst;bin<=hxlast;bin++) {
4257 if (val > valmax) valmax = val;
4262 if (allcha == 0)
return;
4264 stddev = sumx2/allcha - mean*mean;
4267 if (stddev == 0) stddev = binwidx*(hxlast-hxfirst+1)/4;
4274 Double_t constant = 0.5*(valmax+binwidx*allcha/(sqrtpi*stddev));
4282 if ((mean < xmin || mean > xmax) && stddev > (xmax-xmin)) {
4283 mean = 0.5*(xmax+
xmin);
4284 stddev = 0.5*(xmax-
xmin);
4303 Int_t nchanx = hxlast - hxfirst + 1;
4324 Int_t nchanx = hxlast - hxfirst + 1;
4327 if (nchanx <=1 || npar == 1) {
4350 const Int_t idim = 20;
4361 if (m > idim || m > n)
return;
4364 for (l = 2; l <=
m; ++
l) {
4366 b[m + l*20 - 21] = zero;
4373 for (k = hxfirst; k <= hxlast; ++k) {
4378 for (l = 2; l <=
m; ++
l) {
4381 da[l-1] += power*yk;
4383 for (l = 2; l <=
m; ++
l) {
4385 b[m + l*20 - 21] += power;
4388 for (i = 3; i <=
m; ++i) {
4389 for (k = i; k <=
m; ++k) {
4390 b[k - 1 + (i-1)*20 - 21] = b[k + (i-2)*20 - 21];
4395 for (i=0; i<
m; ++i) a[i] = da[i];
4415 xbar = ybar = x2bar = xybar = 0;
4420 for (i = hxfirst; i <= hxlast; ++i) {
4424 if (yk <= 0) yk = 1
e-9;
4433 det = fn*x2bar - xbar*xbar;
4441 a0 = (x2bar*ybar - xbar*xybar) / det;
4442 a1 = (fn*xybar - xbar*ybar) / det;
4453 Int_t a_dim1, a_offset, b_dim1, b_offset;
4455 Int_t im1, jp1, nm1, nmi;
4461 b_offset = b_dim1 + 1;
4464 a_offset = a_dim1 + 1;
4467 if (idim < n)
return;
4470 for (j = 1; j <=
n; ++j) {
4471 if (a[j + j*a_dim1] <= 0) { ifail = -1;
return; }
4472 a[j + j*a_dim1] = one / a[j + j*a_dim1];
4473 if (j == n)
continue;
4475 for (l = jp1; l <=
n; ++
l) {
4476 a[j + l*a_dim1] = a[j + j*a_dim1] * a[l + j*a_dim1];
4477 s1 = -a[l + (j+1)*a_dim1];
4478 for (i = 1; i <= j; ++i) { s1 = a[l + i*a_dim1] * a[i + (j+1)*a_dim1] + s1; }
4479 a[l + (j+1)*a_dim1] = -s1;
4484 for (l = 1; l <= k; ++
l) {
4485 b[l*b_dim1 + 1] = a[a_dim1 + 1]*b[l*b_dim1 + 1];
4488 for (l = 1; l <= k; ++
l) {
4489 for (i = 2; i <=
n; ++i) {
4491 s21 = -b[i + l*b_dim1];
4492 for (j = 1; j <= im1; ++j) {
4493 s21 = a[i + j*a_dim1]*b[j + l*b_dim1] + s21;
4495 b[i + l*b_dim1] = -a[i + i*a_dim1]*s21;
4498 for (i = 1; i <= nm1; ++i) {
4500 s22 = -b[nmi + l*b_dim1];
4501 for (j = 1; j <= i; ++j) {
4503 s22 = a[nmi + nmjp1*a_dim1]*b[nmjp1 + l*b_dim1] + s22;
4505 b[nmi + l*b_dim1] = -s22;
4543 if (binx < 0) binx = 0;
4544 if (binx > ofx) binx = ofx;
4556 Int_t ny = fYaxis.GetNbins()+2;
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");
4597 if (fIntegral[nbinsx+1] !=
fEntries) integral = ((
TH1*)
this)->ComputeIntegral(
true);
4598 else integral = fIntegral[nbinsx];
4600 integral = ((
TH1*)
this)->ComputeIntegral(
true);
4602 if (integral == 0)
return 0;
4609 if (r1 > fIntegral[ibin]) x +=
4610 GetBinWidth(ibin+1)*(r1-fIntegral[ibin])/(fIntegral[ibin+1] - fIntegral[ibin]);
4641 if (bin < 0) bin = 0;
4642 if (bin >= fNcells) bin = fNcells-1;
4667 Error(
"GetBinWithContent",
"function is only valid for 1-D histograms");
4673 if (firstx <= 0) firstx = 1;
4674 if (lastx < firstx) lastx = fXaxis.GetNbins();
4677 for (
Int_t i=firstx;i<=lastx;i++) {
4679 if (diff <= 0) {binx = i;
return diff;}
4680 if (diff < curmax && diff <= maxdiff) {curmax = diff, binminx=i;}
4715 return y0 + (x-x0)*((y1-y0)/(x1-x0));
4724 Error(
"Interpolate",
"This function must be called with 1 argument for a TH1");
4733 Error(
"Interpolate",
"This function must be called with 1 argument for a TH1");
4764 Error(
"IsBinOverflow",
"Invalid axis value");
4781 return (binx <= 0 || biny <= 0);
4783 return (binx <= 0 || biny <= 0 || binz <= 0);
4794 Error(
"IsBinUnderflow",
"Invalid axis value");
4811 Error(
"LabelsDeflate",
"Invalid axis option %s",ax);
4822 while ((obj = next())) {
4824 if (ibin > nbins) nbins = ibin;
4826 if (nbins < 1) nbins = 1;
4827 TH1 *hold = (
TH1*)IsA()->New();
4835 if (xmax <= xmin) xmax = xmin +
nbins;
4837 axis->
Set(nbins,xmin,xmax);
4839 Int_t errors = fSumw2.fN;
4840 if (errors) fSumw2.Set(fNcells);
4850 Int_t bin,binx,biny,binz;
4851 for (bin=0; bin < hold->
fNcells; ++bin) {
4878 TH1 *hold = (
TH1*)IsA()->New();;
4886 xmax = xmin + 2*(xmax-
xmin);
4889 axis->
Set(2*nbins,xmin,xmax);
4891 Int_t errors = fSumw2.fN;
4892 if (errors) fSumw2.Set(fNcells);
4899 Int_t bin,ibin,binx,biny,binz;
4900 for (ibin =0; ibin < hold->
fNcells; ibin++) {
4903 bin =
GetBin(binx,biny,binz);
4911 if (errors) fSumw2.fArray[bin] += hold->
fSumw2.
fArray[ibin];
4940 Warning(
"LabelsOption",
"Cannot sort. No labels");
4973 if (sort < 0)
return;
4975 Error(
"LabelsOption",
"Sorting by value not implemented for 3-D histograms");
4981 std::vector<Int_t>
a(n+2);
4984 std::vector<Double_t> cont;
4985 std::vector<Double_t> errors;
4987 TIter nextold(labels);
4989 while ((obj=nextold())) {
4997 if (fSumw2.fN) errors.resize(n);
4998 for (i=1;i<=
n;i++) {
5000 if (!errors.empty()) errors[i-1] =
GetBinError(i);
5004 for (i=1;i<=
n;i++) {
5006 if (!errors.empty())
SetBinError(i,errors[a[i-1]]);
5008 for (i=1;i<=
n;i++) {
5009 obj = labold->
At(a[i-1]);
5014 std::vector<Double_t> pcont(n+2);
5015 Int_t nx = fXaxis.GetNbins();
5016 Int_t ny = fYaxis.GetNbins();
5017 cont.resize( (nx+2)*(ny+2));
5018 if (fSumw2.fN) errors.resize( (nx+2)*(ny+2));
5019 for (i=1;i<=
nx;i++) {
5020 for (j=1;j<=
ny;j++) {
5022 if (!errors.empty()) errors[i+nx*j] =
GetBinError(i,j);
5025 pcont[k-1] += cont[i+nx*j];
5031 obj = labold->
At(a[i]);
5036 for (i=1;i<=
n;i++) {
5037 for (j=1;j<=
ny;j++) {
5039 if (!errors.empty())
SetBinError(i,j,errors[a[i-1]+1+nx*j]);
5045 for (i=1;i<=
nx;i++) {
5046 for (j=1;j<=
n;j++) {
5048 if (!errors.empty())
SetBinError(i,j,errors[i+nx*(a[j-1]+1)]);
5057 const UInt_t kUsed = 1<<18;
5061 for (i=1;i<=
n;i++) {
5062 const char *label =
"zzzzzzzzzzzz";
5063 for (j=1;j<=
n;j++) {
5064 obj = labold->
At(j-1);
5066 if (obj->
TestBit(kUsed))
continue;
5068 if (strcmp(label,obj->
GetName()) < 0)
continue;
5079 for (i=1;i<=
n;i++) {
5080 obj = labels->
At(i-1);
5087 if (fSumw2.fN) errors.resize(n+2);
5088 for (i=1;i<=
n;i++) {
5090 if (!errors.empty()) errors[i] =
GetBinError(a[i]);
5092 for (i=1;i<=
n;i++) {
5097 Int_t nx = fXaxis.GetNbins()+2;
5098 Int_t ny = fYaxis.GetNbins()+2;
5100 if (fSumw2.fN) errors.resize(nx*ny);
5101 for (i=0;i<
nx;i++) {
5102 for (j=0;j<
ny;j++) {
5104 if (!errors.empty()) errors[i+nx*j] =
GetBinError(i,j);
5108 for (i=1;i<=
n;i++) {
5109 for (j=0;j<
ny;j++) {
5111 if (!errors.empty())
SetBinError(i,j,errors[a[i]+nx*j]);
5115 for (i=0;i<
nx;i++) {
5116 for (j=1;j<=
n;j++) {
5118 if (!errors.empty())
SetBinError(i,j,errors[i+nx*a[j]]);
5123 Int_t nx = fXaxis.GetNbins()+2;
5124 Int_t ny = fYaxis.GetNbins()+2;
5125 Int_t nz = fZaxis.GetNbins()+2;
5126 cont.resize(nx*ny*nz);
5127 if (fSumw2.fN) errors.resize(nx*ny*nz);
5128 for (i=0;i<
nx;i++) {
5129 for (j=0;j<
ny;j++) {
5130 for (k=0;k<nz;k++) {
5132 if (!errors.empty()) errors[i+nx*(j+ny*k)] =
GetBinError(i,j,k);
5138 for (i=1;i<=
n;i++) {
5139 for (j=0;j<
ny;j++) {
5140 for (k=0;k<nz;k++) {
5142 if (!errors.empty())
SetBinError(i,j,k,errors[a[i]+nx*(j+ny*k)]);
5149 for (i=0;i<
nx;i++) {
5150 for (j=1;j<=
n;j++) {
5151 for (k=0;k<nz;k++) {
5153 if (!errors.empty())
SetBinError(i,j,k,errors[i+nx*(a[j]+ny*k)]);
5160 for (i=0;i<
nx;i++) {
5161 for (j=0;j<
ny;j++) {
5162 for (k=1;k<=
n;k++) {
5164 if (!errors.empty())
SetBinError(i,j,k,errors[i+nx*(j+ny*a[k])]);
5200 bool isEquidistant =
true;
5202 for (
int i = 1; i < axis.
GetNbins(); ++i) {
5205 isEquidistant &= match;
5209 return isEquidistant;
5236 if (width1 == 0 || width2 == 0)
5267 delta = (xmax - destAxis.
GetXmax())/width1;
5272 delta = (xmax - anAxis.
GetXmax())/width2;
5277 delta = (xmax - destAxis.
GetXmax())/width1;
5282 printf(
"TH1::RecomputeAxisLimits - Impossible\n");
5362 Error(
"Add",
"Attempt to multiply by a non-existing function");
5384 for (
Int_t binz = 0; binz < nz; ++binz) {
5385 xx[2] = fZaxis.GetBinCenter(binz);
5386 for (
Int_t biny = 0; biny <
ny; ++biny) {
5387 xx[1] = fYaxis.GetBinCenter(biny);
5388 for (
Int_t binx = 0; binx <
nx; ++binx) {
5389 xx[0] = fXaxis.GetBinCenter(binx);
5392 Int_t bin = binx + nx * (biny + ny *binz);
5424 Error(
"Multiply",
"Attempt to multiply by a non-existing histogram");
5433 }
catch(DifferentNumberOfBins&) {
5434 Error(
"Multiply",
"Attempt to multiply histograms with different number of bins");
5436 }
catch(DifferentAxisLimits&) {
5437 Warning(
"Multiply",
"Attempt to multiply histograms with different axis limits");
5438 }
catch(DifferentBinLimits&) {
5439 Warning(
"Multiply",
"Attempt to multiply histograms with different bin limits");
5440 }
catch(DifferentLabels&) {
5441 Warning(
"Multiply",
"Attempt to multiply histograms with different labels");
5486 Error(
"Multiply",
"Attempt to multiply by a non-existing histogram");
5496 }
catch(DifferentNumberOfBins&) {
5497 Error(
"Multiply",
"Attempt to multiply histograms with different number of bins");
5499 }
catch(DifferentAxisLimits&) {
5500 Warning(
"Multiply",
"Attempt to multiply histograms with different axis limits");
5501 }
catch(DifferentBinLimits&) {
5502 Warning(
"Multiply",
"Attempt to multiply histograms with different bin limits");
5503 }
catch(DifferentLabels&) {
5504 Warning(
"Multiply",
"Attempt to multiply histograms with different labels");
5605 if ((ngroup <= 0) || (ngroup > nbins)) {
5606 Error(
"Rebin",
"Illegal value of ngroup=%d",ngroup);
5611 Error(
"Rebin",
"Operation valid on 1-D histograms only");
5614 if (!newname && xbins) {
5615 Error(
"Rebin",
"if xbins is specified, newname must be given");
5619 Int_t newbins = nbins/ngroup;
5621 Int_t nbg = nbins/ngroup;
5622 if (nbg*ngroup != nbins) {
5623 Warning(
"Rebin",
"ngroup=%d is not an exact divider of nbins=%d.",ngroup,nbins);
5641 if (fSumw2.fN != 0) {
5643 for (bin=0;bin<nbins+2;bin++) oldErrors[bin] =
GetBinError(bin);
5647 if (xbins[0] < fXaxis.GetXmin() && oldBins[0] != 0 )
5648 Warning(
"Rebin",
"underflow entries will not be used when rebinning");
5649 if (xbins[newbins] > fXaxis.GetXmax() && oldBins[nbins+1] != 0 )
5650 Warning(
"Rebin",
"overflow entries will not be used when rebinning");
5656 if ((newname && strlen(newname) > 0) || xbins) {
5666 bool resetStat =
false;
5668 if(!xbins && (newbins*ngroup != nbins)) {
5669 xmax = fXaxis.GetBinUpEdge(newbins*ngroup);
5673 Int_t nDivisions = fXaxis.GetNdivisions();
5674 Color_t axisColor = fXaxis.GetAxisColor();
5675 Color_t labelColor = fXaxis.GetLabelColor();
5676 Style_t labelFont = fXaxis.GetLabelFont();
5677 Float_t labelOffset = fXaxis.GetLabelOffset();
5678 Float_t labelSize = fXaxis.GetLabelSize();
5679 Float_t tickLength = fXaxis.GetTickLength();
5680 Float_t titleOffset = fXaxis.GetTitleOffset();
5681 Float_t titleSize = fXaxis.GetTitleSize();
5682 Color_t titleColor = fXaxis.GetTitleColor();
5683 Style_t titleFont = fXaxis.GetTitleFont();
5685 if(!xbins && (fXaxis.GetXbins()->GetSize() > 0)){
5687 for(i = 0; i <= newbins; ++i) bins[i] = fXaxis.GetBinLowEdge(1+i*ngroup);
5693 hnew->
SetBins(newbins,xmin,xmax);
5697 fXaxis.SetNdivisions(nDivisions);
5698 fXaxis.SetAxisColor(axisColor);
5699 fXaxis.SetLabelColor(labelColor);
5700 fXaxis.SetLabelFont(labelFont);
5701 fXaxis.SetLabelOffset(labelOffset);
5702 fXaxis.SetLabelSize(labelSize);
5703 fXaxis.SetTickLength(tickLength);
5704 fXaxis.SetTitleOffset(titleOffset);
5705 fXaxis.SetTitleSize(titleSize);
5706 fXaxis.SetTitleColor(titleColor);
5707 fXaxis.SetTitleFont(titleFont);
5713 while( fXaxis.GetBinCenter(startbin) < newxmin && startbin <=
nbins ) {
5716 Int_t oldbin = startbin;
5718 for (bin = 1;bin<=newbins;bin++) {
5721 Int_t imax = ngroup;
5723 for (i=0;i<ngroup;i++) {
5724 if( (oldbin+i > nbins) ||
5725 ( hnew !=
this && (fXaxis.GetBinCenter(oldbin+i) > xbinmax)) ) {
5729 binContent += oldBins[oldbin+i];
5730 if (oldErrors) binError += oldErrors[oldbin+i]*oldErrors[oldbin+i];
5740 for (i = 0; i < startbin; ++i) {
5741 binContent += oldBins[i];
5742 if (oldErrors) binError += oldErrors[i]*oldErrors[i];
5749 for (i = oldbin; i <= nbins+1; ++i) {
5750 binContent += oldBins[i];
5751 if (oldErrors) binError += oldErrors[i]*oldErrors[i];
5760 if (!resetStat) hnew->
PutStats(stat);
5762 if (oldErrors)
delete [] oldErrors;
5781 if (xmin >= xmax)
return kFALSE;
5787 while (point < xmin) {
5790 xmin = xmin - range;
5799 while (point >= xmax) {
5802 xmax = xmax + range;
5850 TH1 *hold = (
TH1*)IsA()->New();
5863 if (axis == &fXaxis) iaxis = 1;
5864 if (axis == &fYaxis) iaxis = 2;
5865 if (axis == &fZaxis) iaxis = 3;
5866 bool firstw =
kTRUE;
5867 Int_t binx,biny, binz = 0;
5868 Int_t ix = 0,iy = 0,iz = 0;
5871 for (
Int_t bin = 0; bin < ncells; ++bin) {
5874 ix = fXaxis.FindFixBin(bx);
5877 iy = fYaxis.FindFixBin(by);
5880 iz = fZaxis.FindFixBin(bz);
5885 if (content == 0)
continue;
5888 Warning(
"ExtendAxis",
"Histogram %s has underflow or overflow in the axis that is extendable"
5889 " their content will be lost",
GetName() );
5938 if (opt.
Contains(
"width"))
Add(
this,
this, c1, -1);
5942 if (fSumw2.fN)
for(
Int_t i = 0; i <
fNcells; ++i) fSumw2.fArray[i] *= (c1 * c1);
5948 if (ncontours == 0)
return;
5949 Double_t* levels = fContour.GetArray();
5950 for (
Int_t i = 0; i < ncontours; ++i) levels[i] *= c1;
5959 if (
GetDimension() > 1) canExtend &= fYaxis.CanExtend();
5960 if (
GetDimension() > 2) canExtend &= fZaxis.CanExtend();
5973 if (fXaxis.CanExtend()) oldExtendBitMask |=
kXaxis;
5974 if (extendBitMask &
kXaxis) fXaxis.SetCanExtend(
kTRUE);
5975 else fXaxis.SetCanExtend(
kFALSE);
5978 if (fYaxis.CanExtend()) oldExtendBitMask |=
kYaxis;
5979 if (extendBitMask &
kYaxis) fYaxis.SetCanExtend(
kTRUE);
5980 else fYaxis.SetCanExtend(
kFALSE);
5984 if (fZaxis.CanExtend()) oldExtendBitMask |=
kZaxis;
5985 if (extendBitMask &
kZaxis) fZaxis.SetCanExtend(
kTRUE);
5986 else fZaxis.SetCanExtend(
kFALSE);
5989 return oldExtendBitMask;
6035 str1 = str1(isc+1, lns);
6036 isc = str1.
Index(
";");
6039 str2.ReplaceAll(
"#semicolon",10,
";",1);
6040 fXaxis.SetTitle(str2.Data());
6042 str1 = str1(isc+1, lns);
6043 isc = str1.
Index(
";");
6046 str2.ReplaceAll(
"#semicolon",10,
";",1);
6047 fYaxis.SetTitle(str2.Data());
6049 str1 = str1(isc+1, lns);
6051 fZaxis.SetTitle(str1.
Data());
6054 fYaxis.SetTitle(str1.
Data());
6058 fXaxis.SetTitle(str1.
Data());
6075 ::Error(
"SmoothArray",
"Need at least 3 points for smoothing: n = %d",nn);
6082 std::vector<double> yy(nn);
6083 std::vector<double> zz(nn);
6084 std::vector<double> rr(nn);
6086 for (
Int_t pass=0;pass<ntimes;pass++) {
6088 std::copy(xx, xx+nn, zz.begin() );
6090 for (
int noent = 0; noent < 2; ++noent) {
6093 for (
int kk = 0; kk < 3; kk++) {
6094 std::copy(zz.begin(), zz.end(), yy.begin());
6095 int medianType = (kk != 1) ? 3 : 5;
6096 int ifirst = (kk != 1 ) ? 1 : 2;
6097 int ilast = (kk != 1 ) ? nn-1 : nn -2;
6101 for ( ii = ifirst; ii < ilast; ii++) {
6102 assert(ii - ifirst >= 0);
6103 for (
int jj = 0; jj < medianType; jj++) {
6104 hh[jj] = yy[ii - ifirst + jj ];
6113 hh[2] = 3*zz[1] - 2*zz[2];
6118 hh[2] = 3*zz[nn - 2] - 2*zz[nn - 3];
6123 for (ii = 0; ii < 3; ii++) {
6128 for (ii = 0; ii < 3; ii++) {
6129 hh[ii] = yy[nn - 3 + ii];
6136 std::copy ( zz.begin(), zz.end(), yy.begin() );
6139 for (ii = 2; ii < (nn - 2); ii++) {
6140 if (zz[ii - 1] != zz[ii])
continue;
6141 if (zz[ii] != zz[ii + 1])
continue;
6142 hh[0] = zz[ii - 2] - zz[ii];
6143 hh[1] = zz[ii + 2] - zz[ii];
6144 if (hh[0] * hh[1] <= 0)
continue;
6147 yy[ii] = -0.5*zz[ii - 2*jk] + zz[ii]/0.75 + zz[ii + 2*jk] /6.;
6148 yy[ii + jk] = 0.5*(zz[ii + 2*jk] - zz[ii - 2*jk]) + zz[ii];
6153 for (ii = 1; ii < nn - 1; ii++) {
6154 zz[ii] = 0.25*yy[ii - 1] + 0.5*yy[ii] + 0.25*yy[ii + 1];
6157 zz[nn - 1] = yy[nn - 1];
6162 std::copy(zz.begin(), zz.end(), rr.begin());
6165 for (ii = 0; ii <
nn; ii++) {
6166 zz[ii] = xx[ii] - zz[ii];
6174 for (ii = 0; ii <
nn; ii++) {
6175 if (xmin < 0) xx[ii] = rr[ii] + zz[ii];
6177 else xx[ii] =
TMath::Max((rr[ii] + zz[ii]),0.0 );
6193 Error(
"Smooth",
"Smooth only supported for 1-d histograms");
6196 Int_t nbins = fXaxis.GetNbins();
6198 Error(
"Smooth",
"Smooth only supported for histograms with >= 3 bins. Nbins = %d",nbins);
6209 firstbin= fXaxis.GetFirst();
6210 lastbin = fXaxis.GetLast();
6212 nbins = lastbin - firstbin + 1;
6216 for (i=0;i<
nbins;i++) {
6222 for (i=0;i<
nbins;i++) {
6244 void TH1::Streamer(
TBuffer &b)
6249 if (fDirectory) fDirectory->Remove(
this);
6255 fXaxis.SetParent(
this);
6256 fYaxis.SetParent(
this);
6257 fZaxis.SetParent(
this);
6260 while ((obj=next())) {
6266 TNamed::Streamer(b);
6267 TAttLine::Streamer(b);
6268 TAttFill::Streamer(b);
6269 TAttMarker::Streamer(b);
6274 fXaxis.SetParent(
this);
6275 fYaxis.SetParent(
this);
6276 fZaxis.SetParent(
this);
6292 for (
Int_t i=0;i<
n;i++) fContour.fArray[i] = contour[i];
6298 fContour.Streamer(b);
6328 else if (opt.
Contains(
"range")) all = 1;
6329 else if (opt.
Contains(
"base")) all = 2;
6332 Int_t bin, binx, biny, binz;
6333 Int_t firstx=0,lastx=0,firsty=0,lasty=0,firstz=0,lastz=0;
6335 lastx = fXaxis.GetNbins()+1;
6336 if (
fDimension > 1) lasty = fYaxis.GetNbins()+1;
6337 if (
fDimension > 2) lastz = fZaxis.GetNbins()+1;
6339 firstx = fXaxis.GetFirst(); lastx = fXaxis.GetLast();
6340 if (
fDimension > 1) {firsty = fYaxis.GetFirst(); lasty = fYaxis.GetLast();}
6341 if (
fDimension > 2) {firstz = fZaxis.GetFirst(); lastz = fZaxis.GetLast();}
6345 printf(
" Title = %s\n",
GetTitle());
6346 printf(
" NbinsX= %d, xmin= %g, xmax=%g", fXaxis.GetNbins(), fXaxis.GetXmin(), fXaxis.GetXmax());
6347 if(
fDimension > 1) printf(
", NbinsY= %d, ymin= %g, ymax=%g", fYaxis.GetNbins(), fYaxis.GetXmin(), fYaxis.GetXmax());
6348 if(
fDimension > 2) printf(
", NbinsZ= %d, zmin= %g, zmax=%g", fZaxis.GetNbins(), fZaxis.GetXmin(), fZaxis.GetXmax());
6356 for (binx=firstx;binx<=lastx;binx++) {
6357 x = fXaxis.GetBinCenter(binx);
6360 if(fSumw2.fN) printf(
" fSumw[%d]=%g, x=%g, error=%g\n",binx,w,x,e);
6361 else printf(
" fSumw[%d]=%g, x=%g\n",binx,w,x);
6365 for (biny=firsty;biny<=lasty;biny++) {
6366 y = fYaxis.GetBinCenter(biny);
6367 for (binx=firstx;binx<=lastx;binx++) {
6369 x = fXaxis.GetBinCenter(binx);
6372 if(fSumw2.fN) printf(
" fSumw[%d][%d]=%g, x=%g, y=%g, error=%g\n",binx,biny,w,x,y,e);
6373 else printf(
" fSumw[%d][%d]=%g, x=%g, y=%g\n",binx,biny,w,x,y);
6378 for (binz=firstz;binz<=lastz;binz++) {
6379 z = fZaxis.GetBinCenter(binz);
6380 for (biny=firsty;biny<=lasty;biny++) {
6381 y = fYaxis.GetBinCenter(biny);
6382 for (binx=firstx;binx<=lastx;binx++) {
6383 bin =
GetBin(binx,biny,binz);
6384 x = fXaxis.GetBinCenter(binx);
6387 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);
6388 else printf(
" fSumw[%d][%d][%d]=%g, x=%g, y=%g, z=%g\n",binx,biny,binz,w,x,y,z);
6402 fSumw2.Set(fNcells);
6422 if (fIntegral) {
delete []
fIntegral; fIntegral = 0;}
6446 if (opt ==
"ICES")
return;
6476 static Int_t nxaxis = 0;
6477 static Int_t nyaxis = 0;
6478 static Int_t nzaxis = 0;
6479 TString sxaxis=
"xAxis",syaxis=
"yAxis",szaxis=
"zAxis";
6490 if (i != 0) out <<
", ";
6493 out <<
"}; " << std::endl;
6506 if (i != 0) out <<
", ";
6509 out <<
"}; " << std::endl;
6522 if (i != 0) out <<
", ";
6525 out <<
"}; " << std::endl;
6529 out <<
" "<<std::endl;
6539 static Int_t hcounter = 0;
6546 histName += hcounter;
6549 const char *hname = histName.
Data();
6550 if (!strlen(hname)) hname =
"unnamed";
6553 t.ReplaceAll(
"\\",
"\\\\");
6554 t.ReplaceAll(
"\"",
"\\\"");
6555 out << hname <<
" = new " <<
ClassName() <<
"(" << quote
6556 << hname << quote <<
"," << quote<< t.Data() << quote
6559 out <<
", "<<sxaxis;
6566 out <<
", "<<syaxis;
6574 out <<
", "<<szaxis;
6579 out <<
");" << std::endl;
6583 for (bin=0;bin<
fNcells;bin++) {
6586 out<<
" "<<hname<<
"->SetBinContent("<<bin<<
","<<bc<<
");"<<std::endl;
6592 for (bin=0;bin<
fNcells;bin++) {
6595 out<<
" "<<hname<<
"->SetBinError("<<bin<<
","<<be<<
");"<<std::endl;
6611 out<<
" "<<hname<<
"->SetBarOffset("<<
GetBarOffset()<<
");"<<std::endl;
6614 out<<
" "<<hname<<
"->SetBarWidth("<<
GetBarWidth()<<
");"<<std::endl;
6617 out<<
" "<<hname<<
"->SetMinimum("<<
fMinimum<<
");"<<std::endl;
6620 out<<
" "<<hname<<
"->SetMaximum("<<
fMaximum<<
");"<<std::endl;
6623 out<<
" "<<hname<<
"->SetNormFactor("<<
fNormFactor<<
");"<<std::endl;
6626 out<<
" "<<hname<<
"->SetEntries("<<
fEntries<<
");"<<std::endl;
6628 if (fDirectory == 0) {
6629 out<<
" "<<hname<<
"->SetDirectory(0);"<<std::endl;
6632 out<<
" "<<hname<<
"->SetStats(0);"<<std::endl;
6635 out<<
" "<<hname<<
"->SetOption("<<quote<<
fOption.
Data()<<quote<<
");"<<std::endl;
6640 if (ncontours > 0) {
6641 out<<
" "<<hname<<
"->SetContour("<<ncontours<<
");"<<std::endl;
6643 for (
Int_t bin=0;bin<ncontours;bin++) {
6644 if (
gPad->GetLogz()) {
6649 out<<
" "<<hname<<
"->SetContourLevel("<<bin<<
","<<zlevel<<
");"<<std::endl;
6656 static Int_t funcNumber = 0;
6661 out<<
" "<<hname<<
"->GetListOfFunctions()->Add("
6662 <<
Form(
"%s%d",obj->
GetName(),funcNumber)<<
");"<<std::endl;
6664 out<<
" "<<hname<<
"->GetListOfFunctions()->Add(ptstats);"<<std::endl;
6665 out<<
" ptstats->SetParent("<<hname<<
");"<<std::endl;
6667 out<<
" "<<hname<<
"->GetListOfFunctions()->Add("
6669 <<
","<<quote<<lnk->
GetOption()<<quote<<
");"<<std::endl;
6678 fXaxis.SaveAttributes(out,hname,
"->GetXaxis()");
6679 fYaxis.SaveAttributes(out,hname,
"->GetYaxis()");
6680 fZaxis.SaveAttributes(out,hname,
"->GetZaxis()");
6684 out<<
" "<<hname<<
"->Draw("
6685 <<quote<<option<<quote<<
");"<<std::endl;
6696 fXaxis.ResetAttAxis(
"X");
6697 fYaxis.ResetAttAxis(
"Y");
6698 fZaxis.ResetAttAxis(
"Z");
6728 while ((obj = next())) {
6758 if (axis<1 || (axis>3 && axis<11) || axis>13)
return 0;
6762 if (stats[0] == 0)
return 0;
6764 Int_t ax[3] = {2,4,7};
6765 return stats[ax[axis-1]]/stats[0];
6770 return ( neff > 0 ? stddev/
TMath::Sqrt(neff) : 0. );
6812 if (axis<1 || (axis>3 && axis<11) || axis>13)
return 0;
6817 if (stats[0] == 0)
return 0;
6818 Int_t ax[3] = {2,4,7};
6819 Int_t axm = ax[axis%10 - 1];
6820 x = stats[axm]/stats[0];
6821 stddev2 =
TMath::Abs(stats[axm+1]/stats[0] -x*x);
6828 return ( neff > 0 ?
TMath::Sqrt(stddev2/(2*neff) ) : 0. );
6864 if (axis > 0 && axis <= 3){
6868 Double_t stddev3 = stddev*stddev*stddev;
6870 Int_t firstBinX = fXaxis.GetFirst();
6871 Int_t lastBinX = fXaxis.GetLast();
6872 Int_t firstBinY = fYaxis.GetFirst();
6873 Int_t lastBinY = fYaxis.GetLast();
6874 Int_t firstBinZ = fZaxis.GetFirst();
6875 Int_t lastBinZ = fZaxis.GetLast();
6879 if (firstBinX == 1) firstBinX = 0;
6880 if (lastBinX == fXaxis.GetNbins() ) lastBinX += 1;
6883 if (firstBinY == 1) firstBinY = 0;
6884 if (lastBinY == fYaxis.GetNbins() ) lastBinY += 1;
6887 if (firstBinZ == 1) firstBinZ = 0;
6888 if (lastBinZ == fZaxis.GetNbins() ) lastBinZ += 1;
6895 for (
Int_t binx = firstBinX; binx <= lastBinX; binx++) {
6896 for (
Int_t biny = firstBinY; biny <= lastBinY; biny++) {
6897 for (
Int_t binz = firstBinZ; binz <= lastBinZ; binz++) {
6898 if (axis==1 ) x = fXaxis.GetBinCenter(binx);
6899 else if (axis==2 ) x = fYaxis.GetBinCenter(biny);
6900 else if (axis==3 ) x = fZaxis.GetBinCenter(binz);
6903 sum+=w*(x-mean)*(x-mean)*(x-mean);
6910 else if (axis > 10 && axis <= 13) {
6917 Error(
"GetSkewness",
"illegal value of parameter");
6933 if (axis > 0 && axis <= 3){
6937 Double_t stddev4 = stddev*stddev*stddev*stddev;
6939 Int_t firstBinX = fXaxis.GetFirst();
6940 Int_t lastBinX = fXaxis.GetLast();
6941 Int_t firstBinY = fYaxis.GetFirst();
6942 Int_t lastBinY = fYaxis.GetLast();
6943 Int_t firstBinZ = fZaxis.GetFirst();
6944 Int_t lastBinZ = fZaxis.GetLast();
6948 if (firstBinX == 1) firstBinX = 0;
6949 if (lastBinX == fXaxis.GetNbins() ) lastBinX += 1;
6952 if (firstBinY == 1) firstBinY = 0;
6953 if (lastBinY == fYaxis.GetNbins() ) lastBinY += 1;
6956 if (firstBinZ == 1) firstBinZ = 0;
6957 if (lastBinZ == fZaxis.GetNbins() ) lastBinZ += 1;
6964 for (
Int_t binx = firstBinX; binx <= lastBinX; binx++) {
6965 for (
Int_t biny = firstBinY; biny <= lastBinY; biny++) {
6966 for (
Int_t binz = firstBinZ; binz <= lastBinZ; binz++) {
6967 if (axis==1 ) x = fXaxis.GetBinCenter(binx);
6968 else if (axis==2 ) x = fYaxis.GetBinCenter(biny);
6969 else if (axis==3 ) x = fZaxis.GetBinCenter(binz);
6972 sum+=w*(x-mean)*(x-mean)*(x-mean)*(x-mean);
6979 }
else if (axis > 10 && axis <= 13) {
6983 return ( neff > 0 ?
TMath::Sqrt(24./neff ) : 0. );
6986 Error(
"GetKurtosis",
"illegal value of parameter");
7031 for (bin=0;bin<4;bin++) stats[bin] = 0;
7033 Int_t firstBinX = fXaxis.GetFirst();
7034 Int_t lastBinX = fXaxis.GetLast();
7037 if (firstBinX == 1) firstBinX = 0;
7038 if (lastBinX == fXaxis.GetNbins() ) lastBinX += 1;
7040 for (binx = firstBinX; binx <= lastBinX; binx++) {
7041 x = fXaxis.GetBinCenter(binx);
7047 stats[1] += err*err;
7090 if (fSumw2.fN > 0 &&
fTsumw > 0 && stats[1] > 0 )
fEntries = stats[0]*stats[0]/ stats[1];
7100 Int_t bin,binx,biny,binz;
7102 for(binz=1; binz<=fZaxis.GetNbins(); binz++) {
7103 for(biny=1; biny<=fYaxis.GetNbins(); biny++) {
7104 for(binx=1; binx<=fXaxis.GetNbins(); binx++) {
7105 bin =
GetBin(binx,biny,binz);
7122 return Integral(fXaxis.GetFirst(),fXaxis.GetLast(),option);
7135 return DoIntegral(binx1,binx2,0,-1,0,-1,err,option);
7162 if (binx1 < 0) binx1 = 0;
7163 if (binx2 >= nx || binx2 < binx1) binx2 = nx - 1;
7167 if (biny1 < 0) biny1 = 0;
7168 if (biny2 >= ny || biny2 < biny1) biny2 = ny - 1;
7170 biny1 = 0; biny2 = 0;
7175 if (binz1 < 0) binz1 = 0;
7176 if (binz2 >= nz || binz2 < binz1) binz2 = nz - 1;
7178 binz1 = 0; binz2 = 0;
7191 for (
Int_t binx = binx1; binx <= binx2; ++binx) {
7192 if (width) dx = fXaxis.GetBinWidth(binx);
7193 for (
Int_t biny = biny1; biny <= biny2; ++biny) {
7194 if (width) dy = fYaxis.GetBinWidth(biny);
7195 for (
Int_t binz = binz1; binz <= binz2; ++binz) {
7199 dz = fZaxis.GetBinWidth(binz);
7248 printf(
" AndersonDarlingTest Prob = %g, AD TestStatistic = %g\n",pvalue,advalue);
7250 if (opt.
Contains(
"T") )
return advalue;
7261 Error(
"AndersonDarlingTest",
"Histograms must be 1-D");
7362 if (h2 == 0)
return 0;
7370 Error(
"KolmogorovTest",
"Histograms must be 1-D\n");
7376 Error(
"KolmogorovTest",
"Number of channels is different, %d and %d\n",ncx1,ncx2);
7387 if (diff1 > difprec || diff2 > difprec) {
7388 Error(
"KolmogorovTest",
"histograms with different binning");
7401 if (opt.
Contains(
"O")) ilast = ncx1 +1;
7402 for (bin = ifirst; bin <= ilast; bin++) {
7411 Error(
"KolmogorovTest",
"Histogram1 %s integral is zero\n",h1->
GetName());
7415 Error(
"KolmogorovTest",
"Histogram2 %s integral is zero\n",h2->
GetName());
7424 esum1 = sum1 * sum1 / w1;
7429 esum2 = sum2 * sum2 / w2;
7433 if (afunc2 && afunc1) {
7434 Error(
"KolmogorovTest",
"Errors are zero for both histograms\n");
7443 Double_t dfmax =0, rsum1 = 0, rsum2 = 0;
7445 for (bin=ifirst;bin<=ilast;bin++) {
7467 if (opt.
Contains(
"N") && !(afunc1 || afunc2 ) ) {
7471 Double_t chi2 = d12*d12/(esum1+esum2);
7474 if (prob > 0 && prb2 > 0) prob *= prb2*(1-
TMath::Log(prob*prb2));
7478 const Int_t nEXPT = 1000;
7479 if (opt.
Contains(
"X") && !(afunc1 || afunc2 ) ) {
7484 for (
Int_t i=0; i < nEXPT; i++) {
7488 if (dSEXPT>dfmax) prb3 += 1.0;
7496 printf(
" Kolmo Prob h1 = %s, sum bin content =%g effective entries =%g\n",h1->
GetName(),sum1,esum1);
7497 printf(
" Kolmo Prob h2 = %s, sum bin content =%g effective entries =%g\n",h2->
GetName(),sum2,esum2);
7498 printf(
" Kolmo Prob = %g, Max Dist = %g\n",prob,dfmax);
7500 printf(
" Kolmo Prob = %f for shape alone, =%f for normalisation alone\n",prb1,prb2);
7502 printf(
" Kolmo Prob = %f with %d pseudo-experiments\n",prb3,nEXPT);
7508 if(opt.
Contains(
"M"))
return dfmax;
7509 else if(opt.
Contains(
"X"))
return prb3;
7539 for (
Int_t level=0; level<nlevels; level++) levels[level] = fContour.fArray[level];
7550 return (level >= 0 && level < fContour.fN) ? fContour.fArray[level] : 0.0;
7560 if (level <0 || level >= fContour.fN)
return 0;
7561 Double_t zlevel = fContour.fArray[level];
7567 if (zlevel <= 0)
return 0;
7583 if (buffersize <= 0) {
7587 if (buffersize < 100) buffersize = 100;
7609 fContour.Set(nlevels);
7614 for (level=0; level<nlevels; level++) fContour.fArray[level] = levels[level];
7619 if ((zmin == zmax) && (zmin != 0)) {
7625 if (zmax <= 0)
return;
7626 if (zmin <= 0) zmin = 0.001*zmax;
7629 dz = (zmax-zmin)/
Double_t(nlevels);
7631 for (level=0; level<nlevels; level++) {
7632 fContour.fArray[level] = zmin + dz*
Double_t(level);
7642 if (level < 0 || level >= fContour.fN)
return;
7644 fContour.fArray[level] = value;
7665 if (fBuffer) ((
TH1*)
this)->BufferEmpty();
7667 Int_t bin, binx, biny, binz;
7668 Int_t xfirst = fXaxis.GetFirst();
7669 Int_t xlast = fXaxis.GetLast();
7670 Int_t yfirst = fYaxis.GetFirst();
7671 Int_t ylast = fYaxis.GetLast();
7672 Int_t zfirst = fZaxis.GetFirst();
7673 Int_t zlast = fZaxis.GetLast();
7674 Double_t maximum = -FLT_MAX, value;
7675 for (binz=zfirst;binz<=zlast;binz++) {
7676 for (biny=yfirst;biny<=ylast;biny++) {
7677 for (binx=xfirst;binx<=xlast;binx++) {
7678 bin =
GetBin(binx,biny,binz);
7680 if (value > maximum && value < maxval) maximum = value;
7702 if (fBuffer) ((
TH1*)
this)->BufferEmpty();
7704 Int_t bin, binx, biny, binz;
7706 Int_t xfirst = fXaxis.GetFirst();
7707 Int_t xlast = fXaxis.GetLast();
7708 Int_t yfirst = fYaxis.GetFirst();
7709 Int_t ylast = fYaxis.GetLast();
7710 Int_t zfirst = fZaxis.GetFirst();
7711 Int_t zlast = fZaxis.GetLast();
7712 Double_t maximum = -FLT_MAX, value;
7713 locm = locmax = locmay = locmaz = 0;
7714 for (binz=zfirst;binz<=zlast;binz++) {
7715 for (biny=yfirst;biny<=ylast;biny++) {
7716 for (binx=xfirst;binx<=xlast;binx++) {
7717 bin =
GetBin(binx,biny,binz);
7719 if (value > maximum) {
7750 if (fBuffer) ((
TH1*)
this)->BufferEmpty();
7752 Int_t bin, binx, biny, binz;
7753 Int_t xfirst = fXaxis.GetFirst();
7754 Int_t xlast = fXaxis.GetLast();
7755 Int_t yfirst = fYaxis.GetFirst();
7756 Int_t ylast = fYaxis.GetLast();
7757 Int_t zfirst = fZaxis.GetFirst();
7758 Int_t zlast = fZaxis.GetLast();
7760 for (binz=zfirst;binz<=zlast;binz++) {
7761 for (biny=yfirst;biny<=ylast;biny++) {
7762 for (binx=xfirst;binx<=xlast;binx++) {
7763 bin =
GetBin(binx,biny,binz);
7765 if (value < minimum && value > minval) minimum = value;
7787 if (fBuffer) ((
TH1*)
this)->BufferEmpty();
7789 Int_t bin, binx, biny, binz;
7791 Int_t xfirst = fXaxis.GetFirst();
7792 Int_t xlast = fXaxis.GetLast();
7793 Int_t yfirst = fYaxis.GetFirst();
7794 Int_t ylast = fYaxis.GetLast();
7795 Int_t zfirst = fZaxis.GetFirst();
7796 Int_t zlast = fZaxis.GetLast();
7798 locm = locmix = locmiy = locmiz = 0;
7799 for (binz=zfirst;binz<=zlast;binz++) {
7800 for (biny=yfirst;biny<=ylast;biny++) {
7801 for (binx=xfirst;binx<=xlast;binx++) {
7802 bin =
GetBin(binx,biny,binz);
7804 if (value < minimum) {
7844 if (fBuffer) ((
TH1*)
this)->BufferEmpty();
7846 Int_t bin, binx, biny, binz;
7847 Int_t xfirst = fXaxis.GetFirst();
7848 Int_t xlast = fXaxis.GetLast();
7849 Int_t yfirst = fYaxis.GetFirst();
7850 Int_t ylast = fYaxis.GetLast();
7851 Int_t zfirst = fZaxis.GetFirst();
7852 Int_t zlast = fZaxis.GetLast();
7856 for (binz=zfirst;binz<=zlast;binz++) {
7857 for (biny=yfirst;biny<=ylast;biny++) {
7858 for (binx=xfirst;binx<=xlast;binx++) {
7859 bin =
GetBin(binx,biny,binz);
7861 if (value < min) min = value;
7862 if (value > max) max = value;
7880 Error(
"SetBins",
"Operation only valid for 1-d histograms");
7883 fXaxis.SetRange(0,0);
7884 fXaxis.Set(nx,xmin,xmax);
7890 fSumw2.Set(fNcells);
7907 Error(
"SetBins",
"Operation only valid for 1-d histograms");
7910 fXaxis.SetRange(0,0);
7911 fXaxis.Set(nx,xBins);
7917 fSumw2.Set(fNcells);
7933 Error(
"SetBins",
"Operation only valid for 2-D histograms");
7936 fXaxis.SetRange(0,0);
7937 fYaxis.SetRange(0,0);
7938 fXaxis.Set(nx,xmin,xmax);
7939 fYaxis.Set(ny,ymin,ymax);
7941 fNcells = (nx+2)*(ny+2);
7944 fSumw2.Set(fNcells);
7961 Error(
"SetBins",
"Operation only valid for 2-D histograms");
7964 fXaxis.SetRange(0,0);
7965 fYaxis.SetRange(0,0);
7966 fXaxis.Set(nx,xBins);
7967 fYaxis.Set(ny,yBins);
7969 fNcells = (nx+2)*(ny+2);
7972 fSumw2.Set(fNcells);
7988 Error(
"SetBins",
"Operation only valid for 3-D histograms");
7991 fXaxis.SetRange(0,0);
7992 fYaxis.SetRange(0,0);
7993 fZaxis.SetRange(0,0);
7994 fXaxis.Set(nx,xmin,xmax);
7995 fYaxis.Set(ny,ymin,ymax);
7996 fZaxis.Set(nz,zmin,zmax);
7997 fNcells = (nx+2)*(ny+2)*(nz+2);
8000 fSumw2.Set(fNcells);
8018 Error(
"SetBins",
"Operation only valid for 3-D histograms");
8021 fXaxis.SetRange(0,0);
8022 fYaxis.SetRange(0,0);
8023 fZaxis.SetRange(0,0);
8024 fXaxis.Set(nx,xBins);
8025 fYaxis.Set(ny,yBins);
8026 fZaxis.Set(nz,zBins);
8027 fNcells = (nx+2)*(ny+2)*(nz+2);
8030 fSumw2.Set(fNcells);
8049 if (fDirectory == dir)
return;
8050 if (fDirectory) fDirectory->Remove(
this);
8052 if (fDirectory) fDirectory->
Append(
this);
8073 if (fDirectory) fDirectory->Remove(
this);
8075 if (fDirectory) fDirectory->Append(
this);
8130 if (fSumw2.fN > 0 ) fSumw2.Set(0);
8134 if (fSumw2.fN == fNcells) {
8136 Warning(
"Sumw2",
"Sum of squares of weights structure already created");
8140 fSumw2.Set(fNcells);
8171 if (bin < 0) bin = 0;
8172 if (bin >= fNcells) bin = fNcells-1;
8173 if (fBuffer) ((
TH1*)
this)->BufferEmpty();
8174 if (fSumw2.fN)
return TMath::Sqrt(fSumw2.fArray[bin]);
8191 if (bin < 0) bin = 0;
8192 if (bin >= fNcells) bin = fNcells-1;
8193 if (fBuffer) ((
TH1*)
this)->BufferEmpty();
8201 Warning(
"GetBinErrorLow",
"Histogram has negative bin content-force usage to normal errors");
8206 if (n == 0)
return 0;
8221 if (bin < 0) bin = 0;
8222 if (bin >= fNcells) bin = fNcells-1;
8223 if (fBuffer) ((
TH1*)
this)->BufferEmpty();
8231 Warning(
"GetBinErrorUp",
"Histogram has negative bin content-force usage to normal errors");
8250 Error(
"GetBinCenter",
"Invalid method for a %d-d histogram - return a NaN",
fDimension);
8261 Error(
"GetBinLowEdge",
"Invalid method for a %d-d histogram - return a NaN",
fDimension);
8272 Error(
"GetBinWidth",
"Invalid method for a %d-d histogram - return a NaN",
fDimension);
8283 fXaxis.GetCenter(center);
8296 fXaxis.GetLowEdge(edge);
8299 Error(
"GetLowEdge",
"Invalid method for a %d-d histogram ",
fDimension);
8308 if (bin < 0 || bin>= fSumw2.fN)
return;
8309 fSumw2.fArray[bin] = error * error;
8323 if (bin < 0)
return;
8324 if (bin >= fNcells-1) {
8340 if (binx < 0 || binx > fXaxis.GetNbins() + 1)
return;
8341 if (biny < 0 || biny > fYaxis.GetNbins() + 1)
return;
8350 if (binx < 0 || binx > fXaxis.GetNbins() + 1)
return;
8351 if (biny < 0 || biny > fYaxis.GetNbins() + 1)
return;
8352 if (binz < 0 || binz > fZaxis.GetNbins() + 1)
return;
8387 return (
TH1*)
gROOT->ProcessLineFast(
Form(
"TSpectrum::StaticBackground((TH1*)0x%lx,%d,\"%s\")",
8388 (
ULong_t)
this, niter, option));
8401 return (
Int_t)
gROOT->ProcessLineFast(
Form(
"TSpectrum::StaticSearch((TH1*)0x%lx,%g,\"%s\",%g)",
8402 (
ULong_t)
this, sigma, option, threshold));
8420 ::Error(
"TransformHisto",
"Invalid FFT transform class");
8425 ::Error(
"TransformHisto",
"Only 1d and 2D transform are supported");
8439 hout =
new TH1D(name, name,n[0], 0, n[0]);
8441 hout =
new TH2D(name, name, n[0], 0, n[0], n[1], 0, n[1]);
8449 for (binx = 1; binx<=hout->
GetNbinsX(); binx++) {
8450 for (biny=1; biny<=hout->
GetNbinsY(); biny++) {
8451 ind[0] = binx-1; ind[1] = biny-1;
8457 for (binx = 1; binx<=hout->
GetNbinsX(); binx++) {
8458 for (biny=1; biny<=hout->
GetNbinsY(); biny++) {
8459 ind[0] = binx-1; ind[1] = biny-1;
8468 for (binx = 1; binx<=hout->
GetNbinsX(); binx++) {
8469 for (biny=1; biny<=hout->
GetNbinsY(); biny++) {
8470 ind[0] = binx-1; ind[1] = biny-1;
8476 ::Error(
"TransformHisto",
"No complex numbers in the output");
8483 for (binx = 1; binx<=hout->
GetNbinsX(); binx++) {
8484 for (biny=1; biny<=hout->
GetNbinsY(); biny++) {
8485 ind[0] = binx-1; ind[1] = biny-1;
8491 for (binx = 1; binx<=hout->
GetNbinsX(); binx++) {
8492 for (biny=1; biny<=hout->
GetNbinsY(); biny++) {
8493 ind[0] = binx-1; ind[1] = biny-1;
8502 for (binx = 1; binx<=hout->
GetNbinsX(); binx++){
8503 for (biny=1; biny<=hout->
GetNbinsY(); biny++){
8504 ind[0] = binx-1; ind[1] = biny-1;
8525 printf(
"Pure real output, no phase");
8556 std::ostringstream strm;
8575 if (fgDefaultSumw2) Sumw2();
8583 : TH1(name,title,nbins,xlow,xup)
8588 if (xlow >= xup) SetBuffer(fgBufferSize);
8589 if (fgDefaultSumw2) Sumw2();
8597 : TH1(name,title,nbins,xbins)
8601 if (fgDefaultSumw2) Sumw2();
8609 : TH1(name,title,nbins,xbins)
8613 if (fgDefaultSumw2) Sumw2();
8645 if (newval > -128 && newval < 128) {
fArray[bin] =
Char_t(newval);
return;}
8646 if (newval < -127)
fArray[bin] = -127;
8647 if (newval > 127)
fArray[bin] = 127;
8673 if (n < 0) n = fXaxis.GetNbins() + 2;
8756 if (fgDefaultSumw2) Sumw2();
8764 : TH1(name,title,nbins,xlow,xup)
8769 if (xlow >= xup) SetBuffer(fgBufferSize);
8770 if (fgDefaultSumw2) Sumw2();
8778 : TH1(name,title,nbins,xbins)
8782 if (fgDefaultSumw2) Sumw2();
8790 : TH1(name,title,nbins,xbins)
8794 if (fgDefaultSumw2) Sumw2();
8826 if (newval > -32768 && newval < 32768) {
fArray[bin] =
Short_t(newval);
return;}
8827 if (newval < -32767)
fArray[bin] = -32767;
8828 if (newval > 32767)
fArray[bin] = 32767;
8854 if (n < 0) n = fXaxis.GetNbins() + 2;
8937 if (fgDefaultSumw2) Sumw2();
8945 : TH1(name,title,nbins,xlow,xup)
8950 if (xlow >= xup) SetBuffer(fgBufferSize);
8951 if (fgDefaultSumw2) Sumw2();
8959 : TH1(name,title,nbins,xbins)
8963 if (fgDefaultSumw2) Sumw2();
8971 : TH1(name,title,nbins,xbins)
8975 if (fgDefaultSumw2) Sumw2();
9007 if (newval > -2147483647 && newval < 2147483647) {
fArray[bin] =
Int_t(newval);
return;}
9008 if (newval < -2147483647)
fArray[bin] = -2147483647;
9009 if (newval > 2147483647)
fArray[bin] = 2147483647;
9035 if (n < 0) n = fXaxis.GetNbins() + 2;
9119 if (fgDefaultSumw2) Sumw2();
9127 : TH1(name,title,nbins,xlow,xup)
9132 if (xlow >= xup) SetBuffer(fgBufferSize);
9133 if (fgDefaultSumw2) Sumw2();
9141 : TH1(name,title,nbins,xbins)
9145 if (fgDefaultSumw2) Sumw2();
9153 : TH1(name,title,nbins,xbins)
9157 if (fgDefaultSumw2) Sumw2();
9165 : TH1(
"TVectorF",
"",v.GetNrows(),0,v.GetNrows())
9170 for (
Int_t i=0;i<fNcells-2;i++) {
9171 SetBinContent(i+1,
v(i+ivlow));
9174 if (fgDefaultSumw2) Sumw2();
9215 if (n < 0) n = fXaxis.GetNbins() + 2;
9298 if (fgDefaultSumw2) Sumw2();
9306 : TH1(name,title,nbins,xlow,xup)
9311 if (xlow >= xup) SetBuffer(fgBufferSize);
9312 if (fgDefaultSumw2) Sumw2();
9320 : TH1(name,title,nbins,xbins)
9324 if (fgDefaultSumw2) Sumw2();
9332 : TH1(name,title,nbins,xbins)
9336 if (fgDefaultSumw2) Sumw2();
9344 : TH1(
"TVectorD",
"",v.GetNrows(),0,v.GetNrows())
9349 for (
Int_t i=0;i<fNcells-2;i++) {
9350 SetBinContent(i+1,
v(i+ivlow));
9353 if (fgDefaultSumw2) Sumw2();
9394 if (n < 0) n = fXaxis.GetNbins() + 2;
9471 if(hid >= 0) hname.
Form(
"h%d",hid);
9472 else hname.
Form(
"h_%d",hid);
9479 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)
Browse the Histogram object.
Int_t GetFirst() const
Return first bin on the axis i.e.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual const char * GetTitle() const
Returns title of object.
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
void Copy(TAttMarker &attmarker) const
Copy this marker attributes to a new TAttMarker.
virtual Style_t GetLineStyle() const
Return the line style.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void SetNameTitle(const char *name, const char *title)
Change the name and title of this histogram.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Option_t * GetOption() const
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
Return Global bin number corresponding to x,y,z.
object has not been deleted
Double_t fNormFactor
Normalization factor.
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 GetBinErrorLow(Int_t bin) const
Return lower error associated to bin number bin.
TList * GetListOfFunctions() const
TH1D & operator=(const TH1D &h1)
Operator =.
void SetBarWidth(Float_t barwidth=0.5)
static long int sum(long int i)
virtual void Paint(Option_t *option="")
Control routine to paint any kind of histograms.
virtual TH1 * DrawNormalized(Option_t *option="", Double_t norm=1) const
Draw a normalized copy of this histogram.
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 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.
Int_t AxisChoice(Option_t *axis) const
Choose an axis according to "axis".
virtual ~TH1I()
Destructor.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual void SetMaximum(Double_t maximum=-1111)
double Chisquare(const TH1 &h1, TF1 &f1, bool useRange, bool usePL=false)
compute the chi2 value for an histogram given a function (see TH1::Chisquare for the documentation) ...
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)
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.
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...
Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
Short_t fBarWidth
(1000*width) for bar charts or legos
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
static Bool_t fgDefaultSumw2
!flag to call TH1::Sumw2 automatically at histogram creation time
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.
virtual void FitPanel()
Display a panel with all histogram fit options.
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
Bool_t GetCanvasPreferGL() const
Style_t GetHistLineStyle() const
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 Int_t GetMaximumBin() const
Return location of bin with maximum value in the range.
const char * GetBinLabel(Int_t bin) const
Return label for bin.
Double_t KolmogorovProb(Double_t z)
Calculates the Kolmogorov distribution function,.
virtual void Set(Int_t n)=0
virtual void SetError(const Double_t *error)
Replace bin errors by values in array error.
TString & ReplaceAll(const TString &s1, const TString &s2)
TAxis fYaxis
Y axis descriptor.
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)
virtual Int_t GetDimension() const
TList * fFunctions
->Pointer to list of functions (fits and user)
virtual void SetBins(Int_t nx, Double_t xmin, Double_t xmax)
Redefine x axis parameters.
virtual void SetName(const char *name)
Set the name of the TNamed.
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 use under/overflows in statistics
static Bool_t SameLimitsAndNBins(const TAxis &axis1, const TAxis &axis2)
Same limits and bins.
virtual ~TH1F()
Destructor.
void Build()
Creates histogram basic data structure.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
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.
virtual Bool_t GetTimeDisplay() const
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...
void Copy(TAttLine &attline) const
Copy this line attributes to a new TAttLine.
void ToUpper()
Change string to upper case.
virtual void Reset(Option_t *option="")
Reset.
static bool CheckAxisLimits(const TAxis *a1, const TAxis *a2)
Check that the axis limits of the histograms are the same.
Buffer base class used for serializing objects.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
virtual void Copy(TObject &hnew) const
Copy this to newth1.
virtual void Copy(TObject &hnew) const
Copy this to newth1.
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
Int_t LoadPlugin()
Load the plugin library for this handler.
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...
static Bool_t AddDirectoryStatus()
Static function: cannot be inlined on Windows/NT.
tomato 1-D histogram with a float per channel (see TH1 documentation)}
virtual TObject * GetUserFunc() const
tomato 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 Double_t GetNormFactor() const
void Copy(TAttFill &attfill) const
Copy this fill attributes to a new TAttFill.
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...
Short_t Min(Short_t a, Short_t b)
void ToLower()
Change string to lower-case.
TTime operator/(const TTime &t1, const TTime &t2)
void SetBarOffset(Float_t baroff=0.5)
R__EXTERN TVirtualMutex * gROOTMutex
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void Smooth(Int_t ntimes=1, Option_t *option="")
Smooth bin contents of this histogram.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Histogram is forced to be not weighted even when the histogram is filled with weighted different than...
virtual Double_t GetStdDevError(Int_t axis=1) const
Return error of standard deviation estimation for Normal distribution.
TArrayD fSumw2
Array of sum of squares of weights.
virtual void UseCurrentStyle()
Set current style settings in this object This function is called when either TCanvas::UseCurrentStyl...
virtual Int_t GetNbinsX() const
static Bool_t AlmostInteger(Double_t a, Double_t epsilon=0.00000001)
Test if a double is almost an integer.
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 Double_t Integral(Double_t a, Double_t b, Double_t epsrel=1.e-12)
IntegralOneDim or analytical integral.
Style_t GetHistFillStyle() const
void Copy(TArrayD &array) const
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.
TAxis fZaxis
Z axis descriptor.
virtual Double_t GetEntries() const
Return the current number of entries.
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...
Long_t ExecPlugin(int nargs, const T &...params)
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
TH1 * R__H(Int_t hid)
return pointer to histogram with name hid if id >=0 h_id if id <0
virtual void GetCenter(Double_t *center) const
Fill array with center of bins for 1D histogram Better to use h1.GetXaxis().GetCenter(center) ...
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
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)
Check bin limits.
virtual TH1 * GetHistogram() const
Return a pointer to the histogram used to visualise the function.
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.
Double_t fTsumwx2
Total Sum of weight*X*X.
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
if object in a list can be deleted
virtual void SetBarWidth(Float_t width=0.5)
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
TDirectory * fDirectory
!Pointer to directory holding this histogram
static void SetDefaultSumw2(Bool_t sumw2=kTRUE)
When this static function is called with sumw2=kTRUE, all new histograms will automatically activate ...
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width for 1D histogram.
virtual TObject * Clone(const char *newname="") const
Make a clone of an collection using the Streamer facility.
const char * Data() const
virtual Double_t GetSkewness(Int_t axis=1) 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.
NOTE: Must always be 0 !!!
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 Double_t GetRandom() const
Return a random number distributed according the histogram bin contents.
Fill Area Attributes class.
static Int_t FitOptionsMake(Option_t *option, Foption_t &Foption)
Decode string choptin and fill fitOption structure.
virtual Double_t GetBinErrorUp(Int_t bin) const
Return upper error associated to bin number bin.
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.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return bin lower edge for 1D histogram.
Float_t GetBarOffset() const
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)
static void SetDefaultBufferSize(Int_t buffersize=1000)
Static function to set the default buffer size for automatic histograms.
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.
The TNamed class is the base class for all named ROOT classes.
virtual ~TH1()
Histogram default destructor.
virtual Bool_t IsEmpty() const
Double_t GetAt(Int_t i) const
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...
TTime operator-(const TTime &t1, const TTime &t2)
virtual void Copy(TObject &named) const
Copy this to obj.
virtual TObject * FindObject(const char *name) const
Search object named name in the list of functions.
Double_t Log10(Double_t x)
virtual void SetContourLevel(Int_t level, Double_t value)
Set value for one contour level.
Abstract interface to a histogram painter.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
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.
TString & Append(const char *cs)
void Sort(Index n, const Element *a, Index *index, Bool_t down=kTRUE)
void H1InitGaus()
Compute Initial values of parameters for a gaussian.
virtual void DrawPanel()=0
errors from Poisson interval at 95% CL (~ 2 sigma)
TString fOption
histogram options
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.
Float_t GetBarWidth() const
virtual Int_t * GetN() const =0
virtual void GetRange(Double_t *xmin, Double_t *xmax) const
Return range of a generic N-D function.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
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 TH1 * DrawCopy(Option_t *option="", const char *name_postfix="_copy") const
Copy this histogram and Draw in the current pad.
TString operator+(const TString &s1, const TString &s2)
Use the special concatenation constructor.
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.
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.
TArrayD fContour
Array to display contour levels.
virtual void SetBinError(Int_t bin, Double_t error)
See convention for numbering bins in TH1::GetBin.
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...
user specified contour levels
virtual void LabelsInflate(Option_t *axis="X")
Double the number of bins for axis.
void AndersonDarling2SamplesTest(Double_t &pvalue, Double_t &testStat) const
virtual void SetTimeDisplay(Int_t value)
Double_t fTsumwx
Total Sum of weight*X.
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 Double_t GetEffectiveEntries() const
Number of effective entries of the histogram.
static Bool_t fgAddDirectory
!flag to add histograms to the directory
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 Rndm()
Machine independent random number generator.
Double_t fMinimum
Minimum value for plotting.
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)
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.
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
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 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 ...
virtual void SetRange(Int_t first=0, Int_t last=0)
Set the viewing range for the axis from bin first to last.
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
virtual Size_t GetMarkerSize() const
Return the marker size.
void Clear(Option_t *option="")
Remove all objects from the list.
std::string printValue(const TDatime *val)
Print a TDatime at the prompt.
virtual void SetParLimits(Int_t ipar, Double_t parmin, Double_t parmax)
Set limits for parameter ipar.
Color_t GetHistFillColor() const
void FillData(BinData &dv, const TH1 *hist, TF1 *func=0)
fill the data vector from a TH1.
virtual void Print(Option_t *option="") const
Print some global quantities for this histogram.
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.
Width_t GetHistLineWidth() const
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
void SetHistFillStyle(Style_t styl=0)
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 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
if object ctor succeeded but object should not be used
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Redefines TObject::GetObjectInfo.
A 3-Dim function with parameters.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
tomato 1-D histogram with an int per channel (see TH1 documentation)}
TTime operator*(const TTime &t1, const TTime &t2)
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.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual void Copy(TObject &hnew) const
Copy this to newth1.
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 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...
virtual Color_t GetFillColor() const
Return the fill area color.
Collection abstract base class.
TObject * GetObject() const
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...
static Int_t fgBufferSize
!default buffer size for automatic histograms
virtual TH1 * Rebin(Int_t ngroup=2, const char *newname="", const Double_t *xbins=0)
Rebin this histogram.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Double_t fEntries
Number of entries.
virtual Double_t GetMeanError(Int_t axis=1) const
Return standard error of mean of this histogram along the X axis.
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.
Bool_t TestBit(UInt_t f) 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.
char * Form(const char *fmt,...)
virtual void Transform()=0
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
static TVirtualFitter * GetFitter()
static: return the current Fitter
virtual Double_t GetSumOfWeights() const
Return the sum of weights excluding under/overflows.
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 Int_t GetNbinsZ() const
void AbstractMethod(const char *method) const
Use this method to implement an "abstract" method that you don't want to leave purely abstract...
virtual const char * GetName() const
Returns name of object.
virtual Int_t GetSumw2N() const
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual Double_t GetKurtosis(Int_t axis=1) const
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
Bin contents are average (used by Add)
virtual Double_t Chi2Test(const TH1 *h2, Option_t *option="UU", Double_t *res=0) const
test for comparing weighted and unweighted histograms
Double_t * fIntegral
!Integral of bins used by GetRandom
virtual TObjLink * FirstLink() const
static bool CheckConsistency(const TH1 *h1, const TH1 *h2)
Check histogram compatibility.
void SetName(const char *name)
A 2-Dim function with parameters.
TH1()
Histogram default constructor.
R__EXTERN TRandom * gRandom
virtual Color_t GetLineColor() const
Return the line color.
tomato 1-D histogram with a double per channel (see TH1 documentation)}
static Int_t GetDefaultBufferSize()
Static function return the default buffer size for automatic histograms the parameter fgBufferSize ma...
virtual void Rebuild(Option_t *option="")
Using the current bin info, recompute the arrays for contents and errors.
if object destructor must call RecursiveRemove()
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual void RecursiveRemove(TObject *obj)
Recursively remove object from the list of functions.
EBinErrorOpt fBinStatErrOpt
option for bin statistical errors
virtual Int_t GetXlast() const
errors with Normal (Wald) approximation: errorUp=errorLow= sqrt(N)
#define R__LOCKGUARD2(mutex)
virtual void Copy(TObject &hnew) const
Copy this to newth1.
TVirtualFFT is an interface class for Fast Fourier Transforms.
virtual void SetName(const char *name)
Change the name of this histogram.
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
Double_t fTsumw2
Total Sum of squares of weights.
virtual void GetPointComplex(Int_t ipoint, Double_t &re, Double_t &im, Bool_t fromInput=kFALSE) const =0
virtual Int_t GetSize() const
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.
virtual const char * GetName() const
Returns name of object.
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.
Double_t fTsumw
Total Sum of weights.
virtual void Copy(TObject &axis) const
Copy axis structure to another axis.
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)
TH1I & operator=(const TH1I &h1)
Operator =.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
void forward(const LAYERDATA &prevLayerData, LAYERDATA &currLayerData)
apply the weights (and functions) in forward direction of the DNN
THist< 2, double, THistStatContent, THistStatUncertainty > TH2D
Color_t GetHistLineColor() const
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.
virtual Int_t GetMinimumBin() const
Return location of bin with minimum value in the range.
static bool IsEquidistantBinning(const TAxis &axis)
Test if the binning is equidistant.
Short_t fBarOffset
(1000*offset) for bar charts or legos
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Array of doubles (64 bits per element).
Bool_t IsBinOverflow(Int_t bin, Int_t axis=0) const
Return true if the bin is overflow.
virtual UInt_t GetUniqueID() const
Return the unique object id.
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 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 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 Int_t GetXfirst() const
Int_t GetLast() const
Return last bin on the axis i.e.
virtual UInt_t SetCanExtend(UInt_t extendBitMask)
Make the histogram axes extendable / not extendable according to the bit mask returns the previous bi...
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
Mother of all ROOT objects.
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
you should not use this method at all Int_t Int_t z
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 ClearUnderflowAndOverflow()
Remove all the content from the underflow and overflow bins, without changing the number of entries A...
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual Int_t GetNbinsY() const
Bool_t IsBinUnderflow(Int_t bin, Int_t axis=0) const
Return true if the bin is underflow.
TH1S & operator=(const TH1S &h1)
Operator =.
virtual Double_t GetBinErrorSqUnchecked(Int_t bin) const
THashList * GetLabels() const
Double_t fMaximum
Maximum value for plotting.
virtual Color_t GetMarkerColor() const
Return the marker color.
virtual void DirectoryAutoAdd(TDirectory *)
Perform the automatic addition of the histogram to the given directory.
TVirtualHistPainter * fPainter
!pointer to histogram painter
static Bool_t RejectedPoint()
See TF1::RejectPoint above.
virtual void DrawPanel()
Display a panel with all histogram drawing options.
virtual void Add(TObject *obj)
Int_t fBufferSize
fBuffer size
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 void Copy(TObject &hnew) const
Copy this histogram structure to newth1.
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 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...
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual void Copy(TObject &hnew) const
Copy this to newth1.
virtual void SetBinsLength(Int_t=-1)
virtual TObject * GetObjectFit() const
tomato 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.
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
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...
virtual Bool_t CanExtendAllAxes() const
Returns true if all axes are extendable.
Int_t fDimension
!Histogram dimension (1, 2 or 3 dim)
THist< 1, double, THistStatContent, THistStatUncertainty > TH1D
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)
TAxis fXaxis
X axis descriptor.
const TArrayD * GetXbins() const
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 Double_t GetStdDev(Int_t axis=1) const
Returns the Standard Deviation (Sigma).
virtual Int_t Poisson(Double_t mean)
Generates a random integer N according to a Poisson law.
Double_t Sqrt(Double_t x)
virtual void GetMinimumAndMaximum(Double_t &min, Double_t &max) const
Retrieve the minimum and maximum values in the histogram.
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual Bool_t IsInside(const Double_t *x) const
return kTRUE if the point is inside the function range
virtual void Set(Int_t nbins, Double_t xmin, Double_t xmax)
Initialize axis with fix bins.
virtual Double_t GetBinError(Int_t bin) const
Return value of error associated to bin number bin.
virtual Style_t GetMarkerStyle() const
Return the marker style.
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...
virtual Width_t GetLineWidth() const
Return the line width.
static Bool_t AlmostEqual(Double_t a, Double_t b, Double_t epsilon=0.00000001)
Test if two double are almost equal.
virtual Double_t EvalPar(const Double_t *x, const Double_t *params=0)
Evaluate function with given coordinates and parameters.
void SetHistLineColor(Color_t color=1)
virtual Float_t GetBarWidth() const
Double_t * fBuffer
[fBufferSize] entry buffer
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...
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.
virtual Int_t GetNcells() const
double norm(double *x, double *p)
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...
void Set(Int_t n)
Set size of this array to n doubles.
virtual TF1 * GetFunction(const char *name) const
Return pointer to function with name.
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.
virtual Int_t GetNpar() const
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 =.
Long64_t BinarySearch(Long64_t n, const T *array, T value)
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...
virtual Double_t GetContourLevel(Int_t level) const
Return value of contour number level.
virtual Double_t GetContourLevelPad(Int_t level) const
Return the value of contour number "level" in Pad coordinates.
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...
virtual Float_t GetBarOffset() const
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
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 Option_t * GetType() const =0
virtual Int_t ReadArray(Bool_t *&b)=0
Int_t fNcells
number of bins(1D), cells (2D) +U/Overflows
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.
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".
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.