61 fTsumwy = fTsumwy2 = fTsumwxy = 0;
62 fTsumwz = fTsumwz2 = fTsumwxz = fTsumwyz = 0;
72 :
TH1(name,title,nbinsx,xlow,xup),
76 if (nbinsy <= 0) {
Warning(
"TH3",
"nbinsy is <=0 - set to nbinsy = 1"); nbinsy = 1; }
77 if (nbinsz <= 0) nbinsz = 1;
80 fNcells = (nbinsx+2)*(nbinsy+2)*(nbinsz+2);
92 :
TH1(name,title,nbinsx,xbins),
96 if (nbinsy <= 0) {
Warning(
"TH3",
"nbinsy is <=0 - set to nbinsy = 1"); nbinsy = 1; }
97 if (nbinsz <= 0) nbinsz = 1;
102 fNcells = (nbinsx+2)*(nbinsy+2)*(nbinsz+2);
114 :
TH1(name,title,nbinsx,xbins),
118 if (nbinsy <= 0) {
Warning(
"TH3",
"nbinsy is <=0 - set to nbinsy = 1"); nbinsy = 1; }
119 if (nbinsz <= 0) nbinsz = 1;
124 fNcells = (nbinsx+2)*(nbinsy+2)*(nbinsz+2);
136 ((
TH3&)h).Copy(*
this);
177 if (!nbentries)
return 0;
180 if (action == 0)
return 0;
181 nbentries = -nbentries;
196 for (
Int_t i=1;i<nbentries;i++) {
198 if (x < xmin) xmin =
x;
199 if (x > xmax) xmax =
x;
201 if (y < ymin) ymin =
y;
202 if (y > ymax) ymax =
y;
204 if (z < zmin) zmin =
z;
205 if (z > zmax) zmax =
z;
224 for (
Int_t i=0;i<nbentries;i++) {
225 Fill(buffer[4*i+2],buffer[4*i+3],buffer[4*i+4],buffer[4*i+1]);
251 nbentries = -nbentries;
261 return Fill(x,y,z,w);
277 Error(
"Fill",
"Invalid signature - do nothing");
292 Int_t binx, biny, binz, bin;
297 if (binx <0 || biny <0 || binz<0)
return -1;
340 Int_t binx, biny, binz, bin;
345 if (binx <0 || biny <0 || binz<0)
return -1;
385 Int_t binx, biny, binz, bin;
390 if (binx <0 || biny <0 || binz<0)
return -1;
428 Int_t binx, biny, binz, bin;
433 if (binx <0 || biny <0 || binz<0)
return -1;
472 Int_t binx, biny, binz, bin;
477 if (binx <0 || biny <0 || binz<0)
return -1;
516 Int_t binx, biny, binz, bin;
521 if (binx <0 || biny <0 || binz<0)
return -1;
560 Int_t binx, biny, binz, bin;
565 if (binx <0 || biny <0 || binz<0)
return -1;
605 Int_t binx, biny, binz, bin;
610 if (binx <0 || biny <0 || binz<0)
return -1;
655 Int_t bin, binx, biny, binz, ibin, loop;
659 if (!f1) {
Error(
"FillRandom",
"Unknown function: %s",fname);
return; }
665 Int_t nxy = nbinsx*nbinsy;
671 for (binz=1;binz<=nbinsz;binz++) {
673 for (biny=1;biny<=nbinsy;biny++) {
675 for (binx=1;binx<=nbinsx;binx++) {
678 integral[ibin] = integral[ibin-1] + f1->
Eval(xv[0],xv[1],xv[2]);
684 if (integral[nbins] == 0 ) {
686 Error(
"FillRandom",
"Integral = zero");
return;
688 for (bin=1;bin<=
nbins;bin++) integral[bin] /= integral[nbins];
693 for (loop=0;loop<ntimes;loop++) {
697 biny = (ibin - nxy*binz)/nbinsx;
698 binx = 1 + ibin - nbinsx*(biny + nbinsy*binz);
724 if (!h) {
Error(
"FillRandom",
"Null histogram");
return; }
726 Error(
"FillRandom",
"Histograms with different dimensions");
return;
734 for (loop=0;loop<ntimes;loop++) {
747 if (axis < 1 || axis > 3) {
748 Warning(
"FindFirstBinAbove",
"Invalid axis number : %d, axis x assumed\n",axis);
754 Int_t binx, biny, binz;
756 for (binx=1;binx<=nbinsx;binx++) {
757 for (biny=1;biny<=nbinsy;biny++) {
758 for (binz=1;binz<=nbinsz;binz++) {
763 }
else if (axis == 2) {
764 for (biny=1;biny<=nbinsy;biny++) {
765 for (binx=1;binx<=nbinsx;binx++) {
766 for (binz=1;binz<=nbinsz;binz++) {
772 for (binz=1;binz<=nbinsz;binz++) {
773 for (binx=1;binx<=nbinsx;binx++) {
774 for (biny=1;biny<=nbinsy;biny++) {
790 if (axis < 1 || axis > 3) {
791 Warning(
"FindLastBinAbove",
"Invalid axis number : %d, axis x assumed\n",axis);
797 Int_t binx, biny, binz;
799 for (binx=nbinsx;binx>=1;binx--) {
800 for (biny=1;biny<=nbinsy;biny++) {
801 for (binz=1;binz<=nbinsz;binz++) {
806 }
else if (axis == 2) {
807 for (biny=nbinsy;biny>=1;biny--) {
808 for (binx=1;binx<=nbinsx;binx++) {
809 for (binz=1;binz<=nbinsz;binz++) {
815 for (binz=nbinsz;binz>=1;binz--) {
816 for (binx=1;binx<=nbinsx;binx++) {
817 for (biny=1;biny<=nbinsy;biny++) {
864 if (binminx < 1) binminx = 1;
865 if (binmaxx > nbinsx) binmaxx = nbinsx;
866 if (binmaxx < binminx) {binminx = 1; binmaxx = nbinsx;}
867 if (binminy < 1) binminy = 1;
868 if (binmaxy > nbinsy) binmaxy = nbinsy;
869 if (binmaxy < binminy) {binminy = 1; binmaxy = nbinsy;}
873 f1 = (
TF1*)
gROOT->GetFunction(
"gaus");
877 const char *fname = f1->
GetName();
888 for (ipar=0;ipar<npar;ipar++) {
889 snprintf(name,80,
"%s_%d",
GetName(),ipar);
890 snprintf(title,80,
"Fitted value of par[%d]=%s",ipar,f1->
GetParName(ipar));
891 if (xbins->
fN == 0) {
892 hlist[ipar] =
new TH2D(name, title,
896 hlist[ipar] =
new TH2D(name, title,
903 snprintf(name,80,
"%s_chi2",
GetName());
909 Int_t bin,binx,biny,binz;
910 for (biny=binminy;biny<=binmaxy;biny++) {
912 for (binx=binminx;binx<=binmaxx;binx++) {
916 for (binz=1;binz<=nbinsz;binz++) {
917 bin =
GetBin(binx,biny,binz);
918 Float_t w = RetrieveBinContent(bin);
919 if (w == 0)
continue;
924 if (nfill < cut)
continue;
926 hpz->Fit(fname,option);
928 if (npfits > npar && npfits >= cut) {
929 for (ipar=0;ipar<npar;ipar++) {
948 if (biny < 0) biny = 0;
949 if (biny > ofy) biny = ofy;
952 if (binz < 0) binz = 0;
953 if (binz > ofz) binz = ofz;
989 Error(
"GetBinWithContent3",
"function is only valid for 3-D histograms");
992 if (firstx <= 0) firstx = 1;
994 if (firsty <= 0) firsty = 1;
996 if (firstz <= 0) firstz = 1;
998 Int_t binminx = 0, binminy=0, binminz=0;
1000 for (
Int_t k=firstz;k<=lastz;k++) {
1001 for (
Int_t j=firsty;j<=lasty;j++) {
1002 for (
Int_t i=firstx;i<=lastx;i++) {
1004 if (diff <= 0) {binx = i; biny=j; binz=k;
return diff;}
1005 if (diff < curmax && diff <= maxdiff) {curmax = diff, binminx=i; binminy=j;binminz=k;}
1021 if (axis1 < 1 || axis2 < 1 || axis1 > 3 || axis2 > 3) {
1022 Error(
"GetCorrelationFactor",
"Wrong parameters");
1025 if (axis1 == axis2)
return 1;
1027 if (stddev1 == 0)
return 0;
1029 if (stddev2 == 0)
return 0;
1039 if (axis1 < 1 || axis2 < 1 || axis1 > 3 || axis2 > 3) {
1040 Error(
"GetCovariance",
"Wrong parameters");
1057 if (sumw == 0)
return 0;
1058 if (axis1 == 1 && axis2 == 1) {
1059 return TMath::Abs(sumwx2/sumw - sumwx*sumwx/sumw2);
1061 if (axis1 == 2 && axis2 == 2) {
1062 return TMath::Abs(sumwy2/sumw - sumwy*sumwy/sumw2);
1064 if (axis1 == 3 && axis2 == 3) {
1065 return TMath::Abs(sumwz2/sumw - sumwz*sumwz/sumw2);
1067 if ((axis1 == 1 && axis2 == 2) || (axis1 == 2 && axis2 == 1)) {
1068 return sumwxy/sumw - sumwx/sumw*sumwy/sumw;
1070 if ((axis1 == 1 && axis2 == 3) || (axis1 == 3 && axis2 == 1)) {
1071 return sumwxz/sumw - sumwx/sumw*sumwz/sumw;
1073 if ((axis1 == 2 && axis2 == 3) || (axis1 == 3 && axis2 == 2)) {
1074 return sumwyz/sumw - sumwy/sumw*sumwz/sumw;
1089 Int_t nxy = nbinsx*nbinsy;
1099 if (integral == 0 ) { x = 0; y = 0; z = 0;
return;}
1105 Int_t binz = ibin/nxy;
1106 Int_t biny = (ibin - nxy*binz)/nbinsx;
1107 Int_t binx = ibin - nbinsx*(biny + nbinsy*binz);
1135 Int_t bin, binx, biny, binz;
1139 for (bin=0;bin<9;bin++) stats[bin] = 0;
1150 if (firstBinX == 1) firstBinX = 0;
1154 if (firstBinY == 1) firstBinY = 0;
1158 if (firstBinZ == 1) firstBinZ = 0;
1162 for (binz = firstBinZ; binz <= lastBinZ; binz++) {
1164 for (biny = firstBinY; biny <= lastBinY; biny++) {
1166 for (binx = firstBinX; binx <= lastBinX; binx++) {
1167 bin =
GetBin(binx,biny,binz);
1170 w = RetrieveBinContent(bin);
1173 stats[1] += err*err;
1227 return DoIntegral(binx1,binx2,biny1,biny2,binz1,binz2,err,option);
1243 return DoIntegral(binx1,binx2,biny1,biny2,binz1,binz2,error,option,
kTRUE);
1252 Error(
"Interpolate",
"This function must be called with 3 arguments for a TH3");
1262 Error(
"Interpolate",
"This function must be called with 3 arguments for a TH3");
1281 Int_t obx = ubx + 1;
1285 Int_t oby = uby + 1;
1289 Int_t obz = ubz + 1;
1294 if (ubx <=0 || uby <=0 || ubz <= 0 ||
1296 Error(
"Interpolate",
"Cannot interpolate outside histogram domain.");
1315 Double_t i1 = v[0] * (1 - zd) + v[1] * zd;
1316 Double_t i2 = v[2] * (1 - zd) + v[3] * zd;
1317 Double_t j1 = v[4] * (1 - zd) + v[5] * zd;
1318 Double_t j2 = v[6] * (1 - zd) + v[7] * zd;
1321 Double_t w1 = i1 * (1 - yd) + i2 * yd;
1322 Double_t w2 = j1 * (1 - yd) + j2 * yd;
1358 if (h2 == 0)
return 0;
1374 Error(
"KolmogorovTest",
"Histograms must be 3-D\n");
1380 Error(
"KolmogorovTest",
"Number of channels in X is different, %d and %d\n",ncx1,ncx2);
1384 Error(
"KolmogorovTest",
"Number of channels in Y is different, %d and %d\n",ncy1,ncy2);
1388 Error(
"KolmogorovTest",
"Number of channels in Z is different, %d and %d\n",ncz1,ncz2);
1398 if (diff1 > difprec || diff2 > difprec) {
1399 Error(
"KolmogorovTest",
"histograms with different binning along X");
1404 if (diff1 > difprec || diff2 > difprec) {
1405 Error(
"KolmogorovTest",
"histograms with different binning along Y");
1410 if (diff1 > difprec || diff2 > difprec) {
1411 Error(
"KolmogorovTest",
"histograms with different binning along Z");
1416 Int_t ibeg = 1, jbeg = 1, kbeg = 1;
1417 Int_t iend = ncx1, jend = ncy1, kend = ncz1;
1418 if (opt.
Contains(
"U")) {ibeg = 0; jbeg = 0; kbeg = 0;}
1419 if (opt.
Contains(
"O")) {iend = ncx1+1; jend = ncy1+1; kend = ncz1+1;}
1426 for (i = ibeg; i <= iend; i++) {
1427 for (j = jbeg; j <= jend; j++) {
1428 for (k = kbeg; k <= kend; k++) {
1443 Error(
"KolmogorovTest",
"Integral is zero for h1=%s\n",h1->
GetName());
1447 Error(
"KolmogorovTest",
"Integral is zero for h2=%s\n",h2->
GetName());
1455 esum1 = sum1 * sum1 / w1;
1460 esum2 = sum2 * sum2 / w2;
1464 if (afunc2 && afunc1) {
1465 Error(
"KolmogorovTest",
"Errors are zero for both histograms\n");
1471 int order[3] = {0,1,2};
1475 binbeg[0] = ibeg; binbeg[1] = jbeg; binbeg[2] = kbeg;
1476 binend[0] = iend; binend[1] = jend; binend[2] = kend;
1485 for (i = binbeg[order[0] ]; i <= binend[order[0] ]; i++) {
1486 for ( j = binbeg[order[1] ]; j <= binend[order[1] ]; j++) {
1487 for ( k = binbeg[order[2] ]; k <= binend[order[2] ]; k++) {
1488 ibin[ order[0] ] = i;
1489 ibin[ order[1] ] = j;
1490 ibin[ order[2] ] = k;
1491 bin = h1->
GetBin(ibin[0],ibin[1],ibin[2]);
1498 vdfmax[icomb] = dmax;
1517 if (opt.
Contains(
"N") && !(afunc1 || afunc2 ) ) {
1521 Double_t chi2 = d12*d12/(esum1+esum2);
1524 if (prb > 0 && prb2 > 0) prb = prb*prb2*(1-
TMath::Log(prb*prb2));
1530 printf(
" Kolmo Prob h1 = %s, sum1=%g\n",h1->
GetName(),sum1);
1531 printf(
" Kolmo Prob h2 = %s, sum2=%g\n",h2->
GetName(),sum2);
1532 printf(
" Kolmo Probabil = %f, Max Dist = %g\n",prb,dfmax);
1534 printf(
" Kolmo Probabil = %f for shape alone, =%f for normalisation alone\n",prb1,prb2);
1540 if (opt.
Contains(
"M"))
return dfmax;
1562 if (!list)
return 0;
1583 allHaveLimits = allHaveLimits && hasLimits;
1590 if (firstHistWithLimits ) {
1606 firstHistWithLimits =
kFALSE;
1609 if (!initialLimitsFound) {
1612 initialLimitsFound =
kTRUE;
1624 Error(
"Merge",
"Cannot merge histograms - limits are inconsistent:\n "
1625 "first: (%d, %f, %f), second: (%d, %f, %f)",
1635 Error(
"Merge",
"Cannot merge histograms - limits are inconsistent:\n "
1636 "first: (%d, %f, %f), second: (%d, %f, %f)",
1646 Error(
"Merge",
"Cannot merge histograms - limits are inconsistent:\n "
1647 "first: (%d, %f, %f), second: (%d, %f, %f)",
1654 allSameLimits = sameLimitsX && sameLimitsY && sameLimitsZ;
1657 }
while ( ( h = dynamic_cast<TH3*> (
next() ) ) !=
NULL );
1658 if (!h && (*next) ) {
1659 Error(
"Merge",
"Attempt to merge object of class: %s to a %s",
1660 (*next)->ClassName(),this->
ClassName());
1670 if (!allSameLimits) {
1685 if (!allSameLimits && initialLimitsFound) {
1708 if (!allHaveLimits) {
1710 while ( (h = dynamic_cast<TH3*> (
next())) ) {
1714 for (
Int_t i = 0; i < nbentries; i++)
1721 if (!initialLimitsFound) {
1733 for (
Int_t i=0;i<
kNstat;i++) {totstats[i] = stats[i] = 0;}
1736 Int_t binx, biny, binz, ix, iy, iz,
nx,
ny, nz, bin, ibin;
1754 totstats[i] += stats[i];
1755 nentries += histEntries;
1763 for (binz = 0; binz <= nz + 1; binz++) {
1768 for (biny = 0; biny <= ny + 1; biny++) {
1774 for (binx = 0; binx <= nx + 1; binx++) {
1775 bin = binx +(nx+2)*(biny + (ny+2)*binz);
1776 cu = h->RetrieveBinContent(bin);
1777 if (!allSameLimits) {
1779 if (cu != 0 && ( (!sameLimitsX && (binx == 0 || binx == nx+1)) || (!sameLimitsY && (biny == 0 || biny == ny+1)) || (!sameLimitsZ && (binz == 0 || binz == nz+1)))) {
1780 Error(
"Merge",
"Cannot merge histograms - the histograms have"
1781 " different limits and undeflows/overflows are present."
1782 " The initial histogram is now broken!");
1792 ibin = ix +(nbix+2)*(iy + (nbiy+2)*iz);
1793 if (ibin <0)
continue;
1929 const_cast<TAxis*
>(axis1)->SetRange(imin1,imax1);
1930 const_cast<TAxis*
>(axis2)->SetRange(imin2,imax2);
1934 computeErrors =
kTRUE;
1939 originalRange =
kTRUE;
1943 TH1D *
h1 =
DoProject1D(name, title, projAxis, computeErrors, originalRange,
true,
true);
1955 if (!
gPad || !
gPad->FindObject(h1)) {
1960 if (padsav) padsav->
cd();
1967 bool computeErrors,
bool originalRange,
1968 bool useUF,
bool useOF)
const
1987 Error(
"DoProject1D",
"Histogram with name %s must be a TH1D and is a %s",name,h1obj->
ClassName());
1994 if ( originalRange )
1996 if (bins->
fN == 0) {
2002 if (bins->
fN == 0) {
2012 if ( originalRange )
2014 if (bins->
fN == 0) {
2020 if (bins->
fN == 0) {
2023 h1 =
new TH1D(name,title,nx,&bins->
fArray[ixmin-1]);
2046 if ( computeErrors ) h1->
Sumw2();
2049 const TAxis* out1 = 0;
2050 const TAxis* out2 = 0;
2054 }
else if ( projX ==
GetYaxis() ) {
2062 Int_t *refX = 0, *refY = 0, *refZ = 0;
2063 Int_t ixbin, out1bin, out2bin;
2064 if ( projX ==
GetXaxis() ) { refX = &ixbin; refY = &out1bin; refZ = &out2bin; }
2065 if ( projX ==
GetYaxis() ) { refX = &out2bin; refY = &ixbin; refZ = &out1bin; }
2066 if ( projX ==
GetZaxis() ) { refX = &out2bin; refY = &out1bin; refZ = &ixbin; }
2067 R__ASSERT (refX != 0 && refY != 0 && refZ != 0);
2086 for (ixbin=0;ixbin<=1+projX->
GetNbins();ixbin++) {
2093 for (out1bin = out1min; out1bin <= out1max; out1bin++) {
2094 for (out2bin = out2min; out2bin <= out2max; out2bin++) {
2099 cont += RetrieveBinContent(bin);
2100 if (computeErrors) {
2118 bool resetStats =
true;
2119 double eps = 1.E-12;
2123 bool resetEntries = resetStats;
2125 resetEntries |= !useUF || !useOF;
2132 stats[2] = stats[4];
2133 stats[3] = stats[5];
2136 stats[2] = stats[7];
2137 stats[3] = stats[8];
2166 bool computeErrors,
bool originalRange,
2167 bool useUF,
bool useOF)
const
2176 if (ixmin == 0 && ixmax == 0) { ixmin = 1; ixmax = projX->
GetNbins(); }
2177 if (iymin == 0 && iymax == 0) { iymin = 1; iymax = projY->
GetNbins(); }
2187 Error(
"DoProject2D",
"Histogram with name %s must be a TH2D and is a %s",name,h2obj->
ClassName());
2195 if ( originalRange ) {
2217 if ( originalRange )
2219 if (xbins->
fN == 0 && ybins->
fN == 0) {
2222 }
else if (ybins->
fN == 0) {
2225 }
else if (xbins->
fN == 0) {
2232 if (xbins->
fN == 0 && ybins->
fN == 0) {
2235 }
else if (ybins->
fN == 0) {
2238 }
else if (xbins->
fN == 0) {
2239 h2 =
new TH2D(name,title,ny,&ybins->
fArray[iymin-1]
2242 h2 =
new TH2D(name,title,ny,&ybins->
fArray[iymin-1],nx,&xbins->
fArray[ixmin-1]);
2279 if ( computeErrors) h2->
Sumw2();
2291 Int_t *refX = 0, *refY = 0, *refZ = 0;
2292 Int_t ixbin, iybin, outbin;
2293 if ( projX ==
GetXaxis() && projY ==
GetYaxis() ) { refX = &ixbin; refY = &iybin; refZ = &outbin; }
2294 if ( projX ==
GetYaxis() && projY ==
GetXaxis() ) { refX = &iybin; refY = &ixbin; refZ = &outbin; }
2295 if ( projX ==
GetXaxis() && projY ==
GetZaxis() ) { refX = &ixbin; refY = &outbin; refZ = &iybin; }
2296 if ( projX ==
GetZaxis() && projY ==
GetXaxis() ) { refX = &iybin; refY = &outbin; refZ = &ixbin; }
2297 if ( projX ==
GetYaxis() && projY ==
GetZaxis() ) { refX = &outbin; refY = &ixbin; refZ = &iybin; }
2298 if ( projX ==
GetZaxis() && projY ==
GetYaxis() ) { refX = &outbin; refY = &iybin; refZ = &ixbin; }
2299 R__ASSERT (refX != 0 && refY != 0 && refZ != 0);
2308 if (outmin == 0 && outmax == 0) { outmin = 1; outmax = out->
GetNbins(); }
2313 for (ixbin=0;ixbin<=1+projX->
GetNbins();ixbin++) {
2317 for (iybin=0;iybin<=1+projY->
GetNbins();iybin++) {
2325 for (outbin = outmin; outbin <= outmax; outbin++) {
2330 cont += RetrieveBinContent(bin);
2331 if (computeErrors) {
2349 bool resetStats =
true;
2350 double eps = 1.E-12;
2354 bool resetEntries = resetStats;
2356 resetEntries |= !useUF || !useOF;
2361 for (
Int_t i = 0; i <
kNstat; ++i) { oldst[i] = 0; }
2363 std::copy(oldst,oldst+kNstat,stats);
2367 stats[4] = oldst[7];
2368 stats[5] = oldst[8];
2369 stats[6] = oldst[9];
2372 stats[2] = oldst[4];
2373 stats[3] = oldst[5];
2375 stats[4] = oldst[2];
2376 stats[5] = oldst[3];
2379 stats[4] = oldst[7];
2380 stats[5] = oldst[8];
2381 stats[6] = oldst[10];
2385 stats[2] = oldst[7];
2386 stats[3] = oldst[8];
2388 stats[4] = oldst[2];
2389 stats[5] = oldst[3];
2390 stats[6] = oldst[9];
2393 stats[4] = oldst[4];
2394 stats[5] = oldst[5];
2395 stats[6] = oldst[10];
2410 if (!computeErrors) entries =
TMath::Floor( entries + 0.5);
2473 if (opt.
Contains(
"x")) { pcase = 1; ptype =
"x"; }
2474 if (opt.
Contains(
"y")) { pcase = 2; ptype =
"y"; }
2475 if (opt.
Contains(
"z")) { pcase = 3; ptype =
"z"; }
2476 if (opt.
Contains(
"xy")) { pcase = 4; ptype =
"xy"; }
2477 if (opt.
Contains(
"yx")) { pcase = 5; ptype =
"yx"; }
2478 if (opt.
Contains(
"xz")) { pcase = 6; ptype =
"xz"; }
2479 if (opt.
Contains(
"zx")) { pcase = 7; ptype =
"zx"; }
2480 if (opt.
Contains(
"yz")) { pcase = 8; ptype =
"yz"; }
2481 if (opt.
Contains(
"zy")) { pcase = 9; ptype =
"zy"; }
2484 Error(
"Project3D",
"No projection axis specified - return a NULL pointer");
2491 computeErrors =
kTRUE;
2508 originalRange =
kTRUE;
2518 name +=
"_"; name += opt;
2519 title +=
" "; title += ptype; title +=
" projection";
2525 computeErrors, originalRange, useUF, useOF);
2531 computeErrors, originalRange, useUF, useOF);
2537 computeErrors, originalRange, useUF, useOF);
2543 computeErrors, originalRange, useUF, useOF);
2549 computeErrors, originalRange, useUF, useOF);
2555 computeErrors, originalRange, useUF, useOF);
2561 computeErrors, originalRange, useUF, useOF);
2567 computeErrors, originalRange, useUF, useOF);
2573 computeErrors, originalRange, useUF, useOF);
2584 if (!
gPad || !
gPad->FindObject(h)) {
2589 if (padsav) padsav->
cd();
2607 if (useWeights && binSumw2.
fN <= 0) useWeights =
false;
2614 if (outBin <0)
return;
2616 if ( useWeights ) tmp = binSumw2.
fArray[outBin];
2617 p2->
Fill( u , v, w, cont);
2627 bool originalRange,
bool useUF,
bool useOF)
const
2634 if (ixmin == 0 && ixmax == 0) { ixmin = 1; ixmax = projX->
GetNbins(); }
2635 if (iymin == 0 && iymax == 0) { iymin = 1; iymax = projY->
GetNbins(); }
2647 Error(
"DoProjectProfile2D",
"Histogram with name %s must be a TProfile2D and is a %s",name,p2obj->
ClassName());
2655 if ( originalRange ) {
2676 if ( originalRange ) {
2677 if (xbins->
fN == 0 && ybins->
fN == 0) {
2680 }
else if (ybins->
fN == 0) {
2683 }
else if (xbins->
fN == 0) {
2690 if (xbins->
fN == 0 && ybins->
fN == 0) {
2693 }
else if (ybins->
fN == 0) {
2696 }
else if (xbins->
fN == 0) {
2706 const TAxis* outAxis = 0;
2717 if (useWeights ) p2->
Sumw2();
2720 Int_t *refX = 0, *refY = 0, *refZ = 0;
2721 Int_t ixbin, iybin, outbin;
2722 if ( projX ==
GetXaxis() && projY ==
GetYaxis() ) { refX = &ixbin; refY = &iybin; refZ = &outbin; }
2723 if ( projX ==
GetYaxis() && projY ==
GetXaxis() ) { refX = &iybin; refY = &ixbin; refZ = &outbin; }
2724 if ( projX ==
GetXaxis() && projY ==
GetZaxis() ) { refX = &ixbin; refY = &outbin; refZ = &iybin; }
2725 if ( projX ==
GetZaxis() && projY ==
GetXaxis() ) { refX = &iybin; refY = &outbin; refZ = &ixbin; }
2726 if ( projX ==
GetYaxis() && projY ==
GetZaxis() ) { refX = &outbin; refY = &ixbin; refZ = &iybin; }
2727 if ( projX ==
GetZaxis() && projY ==
GetYaxis() ) { refX = &outbin; refY = &iybin; refZ = &ixbin; }
2728 R__ASSERT (refX != 0 && refY != 0 && refZ != 0);
2733 if (outmin == 0 && outmax == 0) { outmin = 1; outmax = outAxis->
GetNbins(); }
2739 if (useWeights && binSumw2.
fN <= 0) useWeights =
false;
2743 for (ixbin=0;ixbin<=1+projX->
GetNbins();ixbin++) {
2745 for ( iybin=0;iybin<=1+projY->
GetNbins();iybin++) {
2750 if (poutBin <0)
continue;
2752 for (outbin = outmin; outbin <= outmax; outbin++) {
2758 Double_t cont = RetrieveBinContent(bin);
2759 if (!cont)
continue;
2763 if ( useWeights ) tmp = binSumw2.
fArray[poutBin];
2773 bool resetStats =
true;
2784 if (!useWeights) entries =
TMath::Floor( entries + 0.5);
2838 if (opt.
Contains(
"xy")) { pcase = 4; ptype =
"xy"; }
2839 if (opt.
Contains(
"yx")) { pcase = 5; ptype =
"yx"; }
2840 if (opt.
Contains(
"xz")) { pcase = 6; ptype =
"xz"; }
2841 if (opt.
Contains(
"zx")) { pcase = 7; ptype =
"zx"; }
2842 if (opt.
Contains(
"yz")) { pcase = 8; ptype =
"yz"; }
2843 if (opt.
Contains(
"zy")) { pcase = 9; ptype =
"zy"; }
2846 Error(
"Project3D",
"No projection axis specified - return a NULL pointer");
2864 originalRange =
kTRUE;
2872 name +=
"_p"; name += opt;
2873 title +=
" profile "; title += ptype; title +=
" projection";
2935 return Rebin3D(ngroup, 1, 1, newname);
2945 return Rebin3D(1, ngroup, 1, newname);
2955 return Rebin3D(1, 1, ngroup, newname);
2986 Int_t i,j,k,xbin,ybin,zbin;
2996 if ((nxgroup <= 0) || (nxgroup > nxbins)) {
2997 Error(
"Rebin",
"Illegal value of nxgroup=%d",nxgroup);
3000 if ((nygroup <= 0) || (nygroup > nybins)) {
3001 Error(
"Rebin",
"Illegal value of nygroup=%d",nygroup);
3004 if ((nzgroup <= 0) || (nzgroup > nzbins)) {
3005 Error(
"Rebin",
"Illegal value of nzgroup=%d",nzgroup);
3009 Int_t newxbins = nxbins/nxgroup;
3010 Int_t newybins = nybins/nygroup;
3011 Int_t newzbins = nzbins/nzgroup;
3017 oldBins[ibin] = RetrieveBinContent(ibin);
3029 if (newname && strlen(newname)) {
3037 bool resetStat =
false;
3041 if (newxbins*nxgroup != nxbins) {
3045 if (newybins*nygroup != nybins) {
3049 if (newzbins*nzgroup != nzbins) {
3091 if (nxgroup != 1 || nygroup != 1 || nzgroup != 1) {
3100 hnew->
SetBins(newxbins,xbins, newybins, ybins, newzbins, zbins);
3105 hnew->
SetBins(newxbins, xmin, xmax, newybins, ymin, ymax, newzbins, zmin, zmax);
3113 for (xbin = 1; xbin <= newxbins; xbin++) {
3116 for (ybin = 1; ybin <= newybins; ybin++) {
3118 for (zbin = 1; zbin <= newzbins; zbin++) {
3121 for (i = 0; i < nxgroup; i++) {
3122 if (oldxbin+i > nxbins)
break;
3123 for (j =0; j < nygroup; j++) {
3124 if (oldybin+j > nybins)
break;
3125 for (k =0; k < nzgroup; k++) {
3126 if (oldzbin+k > nzbins)
break;
3128 bin = oldxbin + i + (oldybin + j)*(nxbins + 2) + (oldzbin + k)*(nxbins + 2)*(nybins + 2);
3129 binContent += oldBins[bin];
3130 if (oldSumw2) binSumw2 += oldSumw2[bin];
3145 for (
Int_t xover = 0; xover <= 1; xover++) {
3146 for (
Int_t yover = 0; yover <= 1; yover++) {
3147 for (
Int_t zover = 0; zover <= 1; zover++) {
3151 for (xbin = xover*oldxbin; xbin <= xover*(nxbins+1); xbin++) {
3152 for (ybin = yover*oldybin; ybin <= yover*(nybins+1); ybin++) {
3153 for (zbin = zover*oldzbin; zbin <= zover*(nzbins+1); zbin++) {
3154 bin =
GetBin(xbin,ybin,zbin);
3155 binContent += oldBins[bin];
3156 if (oldSumw2) binSumw2 += oldSumw2[bin];
3161 yover*(newybins+1), zover*(newzbins+1) );
3168 Double_t binContent0, binContent2, binContent3, binContent4;
3169 Double_t binError0, binError2, binError3, binError4;
3170 Int_t oldxbin2, oldybin2, oldzbin2;
3171 Int_t ufbin, ofbin, ofbin2, ofbin3, ofbin4;
3177 for (xbin = 1; xbin<=newxbins; xbin++) {
3179 for (zbin = 1; zbin<=newzbins; zbin++) {
3180 binContent0 = binContent2 = 0;
3181 binError0 = binError2 = 0;
3182 for (i=0; i<nxgroup; i++) {
3183 if (oldxbin2+i > nxbins)
break;
3184 for (k=0; k<nzgroup; k++) {
3185 if (oldzbin2+k > nzbins)
break;
3187 ufbin = oldxbin2 + i + (nxbins+2)*(nybins+2)*(oldzbin2+k);
3188 binContent0 += oldBins[ufbin];
3189 if (oldSumw2) binError0 += oldSumw2[ufbin];
3190 for (ybin = oldybin; ybin <= nybins + 1; ybin++) {
3192 ofbin = ufbin + ybin*(nxbins+2);
3193 binContent2 += oldBins[ofbin];
3194 if (oldSumw2) binError2 += oldSumw2[ofbin];
3204 oldzbin2 += nzgroup;
3206 oldxbin2 += nxgroup;
3213 for (ybin = 1; ybin<=newybins; ybin++) {
3215 for (zbin = 1; zbin<=newzbins; zbin++) {
3216 binContent0 = binContent2 = 0;
3217 binError0 = binError2 = 0;
3218 for (j=0; j<nygroup; j++) {
3219 if (oldybin2+j > nybins)
break;
3220 for (k=0; k<nzgroup; k++) {
3221 if (oldzbin2+k > nzbins)
break;
3223 ufbin = (oldybin2 + j)*(nxbins+2) + (nxbins+2)*(nybins+2)*(oldzbin2+k);
3224 binContent0 += oldBins[ufbin];
3225 if (oldSumw2) binError0 += oldSumw2[ufbin];
3226 for (xbin = oldxbin; xbin <= nxbins + 1; xbin++) {
3228 ofbin = ufbin + xbin;
3229 binContent2 += oldBins[ofbin];
3230 if (oldSumw2) binError2 += oldSumw2[ofbin];
3240 oldzbin2 += nzgroup;
3242 oldybin2 += nygroup;
3249 for (xbin = 1; xbin<=newxbins; xbin++) {
3251 for (ybin = 1; ybin<=newybins; ybin++) {
3252 binContent0 = binContent2 = 0;
3253 binError0 = binError2 = 0;
3254 for (i=0; i<nxgroup; i++) {
3255 if (oldxbin2+i > nxbins)
break;
3256 for (j=0; j<nygroup; j++) {
3257 if (oldybin2+j > nybins)
break;
3259 ufbin = oldxbin2 + i + (nxbins+2)*(oldybin2+j);
3260 binContent0 += oldBins[ufbin];
3261 if (oldSumw2) binError0 += oldSumw2[ufbin];
3262 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3264 ofbin = ufbin + (nxbins+2)*(nybins+2)*zbin;
3265 binContent2 += oldBins[ofbin];
3266 if (oldSumw2) binError2 += oldSumw2[ofbin];
3276 oldybin2 += nygroup;
3278 oldxbin2 += nxgroup;
3285 for (xbin = 1; xbin<=newxbins; xbin++) {
3294 for (i=0; i<nxgroup; i++) {
3295 if (oldxbin2+i > nxbins)
break;
3296 ufbin = oldxbin2 + i;
3297 binContent0 += oldBins[ufbin];
3298 if (oldSumw2) binError0 += oldSumw2[ufbin];
3299 for (ybin = oldybin; ybin <= nybins + 1; ybin++) {
3300 ofbin3 = ufbin+ybin*(nxbins+2);
3301 binContent3 += oldBins[ ofbin3 ];
3302 if (oldSumw2) binError3 += oldSumw2[ofbin3];
3303 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3305 ofbin4 = oldxbin2 + i + ybin*(nxbins+2) + (nxbins+2)*(nybins+2)*zbin;
3306 binContent4 += oldBins[ofbin4];
3307 if (oldSumw2) binError4 += oldSumw2[ofbin4];
3310 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3311 ofbin2 = ufbin+zbin*(nxbins+2)*(nybins+2);
3312 binContent2 += oldBins[ ofbin2 ];
3313 if (oldSumw2) binError2 += oldSumw2[ofbin2];
3319 hnew->
SetBinContent(xbin,newybins+1,newzbins+1,binContent4);
3326 oldxbin2 += nxgroup;
3333 for (zbin = 1; zbin<=newzbins; zbin++) {
3342 for (i=0; i<nzgroup; i++) {
3343 if (oldzbin2+i > nzbins)
break;
3344 ufbin = (oldzbin2 + i)*(nxbins+2)*(nybins+2);
3345 binContent0 += oldBins[ufbin];
3346 if (oldSumw2) binError0 += oldSumw2[ufbin];
3347 for (ybin = oldybin; ybin <= nybins + 1; ybin++) {
3348 ofbin3 = ufbin+ybin*(nxbins+2);
3349 binContent3 += oldBins[ ofbin3 ];
3350 if (oldSumw2) binError3 += oldSumw2[ofbin3];
3351 for (xbin = oldxbin; xbin <= nxbins + 1; xbin++) {
3353 ofbin4 = ufbin + xbin + ybin*(nxbins+2);
3354 binContent4 += oldBins[ofbin4];
3355 if (oldSumw2) binError4 += oldSumw2[ofbin4];
3358 for (xbin = oldxbin; xbin <= nxbins + 1; xbin++) {
3359 ofbin2 = xbin +(oldzbin2+i)*(nxbins+2)*(nybins+2);
3360 binContent2 += oldBins[ ofbin2 ];
3361 if (oldSumw2) binError2 += oldSumw2[ofbin2];
3367 hnew->
SetBinContent(newxbins+1,newybins+1,zbin,binContent4);
3374 oldzbin2 += nzgroup;
3381 for (ybin = 1; ybin<=newybins; ybin++) {
3390 for (i=0; i<nygroup; i++) {
3391 if (oldybin2+i > nybins)
break;
3392 ufbin = (oldybin2 + i)*(nxbins+2);
3393 binContent0 += oldBins[ufbin];
3394 if (oldSumw2) binError0 += oldSumw2[ufbin];
3395 for (xbin = oldxbin; xbin <= nxbins + 1; xbin++) {
3396 ofbin3 = ufbin+xbin;
3397 binContent3 += oldBins[ ofbin3 ];
3398 if (oldSumw2) binError3 += oldSumw2[ofbin3];
3399 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3401 ofbin4 = xbin + (nxbins+2)*(nybins+2)*zbin+(oldybin2+i)*(nxbins+2);
3402 binContent4 += oldBins[ofbin4];
3403 if (oldSumw2) binError4 += oldSumw2[ofbin4];
3406 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3407 ofbin2 = (oldybin2+i)*(nxbins+2)+zbin*(nxbins+2)*(nybins+2);
3408 binContent2 += oldBins[ ofbin2 ];
3409 if (oldSumw2) binError2 += oldSumw2[ofbin2];
3415 hnew->
SetBinContent(newxbins+1,ybin,newzbins+1,binContent4);
3422 oldybin2 += nygroup;
3465 if (!resetStat) hnew->
PutStats(stat);
3468 if (oldSumw2)
delete [] oldSumw2;
3499 if (bin < 0)
return;
3508 void TH3::Streamer(
TBuffer &R__b)
3518 TH1::Streamer(R__b);
3519 TAtt3D::Streamer(R__b);
3543 if (fgDefaultSumw2) Sumw2();
3561 :
TH3(name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
3576 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
3589 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
3620 if (newval > -128 && newval < 128) {
fArray[bin] =
Char_t(newval);
return;}
3621 if (newval < -127)
fArray[bin] = -127;
3622 if (newval > 127)
fArray[bin] = 127;
3690 void TH3C::Streamer(
TBuffer &R__b)
3703 TH1::Streamer(R__b);
3704 TArrayC::Streamer(R__b);
3706 TAtt3D::Streamer(R__b);
3708 TH3::Streamer(R__b);
3709 TArrayC::Streamer(R__b);
3725 if (
this != &h1) ((
TH3C&)h1).
Copy(*
this);
3804 if (fgDefaultSumw2) Sumw2();
3822 :
TH3(name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
3837 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
3850 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
3881 if (newval > -32768 && newval < 32768) {
fArray[bin] =
Short_t(newval);
return;}
3882 if (newval < -32767)
fArray[bin] = -32767;
3883 if (newval > 32767)
fArray[bin] = 32767;
3922 void TH3S::Streamer(
TBuffer &R__b)
3935 TH1::Streamer(R__b);
3936 TArrayS::Streamer(R__b);
3938 TAtt3D::Streamer(R__b);
3940 TH3::Streamer(R__b);
3941 TArrayS::Streamer(R__b);
3957 if (
this != &h1) ((
TH3S&)h1).
Copy(*
this);
4036 if (fgDefaultSumw2) Sumw2();
4054 :
TH3(name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
4069 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4082 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4113 if (newval > -2147483647 && newval < 2147483647) {
fArray[bin] =
Int_t(newval);
return;}
4114 if (newval < -2147483647)
fArray[bin] = -2147483647;
4115 if (newval > 2147483647)
fArray[bin] = 2147483647;
4156 if (
this != &h1) ((
TH3I&)h1).
Copy(*
this);
4235 if (fgDefaultSumw2) Sumw2();
4253 :
TH3(name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
4268 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4281 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4332 void TH3F::Streamer(
TBuffer &R__b)
4345 TH1::Streamer(R__b);
4346 TArrayF::Streamer(R__b);
4348 TAtt3D::Streamer(R__b);
4350 TH3::Streamer(R__b);
4351 TArrayF::Streamer(R__b);
4367 if (
this != &h1) ((
TH3F&)h1).
Copy(*
this);
4446 if (fgDefaultSumw2) Sumw2();
4464 :
TH3(name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
4479 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4492 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4543 void TH3D::Streamer(
TBuffer &R__b)
4556 TH1::Streamer(R__b);
4557 TArrayD::Streamer(R__b);
4559 TAtt3D::Streamer(R__b);
4561 TH3::Streamer(R__b);
4562 TArrayD::Streamer(R__b);
4578 if (
this != &h1) ((
TH3D&)h1).
Copy(*
this);
TObject * GetParent() const
Return pointer to parent of this buffer.
Int_t GetFirst() const
Return first bin on the axis i.e.
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title Offset is a correction factor with respect to the "s...
virtual const char * GetTitle() const
Returns title of object.
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
Return Global bin number corresponding to x,y,z.
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
virtual Color_t GetAxisColor() const
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
virtual void Paint(Option_t *option="")
Control routine to paint any kind of histograms.
virtual void SetParameters(const Double_t *params)
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual Color_t GetLabelColor() const
Double_t Floor(Double_t x)
void Set(Int_t n)
Set size of this array to n chars.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
virtual TH3 * RebinX(Int_t ngroup=2, const char *newname="")
Rebin only the X axis see Rebin3D.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Sumw2(Bool_t flag=kTRUE)
Create/Delete structure to store sum of squares of weights per bin This is needed to compute the corr...
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
static Bool_t fgDefaultSumw2
flag to use under/overflows in statistics
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
TVirtualHistPainter * GetPainter(Option_t *option="")
return pointer to painter if painter does not exist, it is created
Collectable string class.
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
virtual Double_t Rndm(Int_t i=0)
Machine independent random number generator.
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
3-D histogram with a float per channel (see TH1 documentation)}
Double_t KolmogorovProb(Double_t z)
Calculates the Kolmogorov distribution function, Begin_Html.
virtual Int_t GetNumberFitPoints() const
virtual const char * GetParName(Int_t ipar) const
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
virtual Int_t GetDimension() const
virtual void SetBins(Int_t nx, Double_t xmin, Double_t xmax)
Redefine x axis parameters.
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...
static Bool_t fgStatOverflows
flag to add histograms to the directory
static Bool_t SameLimitsAndNBins(const TAxis &axis1, const TAxis &axis2)
Same limits and bins.
virtual void SetLabelColor(Color_t color=1, Float_t alpha=1.)
Set color of labels.
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 SetNdivisions(Int_t n=510, Bool_t optim=kTRUE)
Set the number of divisions for this axis.
virtual void SetRange(Double_t xmin, Double_t xmax)
Initialize the upper and lower bounds to draw the function.
virtual void AddFirst(TObject *obj)
Add object at the beginning of the list.
Use this attribute class when an object should have 3D capabilities.
void ToUpper()
Change string to upper case.
TH3S & operator=(const TH3S &h1)
Operator =.
Buffer base class used for serializing objects.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
static THLimitsFinder * GetLimitsFinder()
Return pointer to the current finder.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual ~TH3D()
Destructor.
void Copy(TArrayS &array) const
Array of floats (32 bits per element).
virtual void SetTitleFont(Style_t font=62)
Set the title font.
void ToLower()
Change string to lower-case.
virtual Double_t GetParError(Int_t ipar) const
Return value of parameter number ipar.
virtual Color_t GetTitleColor() const
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
virtual Style_t GetTitleFont() const
virtual void Copy(TObject &hnew) const
Copy.
virtual Int_t GetNbinsX() const
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...
const TKDTreeBinning * bins
void Copy(TArrayD &array) const
virtual Int_t FindGoodLimits(TH1 *h, Double_t xmin, Double_t xmax)
compute the best axis limits for the X axis.
static Bool_t RecomputeAxisLimits(TAxis &destAxis, const TAxis &anAxis)
Finds new limits for the axis for the Merge function.
virtual Double_t GetEntries() const
return the current number of entries
virtual Bool_t Multiply(TF1 *h1, Double_t c1=1)
Performs the operation: this = this*c1*f1 if errors are defined (see TH1::Sumw2), errors are also rec...
virtual Float_t GetTitleSize() const
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,lastz] for which diff = abs(cell_content-c) <= maxdiff In case several cells in the specified range with diff=0 are found the first cell found is returned in binx,biny,binz.
virtual void SetLabelOffset(Float_t offset=0.005)
Set distance between the axis and the labels The distance is expressed in per cent of the pad width...
TH3C operator-(TH3C &h1, TH3C &h2)
Operator -.
virtual TVirtualPad * cd(Int_t subpadnumber=0)=0
virtual Int_t BufferFill(Double_t x, Double_t y, Double_t z, Double_t w)
accumulate arguments in buffer.
TH1 * Project3D(Option_t *option="x") const
Project a 3-d histogram into 1 or 2-d histograms depending on the option parameter option may contain...
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...
Array of integers (32 bits per element).
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void SetBuffer(Int_t buffersize, Option_t *option="")
set the maximum number of entries to be kept in the buffer
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
virtual void SetLabelFont(Style_t font=62)
Set labels' font.
const char * Data() const
Int_t Fill(const Double_t *v)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
Double_t GetChisquare() const
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
virtual Int_t GetVersionOwner() const =0
virtual Bool_t IsEmpty() const
virtual TH3 * RebinY(Int_t ngroup=2, const char *newname="")
Rebin only the Y axis see Rebin3D.
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...
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
virtual void AddAll(const TCollection *col)
static double p2(double t, double a, double b, double c)
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 void SetMarkerColor(Color_t mcolor=1)
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 void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
ClassImp(TH3C) TH3C
Constructor.
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
virtual void ResetStats()
Reset the statistics including the number of entries and replace with values calculates from bin cont...
TVirtualPad is an abstract base class for the Pad and Canvas classes.
void Set(Int_t n)
Set size of this array to n ints.
virtual void Reset(Option_t *option="")
Reset.
virtual void SetBinError(Int_t bin, Double_t error)
see convention for numbering bins in TH1::GetBin
virtual Double_t ComputeIntegral(Bool_t onlyPositive=false)
Compute integral (cumulative sum of bins) The result stored in fIntegral is used by the GetRandom fun...
The 3-D histogram classes derived from the 1-D histogram classes.
virtual Float_t GetTitleOffset() const
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
3-D histogram with a int per channel (see TH1 documentation)}
virtual Bool_t Divide(TF1 *f1, Double_t c1=1)
Performs the operation: this = this/(c1*f1) if errors are defined (see TH1::Sumw2), errors are also recalculated.
virtual ~TH3I()
Destructor.
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
virtual Double_t GetEffectiveEntries() const
number of effective entries of the histogram, neff = (Sum of weights )^2 / (Sum of weight^2 ) In case...
virtual ~TH3S()
Destructor.
void Set(Int_t n)
Set size of this array to n shorts.
virtual Double_t GetCorrelationFactor(Int_t axis1=1, Int_t axis2=2) const
Return correlation factor between axis1 and axis2.
virtual void ImportAttributes(const TAxis *axis)
Copy axis attributes to this.
virtual void ExtendAxis(Double_t x, TAxis *axis)
Histogram is resized along axis such that x is in the axis range.
void Copy(TArrayF &array) const
3-D histogram with a short per channel (see TH1 documentation)
virtual void SetLineColor(Color_t lcolor)
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
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 methdod performing the projection to 1D histogram called from TH3::Project3D ...
TH3C & operator=(const TH3C &h1)
Operator =.
virtual void SetRange(Int_t first=0, Int_t last=0)
Set the viewing range for the axis from bin first to last.
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.
Class to manage histogram axis.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
3-D histogram with a double per channel (see TH1 documentation)}
Array of shorts (16 bits per element).
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
virtual void SetFillColor(Color_t fcolor)
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
virtual Double_t GetCovariance(Int_t axis1=1, Int_t axis2=2) const
Return covariance between axis1 and axis2.
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 const char * ClassName() const
Returns name of class to which the object belongs.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
unsigned int r1[N_CITIES]
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...
Bool_t Permute(Int_t n, Int_t *a)
Simple recursive algorithm to find the permutations of n natural numbers, not necessarily all distinc...
virtual Color_t GetFillColor() const
Collection abstract base class.
static Int_t fgBufferSize
Double_t Mean(Long64_t n, const T *a, const Double_t *w=0)
void Copy(TArrayI &array) const
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
Bool_t TestBit(UInt_t f) const
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
virtual Int_t GetNbinsZ() const
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 const char * GetName() const
Returns name of object.
virtual Int_t GetSumw2N() const
virtual void SetMarkerStyle(Style_t mstyle=1)
const char * GetTitle() const
Returns title of object.
Int_t Fill(Double_t)
Invalid Fill method.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Double_t * fIntegral
Histogram dimension (1, 2 or 3 dim)
R__EXTERN TRandom * gRandom
virtual Color_t GetLineColor() const
1-D histogram with a double per channel (see TH1 documentation)}
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 The size is expressed in per cent of the pad width.
virtual void SetTitleColor(Color_t color=1)
Set color of axis title.
virtual void SetTitleSize(Float_t size=0.04)
Set size of axis title The size is expressed in per cent of the pad width.
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
virtual Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const
See comments in TH1::GetBin.
const Double_t * GetArray() const
virtual Long64_t Merge(TCollection *list)
Add all histograms in the collection to this histogram.
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
virtual void SetName(const char *name)
Change the name of this histogram.
void Copy(TArrayC &array) const
TString & Remove(Ssiz_t pos)
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
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 Int_t FindFirstBinAbove(Double_t threshold=0, Int_t axis=1) const
Find first bin with content > threshold for axis (1=x, 2=y, 3=z) if no bins with content > threshold ...
virtual void Reset(Option_t *option="")
-*Reset contents of a Profile2D histogram *-* ======================================= ...
virtual Int_t BufferEmpty(Int_t action=0)
Fill histogram with all entries in the buffer.
TH3D & operator=(const TH3D &h1)
Operator =.
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 void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
virtual void SetShowProjection(const char *option, Int_t nbins)=0
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
virtual Style_t GetLabelFont() const
virtual Int_t GetNdivisions() const
3-D histogram with a bype per channel (see TH1 documentation)
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 void SetBinLabel(Int_t bin, const char *label)
Set label for bin.
Profile2D histograms are used to display the mean value of Z and its RMS for each cell in X...
Array of doubles (64 bits per element).
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
virtual Bool_t Add(TF1 *h1, Double_t c1=1, Option_t *option="")
Performs the operation: this = this + c1*f1 if errors are defined (see TH1::Sumw2), errors are also recalculated.
Int_t GetLast() const
Return last bin on the axis i.e.
virtual Double_t GetParameter(Int_t ipar) const
virtual UInt_t SetCanExtend(UInt_t extendBitMask)
make the histogram axes extendable / not extendable according to the bit mask returns the previous bi...
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
Mother of all ROOT objects.
virtual Double_t * GetParameters() const
virtual Float_t GetLabelSize() const
virtual Int_t GetNbinsY() const
THashList * GetLabels() const
virtual Color_t GetMarkerColor() const
virtual Int_t FindLastBinAbove(Double_t threshold=0, Int_t axis=1) const
Find last bin with content > threshold for axis (1=x, 2=y, 3=z) if no bins with content > threshold i...
TVirtualHistPainter * fPainter
Integral of bins used by GetRandom.
virtual void GetStats(Double_t *stats) const
Fill the array stats from the contents of this histogram The array stats must be correctly dimensionn...
virtual ~TH3C()
Destructor.
virtual TH3 * RebinZ(Int_t ngroup=2, const char *newname="")
Rebin only the Z axis see Rebin3D.
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 cellcontents of a 3-dim hist...
virtual void Copy(TObject &hnew) const
Copy this histogram structure to newth1.
TH3C operator+(TH3C &h1, TH3C &h2)
Operator +.
Short_t Max(Short_t a, Short_t b)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual void SetBinsLength(Int_t=-1)
virtual ~TH3F()
Destructor.
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
virtual Bool_t CanExtendAllAxes() const
returns true if all axes are extendable
Int_t fDimension
Pointer to directory holding this histogram.
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length The length is expressed in per cent of the pad width.
void Set(Int_t n)
Set size of this array to n floats.
virtual void SetEntries(Double_t n)
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
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...
const TArrayD * GetXbins() const
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
virtual Double_t GetStdDev(Int_t axis=1) const
Returns the Standard Deviation (Sigma).
TH3C operator*(Float_t c1, TH3C &h1)
Operator *.
Double_t Sqrt(Double_t x)
virtual ~TH3()
Destructor.
TH3F & operator=(const TH3F &h1)
Operator =.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual void Set(Int_t nbins, Double_t xmin, Double_t xmax)
Initialize axis with fix bins.
virtual Double_t GetBinError(Int_t bin) const
Return value of error associated to bin number bin.
virtual Style_t GetMarkerStyle() const
virtual Double_t Interpolate(Double_t x)
Not yet implemented.
Int_t Fill(Double_t)
Invalid Fill method.
virtual Float_t GetTickLength() const
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
void SetBins(const Int_t *nbins, const Double_t *range)
virtual ClassDef(TH1, 7) protected void UpdateBinContent(Int_t bin, Double_t content)
raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin...
void Set(Int_t n)
Set size of this array to n doubles.
TH3C operator/(TH3C &h1, TH3C &h2)
Operator /.
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
virtual Int_t GetNpar() const
Long64_t BinarySearch(Long64_t n, const T *array, T value)
Ssiz_t First(char c) const
Find first occurrence of a character c.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual Float_t GetLabelOffset() const
2-D histogram with a double per channel (see TH1 documentation)}
Array of chars or bytes (8 bits per element).
virtual TArrayD * GetBinSumw2()
TH3I & operator=(const TH3I &h1)
Operator =.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.