78 :
TH1(
name,title,nbinsx,xlow,xup),
83 Warning(
"TH3",
"nbinsy is <=0 - set to nbinsy = 1");
87 Warning(
"TH3",
"nbinsz is <=0 - set to nbinsz = 1");
90 fYaxis.Set(nbinsy,ylow,yup);
91 fZaxis.Set(nbinsz,zlow,zup);
92 fNcells = (nbinsx+2)*(nbinsy+2)*(nbinsz+2);
93 fTsumwy = fTsumwy2 = fTsumwxy = 0;
94 fTsumwz = fTsumwz2 = fTsumwxz = fTsumwyz = 0;
108 if (nbinsy <= 0) {
Warning(
"TH3",
"nbinsy is <=0 - set to nbinsy = 1"); nbinsy = 1; }
109 if (nbinsz <= 0) nbinsz = 1;
114 fNcells = (nbinsx+2)*(nbinsy+2)*(nbinsz+2);
130 if (nbinsy <= 0) {
Warning(
"TH3",
"nbinsy is <=0 - set to nbinsy = 1"); nbinsy = 1; }
131 if (nbinsz <= 0) nbinsz = 1;
136 fNcells = (nbinsx+2)*(nbinsy+2)*(nbinsz+2);
148 ((
TH3&)
h).Copy(*
this);
189 if (!nbentries)
return 0;
192 if (action == 0)
return 0;
193 nbentries = -nbentries;
208 for (
Int_t i=1;i<nbentries;i++) {
216 if (z < zmin) zmin = z;
217 if (z > zmax) zmax = z;
236 for (
Int_t i=0;i<nbentries;i++) {
237 Fill(buffer[4*i+2],buffer[4*i+3],buffer[4*i+4],buffer[4*i+1]);
263 nbentries = -nbentries;
289 Error(
"Fill",
"Invalid signature - do nothing");
304 Int_t binx, biny, binz, bin;
309 if (binx <0 || biny <0 || binz<0)
return -1;
352 Int_t binx, biny, binz, bin;
357 if (binx <0 || biny <0 || binz<0)
return -1;
397 Int_t binx, biny, binz, bin;
402 if (binx <0 || biny <0 || binz<0)
return -1;
440 Int_t binx, biny, binz, bin;
445 if (binx <0 || biny <0 || binz<0)
return -1;
484 Int_t binx, biny, binz, bin;
489 if (binx <0 || biny <0 || binz<0)
return -1;
528 Int_t binx, biny, binz, bin;
533 if (binx <0 || biny <0 || binz<0)
return -1;
572 Int_t binx, biny, binz, bin;
577 if (binx <0 || biny <0 || binz<0)
return -1;
617 Int_t binx, biny, binz, bin;
622 if (binx <0 || biny <0 || binz<0)
return -1;
671 Int_t bin, binx, biny, binz, ibin, loop;
675 if (!fobj) {
Error(
"FillRandom",
"Unknown function: %s",fname);
return; }
676 TF3 *
f1 =
dynamic_cast<TF3*
>( fobj );
677 if (!
f1) {
Error(
"FillRandom",
"Function: %s is not a TF3, is a %s",fname,fobj->IsA()->
GetName());
return; }
687 Info(
"FillRandom",
"Using function axis and range ([%g,%g],[%g,%g],[%g,%g])",
xmin,
xmax,
ymin,
ymax,zmin,zmax);
697 Int_t nxy = nbinsx*nbinsy;
698 Int_t nbins = nbinsx*nbinsy*nbinsz;
704 for (binz=1;binz<=nbinsz;binz++) {
706 for (biny=1;biny<=nbinsy;biny++) {
708 for (binx=1;binx<=nbinsx;binx++) {
716 integral[ibin] = integral[ibin-1] + fint;
722 if (integral[nbins] == 0 ) {
724 Error(
"FillRandom",
"Integral = zero");
return;
726 for (bin=1;bin<=nbins;bin++) integral[bin] /= integral[nbins];
731 for (loop=0;loop<ntimes;loop++) {
735 biny = (ibin - nxy*binz)/nbinsx;
736 binx = 1 + ibin - nbinsx*(biny + nbinsy*binz);
762 if (!
h) {
Error(
"FillRandom",
"Null histogram");
return; }
764 Error(
"FillRandom",
"Histograms with different dimensions");
return;
767 if (
h->ComputeIntegral() == 0)
return;
772 for (loop=0;loop<ntimes;loop++) {
817 auto computeFirstAndLastBin = [](
const TAxis & outerAxis,
Int_t &firstbin,
Int_t &lastbin) {
825 if (firstbin == 0 && lastbin == 0) {
830 if (firstbin < 0) firstbin = 0;
831 if (lastbin < 0 || lastbin > nbins + 1) lastbin = nbins + 1;
832 if (lastbin < firstbin) {firstbin = 0; lastbin = nbins + 1;}
835 computeFirstAndLastBin(
fXaxis, binminx, binmaxx);
836 computeFirstAndLastBin(
fYaxis, binminy, binmaxy);
839 auto computeAxisLimits = [](
const TAxis & outerAxis,
Int_t firstbin,
Int_t lastbin,
841 Int_t firstOutBin = std::max(firstbin,1);
843 nBins = lastOutBin-firstOutBin+1;
851 Int_t firstBinXaxis = computeAxisLimits(
fXaxis, binminx, binmaxx, nbinsX, xMin, xMax);
854 Int_t firstBinYaxis = computeAxisLimits(
fYaxis, binminy, binmaxy, nbinsY, yMin, yMax);
871 std::vector<TH1*> hlist(npar+1);
874 for (ipar=0;ipar<= npar;ipar++) {
884 if (xbins->
fN == 0 && ybins->
fN == 0) {
888 }
else if (xbins->
fN > 0 && ybins->
fN > 0 ) {
890 nbinsX, &xbins->
fArray[firstBinXaxis],
891 nbinsY, &ybins->
fArray[firstBinYaxis]);
899 TH1 * hchi2 = hlist.back();
907 for (
Int_t biny=binminy; biny<=binmaxy; biny++) {
908 for (
Int_t binx=binminx; binx<=binmaxx; binx++) {
915 Info(
"FitSlicesZ",
"Slice (%d,%d) skipped, the number of entries is zero or smaller than the given cut value, n=%f",binx,biny,
nentries);
922 hlist[0]->GetBinXYZ(bin,ibx,iby,ibz);
928 if (npfits > npar && npfits >= cut) {
929 for (ipar=0;ipar<npar;ipar++) {
937 Info(
"FitSlicesZ",
"Fitted slice (%d,%d) skipped, the number of fitted points is too small, n=%d",binx,biny,npfits);
952 if (biny < 0) biny = 0;
953 if (biny > ofy) biny = ofy;
956 if (binz < 0) binz = 0;
957 if (binz > ofz) binz = ofz;
993 Error(
"GetBinWithContent3",
"function is only valid for 3-D histograms");
996 if (firstx <= 0) firstx = 1;
998 if (firsty <= 0) firsty = 1;
1000 if (firstz <= 0) firstz = 1;
1002 Int_t binminx = 0, binminy=0, binminz=0;
1004 for (
Int_t k=firstz;k<=lastz;k++) {
1005 for (
Int_t j=firsty;j<=lasty;j++) {
1006 for (
Int_t i=firstx;i<=lastx;i++) {
1008 if (diff <= 0) {binx = i; biny=j; binz=k;
return diff;}
1009 if (diff < curmax && diff <= maxdiff) {curmax = diff, binminx=i; binminy=j;binminz=k;}
1025 if (axis1 < 1 || axis2 < 1 || axis1 > 3 || axis2 > 3) {
1026 Error(
"GetCorrelationFactor",
"Wrong parameters");
1029 if (axis1 == axis2)
return 1;
1031 if (stddev1 == 0)
return 0;
1033 if (stddev2 == 0)
return 0;
1043 if (axis1 < 1 || axis2 < 1 || axis1 > 3 || axis2 > 3) {
1044 Error(
"GetCovariance",
"Wrong parameters");
1061 if (sumw == 0)
return 0;
1062 if (axis1 == 1 && axis2 == 1) {
1063 return TMath::Abs(sumwx2/sumw - sumwx*sumwx/sumw2);
1065 if (axis1 == 2 && axis2 == 2) {
1066 return TMath::Abs(sumwy2/sumw - sumwy*sumwy/sumw2);
1068 if (axis1 == 3 && axis2 == 3) {
1069 return TMath::Abs(sumwz2/sumw - sumwz*sumwz/sumw2);
1071 if ((axis1 == 1 && axis2 == 2) || (axis1 == 2 && axis2 == 1)) {
1072 return sumwxy/sumw - sumwx/sumw*sumwy/sumw;
1074 if ((axis1 == 1 && axis2 == 3) || (axis1 == 3 && axis2 == 1)) {
1075 return sumwxz/sumw - sumwx/sumw*sumwz/sumw;
1077 if ((axis1 == 2 && axis2 == 3) || (axis1 == 3 && axis2 == 2)) {
1078 return sumwyz/sumw - sumwy/sumw*sumwz/sumw;
1093 Int_t nxy = nbinsx*nbinsy;
1094 Int_t nbins = nxy*nbinsz;
1103 if (integral == 0 ) {
x = 0;
y = 0; z = 0;
return;}
1109 Int_t binz = ibin/nxy;
1110 Int_t biny = (ibin - nxy*binz)/nbinsx;
1111 Int_t binx = ibin - nbinsx*(biny + nbinsy*binz);
1139 Int_t bin, binx, biny, binz;
1143 for (bin=0;bin<11;bin++) stats[bin] = 0;
1154 if (firstBinX == 1) firstBinX = 0;
1158 if (firstBinY == 1) firstBinY = 0;
1162 if (firstBinZ == 1) firstBinZ = 0;
1166 for (binz = firstBinZ; binz <= lastBinZ; binz++) {
1168 for (biny = firstBinY; biny <= lastBinY; biny++) {
1170 for (binx = firstBinX; binx <= lastBinX; binx++) {
1171 bin =
GetBin(binx,biny,binz);
1177 stats[1] += err*err;
1231 return DoIntegral(binx1,binx2,biny1,biny2,binz1,binz2,err,option);
1247 return DoIntegral(binx1,binx2,biny1,biny2,binz1,binz2,error,option,
kTRUE);
1255 Error(
"Interpolate",
"This function must be called with 3 arguments for a TH3");
1265 Error(
"Interpolate",
"This function must be called with 3 arguments for a TH3");
1284 Int_t obx = ubx + 1;
1288 Int_t oby = uby + 1;
1292 Int_t obz = ubz + 1;
1297 if (ubx <=0 || uby <=0 || ubz <= 0 ||
1299 Error(
"Interpolate",
"Cannot interpolate outside histogram domain.");
1324 Double_t w1 = i1 * (1 - yd) + i2 * yd;
1325 Double_t w2 = j1 * (1 - yd) + j2 * yd;
1328 Double_t result = w1 * (1 - xd) + w2 * xd;
1361 if (h2 == 0)
return 0;
1377 Error(
"KolmogorovTest",
"Histograms must be 3-D\n");
1383 Error(
"KolmogorovTest",
"Number of channels in X is different, %d and %d\n",ncx1,ncx2);
1387 Error(
"KolmogorovTest",
"Number of channels in Y is different, %d and %d\n",ncy1,ncy2);
1391 Error(
"KolmogorovTest",
"Number of channels in Z is different, %d and %d\n",ncz1,ncz2);
1401 if (diff1 > difprec || diff2 > difprec) {
1402 Error(
"KolmogorovTest",
"histograms with different binning along X");
1407 if (diff1 > difprec || diff2 > difprec) {
1408 Error(
"KolmogorovTest",
"histograms with different binning along Y");
1413 if (diff1 > difprec || diff2 > difprec) {
1414 Error(
"KolmogorovTest",
"histograms with different binning along Z");
1419 Int_t ibeg = 1, jbeg = 1, kbeg = 1;
1420 Int_t iend = ncx1, jend = ncy1, kend = ncz1;
1421 if (opt.
Contains(
"U")) {ibeg = 0; jbeg = 0; kbeg = 0;}
1422 if (opt.
Contains(
"O")) {iend = ncx1+1; jend = ncy1+1; kend = ncz1+1;}
1429 for (i = ibeg; i <= iend; i++) {
1430 for (j = jbeg; j <= jend; j++) {
1431 for (k = kbeg; k <= kend; k++) {
1446 Error(
"KolmogorovTest",
"Integral is zero for h1=%s\n",
h1->
GetName());
1450 Error(
"KolmogorovTest",
"Integral is zero for h2=%s\n",h2->
GetName());
1458 esum1 = sum1 * sum1 / w1;
1463 esum2 = sum2 * sum2 / w2;
1467 if (afunc2 && afunc1) {
1468 Error(
"KolmogorovTest",
"Errors are zero for both histograms\n");
1474 int order[3] = {0,1,2};
1478 binbeg[0] = ibeg; binbeg[1] = jbeg; binbeg[2] = kbeg;
1479 binend[0] = iend; binend[1] = jend; binend[2] = kend;
1488 for (i = binbeg[order[0] ]; i <= binend[order[0] ]; i++) {
1489 for ( j = binbeg[order[1] ]; j <= binend[order[1] ]; j++) {
1490 for ( k = binbeg[order[2] ]; k <= binend[order[2] ]; k++) {
1491 ibin[ order[0] ] = i;
1492 ibin[ order[1] ] = j;
1493 ibin[ order[2] ] = k;
1494 bin =
h1->
GetBin(ibin[0],ibin[1],ibin[2]);
1501 vdfmax[icomb] = dmax;
1520 if (opt.
Contains(
"N") && !(afunc1 || afunc2 ) ) {
1524 Double_t chi2 = d12*d12/(esum1+esum2);
1527 if (prb > 0 && prb2 > 0) prb = prb*prb2*(1-
TMath::Log(prb*prb2));
1533 printf(
" Kolmo Prob h1 = %s, sum1=%g\n",
h1->
GetName(),sum1);
1534 printf(
" Kolmo Prob h2 = %s, sum2=%g\n",h2->
GetName(),sum2);
1535 printf(
" Kolmo Probabil = %f, Max Dist = %g\n",prb,dfmax);
1537 printf(
" Kolmo Probabil = %f for shape alone, =%f for normalisation alone\n",prb1,prb2);
1543 if (opt.
Contains(
"M"))
return dfmax;
1676 computeErrors =
kTRUE;
1681 originalRange =
kTRUE;
1685 TH1D *
h1 =
DoProject1D(
name, title, projAxis, &out1, &out2, computeErrors, originalRange,
true,
true);
1704 if (padsav) padsav->
cd();
1716 bool computeErrors,
bool originalRange,
1717 bool useUF,
bool useOF)
const
1726 Int_t nx = ixmax-ixmin+1;
1732 Error(
"DoProject1D",
"Histogram with name %s must be a TH1D and is a %s",
name,h1obj->
ClassName());
1739 if ( originalRange )
1741 if (bins->
fN == 0) {
1747 if (bins->
fN == 0) {
1757 if ( originalRange )
1759 if (bins->
fN == 0) {
1765 if (bins->
fN == 0) {
1795 if (out1 ==
nullptr && out2 ==
nullptr) {
1807 R__ASSERT(out1 !=
nullptr && out2 !=
nullptr);
1809 Int_t *refX = 0, *refY = 0, *refZ = 0;
1810 Int_t ixbin, out1bin, out2bin;
1826 R__ASSERT (refX != 0 && refY != 0 && refZ != 0);
1845 for (ixbin=0;ixbin<=1+projX->
GetNbins();ixbin++) {
1852 for (out1bin = out1min; out1bin <= out1max; out1bin++) {
1853 for (out2bin = out2min; out2bin <= out2max; out2bin++) {
1859 if (computeErrors) {
1877 bool resetStats =
true;
1878 double eps = 1.E-12;
1882 bool resetEntries = resetStats;
1884 resetEntries |= !useUF || !useOF;
1891 stats[2] = stats[4];
1892 stats[3] = stats[5];
1895 stats[2] = stats[7];
1896 stats[3] = stats[8];
1925 bool computeErrors,
bool originalRange,
1926 bool useUF,
bool useOF)
const
1936 Int_t nx = ixmax-ixmin+1;
1937 Int_t ny = iymax-iymin+1;
1945 Error(
"DoProject2D",
"Histogram with name %s must be a TH2D and is a %s",
name,h2obj->
ClassName());
1953 if ( originalRange ) {
1975 if ( originalRange )
1977 if (xbins->
fN == 0 && ybins->
fN == 0) {
1980 }
else if (ybins->
fN == 0) {
1983 }
else if (xbins->
fN == 0) {
1990 if (xbins->
fN == 0 && ybins->
fN == 0) {
1993 }
else if (ybins->
fN == 0) {
1995 ,nx,&xbins->
fArray[ixmin-1]);
1996 }
else if (xbins->
fN == 0) {
2040 const TAxis* out = 0;
2049 Int_t *refX = 0, *refY = 0, *refZ = 0;
2050 Int_t ixbin, iybin, outbin;
2051 if ( projX ==
GetXaxis() && projY ==
GetYaxis() ) { refX = &ixbin; refY = &iybin; refZ = &outbin; }
2052 if ( projX ==
GetYaxis() && projY ==
GetXaxis() ) { refX = &iybin; refY = &ixbin; refZ = &outbin; }
2053 if ( projX ==
GetXaxis() && projY ==
GetZaxis() ) { refX = &ixbin; refY = &outbin; refZ = &iybin; }
2054 if ( projX ==
GetZaxis() && projY ==
GetXaxis() ) { refX = &iybin; refY = &outbin; refZ = &ixbin; }
2055 if ( projX ==
GetYaxis() && projY ==
GetZaxis() ) { refX = &outbin; refY = &ixbin; refZ = &iybin; }
2056 if ( projX ==
GetZaxis() && projY ==
GetYaxis() ) { refX = &outbin; refY = &iybin; refZ = &ixbin; }
2057 R__ASSERT (refX != 0 && refY != 0 && refZ != 0);
2066 if (outmin == 0 && outmax == 0) { outmin = 1; outmax = out->
GetNbins(); }
2071 for (ixbin=0;ixbin<=1+projX->
GetNbins();ixbin++) {
2075 for (iybin=0;iybin<=1+projY->
GetNbins();iybin++) {
2083 for (outbin = outmin; outbin <= outmax; outbin++) {
2089 if (computeErrors) {
2107 bool resetStats =
true;
2108 double eps = 1.E-12;
2112 bool resetEntries = resetStats;
2114 resetEntries |= !useUF || !useOF;
2119 for (
Int_t i = 0; i <
kNstat; ++i) { oldst[i] = 0; }
2121 std::copy(oldst,oldst+
kNstat,stats);
2125 stats[4] = oldst[7];
2126 stats[5] = oldst[8];
2127 stats[6] = oldst[9];
2130 stats[2] = oldst[4];
2131 stats[3] = oldst[5];
2133 stats[4] = oldst[2];
2134 stats[5] = oldst[3];
2137 stats[4] = oldst[7];
2138 stats[5] = oldst[8];
2139 stats[6] = oldst[10];
2143 stats[2] = oldst[7];
2144 stats[3] = oldst[8];
2146 stats[4] = oldst[2];
2147 stats[5] = oldst[3];
2148 stats[6] = oldst[9];
2151 stats[4] = oldst[4];
2152 stats[5] = oldst[5];
2153 stats[6] = oldst[10];
2168 if (!computeErrors) entries =
TMath::Floor( entries + 0.5);
2231 if (opt.
Contains(
"x")) { pcase = 1; ptype =
"x"; }
2232 if (opt.
Contains(
"y")) { pcase = 2; ptype =
"y"; }
2233 if (opt.
Contains(
"z")) { pcase = 3; ptype =
"z"; }
2234 if (opt.
Contains(
"xy")) { pcase = 4; ptype =
"xy"; }
2235 if (opt.
Contains(
"yx")) { pcase = 5; ptype =
"yx"; }
2236 if (opt.
Contains(
"xz")) { pcase = 6; ptype =
"xz"; }
2237 if (opt.
Contains(
"zx")) { pcase = 7; ptype =
"zx"; }
2238 if (opt.
Contains(
"yz")) { pcase = 8; ptype =
"yz"; }
2239 if (opt.
Contains(
"zy")) { pcase = 9; ptype =
"zy"; }
2242 Error(
"Project3D",
"No projection axis specified - return a NULL pointer");
2249 computeErrors =
kTRUE;
2266 originalRange =
kTRUE;
2277 title +=
" "; title += ptype; title +=
" projection";
2283 computeErrors, originalRange, useUF, useOF);
2289 computeErrors, originalRange, useUF, useOF);
2295 computeErrors, originalRange, useUF, useOF);
2301 computeErrors, originalRange, useUF, useOF);
2307 computeErrors, originalRange, useUF, useOF);
2313 computeErrors, originalRange, useUF, useOF);
2319 computeErrors, originalRange, useUF, useOF);
2325 computeErrors, originalRange, useUF, useOF);
2331 computeErrors, originalRange, useUF, useOF);
2347 if (padsav) padsav->
cd();
2365 if (useWeights && binSumw2.
fN <= 0) useWeights =
false;
2372 if (outBin <0)
return;
2374 if ( useWeights ) tmp = binSumw2.
fArray[outBin];
2375 p2->
Fill( u ,
v, w, cont);
2385 bool originalRange,
bool useUF,
bool useOF)
const
2393 Int_t nx = ixmax-ixmin+1;
2394 Int_t ny = iymax-iymin+1;
2404 Error(
"DoProjectProfile2D",
"Histogram with name %s must be a TProfile2D and is a %s",
name,p2obj->
ClassName());
2412 if ( originalRange ) {
2433 if ( originalRange ) {
2434 if (xbins->
fN == 0 && ybins->
fN == 0) {
2437 }
else if (ybins->
fN == 0) {
2440 }
else if (xbins->
fN == 0) {
2447 if (xbins->
fN == 0 && ybins->
fN == 0) {
2450 }
else if (ybins->
fN == 0) {
2452 ,nx,&xbins->
fArray[ixmin-1]);
2453 }
else if (xbins->
fN == 0) {
2463 const TAxis* outAxis = 0;
2478 Int_t *refX = 0, *refY = 0, *refZ = 0;
2479 Int_t ixbin, iybin, outbin;
2480 if ( projX ==
GetXaxis() && projY ==
GetYaxis() ) { refX = &ixbin; refY = &iybin; refZ = &outbin; }
2481 if ( projX ==
GetYaxis() && projY ==
GetXaxis() ) { refX = &iybin; refY = &ixbin; refZ = &outbin; }
2482 if ( projX ==
GetXaxis() && projY ==
GetZaxis() ) { refX = &ixbin; refY = &outbin; refZ = &iybin; }
2483 if ( projX ==
GetZaxis() && projY ==
GetXaxis() ) { refX = &iybin; refY = &outbin; refZ = &ixbin; }
2484 if ( projX ==
GetYaxis() && projY ==
GetZaxis() ) { refX = &outbin; refY = &ixbin; refZ = &iybin; }
2485 if ( projX ==
GetZaxis() && projY ==
GetYaxis() ) { refX = &outbin; refY = &iybin; refZ = &ixbin; }
2486 R__ASSERT (refX != 0 && refY != 0 && refZ != 0);
2496 if (useWeights && binSumw2.
fN <= 0) useWeights =
false;
2500 for (ixbin=0;ixbin<=1+projX->
GetNbins();ixbin++) {
2502 for ( iybin=0;iybin<=1+projY->
GetNbins();iybin++) {
2507 if (poutBin <0)
continue;
2509 for (outbin = outmin; outbin <= outmax; outbin++) {
2516 if (!cont)
continue;
2520 if ( useWeights ) tmp = binSumw2.
fArray[poutBin];
2530 bool resetStats =
true;
2541 if (!useWeights) entries =
TMath::Floor( entries + 0.5);
2595 if (opt.
Contains(
"xy")) { pcase = 4; ptype =
"xy"; }
2596 if (opt.
Contains(
"yx")) { pcase = 5; ptype =
"yx"; }
2597 if (opt.
Contains(
"xz")) { pcase = 6; ptype =
"xz"; }
2598 if (opt.
Contains(
"zx")) { pcase = 7; ptype =
"zx"; }
2599 if (opt.
Contains(
"yz")) { pcase = 8; ptype =
"yz"; }
2600 if (opt.
Contains(
"zy")) { pcase = 9; ptype =
"zy"; }
2603 Error(
"Project3D",
"No projection axis specified - return a NULL pointer");
2621 originalRange =
kTRUE;
2630 title +=
" profile "; title += ptype; title +=
" projection";
2692 return Rebin3D(ngroup, 1, 1, newname);
2702 return Rebin3D(1, ngroup, 1, newname);
2712 return Rebin3D(1, 1, ngroup, newname);
2743 Int_t i,j,k,xbin,ybin,zbin;
2753 if ((nxgroup <= 0) || (nxgroup > nxbins)) {
2754 Error(
"Rebin",
"Illegal value of nxgroup=%d",nxgroup);
2757 if ((nygroup <= 0) || (nygroup > nybins)) {
2758 Error(
"Rebin",
"Illegal value of nygroup=%d",nygroup);
2761 if ((nzgroup <= 0) || (nzgroup > nzbins)) {
2762 Error(
"Rebin",
"Illegal value of nzgroup=%d",nzgroup);
2766 Int_t newxbins = nxbins/nxgroup;
2767 Int_t newybins = nybins/nygroup;
2768 Int_t newzbins = nzbins/nzgroup;
2786 if (newname && strlen(newname)) {
2794 bool resetStat =
false;
2798 if (newxbins*nxgroup != nxbins) {
2802 if (newybins*nygroup != nybins) {
2806 if (newzbins*nzgroup != nzbins) {
2848 if (nxgroup != 1 || nygroup != 1 || nzgroup != 1) {
2857 hnew->
SetBins(newxbins,xbins, newybins, ybins, newzbins, zbins);
2870 for (xbin = 1; xbin <= newxbins; xbin++) {
2873 for (ybin = 1; ybin <= newybins; ybin++) {
2875 for (zbin = 1; zbin <= newzbins; zbin++) {
2878 for (i = 0; i < nxgroup; i++) {
2879 if (oldxbin+i > nxbins)
break;
2880 for (j =0; j < nygroup; j++) {
2881 if (oldybin+j > nybins)
break;
2882 for (k =0; k < nzgroup; k++) {
2883 if (oldzbin+k > nzbins)
break;
2885 bin = oldxbin + i + (oldybin + j)*(nxbins + 2) + (oldzbin + k)*(nxbins + 2)*(nybins + 2);
2886 binContent += oldBins[bin];
2887 if (oldSumw2) binSumw2 += oldSumw2[bin];
2902 for (
Int_t xover = 0; xover <= 1; xover++) {
2903 for (
Int_t yover = 0; yover <= 1; yover++) {
2904 for (
Int_t zover = 0; zover <= 1; zover++) {
2908 for (xbin = xover*oldxbin; xbin <= xover*(nxbins+1); xbin++) {
2909 for (ybin = yover*oldybin; ybin <= yover*(nybins+1); ybin++) {
2910 for (zbin = zover*oldzbin; zbin <= zover*(nzbins+1); zbin++) {
2911 bin =
GetBin(xbin,ybin,zbin);
2912 binContent += oldBins[bin];
2913 if (oldSumw2) binSumw2 += oldSumw2[bin];
2918 yover*(newybins+1), zover*(newzbins+1) );
2925 Double_t binContent0, binContent2, binContent3, binContent4;
2926 Double_t binError0, binError2, binError3, binError4;
2927 Int_t oldxbin2, oldybin2, oldzbin2;
2928 Int_t ufbin, ofbin, ofbin2, ofbin3, ofbin4;
2934 for (xbin = 1; xbin<=newxbins; xbin++) {
2936 for (zbin = 1; zbin<=newzbins; zbin++) {
2937 binContent0 = binContent2 = 0;
2938 binError0 = binError2 = 0;
2939 for (i=0; i<nxgroup; i++) {
2940 if (oldxbin2+i > nxbins)
break;
2941 for (k=0; k<nzgroup; k++) {
2942 if (oldzbin2+k > nzbins)
break;
2944 ufbin = oldxbin2 + i + (nxbins+2)*(nybins+2)*(oldzbin2+k);
2945 binContent0 += oldBins[ufbin];
2946 if (oldSumw2) binError0 += oldSumw2[ufbin];
2947 for (ybin = oldybin; ybin <= nybins + 1; ybin++) {
2949 ofbin = ufbin + ybin*(nxbins+2);
2950 binContent2 += oldBins[ofbin];
2951 if (oldSumw2) binError2 += oldSumw2[ofbin];
2961 oldzbin2 += nzgroup;
2963 oldxbin2 += nxgroup;
2970 for (ybin = 1; ybin<=newybins; ybin++) {
2972 for (zbin = 1; zbin<=newzbins; zbin++) {
2973 binContent0 = binContent2 = 0;
2974 binError0 = binError2 = 0;
2975 for (j=0; j<nygroup; j++) {
2976 if (oldybin2+j > nybins)
break;
2977 for (k=0; k<nzgroup; k++) {
2978 if (oldzbin2+k > nzbins)
break;
2980 ufbin = (oldybin2 + j)*(nxbins+2) + (nxbins+2)*(nybins+2)*(oldzbin2+k);
2981 binContent0 += oldBins[ufbin];
2982 if (oldSumw2) binError0 += oldSumw2[ufbin];
2983 for (xbin = oldxbin; xbin <= nxbins + 1; xbin++) {
2985 ofbin = ufbin + xbin;
2986 binContent2 += oldBins[ofbin];
2987 if (oldSumw2) binError2 += oldSumw2[ofbin];
2997 oldzbin2 += nzgroup;
2999 oldybin2 += nygroup;
3006 for (xbin = 1; xbin<=newxbins; xbin++) {
3008 for (ybin = 1; ybin<=newybins; ybin++) {
3009 binContent0 = binContent2 = 0;
3010 binError0 = binError2 = 0;
3011 for (i=0; i<nxgroup; i++) {
3012 if (oldxbin2+i > nxbins)
break;
3013 for (j=0; j<nygroup; j++) {
3014 if (oldybin2+j > nybins)
break;
3016 ufbin = oldxbin2 + i + (nxbins+2)*(oldybin2+j);
3017 binContent0 += oldBins[ufbin];
3018 if (oldSumw2) binError0 += oldSumw2[ufbin];
3019 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3021 ofbin = ufbin + (nxbins+2)*(nybins+2)*zbin;
3022 binContent2 += oldBins[ofbin];
3023 if (oldSumw2) binError2 += oldSumw2[ofbin];
3033 oldybin2 += nygroup;
3035 oldxbin2 += nxgroup;
3042 for (xbin = 1; xbin<=newxbins; xbin++) {
3051 for (i=0; i<nxgroup; i++) {
3052 if (oldxbin2+i > nxbins)
break;
3053 ufbin = oldxbin2 + i;
3054 binContent0 += oldBins[ufbin];
3055 if (oldSumw2) binError0 += oldSumw2[ufbin];
3056 for (ybin = oldybin; ybin <= nybins + 1; ybin++) {
3057 ofbin3 = ufbin+ybin*(nxbins+2);
3058 binContent3 += oldBins[ ofbin3 ];
3059 if (oldSumw2) binError3 += oldSumw2[ofbin3];
3060 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3062 ofbin4 = oldxbin2 + i + ybin*(nxbins+2) + (nxbins+2)*(nybins+2)*zbin;
3063 binContent4 += oldBins[ofbin4];
3064 if (oldSumw2) binError4 += oldSumw2[ofbin4];
3067 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3068 ofbin2 = ufbin+zbin*(nxbins+2)*(nybins+2);
3069 binContent2 += oldBins[ ofbin2 ];
3070 if (oldSumw2) binError2 += oldSumw2[ofbin2];
3076 hnew->
SetBinContent(xbin,newybins+1,newzbins+1,binContent4);
3083 oldxbin2 += nxgroup;
3090 for (zbin = 1; zbin<=newzbins; zbin++) {
3099 for (i=0; i<nzgroup; i++) {
3100 if (oldzbin2+i > nzbins)
break;
3101 ufbin = (oldzbin2 + i)*(nxbins+2)*(nybins+2);
3102 binContent0 += oldBins[ufbin];
3103 if (oldSumw2) binError0 += oldSumw2[ufbin];
3104 for (ybin = oldybin; ybin <= nybins + 1; ybin++) {
3105 ofbin3 = ufbin+ybin*(nxbins+2);
3106 binContent3 += oldBins[ ofbin3 ];
3107 if (oldSumw2) binError3 += oldSumw2[ofbin3];
3108 for (xbin = oldxbin; xbin <= nxbins + 1; xbin++) {
3110 ofbin4 = ufbin + xbin + ybin*(nxbins+2);
3111 binContent4 += oldBins[ofbin4];
3112 if (oldSumw2) binError4 += oldSumw2[ofbin4];
3115 for (xbin = oldxbin; xbin <= nxbins + 1; xbin++) {
3116 ofbin2 = xbin +(oldzbin2+i)*(nxbins+2)*(nybins+2);
3117 binContent2 += oldBins[ ofbin2 ];
3118 if (oldSumw2) binError2 += oldSumw2[ofbin2];
3124 hnew->
SetBinContent(newxbins+1,newybins+1,zbin,binContent4);
3131 oldzbin2 += nzgroup;
3138 for (ybin = 1; ybin<=newybins; ybin++) {
3147 for (i=0; i<nygroup; i++) {
3148 if (oldybin2+i > nybins)
break;
3149 ufbin = (oldybin2 + i)*(nxbins+2);
3150 binContent0 += oldBins[ufbin];
3151 if (oldSumw2) binError0 += oldSumw2[ufbin];
3152 for (xbin = oldxbin; xbin <= nxbins + 1; xbin++) {
3153 ofbin3 = ufbin+xbin;
3154 binContent3 += oldBins[ ofbin3 ];
3155 if (oldSumw2) binError3 += oldSumw2[ofbin3];
3156 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3158 ofbin4 = xbin + (nxbins+2)*(nybins+2)*zbin+(oldybin2+i)*(nxbins+2);
3159 binContent4 += oldBins[ofbin4];
3160 if (oldSumw2) binError4 += oldSumw2[ofbin4];
3163 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3164 ofbin2 = (oldybin2+i)*(nxbins+2)+zbin*(nxbins+2)*(nybins+2);
3165 binContent2 += oldBins[ ofbin2 ];
3166 if (oldSumw2) binError2 += oldSumw2[ofbin2];
3172 hnew->
SetBinContent(newxbins+1,ybin,newzbins+1,binContent4);
3179 oldybin2 += nygroup;
3222 if (!resetStat) hnew->
PutStats(stat);
3225 if (oldSumw2)
delete [] oldSumw2;
3256 if (bin < 0)
return;
3265void TH3::Streamer(
TBuffer &R__b)
3275 TH1::Streamer(R__b);
3276 TAtt3D::Streamer(R__b);
3318 :
TH3(
name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
3333 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
3346 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
3377 if (newval > -128 && newval < 128) {
fArray[bin] =
Char_t(newval);
return;}
3378 if (newval < -127)
fArray[bin] = -127;
3379 if (newval > 127)
fArray[bin] = 127;
3447void TH3C::Streamer(
TBuffer &R__b)
3460 TH1::Streamer(R__b);
3461 TArrayC::Streamer(R__b);
3463 TAtt3D::Streamer(R__b);
3465 TH3::Streamer(R__b);
3466 TArrayC::Streamer(R__b);
3579 :
TH3(
name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
3594 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
3607 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
3638 if (newval > -32768 && newval < 32768) {
fArray[bin] =
Short_t(newval);
return;}
3639 if (newval < -32767)
fArray[bin] = -32767;
3640 if (newval > 32767)
fArray[bin] = 32767;
3679void TH3S::Streamer(
TBuffer &R__b)
3692 TH1::Streamer(R__b);
3693 TArrayS::Streamer(R__b);
3695 TAtt3D::Streamer(R__b);
3697 TH3::Streamer(R__b);
3698 TArrayS::Streamer(R__b);
3811 :
TH3(
name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
3826 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
3839 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
3870 if (newval > -2147483647 && newval < 2147483647) {
fArray[bin] =
Int_t(newval);
return;}
3871 if (newval < -2147483647)
fArray[bin] = -2147483647;
3872 if (newval > 2147483647)
fArray[bin] = 2147483647;
4010 :
TH3(
name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
4025 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4038 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4089void TH3F::Streamer(
TBuffer &R__b)
4102 TH1::Streamer(R__b);
4103 TArrayF::Streamer(R__b);
4105 TAtt3D::Streamer(R__b);
4107 TH3::Streamer(R__b);
4108 TArrayF::Streamer(R__b);
4221 :
TH3(
name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
4236 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4249 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4300void TH3D::Streamer(
TBuffer &R__b)
4313 TH1::Streamer(R__b);
4314 TArrayD::Streamer(R__b);
4316 TAtt3D::Streamer(R__b);
4318 TH3::Streamer(R__b);
4319 TArrayD::Streamer(R__b);
void Warning(const char *location, const char *msgfmt,...)
TH3C operator/(TH3C &h1, TH3C &h2)
Operator /.
TH3C operator*(Float_t c1, TH3C &h1)
Operator *.
TH3C operator-(TH3C &h1, TH3C &h2)
Operator -.
TH3C operator+(TH3C &h1, TH3C &h2)
Operator +.
R__EXTERN TRandom * gRandom
Array of chars or bytes (8 bits per element).
void Set(Int_t n)
Set size of this array to n chars.
void Copy(TArrayC &array) const
Array of doubles (64 bits per element).
void Copy(TArrayD &array) const
void Set(Int_t n)
Set size of this array to n doubles.
Array of floats (32 bits per element).
void Copy(TArrayF &array) const
void Set(Int_t n)
Set size of this array to n floats.
Array of integers (32 bits per element).
void Set(Int_t n)
Set size of this array to n ints.
void Copy(TArrayI &array) const
Array of shorts (16 bits per element).
void Set(Int_t n)
Set size of this array to n shorts.
void Copy(TArrayS &array) const
Use this attribute class when an object should have 3D capabilities.
virtual Color_t GetTitleColor() const
virtual Color_t GetLabelColor() const
virtual Int_t GetNdivisions() const
virtual Color_t GetAxisColor() const
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
virtual Style_t GetTitleFont() const
virtual Float_t GetLabelOffset() const
virtual void SetAxisColor(Color_t color=1, Float_t alpha=1.)
Set color of the line axis and tick marks.
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels.
virtual Style_t GetLabelFont() const
virtual void SetTitleFont(Style_t font=62)
Set the title font.
virtual void SetLabelOffset(Float_t offset=0.005)
Set distance between the axis and the labels.
virtual void SetLabelFont(Style_t font=62)
Set labels' font.
virtual void SetTitleSize(Float_t size=0.04)
Set size of axis title.
virtual void SetTitleColor(Color_t color=1)
Set color of axis title.
virtual Float_t GetTitleSize() const
virtual Float_t GetLabelSize() const
virtual Float_t GetTickLength() const
virtual Float_t GetTitleOffset() const
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length.
virtual void SetNdivisions(Int_t n=510, Bool_t optim=kTRUE)
Set the number of divisions for this axis.
virtual void SetLabelColor(Color_t color=1, Float_t alpha=1.)
Set color of labels.
virtual Color_t GetFillColor() const
Return the fill area color.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetMarkerStyle() const
Return the marker style.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual Color_t GetMarkerColor() const
Return the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
Class to manage histogram axis.
virtual void SetBinLabel(Int_t bin, const char *label)
Set label for bin.
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
const TArrayD * GetXbins() const
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
virtual void Set(Int_t nbins, Double_t xmin, Double_t xmax)
Initialize axis with fix bins.
virtual Int_t FindFixBin(Double_t x) const
Find bin number corresponding to abscissa x.
Int_t GetLast() const
Return last bin on the axis i.e.
virtual void ImportAttributes(const TAxis *axis)
Copy axis attributes to this.
const char * GetTitle() const
Returns title of object.
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 GetBinWidth(Int_t bin) const
Return bin width.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
Int_t GetFirst() const
Return first bin on the axis i.e.
THashList * GetLabels() const
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
TObject * GetParent() const
Return pointer to parent of this buffer.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual Int_t GetVersionOwner() const =0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual TH1 * GetHistogram() const
Return a pointer to the histogram used to visualise the function.
virtual Double_t GetParError(Int_t ipar) const
Return value of parameter number ipar.
Double_t GetChisquare() const
virtual void SetRange(Double_t xmin, Double_t xmax)
Initialize the upper and lower bounds to draw the function.
virtual Int_t GetNpar() const
virtual Int_t GetNumberFitPoints() const
virtual Double_t * GetParameters() const
virtual Double_t EvalPar(const Double_t *x, const Double_t *params=0)
Evaluate function with given coordinates and parameters.
virtual void GetRange(Double_t *xmin, Double_t *xmax) const
Return range of a generic N-D function.
virtual const char * GetParName(Int_t ipar) const
virtual void SetParameters(const Double_t *params)
virtual Double_t GetParameter(Int_t ipar) const
A 3-Dim function with parameters.
1-D histogram with a double per channel (see TH1 documentation)}
virtual void Reset(Option_t *option="")
Reset.
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
Double_t * fBuffer
[fBufferSize] entry buffer
virtual Double_t GetEffectiveEntries() const
Number of effective entries of the histogram.
virtual Bool_t Multiply(TF1 *f1, Double_t c1=1)
Performs the operation:
Int_t fNcells
number of bins(1D), cells (2D) +U/Overflows
Double_t fTsumw
Total Sum of weights.
Double_t fTsumw2
Total Sum of squares of weights.
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...
Double_t fTsumwx2
Total Sum of weight*X*X.
virtual Double_t GetStdDev(Int_t axis=1) const
Returns the Standard Deviation (Sigma).
virtual Int_t GetNbinsY() const
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
virtual Double_t GetBinError(Int_t bin) const
Return value of error associated to bin number bin.
virtual Int_t GetNbinsZ() const
virtual Int_t GetDimension() const
@ kIsNotW
Histogram is forced to be not weighted even when the histogram is filled with weighted different than...
virtual Bool_t CanExtendAllAxes() const
Returns true if all axes are extendable.
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
virtual Int_t GetNcells() const
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
TVirtualHistPainter * GetPainter(Option_t *option="")
Return pointer to painter.
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
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 GetBin(Int_t binx, Int_t biny=0, Int_t binz=0) const
Return Global bin number corresponding to binx,y,z.
virtual Int_t GetNbinsX() const
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),...
Int_t fBufferSize
fBuffer size
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...
Int_t fDimension
!Histogram dimension (1, 2 or 3 dim)
virtual void SetBinError(Int_t bin, Double_t error)
Set the bin Error Note that this resets the bin eror option to be of Normal Type and for the non-empt...
static Int_t fgBufferSize
!default buffer size for automatic histograms
Double_t * fIntegral
!Integral of bins used by GetRandom
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 Double_t GetBinLowEdge(Int_t bin) const
Return bin lower edge for 1D histogram.
virtual Double_t GetEntries() const
Return the current number of entries.
virtual void Copy(TObject &hnew) const
Copy this histogram structure to newth1.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual void ResetStats()
Reset the statistics including the number of entries and replace with values calculates from bin cont...
virtual void SetBuffer(Int_t buffersize, Option_t *option="")
Set the maximum number of entries to be kept in the buffer.
Double_t fEntries
Number of entries.
virtual void SetName(const char *name)
Change the name of this histogram.
TAxis fZaxis
Z axis descriptor.
virtual void UpdateBinContent(Int_t bin, Double_t content)
Raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin...
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
TAxis fXaxis
X axis descriptor.
virtual void ExtendAxis(Double_t x, TAxis *axis)
Histogram is resized along axis such that x is in the axis range.
TArrayD fSumw2
Array of sum of squares of weights.
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
virtual void Paint(Option_t *option="")
Control routine to paint any kind of histograms.
virtual Int_t GetSumw2N() 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.
Bool_t GetStatOverflowsBehaviour() const
virtual Bool_t Divide(TF1 *f1, Double_t c1=1)
Performs the operation: this = this/(c1*f1) if errors are defined (see TH1::Sumw2),...
TAxis fYaxis
Y axis descriptor.
TVirtualHistPainter * fPainter
!pointer to histogram painter
virtual void SetBins(Int_t nx, Double_t xmin, Double_t xmax)
Redefine x axis parameters.
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
virtual void SetEntries(Double_t n)
static Bool_t fgDefaultSumw2
!flag to call TH1::Sumw2 automatically at histogram creation time
Double_t fTsumwx
Total Sum of weight*X.
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...
2-D histogram with a double per channel (see TH1 documentation)}
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
3-D histogram with a byte per channel (see TH1 documentation)
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
TH3C & operator=(const TH3C &h1)
Operator =.
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
virtual ~TH3C()
Destructor.
3-D histogram with a double per channel (see TH1 documentation)}
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
TH3D & operator=(const TH3D &h1)
Operator =.
virtual ~TH3D()
Destructor.
3-D histogram with a float per channel (see TH1 documentation)}
TH3F & operator=(const TH3F &h1)
Operator =.
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
virtual ~TH3F()
Destructor.
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
3-D histogram with an int per channel (see TH1 documentation)}
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
TH3I & operator=(const TH3I &h1)
Operator =.
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
virtual ~TH3I()
Destructor.
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
3-D histogram with a short per channel (see TH1 documentation)
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
virtual ~TH3S()
Destructor.
TH3S & operator=(const TH3S &h1)
Operator =.
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
The 3-D histogram classes derived from the 1-D histogram classes.
virtual TH3 * Rebin3D(Int_t nxgroup=2, Int_t nygroup=2, Int_t nzgroup=2, const char *newname="")
Rebin this histogram grouping nxgroup/nygroup/nzgroup bins along the xaxis/yaxis/zaxis together.
Int_t Fill(Double_t)
Invalid Fill method.
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 Double_t GetCovariance(Int_t axis1=1, Int_t axis2=2) const
Return covariance between axis1 and axis2.
virtual Int_t BufferEmpty(Int_t action=0)
Fill histogram with all entries in the buffer.
virtual TH2D * DoProject2D(const char *name, const char *title, const TAxis *projX, const TAxis *projY, bool computeErrors, bool originalRange, bool useUF, bool useOF) const
internal method performing the projection to a 2D histogram called from TH3::Project3D
virtual TH1D * ProjectionY(const char *name="_py", Int_t ixmin=0, Int_t ixmax=-1, Int_t izmin=0, Int_t izmax=-1, Option_t *option="") const
Project a 3-D histogram into a 1-D histogram along Y.
virtual Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const
See comments in TH1::GetBin.
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
virtual void Copy(TObject &hnew) const
Copy.
virtual ~TH3()
Destructor.
virtual TH3 * RebinY(Int_t ngroup=2, const char *newname="")
Rebin only the Y axis see Rebin3D.
virtual Double_t IntegralAndError(Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Int_t binz1, Int_t binz2, Double_t &err, Option_t *option="") const
Return integral of bin contents in range [binx1,binx2],[biny1,biny2],[binz1,binz2] for a 3-D histogra...
virtual TH1D * ProjectionZ(const char *name="_pz", Int_t ixmin=0, Int_t ixmax=-1, Int_t iymin=0, Int_t iymax=-1, Option_t *option="") const
Project a 3-D histogram into a 1-D histogram along Z.
virtual TH1D * ProjectionX(const char *name="_px", Int_t iymin=0, Int_t iymax=-1, Int_t izmin=0, Int_t izmax=-1, Option_t *option="") const
Project a 3-D histogram into a 1-D histogram along X.
virtual TProfile2D * Project3DProfile(Option_t *option="xy") const
Project a 3-d histogram into a 2-d profile histograms depending on the option parameter option may co...
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const
Statistical test of compatibility in shape between THIS histogram and h2, using Kolmogorov test.
virtual void FitSlicesZ(TF1 *f1=0, Int_t binminx=1, Int_t binmaxx=0, Int_t binminy=1, Int_t binmaxy=0, Int_t cut=0, Option_t *option="QNR")
Project slices along Z in case of a 3-D histogram, then fit each slice with function f1 and make a 2-...
virtual TH1 * Project3D(Option_t *option="x") const
Project a 3-d histogram into 1 or 2-d histograms depending on the option parameter,...
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
virtual Double_t GetBinWithContent3(Double_t c, Int_t &binx, Int_t &biny, Int_t &binz, Int_t firstx=0, Int_t lastx=0, Int_t firsty=0, Int_t lasty=0, Int_t firstz=0, Int_t lastz=0, Double_t maxdiff=0) const
Compute first cell (binx,biny,binz) in the range [firstx,lastx](firsty,lasty][firstz,...
virtual TH3 * RebinX(Int_t ngroup=2, const char *newname="")
Rebin only the X axis see Rebin3D.
void DoFillProfileProjection(TProfile2D *p2, const TAxis &a1, const TAxis &a2, const TAxis &a3, Int_t bin1, Int_t bin2, Int_t bin3, Int_t inBin, Bool_t useWeights) const
internal function to fill the bins of the projected profile 2D histogram called from DoProjectProfile...
virtual void GetRandom3(Double_t &x, Double_t &y, Double_t &z)
Return 3 random numbers along axis x , y and z distributed according the cell-contents of a 3-dim his...
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
virtual TH3 * RebinZ(Int_t ngroup=2, const char *newname="")
Rebin only the Z axis see Rebin3D.
virtual Int_t BufferFill(Double_t x, Double_t y, Double_t z, Double_t w)
accumulate arguments in buffer.
virtual Double_t Interpolate(Double_t x, Double_t y) const
Not yet implemented.
virtual void SetShowProjection(const char *option="xy", Int_t nbins=1)
When the mouse is moved in a pad containing a 3-d view of this histogram a second canvas shows a proj...
virtual Double_t GetCorrelationFactor(Int_t axis1=1, Int_t axis2=2) const
Return correlation factor between axis1 and axis2.
virtual TH1D * DoProject1D(const char *name, const char *title, int imin1, int imax1, int imin2, int imax2, const TAxis *projAxis, const TAxis *axis1, const TAxis *axis2, Option_t *option) const
internal method performing the projection to 1D histogram called from TH3::Project3D
TH3()
Default constructor.
virtual TProfile2D * DoProjectProfile2D(const char *name, const char *title, const TAxis *projX, const TAxis *projY, bool originalRange, bool useUF, bool useOF) const
internal method to project to a 2D Profile called from TH3::Project3DProfile
static THLimitsFinder * GetLimitsFinder()
Return pointer to the current finder.
virtual Int_t FindGoodLimits(TH1 *h, Double_t xmin, Double_t xmax)
Compute the best axis limits for the X axis.
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
Collectable string class.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Profile2D histograms are used to display the mean value of Z and its RMS for each cell in X,...
Int_t Fill(const Double_t *v)
virtual void Reset(Option_t *option="")
Reset contents of a Profile2D histogram.
void SetBins(const Int_t *nbins, const Double_t *range)
virtual void Sumw2(Bool_t flag=kTRUE)
Create/Delete structure to store sum of squares of weights per bin.
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
virtual TArrayD * GetBinSumw2()
virtual Double_t Rndm()
Machine independent random number generator.
void ToLower()
Change string to lower-case.
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
void ToUpper()
Change string to upper case.
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual void SetShowProjection(const char *option, Int_t nbins)=0
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual TVirtualPad * cd(Int_t subpadnumber=0)=0
Short_t Max(Short_t a, Short_t b)
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...
Bool_t Permute(Int_t n, Int_t *a)
Simple recursive algorithm to find the permutations of n natural numbers, not necessarily all distinc...
Double_t QuietNaN()
Returns a quiet NaN as defined by IEEE 754
Double_t Floor(Double_t x)
Double_t Mean(Long64_t n, const T *a, const Double_t *w=0)
Return the weighted mean of an array a with length n.
Double_t Sqrt(Double_t x)
Double_t KolmogorovProb(Double_t z)
Calculates the Kolmogorov distribution function,.
Long64_t BinarySearch(Long64_t n, const T *array, T value)