104 :
TH1(
name,title,nbinsx,xlow,xup)
108 Warning(
"TH3",
"nbinsy is <=0 - set to nbinsy = 1");
112 Warning(
"TH3",
"nbinsz is <=0 - set to nbinsz = 1");
117 fNcells = (nbinsx+2)*(nbinsy+2)*(nbinsz+2);
148 if (nbinsy <= 0) {
Warning(
"TH3",
"nbinsy is <=0 - set to nbinsy = 1"); nbinsy = 1; }
149 if (nbinsz <= 0) nbinsz = 1;
154 fNcells = (nbinsx+2)*(nbinsy+2)*(nbinsz+2);
185 if (nbinsy <= 0) {
Warning(
"TH3",
"nbinsy is <=0 - set to nbinsy = 1"); nbinsy = 1; }
186 if (nbinsz <= 0) nbinsz = 1;
191 fNcells = (nbinsx+2)*(nbinsy+2)*(nbinsz+2);
269 if (!nbentries)
return 0;
272 if (action == 0)
return 0;
273 nbentries = -nbentries;
288 for (
Int_t i=1;i<nbentries;i++) {
296 if (z < zmin) zmin = z;
297 if (z > zmax) zmax = z;
316 for (
Int_t i=0;i<nbentries;i++) {
317 Fill(buffer[4*i+2],buffer[4*i+3],buffer[4*i+4],buffer[4*i+1]);
344 nbentries = -nbentries;
370 Error(
"Fill",
"Invalid signature - do nothing");
385 Int_t binx, biny, binz, bin;
390 if (binx <0 || biny <0 || binz<0)
return -1;
433 Int_t binx, biny, binz, bin;
438 if (binx <0 || biny <0 || binz<0)
return -1;
478 Int_t binx, biny, binz, bin;
483 if (binx <0 || biny <0 || binz<0)
return -1;
526 Int_t binx, biny, binz, bin;
531 if (binx <0 || biny <0 || binz<0)
return -1;
574 Int_t binx, biny, binz, bin;
579 if (binx <0 || biny <0 || binz<0)
return -1;
622 Int_t binx, biny, binz, bin;
627 if (binx <0 || biny <0 || binz<0)
return -1;
670 Int_t binx, biny, binz, bin;
675 if (binx < 0 || biny < 0 || binz < 0)
724 Int_t binx, biny, binz, bin;
729 if (binx <0 || biny <0 || binz<0)
return -1;
773 Int_t binx, biny, binz, bin;
778 if (binx <0 || biny <0 || binz<0)
return -1;
835 Int_t bin, binx, biny, binz, ibin, loop;
837 TF3 *
f1 =
dynamic_cast<TF3*
>( fobj );
838 if (!
f1) {
Error(
"FillRandom",
"Function: %s is not a TF3, is a %s",fobj->
GetName(),fobj->
IsA()->
GetName());
return; }
848 Info(
"FillRandom",
"Using function axis and range ([%g,%g],[%g,%g],[%g,%g])",
xmin,
xmax,
ymin,
ymax,zmin,zmax);
858 Int_t nxy = nbinsx*nbinsy;
859 Int_t nbins = nbinsx*nbinsy*nbinsz;
865 for (binz=1;binz<=nbinsz;binz++) {
867 for (biny=1;biny<=nbinsy;biny++) {
869 for (binx=1;binx<=nbinsx;binx++) {
877 integral[ibin] = integral[ibin-1] + fint;
883 if (integral[nbins] == 0 ) {
885 Error(
"FillRandom",
"Integral = zero");
return;
887 for (bin=1;bin<=nbins;bin++) integral[bin] /= integral[nbins];
892 for (loop=0;loop<ntimes;loop++) {
896 biny = (ibin - nxy*binz)/nbinsx;
897 binx = 1 + ibin - nbinsx*(biny + nbinsy*binz);
927 if (!
h) {
Error(
"FillRandom",
"Null histogram");
return; }
929 Error(
"FillRandom",
"Histograms with different dimensions");
return;
932 if (
h->ComputeIntegral() == 0)
return;
937 for (loop=0;loop<ntimes;loop++) {
938 h3->GetRandom3(
x,
y,z,rng);
982 auto computeFirstAndLastBin = [](
const TAxis & outerAxis,
Int_t &firstbin,
Int_t &lastbin) {
990 if (firstbin == 0 && lastbin == 0) {
995 if (firstbin < 0) firstbin = 0;
996 if (lastbin < 0 || lastbin > nbins + 1) lastbin = nbins + 1;
997 if (lastbin < firstbin) {firstbin = 0; lastbin = nbins + 1;}
1000 computeFirstAndLastBin(
fXaxis, binminx, binmaxx);
1001 computeFirstAndLastBin(
fYaxis, binminy, binmaxy);
1004 auto computeAxisLimits = [](
const TAxis & outerAxis,
Int_t firstbin,
Int_t lastbin,
1006 Int_t firstOutBin = std::max(firstbin,1);
1007 Int_t lastOutBin = std::min(lastbin,outerAxis.
GetNbins() ) ;
1008 nBins = lastOutBin-firstOutBin+1;
1016 Int_t firstBinXaxis = computeAxisLimits(
fXaxis, binminx, binmaxx, nbinsX, xMin, xMax);
1019 Int_t firstBinYaxis = computeAxisLimits(
fYaxis, binminy, binmaxy, nbinsY, yMin, yMax);
1022 if (
f1 ==
nullptr) {
1036 std::vector<TH1*> hlist(npar+1);
1039 for (ipar=0;ipar<= npar;ipar++) {
1047 title =
"chisquare";
1049 if (xbins->fN == 0 && ybins->
fN == 0) {
1050 hlist[ipar] =
new TH2D(
name, title,
1052 nbinsY, yMin, yMax);
1053 }
else if (xbins->fN > 0 && ybins->
fN > 0 ) {
1054 hlist[ipar] =
new TH2D(
name, title,
1055 nbinsX, &xbins->fArray[firstBinXaxis],
1056 nbinsY, &ybins->
fArray[firstBinYaxis]);
1064 TH1 * hchi2 = hlist.back();
1067 TH1D *hpz =
nullptr;
1072 for (
Int_t biny=binminy; biny<=binmaxy; biny++) {
1073 for (
Int_t binx=binminx; binx<=binmaxx; binx++) {
1080 Info(
"FitSlicesZ",
"Slice (%d,%d) skipped, the number of entries is zero or smaller than the given cut value, n=%f",binx,biny,
nentries);
1086 int ibx,iby,ibz = 0;
1087 hlist[0]->GetBinXYZ(bin,ibx,iby,ibz);
1093 if (npfits > npar && npfits >= cut) {
1094 for (ipar=0;ipar<npar;ipar++) {
1102 Info(
"FitSlicesZ",
"Fitted slice (%d,%d) skipped, the number of fitted points is too small, n=%d",binx,biny,npfits);
1117 if (biny < 0) biny = 0;
1118 if (biny > ofy) biny = ofy;
1121 if (binz < 0) binz = 0;
1122 if (binz > ofz) binz = ofz;
1158 Error(
"GetBinWithContent3",
"function is only valid for 3-D histograms");
1161 if (firstx <= 0) firstx = 1;
1163 if (firsty <= 0) firsty = 1;
1165 if (firstz <= 0) firstz = 1;
1167 Int_t binminx = 0, binminy=0, binminz=0;
1169 for (
Int_t k=firstz;k<=lastz;k++) {
1170 for (
Int_t j=firsty;j<=lasty;j++) {
1171 for (
Int_t i=firstx;i<=lastx;i++) {
1173 if (diff <= 0) {binx = i; biny=j; binz=k;
return diff;}
1174 if (diff < curmax && diff <= maxdiff) {curmax = diff, binminx=i; binminy=j;binminz=k;}
1190 if (axis1 < 1 || axis2 < 1 || axis1 > 3 || axis2 > 3) {
1191 Error(
"GetCorrelationFactor",
"Wrong parameters");
1194 if (axis1 == axis2)
return 1;
1196 if (stddev1 == 0)
return 0;
1198 if (stddev2 == 0)
return 0;
1208 if (axis1 < 1 || axis2 < 1 || axis1 > 3 || axis2 > 3) {
1209 Error(
"GetCovariance",
"Wrong parameters");
1225 if (sumw == 0)
return 0;
1226 if (axis1 == 1 && axis2 == 1) {
1227 return TMath::Abs(sumwx2/sumw - sumwx*sumwx/(sumw*sumw));
1229 if (axis1 == 2 && axis2 == 2) {
1230 return TMath::Abs(sumwy2/sumw - sumwy*sumwy/(sumw*sumw));
1232 if (axis1 == 3 && axis2 == 3) {
1233 return TMath::Abs(sumwz2/sumw - sumwz*sumwz/(sumw*sumw));
1235 if ((axis1 == 1 && axis2 == 2) || (axis1 == 2 && axis2 == 1)) {
1236 return sumwxy/sumw - sumwx*sumwy/(sumw*sumw);
1238 if ((axis1 == 1 && axis2 == 3) || (axis1 == 3 && axis2 == 1)) {
1239 return sumwxz/sumw - sumwx*sumwz/(sumw*sumw);
1241 if ((axis1 == 2 && axis2 == 3) || (axis1 == 3 && axis2 == 2)) {
1242 return sumwyz/sumw - sumwy*sumwz/(sumw*sumw);
1261 Int_t nxy = nbinsx*nbinsy;
1262 Int_t nbins = nxy*nbinsz;
1271 if (integral == 0 ) {
x = 0;
y = 0; z = 0;
return;}
1278 Int_t binz = ibin/nxy;
1279 Int_t biny = (ibin - nxy*binz)/nbinsx;
1280 Int_t binx = ibin - nbinsx*(biny + nbinsy*binz);
1308 Int_t bin, binx, biny, binz;
1312 for (bin=0;bin<11;bin++) stats[bin] = 0;
1323 if (firstBinX == 1) firstBinX = 0;
1327 if (firstBinY == 1) firstBinY = 0;
1331 if (firstBinZ == 1) firstBinZ = 0;
1341 for (binz = firstBinZ; binz <= lastBinZ; binz++) {
1343 for (biny = firstBinY; biny <= lastBinY; biny++) {
1345 for (binx = firstBinX; binx <= lastBinX; binx++) {
1346 bin =
GetBin(binx,biny,binz);
1352 stats[1] += err*err;
1430 Error(
"Interpolate",
"This function must be called with 3 arguments for a TH3");
1440 Error(
"Interpolate",
"This function must be called with 3 arguments for a TH3");
1459 Int_t obx = ubx + 1;
1463 Int_t oby = uby + 1;
1467 Int_t obz = ubz + 1;
1472 if (ubx <=0 || uby <=0 || ubz <= 0 ||
1474 Error(
"Interpolate",
"Cannot interpolate outside histogram domain.");
1499 Double_t w1 = i1 * (1 - yd) + i2 * yd;
1500 Double_t w2 = j1 * (1 - yd) + j2 * yd;
1536 if (h2 ==
nullptr)
return 0;
1538 const TAxis *xaxis2 = h2->GetXaxis();
1540 const TAxis *yaxis2 = h2->GetYaxis();
1542 const TAxis *zaxis2 = h2->GetZaxis();
1552 Error(
"KolmogorovTest",
"Histograms must be 3-D\n");
1558 Error(
"KolmogorovTest",
"Number of channels in X is different, %d and %d\n",ncx1,ncx2);
1562 Error(
"KolmogorovTest",
"Number of channels in Y is different, %d and %d\n",ncy1,ncy2);
1566 Error(
"KolmogorovTest",
"Number of channels in Z is different, %d and %d\n",ncz1,ncz2);
1576 if (diff1 > difprec || diff2 > difprec) {
1577 Error(
"KolmogorovTest",
"histograms with different binning along X");
1582 if (diff1 > difprec || diff2 > difprec) {
1583 Error(
"KolmogorovTest",
"histograms with different binning along Y");
1588 if (diff1 > difprec || diff2 > difprec) {
1589 Error(
"KolmogorovTest",
"histograms with different binning along Z");
1594 Int_t ibeg = 1, jbeg = 1, kbeg = 1;
1595 Int_t iend = ncx1, jend = ncy1, kend = ncz1;
1596 if (opt.
Contains(
"U")) {ibeg = 0; jbeg = 0; kbeg = 0;}
1597 if (opt.
Contains(
"O")) {iend = ncx1+1; jend = ncy1+1; kend = ncz1+1;}
1604 for (i = ibeg; i <= iend; i++) {
1605 for (j = jbeg; j <= jend; j++) {
1606 for (k = kbeg; k <= kend; k++) {
1609 sum2 += h2->GetBinContent(bin);
1611 Double_t ew2 = h2->GetBinError(bin);
1621 Error(
"KolmogorovTest",
"Integral is zero for h1=%s\n",
h1->
GetName());
1625 Error(
"KolmogorovTest",
"Integral is zero for h2=%s\n",h2->GetName());
1633 esum1 = sum1 * sum1 / w1;
1638 esum2 = sum2 * sum2 / w2;
1642 if (afunc2 && afunc1) {
1643 Error(
"KolmogorovTest",
"Errors are zero for both histograms\n");
1649 int order[3] = {0,1,2};
1653 binbeg[0] = ibeg; binbeg[1] = jbeg; binbeg[2] = kbeg;
1654 binend[0] = iend; binend[1] = jend; binend[2] = kend;
1663 for (i = binbeg[order[0] ]; i <= binend[order[0] ]; i++) {
1664 for ( j = binbeg[order[1] ]; j <= binend[order[1] ]; j++) {
1665 for ( k = binbeg[order[2] ]; k <= binend[order[2] ]; k++) {
1666 ibin[ order[0] ] = i;
1667 ibin[ order[1] ] = j;
1668 ibin[ order[2] ] = k;
1669 bin =
h1->
GetBin(ibin[0],ibin[1],ibin[2]);
1671 rsum2 += s2*h2->GetBinContent(bin);
1676 vdfmax[icomb] = dmax;
1695 if (opt.
Contains(
"N") && !(afunc1 || afunc2 ) ) {
1699 Double_t chi2 = d12*d12/(esum1+esum2);
1702 if (prb > 0 && prb2 > 0) prb = prb*prb2*(1-
TMath::Log(prb*prb2));
1708 printf(
" Kolmo Prob h1 = %s, sum1=%g\n",
h1->
GetName(),sum1);
1709 printf(
" Kolmo Prob h2 = %s, sum2=%g\n",h2->GetName(),sum2);
1710 printf(
" Kolmo Probabil = %f, Max Dist = %g\n",prb,dfmax);
1712 printf(
" Kolmo Probabil = %f for shape alone, =%f for normalisation alone\n",prb1,prb2);
1716 if (
TMath::Abs(rsum2-1) > 0.002)
Warning(
"KolmogorovTest",
"Numerical problems with h2=%s\n",h2->GetName());
1718 if (opt.
Contains(
"M"))
return dfmax;
1851 computeErrors =
kTRUE;
1856 originalRange =
kTRUE;
1860 TH1D *
h1 =
DoProject1D(
name, title, projAxis, &out1, &out2, computeErrors, originalRange,
true,
true);
1888 bool computeErrors,
bool originalRange,
1889 bool useUF,
bool useOF)
const
1898 Int_t nx = ixmax-ixmin+1;
1904 Error(
"DoProject1D",
"Histogram with name %s must be a TH1D and is a %s",
name,h1obj->
ClassName());
1911 if ( originalRange )
1913 if (bins->
fN == 0) {
1919 if (bins->
fN == 0) {
1929 if ( originalRange )
1931 if (bins->
fN == 0) {
1937 if (bins->
fN == 0) {
1967 if (out1 ==
nullptr && out2 ==
nullptr) {
1979 R__ASSERT(out1 !=
nullptr && out2 !=
nullptr);
1981 Int_t *refX =
nullptr, *refY =
nullptr, *refZ =
nullptr;
1982 Int_t ixbin, out1bin, out2bin;
1998 R__ASSERT (refX !=
nullptr && refY !=
nullptr && refZ !=
nullptr);
2020 for (ixbin=0;ixbin<=1+projX->
GetNbins();ixbin++) {
2027 for (out1bin = out1min; out1bin <= out1max; out1bin++) {
2028 for (out2bin = out2min; out2bin <= out2max; out2bin++) {
2034 if (computeErrors) {
2053 bool resetStats =
true;
2054 double eps = 1.E-12;
2058 bool resetEntries = resetStats;
2060 resetEntries |= !useUF || !useOF;
2067 stats[2] = stats[4];
2068 stats[3] = stats[5];
2071 stats[2] = stats[7];
2072 stats[3] = stats[8];
2101 bool computeErrors,
bool originalRange,
2102 bool useUF,
bool useOF)
const
2112 Int_t nx = ixmax-ixmin+1;
2113 Int_t ny = iymax-iymin+1;
2121 Error(
"DoProject2D",
"Histogram with name %s must be a TH2D and is a %s",
name,h2obj->
ClassName());
2129 if ( originalRange ) {
2136 h2->GetYaxis()->Set(projX->
GetNbins(),&xbins->fArray[ixmin-1]);
2141 h2->GetXaxis()->Set(ny,&ybins->
fArray[iymin-1]);
2143 h2->GetYaxis()->Set(nx,&xbins->fArray[ixmin-1]);
2151 if ( originalRange )
2153 if (xbins->fN == 0 && ybins->
fN == 0) {
2156 }
else if (ybins->
fN == 0) {
2158 ,projX->
GetNbins(),&xbins->fArray[ixmin-1]);
2159 }
else if (xbins->fN == 0) {
2166 if (xbins->fN == 0 && ybins->
fN == 0) {
2169 }
else if (ybins->
fN == 0) {
2171 ,nx,&xbins->fArray[ixmin-1]);
2172 }
else if (xbins->fN == 0) {
2176 h2 =
new TH2D(
name,title,ny,&ybins->
fArray[iymin-1],nx,&xbins->fArray[ixmin-1]);
2185 h2->GetXaxis()->ImportAttributes(projY);
2186 h2->GetYaxis()->ImportAttributes(projX);
2194 h2->GetXaxis()->SetBinLabel(i,lb->
String().
Data());
2203 h2->GetYaxis()->SetBinLabel(i,lb->
String().
Data());
2213 if ( computeErrors && (h2->GetSumw2N() != h2->GetNcells()) ) h2->Sumw2();
2216 const TAxis* out =
nullptr;
2225 Int_t *refX =
nullptr, *refY =
nullptr, *refZ =
nullptr;
2226 Int_t ixbin, iybin, outbin;
2227 if ( projX ==
GetXaxis() && projY ==
GetYaxis() ) { refX = &ixbin; refY = &iybin; refZ = &outbin; }
2228 if ( projX ==
GetYaxis() && projY ==
GetXaxis() ) { refX = &iybin; refY = &ixbin; refZ = &outbin; }
2229 if ( projX ==
GetXaxis() && projY ==
GetZaxis() ) { refX = &ixbin; refY = &outbin; refZ = &iybin; }
2230 if ( projX ==
GetZaxis() && projY ==
GetXaxis() ) { refX = &iybin; refY = &outbin; refZ = &ixbin; }
2231 if ( projX ==
GetYaxis() && projY ==
GetZaxis() ) { refX = &outbin; refY = &ixbin; refZ = &iybin; }
2232 if ( projX ==
GetZaxis() && projY ==
GetYaxis() ) { refX = &outbin; refY = &iybin; refZ = &ixbin; }
2233 R__ASSERT (refX !=
nullptr && refY !=
nullptr && refZ !=
nullptr);
2239 Int_t outmin = out->GetFirst();
2240 Int_t outmax = out->GetLast();
2242 if (outmin == 0 && outmax == 0) { outmin = 1; outmax = out->GetNbins(); }
2247 for (ixbin=0;ixbin<=1+projX->
GetNbins();ixbin++) {
2251 for (iybin=0;iybin<=1+projY->
GetNbins();iybin++) {
2259 for (outbin = outmin; outbin <= outmax; outbin++) {
2265 if (computeErrors) {
2273 h2->SetBinContent(iy , ix, cont);
2274 if (computeErrors) h2->SetBinError(iy, ix,
TMath::Sqrt(err2) );
2283 bool resetStats =
true;
2284 double eps = 1.E-12;
2288 bool resetEntries = resetStats;
2290 resetEntries |= !useUF || !useOF;
2295 for (
Int_t i = 0; i <
kNstat; ++i) { oldst[i] = 0; }
2297 std::copy(oldst,oldst+
kNstat,stats);
2301 stats[4] = oldst[7];
2302 stats[5] = oldst[8];
2303 stats[6] = oldst[9];
2306 stats[2] = oldst[4];
2307 stats[3] = oldst[5];
2309 stats[4] = oldst[2];
2310 stats[5] = oldst[3];
2313 stats[4] = oldst[7];
2314 stats[5] = oldst[8];
2315 stats[6] = oldst[10];
2319 stats[2] = oldst[7];
2320 stats[3] = oldst[8];
2322 stats[4] = oldst[2];
2323 stats[5] = oldst[3];
2324 stats[6] = oldst[9];
2327 stats[4] = oldst[4];
2328 stats[5] = oldst[5];
2329 stats[6] = oldst[10];
2333 h2->PutStats(stats);
2343 Double_t entries = h2->GetEffectiveEntries();
2344 if (!computeErrors) entries =
TMath::Floor( entries + 0.5);
2345 h2->SetEntries( entries );
2410 Int_t underscore = extra_name.
Last(
'_');
2411 if (underscore > 0) {
2412 extra_name.
Remove(underscore,extra_name.
Length()-underscore);
2413 opt.
Remove(0,underscore+1);
2419 if (opt.
Contains(
"x")) { pcase = 1; ptype =
"x"; }
2420 if (opt.
Contains(
"y")) { pcase = 2; ptype =
"y"; }
2421 if (opt.
Contains(
"z")) { pcase = 3; ptype =
"z"; }
2422 if (opt.
Contains(
"xy")) { pcase = 4; ptype =
"xy"; }
2423 if (opt.
Contains(
"yx")) { pcase = 5; ptype =
"yx"; }
2424 if (opt.
Contains(
"xz")) { pcase = 6; ptype =
"xz"; }
2425 if (opt.
Contains(
"zx")) { pcase = 7; ptype =
"zx"; }
2426 if (opt.
Contains(
"yz")) { pcase = 8; ptype =
"yz"; }
2427 if (opt.
Contains(
"zy")) { pcase = 9; ptype =
"zy"; }
2430 Error(
"Project3D",
"No projection axis specified - return a NULL pointer");
2437 computeErrors =
kTRUE;
2454 originalRange =
kTRUE;
2464 if (underscore > 0) {
2469 title +=
" "; title += ptype; title +=
" projection";
2475 computeErrors, originalRange, useUF, useOF);
2481 computeErrors, originalRange, useUF, useOF);
2487 computeErrors, originalRange, useUF, useOF);
2493 computeErrors, originalRange, useUF, useOF);
2499 computeErrors, originalRange, useUF, useOF);
2505 computeErrors, originalRange, useUF, useOF);
2511 computeErrors, originalRange, useUF, useOF);
2517 computeErrors, originalRange, useUF, useOF);
2523 computeErrors, originalRange, useUF, useOF);
2554 if (useWeights && binSumw2.
fN <= 0) useWeights =
false;
2561 if (outBin <0)
return;
2563 if ( useWeights ) tmp = binSumw2.
fArray[outBin];
2564 p2->
Fill( u ,
v,
w, cont);
2574 bool originalRange,
bool useUF,
bool useOF)
const
2582 Int_t nx = ixmax-ixmin+1;
2583 Int_t ny = iymax-iymin+1;
2593 Error(
"DoProjectProfile2D",
"Histogram with name %s must be a TProfile2D and is a %s",
name,p2obj->
ClassName());
2601 if ( originalRange ) {
2622 if ( originalRange ) {
2623 if (xbins->fN == 0 && ybins->
fN == 0) {
2626 }
else if (ybins->
fN == 0) {
2628 ,projX->
GetNbins(),&xbins->fArray[ixmin-1]);
2629 }
else if (xbins->fN == 0) {
2636 if (xbins->fN == 0 && ybins->
fN == 0) {
2639 }
else if (ybins->
fN == 0) {
2641 ,nx,&xbins->fArray[ixmin-1]);
2642 }
else if (xbins->fN == 0) {
2676 const TAxis* outAxis =
nullptr;
2691 Int_t *refX =
nullptr, *refY =
nullptr, *refZ =
nullptr;
2692 Int_t ixbin, iybin, outbin;
2693 if ( projX ==
GetXaxis() && projY ==
GetYaxis() ) { refX = &ixbin; refY = &iybin; refZ = &outbin; }
2694 if ( projX ==
GetYaxis() && projY ==
GetXaxis() ) { refX = &iybin; refY = &ixbin; refZ = &outbin; }
2695 if ( projX ==
GetXaxis() && projY ==
GetZaxis() ) { refX = &ixbin; refY = &outbin; refZ = &iybin; }
2696 if ( projX ==
GetZaxis() && projY ==
GetXaxis() ) { refX = &iybin; refY = &outbin; refZ = &ixbin; }
2697 if ( projX ==
GetYaxis() && projY ==
GetZaxis() ) { refX = &outbin; refY = &ixbin; refZ = &iybin; }
2698 if ( projX ==
GetZaxis() && projY ==
GetYaxis() ) { refX = &outbin; refY = &iybin; refZ = &ixbin; }
2699 R__ASSERT (refX !=
nullptr && refY !=
nullptr && refZ !=
nullptr);
2709 if (useWeights && binSumw2.
fN <= 0) useWeights =
false;
2713 for (ixbin=0;ixbin<=1+projX->
GetNbins();ixbin++) {
2715 for ( iybin=0;iybin<=1+projY->
GetNbins();iybin++) {
2720 if (poutBin <0)
continue;
2722 for (outbin = outmin; outbin <= outmax; outbin++) {
2729 if (!cont)
continue;
2733 if ( useWeights ) tmp = binSumw2.
fArray[poutBin];
2743 bool resetStats =
true;
2754 if (!useWeights) entries =
TMath::Floor( entries + 0.5);
2808 if (opt.
Contains(
"xy")) { pcase = 4; ptype =
"xy"; }
2809 if (opt.
Contains(
"yx")) { pcase = 5; ptype =
"yx"; }
2810 if (opt.
Contains(
"xz")) { pcase = 6; ptype =
"xz"; }
2811 if (opt.
Contains(
"zx")) { pcase = 7; ptype =
"zx"; }
2812 if (opt.
Contains(
"yz")) { pcase = 8; ptype =
"yz"; }
2813 if (opt.
Contains(
"zy")) { pcase = 9; ptype =
"zy"; }
2816 Error(
"Project3D",
"No projection axis specified - return a NULL pointer");
2834 originalRange =
kTRUE;
2843 title +=
" profile "; title += ptype; title +=
" projection";
2905 return Rebin3D(ngroup, 1, 1, newname);
2915 return Rebin3D(1, ngroup, 1, newname);
2925 return Rebin3D(1, 1, ngroup, newname);
2956 Int_t i,j,k,xbin,ybin,zbin;
2966 if ((nxgroup <= 0) || (nxgroup > nxbins)) {
2967 Error(
"Rebin",
"Illegal value of nxgroup=%d",nxgroup);
2970 if ((nygroup <= 0) || (nygroup > nybins)) {
2971 Error(
"Rebin",
"Illegal value of nygroup=%d",nygroup);
2974 if ((nzgroup <= 0) || (nzgroup > nzbins)) {
2975 Error(
"Rebin",
"Illegal value of nzgroup=%d",nzgroup);
2979 Int_t newxbins = nxbins/nxgroup;
2980 Int_t newybins = nybins/nygroup;
2981 Int_t newzbins = nzbins/nzgroup;
2999 if (newname && strlen(newname)) {
3007 bool resetStat =
false;
3011 if (newxbins*nxgroup != nxbins) {
3015 if (newybins*nygroup != nybins) {
3019 if (newzbins*nzgroup != nzbins) {
3061 if (nxgroup != 1 || nygroup != 1 || nzgroup != 1) {
3070 hnew->
SetBins(newxbins,xbins, newybins, ybins, newzbins, zbins);
3083 for (xbin = 1; xbin <= newxbins; xbin++) {
3086 for (ybin = 1; ybin <= newybins; ybin++) {
3088 for (zbin = 1; zbin <= newzbins; zbin++) {
3091 for (i = 0; i < nxgroup; i++) {
3092 if (oldxbin+i > nxbins)
break;
3093 for (j =0; j < nygroup; j++) {
3094 if (oldybin+j > nybins)
break;
3095 for (k =0; k < nzgroup; k++) {
3096 if (oldzbin+k > nzbins)
break;
3098 bin = oldxbin + i + (oldybin + j)*(nxbins + 2) + (oldzbin + k)*(nxbins + 2)*(nybins + 2);
3099 binContent += oldBins[bin];
3100 if (oldSumw2) binSumw2 += oldSumw2[bin];
3115 for (
Int_t xover = 0; xover <= 1; xover++) {
3116 for (
Int_t yover = 0; yover <= 1; yover++) {
3117 for (
Int_t zover = 0; zover <= 1; zover++) {
3121 for (xbin = xover*oldxbin; xbin <= xover*(nxbins+1); xbin++) {
3122 for (ybin = yover*oldybin; ybin <= yover*(nybins+1); ybin++) {
3123 for (zbin = zover*oldzbin; zbin <= zover*(nzbins+1); zbin++) {
3124 bin =
GetBin(xbin,ybin,zbin);
3125 binContent += oldBins[bin];
3126 if (oldSumw2) binSumw2 += oldSumw2[bin];
3131 yover*(newybins+1), zover*(newzbins+1) );
3138 Double_t binContent0, binContent2, binContent3, binContent4;
3139 Double_t binError0, binError2, binError3, binError4;
3140 Int_t oldxbin2, oldybin2, oldzbin2;
3141 Int_t ufbin, ofbin, ofbin2, ofbin3, ofbin4;
3147 for (xbin = 1; xbin<=newxbins; xbin++) {
3149 for (zbin = 1; zbin<=newzbins; zbin++) {
3150 binContent0 = binContent2 = 0;
3151 binError0 = binError2 = 0;
3152 for (i=0; i<nxgroup; i++) {
3153 if (oldxbin2+i > nxbins)
break;
3154 for (k=0; k<nzgroup; k++) {
3155 if (oldzbin2+k > nzbins)
break;
3157 ufbin = oldxbin2 + i + (nxbins+2)*(nybins+2)*(oldzbin2+k);
3158 binContent0 += oldBins[ufbin];
3159 if (oldSumw2) binError0 += oldSumw2[ufbin];
3160 for (ybin = oldybin; ybin <= nybins + 1; ybin++) {
3162 ofbin = ufbin + ybin*(nxbins+2);
3163 binContent2 += oldBins[ofbin];
3164 if (oldSumw2) binError2 += oldSumw2[ofbin];
3174 oldzbin2 += nzgroup;
3176 oldxbin2 += nxgroup;
3183 for (ybin = 1; ybin<=newybins; ybin++) {
3185 for (zbin = 1; zbin<=newzbins; zbin++) {
3186 binContent0 = binContent2 = 0;
3187 binError0 = binError2 = 0;
3188 for (j=0; j<nygroup; j++) {
3189 if (oldybin2+j > nybins)
break;
3190 for (k=0; k<nzgroup; k++) {
3191 if (oldzbin2+k > nzbins)
break;
3193 ufbin = (oldybin2 + j)*(nxbins+2) + (nxbins+2)*(nybins+2)*(oldzbin2+k);
3194 binContent0 += oldBins[ufbin];
3195 if (oldSumw2) binError0 += oldSumw2[ufbin];
3196 for (xbin = oldxbin; xbin <= nxbins + 1; xbin++) {
3198 ofbin = ufbin + xbin;
3199 binContent2 += oldBins[ofbin];
3200 if (oldSumw2) binError2 += oldSumw2[ofbin];
3210 oldzbin2 += nzgroup;
3212 oldybin2 += nygroup;
3219 for (xbin = 1; xbin<=newxbins; xbin++) {
3221 for (ybin = 1; ybin<=newybins; ybin++) {
3222 binContent0 = binContent2 = 0;
3223 binError0 = binError2 = 0;
3224 for (i=0; i<nxgroup; i++) {
3225 if (oldxbin2+i > nxbins)
break;
3226 for (j=0; j<nygroup; j++) {
3227 if (oldybin2+j > nybins)
break;
3229 ufbin = oldxbin2 + i + (nxbins+2)*(oldybin2+j);
3230 binContent0 += oldBins[ufbin];
3231 if (oldSumw2) binError0 += oldSumw2[ufbin];
3232 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3234 ofbin = ufbin + (nxbins+2)*(nybins+2)*zbin;
3235 binContent2 += oldBins[ofbin];
3236 if (oldSumw2) binError2 += oldSumw2[ofbin];
3246 oldybin2 += nygroup;
3248 oldxbin2 += nxgroup;
3255 for (xbin = 1; xbin<=newxbins; xbin++) {
3264 for (i=0; i<nxgroup; i++) {
3265 if (oldxbin2+i > nxbins)
break;
3266 ufbin = oldxbin2 + i;
3267 binContent0 += oldBins[ufbin];
3268 if (oldSumw2) binError0 += oldSumw2[ufbin];
3269 for (ybin = oldybin; ybin <= nybins + 1; ybin++) {
3270 ofbin3 = ufbin+ybin*(nxbins+2);
3271 binContent3 += oldBins[ ofbin3 ];
3272 if (oldSumw2) binError3 += oldSumw2[ofbin3];
3273 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3275 ofbin4 = oldxbin2 + i + ybin*(nxbins+2) + (nxbins+2)*(nybins+2)*zbin;
3276 binContent4 += oldBins[ofbin4];
3277 if (oldSumw2) binError4 += oldSumw2[ofbin4];
3280 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3281 ofbin2 = ufbin+zbin*(nxbins+2)*(nybins+2);
3282 binContent2 += oldBins[ ofbin2 ];
3283 if (oldSumw2) binError2 += oldSumw2[ofbin2];
3289 hnew->
SetBinContent(xbin,newybins+1,newzbins+1,binContent4);
3296 oldxbin2 += nxgroup;
3303 for (zbin = 1; zbin<=newzbins; zbin++) {
3312 for (i=0; i<nzgroup; i++) {
3313 if (oldzbin2+i > nzbins)
break;
3314 ufbin = (oldzbin2 + i)*(nxbins+2)*(nybins+2);
3315 binContent0 += oldBins[ufbin];
3316 if (oldSumw2) binError0 += oldSumw2[ufbin];
3317 for (ybin = oldybin; ybin <= nybins + 1; ybin++) {
3318 ofbin3 = ufbin+ybin*(nxbins+2);
3319 binContent3 += oldBins[ ofbin3 ];
3320 if (oldSumw2) binError3 += oldSumw2[ofbin3];
3321 for (xbin = oldxbin; xbin <= nxbins + 1; xbin++) {
3323 ofbin4 = ufbin + xbin + ybin*(nxbins+2);
3324 binContent4 += oldBins[ofbin4];
3325 if (oldSumw2) binError4 += oldSumw2[ofbin4];
3328 for (xbin = oldxbin; xbin <= nxbins + 1; xbin++) {
3329 ofbin2 = xbin +(oldzbin2+i)*(nxbins+2)*(nybins+2);
3330 binContent2 += oldBins[ ofbin2 ];
3331 if (oldSumw2) binError2 += oldSumw2[ofbin2];
3337 hnew->
SetBinContent(newxbins+1,newybins+1,zbin,binContent4);
3344 oldzbin2 += nzgroup;
3351 for (ybin = 1; ybin<=newybins; ybin++) {
3360 for (i=0; i<nygroup; i++) {
3361 if (oldybin2+i > nybins)
break;
3362 ufbin = (oldybin2 + i)*(nxbins+2);
3363 binContent0 += oldBins[ufbin];
3364 if (oldSumw2) binError0 += oldSumw2[ufbin];
3365 for (xbin = oldxbin; xbin <= nxbins + 1; xbin++) {
3366 ofbin3 = ufbin+xbin;
3367 binContent3 += oldBins[ ofbin3 ];
3368 if (oldSumw2) binError3 += oldSumw2[ofbin3];
3369 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3371 ofbin4 = xbin + (nxbins+2)*(nybins+2)*zbin+(oldybin2+i)*(nxbins+2);
3372 binContent4 += oldBins[ofbin4];
3373 if (oldSumw2) binError4 += oldSumw2[ofbin4];
3376 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3377 ofbin2 = (oldybin2+i)*(nxbins+2)+zbin*(nxbins+2)*(nybins+2);
3378 binContent2 += oldBins[ ofbin2 ];
3379 if (oldSumw2) binError2 += oldSumw2[ofbin2];
3385 hnew->
SetBinContent(newxbins+1,ybin,newzbins+1,binContent4);
3392 oldybin2 += nygroup;
3435 if (!resetStat) hnew->
PutStats(stat);
3438 if (oldSumw2)
delete [] oldSumw2;
3469 if (bin < 0)
return;
3502 bool originalRange,
bool useUF,
bool useOF)
3504 return h.DoProject1D(
name, title, projX,
nullptr,
nullptr, computeErrors, originalRange, useUF, useOF);
3511 bool computeErrors,
bool originalRange,
bool useUF,
bool useOF)
3513 return h.DoProject2D(
name, title, projX, projY, computeErrors, originalRange, useUF, useOF);
3549 :
TH3(
name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
3565 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
3579 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
3592 h3c.TH3C::Copy(*
this);
3614 if (newval > -128 && newval < 128) {
fArray[bin] =
Char_t(newval);
return;}
3615 if (newval < -127)
fArray[bin] = -127;
3616 if (newval > 127)
fArray[bin] = 127;
3720 h3c.TH3C::Copy(*
this);
3818 :
TH3(
name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
3834 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
3848 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
3861 h3s.TH3S::Copy(*
this);
3883 if (newval > -32768 && newval < 32768) {
fArray[bin] =
Short_t(newval);
return;}
3884 if (newval < -32767)
fArray[bin] = -32767;
3885 if (newval > 32767)
fArray[bin] = 32767;
3960 h3s.TH3S::Copy(*
this);
4058 :
TH3(
name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
4074 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4088 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4101 h3i.TH3I::Copy(*
this);
4123 if (newval > -INT_MAX && newval < INT_MAX) {
fArray[bin] =
Int_t(newval);
return;}
4124 if (newval < -INT_MAX)
fArray[bin] = -INT_MAX;
4125 if (newval > INT_MAX)
fArray[bin] = INT_MAX;
4167 h3i.TH3I::Copy(*
this);
4265 :
TH3(
name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
4281 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4295 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4308 h3l.TH3L::Copy(*
this);
4330 if (newval > -LLONG_MAX && newval < LLONG_MAX) {
fArray[bin] =
Int_t(newval);
return;}
4331 if (newval < -LLONG_MAX)
fArray[bin] = -LLONG_MAX;
4332 if (newval > LLONG_MAX)
fArray[bin] = LLONG_MAX;
4374 h3l.TH3L::Copy(*
this);
4472 :
TH3(
name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
4488 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4502 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4515 h3f.TH3F::Copy(*
this);
4590 h3f.TH3F::Copy(*
this);
4688 :
TH3(
name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
4704 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4718 :
TH3(
name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
TH3C operator-(TH3C const &h1, TH3C const &h2)
Operator -.
TH3C operator+(TH3C const &h1, TH3C const &h2)
Operator +.
TH3C operator/(TH3C const &h1, TH3C const &h2)
Operator /.
TH3C operator*(Float_t c1, TH3C const &h3c)
Operator *.
R__EXTERN TRandom * gRandom
Array of chars or bytes (8 bits per element).
void Streamer(TBuffer &) override
Stream a TArrayC object.
void Set(Int_t n) override
Set size of this array to n chars.
Array of doubles (64 bits per element).
void Streamer(TBuffer &) override
Stream a TArrayD object.
void Set(Int_t n) override
Set size of this array to n doubles.
Array of floats (32 bits per element).
void Set(Int_t n) override
Set size of this array to n floats.
void Streamer(TBuffer &) override
Stream a TArrayF object.
Array of integers (32 bits per element).
void Set(Int_t n) override
Set size of this array to n ints.
Array of long64s (64 bits per element).
void Set(Int_t n) override
Set size of this array to n long64s.
Array of shorts (16 bits per element).
void Set(Int_t n) override
Set size of this array to n shorts.
void Streamer(TBuffer &) override
Stream a TArrayS object.
virtual void Set(Int_t n)=0
virtual void Streamer(TBuffer &)
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.
Bool_t IsAlphanumeric() const
const char * GetTitle() const override
Returns title of object.
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
const TArrayD * GetXbins() const
void SetCanExtend(Bool_t canExtend)
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.
virtual void SetRange(Int_t first=0, Int_t last=0)
Set the viewing range for the axis using bin numbers.
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 Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
TObject * GetParent() const
Return pointer to parent of this buffer.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=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 Note that this histogram is managed ...
virtual Double_t GetParError(Int_t ipar) const
Return value of parameter number ipar.
Double_t GetChisquare() const
Return the Chisquare after fitting. See ROOT::Fit::FitResult::Chi2()
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 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 Double_t EvalPar(const Double_t *x, const Double_t *params=nullptr)
Evaluate function with given coordinates and parameters.
virtual void SetParameters(const Double_t *params)
TClass * IsA() const override
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)
void Reset(Option_t *option="") override
Reset.
TH1 is the base class of all histogram classes in ROOT.
virtual void SetDirectory(TDirectory *dir)
By default, when a 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.
void Copy(TObject &hnew) const override
Copy this histogram structure to newth1.
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 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
void Streamer(TBuffer &) override
Stream a class object.
@ kIsNotW
Histogram is forced to be not weighted even when the histogram is filled with weighted.
virtual Bool_t CanExtendAllAxes() const
Returns true if all axes are extendable.
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
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.
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
void Draw(Option_t *option="") override
Draw this histogram with options.
UInt_t GetAxisLabelStatus() const
Internal function used in TH1::Fill to see which axis is full alphanumeric, i.e.
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.
void SetName(const char *name) override
Change the name of this histogram.
void Paint(Option_t *option="") override
Control routine to paint any kind of histograms.
virtual void ResetStats()
Reset the statistics including the number of entries and replace with values calculated from bin cont...
virtual void SetBuffer(Int_t buffersize, Option_t *option="")
Set the maximum number of entries to be kept in the buffer.
@ kNstat
Size of statistics data (up to TProfile3D)
Double_t fEntries
Number of entries.
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 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
TObject * Clone(const char *newname="") const override
Make a complete copy of the underlying object.
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 (normalized cumulative sum of bins) w/o under/overflows The result is stored in fInt...
2-D histogram with a double per channel (see TH1 documentation)
3-D histogram with a byte per channel (see TH1 documentation)
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
TClass * IsA() const override
~TH3C() override
Destructor.
void Reset(Option_t *option="") override
Reset this histogram: contents, errors, etc.
void AddBinContent(Int_t bin) override
Increment bin content by 1.
TH3C & operator=(const TH3C &h1)
Operator =.
void Streamer(TBuffer &) override
Stream an object of class TH3C.
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
3-D histogram with a double per channel (see TH1 documentation)
TClass * IsA() const override
void Streamer(TBuffer &) override
Stream an object of class TH3D.
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
~TH3D() override
Destructor.
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
TH3D & operator=(const TH3D &h1)
Operator =.
3-D histogram with a float per channel (see TH1 documentation)
TH3F & operator=(const TH3F &h1)
Operator =.
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
~TH3F() override
Destructor.
void Streamer(TBuffer &) override
Stream an object of class TH3F.
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
TClass * IsA() const override
3-D histogram with an int per channel (see TH1 documentation)
TH3I & operator=(const TH3I &h1)
Operator =.
void AddBinContent(Int_t bin) override
Increment bin content by 1.
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
~TH3I() override
Destructor.
3-D histogram with a long64 per channel (see TH1 documentation)
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
TH3L & operator=(const TH3L &h1)
Operator =.
void AddBinContent(Int_t bin) override
Increment bin content by 1.
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
~TH3L() override
Destructor.
3-D histogram with a short per channel (see TH1 documentation)
void Streamer(TBuffer &) override
Stream an object of class TH3S.
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
void AddBinContent(Int_t bin) override
Increment bin content by 1.
~TH3S() override
Destructor.
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
TClass * IsA() const override
TH3S & operator=(const TH3S &h1)
Operator =.
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 BufferEmpty(Int_t action=0) override
Fill histogram with all entries in the buffer.
Double_t fTsumwy
Total Sum of weight*Y.
Double_t fTsumwy2
Total Sum of weight*Y*Y.
virtual Double_t GetCovariance(Int_t axis1=1, Int_t axis2=2) const
Return covariance between axis1 and axis2.
void GetStats(Double_t *stats) const override
Fill the array stats from the contents of this histogram The array stats must be correctly dimensione...
void Copy(TObject &hnew) const override
Copy.
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
Double_t fTsumwxz
Total Sum of weight*X*Z.
Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const override
Statistical test of compatibility in shape between THIS histogram and h2, using Kolmogorov test.
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.
Double_t Interpolate(Double_t x, Double_t y) const override
Not yet implemented.
virtual void GetRandom3(Double_t &x, Double_t &y, Double_t &, TRandom *rng=nullptr)
Return 3 random numbers along axis x , y and z distributed according to the cell-contents of this 3-d...
void Reset(Option_t *option="") override
Reset this histogram: contents, errors, etc.
void AddBinContent(Int_t bin) override
Increment bin content by 1.
~TH3() override
Destructor.
Int_t Fill(Double_t) override
Invalid Fill method.
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...
Double_t fTsumwz2
Total Sum of weight*Z*Z.
Double_t fTsumwxy
Total Sum of weight*X*Y.
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 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,...
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 TH3 * RebinZ(Int_t ngroup=2, const char *newname="")
Rebin only the Z axis see Rebin3D.
void Streamer(TBuffer &) override
Stream an object of class TH3.
Double_t Integral(Option_t *option="") const override
Return integral of bin contents.
virtual Int_t BufferFill(Double_t x, Double_t y, Double_t z, Double_t w)
Accumulate arguments in buffer.
void FillRandom(TF1 *f1, Int_t ntimes=5000, TRandom *rng=nullptr) override
Fill histogram following distribution in function fname.
TClass * IsA() const override
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...
TH3 * RebinX(Int_t ngroup=2, const char *newname="") override
Rebin only the X axis see Rebin3D.
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
Double_t fTsumwz
Total Sum of weight*Z.
Double_t GetBinContent(Int_t binx, Int_t biny, Int_t binz) const override
void SetBinContent(Int_t bin, Double_t content) override
Set bin content.
Double_t fTsumwyz
Total Sum of weight*Y*Z.
TH3()
Default constructor.
Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const override
See comments in TH1::GetBin.
virtual void FitSlicesZ(TF1 *f1=nullptr, 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 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
void PutStats(Double_t *stats) override
Replace current statistics with the values in array stats.
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...
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
Collectable string class.
Mother of all ROOT objects.
void AbstractMethod(const char *method) const
Use this method to implement an "abstract" method that you don't want to leave purely abstract.
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.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
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 TClass * IsA() const
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 error for each cell in X,...
void PutStats(Double_t *stats) override
Replace current statistics with the values in array stats.
Int_t Fill(const Double_t *v)
void Sumw2(Bool_t flag=kTRUE) override
Create/Delete structure to store sum of squares of weights per bin.
void SetBins(const Int_t *nbins, const Double_t *range)
virtual TArrayD * GetBinSumw2()
void Reset(Option_t *option="") override
Reset contents of a Profile2D histogram.
This is the base class for the ROOT Random number generators.
Double_t Rndm() override
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
Ssiz_t Last(char c) const
Find last occurrence of a character c.
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
small helper class to store/restore gPad context in TPad methods
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and 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)
Rounds x downward, returning the largest integral value that is not greater than x.
Double_t Log(Double_t x)
Returns the natural logarithm of x.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Double_t Mean(Long64_t n, const T *a, const Double_t *w=nullptr)
Returns the weighted mean of an array a with length n.
Double_t KolmogorovProb(Double_t z)
Calculates the Kolmogorov distribution function,.
Long64_t BinarySearch(Long64_t n, const T *array, T value)
Binary search in an array of n values to locate value.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.