66 fTsumwy = fTsumwy2 = fTsumwxy = 0;
67 fTsumwz = fTsumwz2 = fTsumwxz = fTsumwyz = 0;
77 :
TH1(name,title,nbinsx,xlow,xup),
81 if (nbinsy <= 0) {
Warning(
"TH3",
"nbinsy is <=0 - set to nbinsy = 1"); nbinsy = 1; }
82 if (nbinsz <= 0) nbinsz = 1;
85 fNcells = (nbinsx+2)*(nbinsy+2)*(nbinsz+2);
97 :
TH1(name,title,nbinsx,xbins),
101 if (nbinsy <= 0) {
Warning(
"TH3",
"nbinsy is <=0 - set to nbinsy = 1"); nbinsy = 1; }
102 if (nbinsz <= 0) nbinsz = 1;
107 fNcells = (nbinsx+2)*(nbinsy+2)*(nbinsz+2);
119 :
TH1(name,title,nbinsx,xbins),
123 if (nbinsy <= 0) {
Warning(
"TH3",
"nbinsy is <=0 - set to nbinsy = 1"); nbinsy = 1; }
124 if (nbinsz <= 0) nbinsz = 1;
129 fNcells = (nbinsx+2)*(nbinsy+2)*(nbinsz+2);
141 ((
TH3&)h).Copy(*
this);
182 if (!nbentries)
return 0;
185 if (action == 0)
return 0;
186 nbentries = -nbentries;
201 for (
Int_t i=1;i<nbentries;i++) {
203 if (x < xmin) xmin =
x;
204 if (x > xmax) xmax =
x;
206 if (y < ymin) ymin =
y;
207 if (y > ymax) ymax =
y;
209 if (z < zmin) zmin = z;
210 if (z > zmax) zmax = z;
229 for (
Int_t i=0;i<nbentries;i++) {
230 Fill(buffer[4*i+2],buffer[4*i+3],buffer[4*i+4],buffer[4*i+1]);
256 nbentries = -nbentries;
266 return Fill(x,y,z,w);
282 Error(
"Fill",
"Invalid signature - do nothing");
297 Int_t binx, biny, binz, bin;
302 if (binx <0 || biny <0 || binz<0)
return -1;
345 Int_t binx, biny, binz, bin;
350 if (binx <0 || biny <0 || binz<0)
return -1;
390 Int_t binx, biny, binz, bin;
395 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;
477 Int_t binx, biny, binz, bin;
482 if (binx <0 || biny <0 || binz<0)
return -1;
521 Int_t binx, biny, binz, bin;
526 if (binx <0 || biny <0 || binz<0)
return -1;
565 Int_t binx, biny, binz, bin;
570 if (binx <0 || biny <0 || binz<0)
return -1;
610 Int_t binx, biny, binz, bin;
615 if (binx <0 || biny <0 || binz<0)
return -1;
660 Int_t bin, binx, biny, binz, ibin, loop;
664 if (!f1) {
Error(
"FillRandom",
"Unknown function: %s",fname);
return; }
670 Int_t nxy = nbinsx*nbinsy;
676 for (binz=1;binz<=nbinsz;binz++) {
678 for (biny=1;biny<=nbinsy;biny++) {
680 for (binx=1;binx<=nbinsx;binx++) {
683 integral[ibin] = integral[ibin-1] + f1->
Eval(xv[0],xv[1],xv[2]);
689 if (integral[nbins] == 0 ) {
691 Error(
"FillRandom",
"Integral = zero");
return;
693 for (bin=1;bin<=
nbins;bin++) integral[bin] /= integral[nbins];
698 for (loop=0;loop<ntimes;loop++) {
702 biny = (ibin - nxy*binz)/nbinsx;
703 binx = 1 + ibin - nbinsx*(biny + nbinsy*binz);
729 if (!h) {
Error(
"FillRandom",
"Null histogram");
return; }
731 Error(
"FillRandom",
"Histograms with different dimensions");
return;
739 for (loop=0;loop<ntimes;loop++) {
752 if (axis < 1 || axis > 3) {
753 Warning(
"FindFirstBinAbove",
"Invalid axis number : %d, axis x assumed\n",axis);
759 Int_t binx, biny, binz;
761 for (binx=1;binx<=nbinsx;binx++) {
762 for (biny=1;biny<=nbinsy;biny++) {
763 for (binz=1;binz<=nbinsz;binz++) {
768 }
else if (axis == 2) {
769 for (biny=1;biny<=nbinsy;biny++) {
770 for (binx=1;binx<=nbinsx;binx++) {
771 for (binz=1;binz<=nbinsz;binz++) {
777 for (binz=1;binz<=nbinsz;binz++) {
778 for (binx=1;binx<=nbinsx;binx++) {
779 for (biny=1;biny<=nbinsy;biny++) {
795 if (axis < 1 || axis > 3) {
796 Warning(
"FindLastBinAbove",
"Invalid axis number : %d, axis x assumed\n",axis);
802 Int_t binx, biny, binz;
804 for (binx=nbinsx;binx>=1;binx--) {
805 for (biny=1;biny<=nbinsy;biny++) {
806 for (binz=1;binz<=nbinsz;binz++) {
811 }
else if (axis == 2) {
812 for (biny=nbinsy;biny>=1;biny--) {
813 for (binx=1;binx<=nbinsx;binx++) {
814 for (binz=1;binz<=nbinsz;binz++) {
820 for (binz=nbinsz;binz>=1;binz--) {
821 for (binx=1;binx<=nbinsx;binx++) {
822 for (biny=1;biny<=nbinsy;biny++) {
869 if (binminx < 1) binminx = 1;
870 if (binmaxx > nbinsx) binmaxx = nbinsx;
871 if (binmaxx < binminx) {binminx = 1; binmaxx = nbinsx;}
872 if (binminy < 1) binminy = 1;
873 if (binmaxy > nbinsy) binmaxy = nbinsy;
874 if (binmaxy < binminy) {binminy = 1; binmaxy = nbinsy;}
878 f1 = (
TF1*)
gROOT->GetFunction(
"gaus");
882 const char *fname = f1->
GetName();
889 char name[80], title[80];
893 for (ipar=0;ipar<npar;ipar++) {
894 snprintf(name,80,
"%s_%d",
GetName(),ipar);
895 snprintf(title,80,
"Fitted value of par[%d]=%s",ipar,f1->
GetParName(ipar));
896 if (xbins->
fN == 0) {
897 hlist[ipar] =
new TH2D(name, title,
901 hlist[ipar] =
new TH2D(name, title,
908 snprintf(name,80,
"%s_chi2",
GetName());
914 Int_t bin,binx,biny,binz;
915 for (biny=binminy;biny<=binmaxy;biny++) {
917 for (binx=binminx;binx<=binmaxx;binx++) {
921 for (binz=1;binz<=nbinsz;binz++) {
922 bin =
GetBin(binx,biny,binz);
924 if (w == 0)
continue;
929 if (nfill < cut)
continue;
931 hpz->Fit(fname,option);
933 if (npfits > npar && npfits >= cut) {
934 for (ipar=0;ipar<npar;ipar++) {
953 if (biny < 0) biny = 0;
954 if (biny > ofy) biny = ofy;
957 if (binz < 0) binz = 0;
958 if (binz > ofz) binz = ofz;
994 Error(
"GetBinWithContent3",
"function is only valid for 3-D histograms");
997 if (firstx <= 0) firstx = 1;
999 if (firsty <= 0) firsty = 1;
1001 if (firstz <= 0) firstz = 1;
1003 Int_t binminx = 0, binminy=0, binminz=0;
1005 for (
Int_t k=firstz;k<=lastz;k++) {
1006 for (
Int_t j=firsty;j<=lasty;j++) {
1007 for (
Int_t i=firstx;i<=lastx;i++) {
1009 if (diff <= 0) {binx = i; biny=j; binz=k;
return diff;}
1010 if (diff < curmax && diff <= maxdiff) {curmax = diff, binminx=i; binminy=j;binminz=k;}
1026 if (axis1 < 1 || axis2 < 1 || axis1 > 3 || axis2 > 3) {
1027 Error(
"GetCorrelationFactor",
"Wrong parameters");
1030 if (axis1 == axis2)
return 1;
1032 if (stddev1 == 0)
return 0;
1034 if (stddev2 == 0)
return 0;
1044 if (axis1 < 1 || axis2 < 1 || axis1 > 3 || axis2 > 3) {
1045 Error(
"GetCovariance",
"Wrong parameters");
1062 if (sumw == 0)
return 0;
1063 if (axis1 == 1 && axis2 == 1) {
1064 return TMath::Abs(sumwx2/sumw - sumwx*sumwx/sumw2);
1066 if (axis1 == 2 && axis2 == 2) {
1067 return TMath::Abs(sumwy2/sumw - sumwy*sumwy/sumw2);
1069 if (axis1 == 3 && axis2 == 3) {
1070 return TMath::Abs(sumwz2/sumw - sumwz*sumwz/sumw2);
1072 if ((axis1 == 1 && axis2 == 2) || (axis1 == 2 && axis2 == 1)) {
1073 return sumwxy/sumw - sumwx/sumw*sumwy/sumw;
1075 if ((axis1 == 1 && axis2 == 3) || (axis1 == 3 && axis2 == 1)) {
1076 return sumwxz/sumw - sumwx/sumw*sumwz/sumw;
1078 if ((axis1 == 2 && axis2 == 3) || (axis1 == 3 && axis2 == 2)) {
1079 return sumwyz/sumw - sumwy/sumw*sumwz/sumw;
1094 Int_t nxy = nbinsx*nbinsy;
1104 if (integral == 0 ) { x = 0; y = 0; z = 0;
return;}
1110 Int_t binz = ibin/nxy;
1111 Int_t biny = (ibin - nxy*binz)/nbinsx;
1112 Int_t binx = ibin - nbinsx*(biny + nbinsy*binz);
1140 Int_t bin, binx, biny, binz;
1144 for (bin=0;bin<9;bin++) stats[bin] = 0;
1155 if (firstBinX == 1) firstBinX = 0;
1159 if (firstBinY == 1) firstBinY = 0;
1163 if (firstBinZ == 1) firstBinZ = 0;
1167 for (binz = firstBinZ; binz <= lastBinZ; binz++) {
1169 for (biny = firstBinY; biny <= lastBinY; biny++) {
1171 for (binx = firstBinX; binx <= lastBinX; binx++) {
1172 bin =
GetBin(binx,biny,binz);
1178 stats[1] += err*err;
1232 return DoIntegral(binx1,binx2,biny1,biny2,binz1,binz2,err,option);
1248 return DoIntegral(binx1,binx2,biny1,biny2,binz1,binz2,error,option,
kTRUE);
1257 Error(
"Interpolate",
"This function must be called with 3 arguments for a TH3");
1267 Error(
"Interpolate",
"This function must be called with 3 arguments for a TH3");
1286 Int_t obx = ubx + 1;
1290 Int_t oby = uby + 1;
1294 Int_t obz = ubz + 1;
1299 if (ubx <=0 || uby <=0 || ubz <= 0 ||
1301 Error(
"Interpolate",
"Cannot interpolate outside histogram domain.");
1320 Double_t i1 = v[0] * (1 - zd) + v[1] * zd;
1321 Double_t i2 = v[2] * (1 - zd) + v[3] * zd;
1322 Double_t j1 = v[4] * (1 - zd) + v[5] * zd;
1323 Double_t j2 = v[6] * (1 - zd) + v[7] * zd;
1326 Double_t w1 = i1 * (1 - yd) + i2 * yd;
1327 Double_t w2 = j1 * (1 - yd) + j2 * yd;
1363 if (h2 == 0)
return 0;
1379 Error(
"KolmogorovTest",
"Histograms must be 3-D\n");
1385 Error(
"KolmogorovTest",
"Number of channels in X is different, %d and %d\n",ncx1,ncx2);
1389 Error(
"KolmogorovTest",
"Number of channels in Y is different, %d and %d\n",ncy1,ncy2);
1393 Error(
"KolmogorovTest",
"Number of channels in Z is different, %d and %d\n",ncz1,ncz2);
1403 if (diff1 > difprec || diff2 > difprec) {
1404 Error(
"KolmogorovTest",
"histograms with different binning along X");
1409 if (diff1 > difprec || diff2 > difprec) {
1410 Error(
"KolmogorovTest",
"histograms with different binning along Y");
1415 if (diff1 > difprec || diff2 > difprec) {
1416 Error(
"KolmogorovTest",
"histograms with different binning along Z");
1421 Int_t ibeg = 1, jbeg = 1, kbeg = 1;
1422 Int_t iend = ncx1, jend = ncy1, kend = ncz1;
1423 if (opt.
Contains(
"U")) {ibeg = 0; jbeg = 0; kbeg = 0;}
1424 if (opt.
Contains(
"O")) {iend = ncx1+1; jend = ncy1+1; kend = ncz1+1;}
1431 for (i = ibeg; i <= iend; i++) {
1432 for (j = jbeg; j <= jend; j++) {
1433 for (k = kbeg; k <= kend; k++) {
1448 Error(
"KolmogorovTest",
"Integral is zero for h1=%s\n",h1->
GetName());
1452 Error(
"KolmogorovTest",
"Integral is zero for h2=%s\n",h2->
GetName());
1460 esum1 = sum1 * sum1 / w1;
1465 esum2 = sum2 * sum2 / w2;
1469 if (afunc2 && afunc1) {
1470 Error(
"KolmogorovTest",
"Errors are zero for both histograms\n");
1476 int order[3] = {0,1,2};
1480 binbeg[0] = ibeg; binbeg[1] = jbeg; binbeg[2] = kbeg;
1481 binend[0] = iend; binend[1] = jend; binend[2] = kend;
1490 for (i = binbeg[order[0] ]; i <= binend[order[0] ]; i++) {
1491 for ( j = binbeg[order[1] ]; j <= binend[order[1] ]; j++) {
1492 for ( k = binbeg[order[2] ]; k <= binend[order[2] ]; k++) {
1493 ibin[ order[0] ] = i;
1494 ibin[ order[1] ] = j;
1495 ibin[ order[2] ] = k;
1496 bin = h1->
GetBin(ibin[0],ibin[1],ibin[2]);
1503 vdfmax[icomb] = dmax;
1522 if (opt.
Contains(
"N") && !(afunc1 || afunc2 ) ) {
1526 Double_t chi2 = d12*d12/(esum1+esum2);
1529 if (prb > 0 && prb2 > 0) prb = prb*prb2*(1-
TMath::Log(prb*prb2));
1535 printf(
" Kolmo Prob h1 = %s, sum1=%g\n",h1->
GetName(),sum1);
1536 printf(
" Kolmo Prob h2 = %s, sum2=%g\n",h2->
GetName(),sum2);
1537 printf(
" Kolmo Probabil = %f, Max Dist = %g\n",prb,dfmax);
1539 printf(
" Kolmo Probabil = %f for shape alone, =%f for normalisation alone\n",prb1,prb2);
1545 if (opt.
Contains(
"M"))
return dfmax;
1567 if (!list)
return 0;
1584 TIter next(&inlist);
1588 allHaveLimits = allHaveLimits && hasLimits;
1595 if (firstHistWithLimits ) {
1611 firstHistWithLimits =
kFALSE;
1614 if (!initialLimitsFound) {
1617 initialLimitsFound =
kTRUE;
1629 Error(
"Merge",
"Cannot merge histograms - limits are inconsistent:\n " 1630 "first: (%d, %f, %f), second: (%d, %f, %f)",
1640 Error(
"Merge",
"Cannot merge histograms - limits are inconsistent:\n " 1641 "first: (%d, %f, %f), second: (%d, %f, %f)",
1651 Error(
"Merge",
"Cannot merge histograms - limits are inconsistent:\n " 1652 "first: (%d, %f, %f), second: (%d, %f, %f)",
1659 allSameLimits = sameLimitsX && sameLimitsY && sameLimitsZ;
1662 }
while ( ( h = dynamic_cast<TH3*> ( next() ) ) !=
NULL );
1663 if (!h && (*next) ) {
1664 Error(
"Merge",
"Attempt to merge object of class: %s to a %s",
1665 (*next)->ClassName(),this->
ClassName());
1675 if (!allSameLimits) {
1680 hclone = (
TH3*)IsA()->New();
1690 if (!allSameLimits && initialLimitsFound) {
1713 if (!allHaveLimits) {
1715 while ( (h = dynamic_cast<TH3*> (next())) ) {
1719 for (
Int_t i = 0; i < nbentries; i++)
1726 if (!initialLimitsFound) {
1738 for (
Int_t i=0;i<
kNstat;i++) {totstats[i] = stats[i] = 0;}
1741 Int_t binx, biny, binz, ix, iy, iz,
nx,
ny, nz, bin, ibin;
1748 while ( (h=(
TH3*)next()) ) {
1759 totstats[i] += stats[i];
1760 nentries += histEntries;
1768 for (binz = 0; binz <= nz + 1; binz++) {
1773 for (biny = 0; biny <= ny + 1; biny++) {
1779 for (binx = 0; binx <= nx + 1; binx++) {
1780 bin = binx +(nx+2)*(biny + (ny+2)*binz);
1782 if (!allSameLimits) {
1784 if (cu != 0 && ( (!sameLimitsX && (binx == 0 || binx == nx+1)) || (!sameLimitsY && (biny == 0 || biny == ny+1)) || (!sameLimitsZ && (binz == 0 || binz == nz+1)))) {
1785 Error(
"Merge",
"Cannot merge histograms - the histograms have" 1786 " different limits and undeflows/overflows are present." 1787 " The initial histogram is now broken!");
1797 ibin = ix +(nbix+2)*(iy + (nbiy+2)*iz);
1798 if (ibin <0)
continue;
1934 const_cast<TAxis*
>(axis1)->SetRange(imin1,imax1);
1935 const_cast<TAxis*
>(axis2)->SetRange(imin2,imax2);
1939 computeErrors =
kTRUE;
1944 originalRange =
kTRUE;
1948 TH1D *
h1 =
DoProject1D(name, title, projAxis, computeErrors, originalRange,
true,
true);
1960 if (!
gPad || !
gPad->FindObject(h1)) {
1965 if (padsav) padsav->
cd();
1972 bool computeErrors,
bool originalRange,
1973 bool useUF,
bool useOF)
const 1992 Error(
"DoProject1D",
"Histogram with name %s must be a TH1D and is a %s",name,h1obj->
ClassName());
1999 if ( originalRange )
2001 if (bins->
fN == 0) {
2007 if (bins->
fN == 0) {
2017 if ( originalRange )
2019 if (bins->
fN == 0) {
2025 if (bins->
fN == 0) {
2028 h1 =
new TH1D(name,title,nx,&bins->
fArray[ixmin-1]);
2051 if ( computeErrors ) h1->
Sumw2();
2054 const TAxis* out1 = 0;
2055 const TAxis* out2 = 0;
2059 }
else if ( projX ==
GetYaxis() ) {
2067 Int_t *refX = 0, *refY = 0, *refZ = 0;
2068 Int_t ixbin, out1bin, out2bin;
2069 if ( projX ==
GetXaxis() ) { refX = &ixbin; refY = &out1bin; refZ = &out2bin; }
2070 if ( projX ==
GetYaxis() ) { refX = &out2bin; refY = &ixbin; refZ = &out1bin; }
2071 if ( projX ==
GetZaxis() ) { refX = &out2bin; refY = &out1bin; refZ = &ixbin; }
2072 R__ASSERT (refX != 0 && refY != 0 && refZ != 0);
2091 for (ixbin=0;ixbin<=1+projX->
GetNbins();ixbin++) {
2098 for (out1bin = out1min; out1bin <= out1max; out1bin++) {
2099 for (out2bin = out2min; out2bin <= out2max; out2bin++) {
2105 if (computeErrors) {
2123 bool resetStats =
true;
2124 double eps = 1.E-12;
2128 bool resetEntries = resetStats;
2130 resetEntries |= !useUF || !useOF;
2137 stats[2] = stats[4];
2138 stats[3] = stats[5];
2141 stats[2] = stats[7];
2142 stats[3] = stats[8];
2171 bool computeErrors,
bool originalRange,
2172 bool useUF,
bool useOF)
const 2181 if (ixmin == 0 && ixmax == 0) { ixmin = 1; ixmax = projX->
GetNbins(); }
2182 if (iymin == 0 && iymax == 0) { iymin = 1; iymax = projY->
GetNbins(); }
2192 Error(
"DoProject2D",
"Histogram with name %s must be a TH2D and is a %s",name,h2obj->
ClassName());
2200 if ( originalRange ) {
2222 if ( originalRange )
2224 if (xbins->
fN == 0 && ybins->
fN == 0) {
2227 }
else if (ybins->
fN == 0) {
2230 }
else if (xbins->
fN == 0) {
2237 if (xbins->
fN == 0 && ybins->
fN == 0) {
2240 }
else if (ybins->
fN == 0) {
2243 }
else if (xbins->
fN == 0) {
2244 h2 =
new TH2D(name,title,ny,&ybins->
fArray[iymin-1]
2247 h2 =
new TH2D(name,title,ny,&ybins->
fArray[iymin-1],nx,&xbins->
fArray[ixmin-1]);
2284 if ( computeErrors) h2->
Sumw2();
2287 const TAxis* out = 0;
2296 Int_t *refX = 0, *refY = 0, *refZ = 0;
2297 Int_t ixbin, iybin, outbin;
2298 if ( projX ==
GetXaxis() && projY ==
GetYaxis() ) { refX = &ixbin; refY = &iybin; refZ = &outbin; }
2299 if ( projX ==
GetYaxis() && projY ==
GetXaxis() ) { refX = &iybin; refY = &ixbin; refZ = &outbin; }
2300 if ( projX ==
GetXaxis() && projY ==
GetZaxis() ) { refX = &ixbin; refY = &outbin; refZ = &iybin; }
2301 if ( projX ==
GetZaxis() && projY ==
GetXaxis() ) { refX = &iybin; refY = &outbin; refZ = &ixbin; }
2302 if ( projX ==
GetYaxis() && projY ==
GetZaxis() ) { refX = &outbin; refY = &ixbin; refZ = &iybin; }
2303 if ( projX ==
GetZaxis() && projY ==
GetYaxis() ) { refX = &outbin; refY = &iybin; refZ = &ixbin; }
2304 R__ASSERT (refX != 0 && refY != 0 && refZ != 0);
2313 if (outmin == 0 && outmax == 0) { outmin = 1; outmax = out->
GetNbins(); }
2318 for (ixbin=0;ixbin<=1+projX->
GetNbins();ixbin++) {
2322 for (iybin=0;iybin<=1+projY->
GetNbins();iybin++) {
2330 for (outbin = outmin; outbin <= outmax; outbin++) {
2336 if (computeErrors) {
2354 bool resetStats =
true;
2355 double eps = 1.E-12;
2359 bool resetEntries = resetStats;
2361 resetEntries |= !useUF || !useOF;
2366 for (
Int_t i = 0; i <
kNstat; ++i) { oldst[i] = 0; }
2368 std::copy(oldst,oldst+kNstat,stats);
2372 stats[4] = oldst[7];
2373 stats[5] = oldst[8];
2374 stats[6] = oldst[9];
2377 stats[2] = oldst[4];
2378 stats[3] = oldst[5];
2380 stats[4] = oldst[2];
2381 stats[5] = oldst[3];
2384 stats[4] = oldst[7];
2385 stats[5] = oldst[8];
2386 stats[6] = oldst[10];
2390 stats[2] = oldst[7];
2391 stats[3] = oldst[8];
2393 stats[4] = oldst[2];
2394 stats[5] = oldst[3];
2395 stats[6] = oldst[9];
2398 stats[4] = oldst[4];
2399 stats[5] = oldst[5];
2400 stats[6] = oldst[10];
2415 if (!computeErrors) entries =
TMath::Floor( entries + 0.5);
2478 if (opt.
Contains(
"x")) { pcase = 1; ptype =
"x"; }
2479 if (opt.
Contains(
"y")) { pcase = 2; ptype =
"y"; }
2480 if (opt.
Contains(
"z")) { pcase = 3; ptype =
"z"; }
2481 if (opt.
Contains(
"xy")) { pcase = 4; ptype =
"xy"; }
2482 if (opt.
Contains(
"yx")) { pcase = 5; ptype =
"yx"; }
2483 if (opt.
Contains(
"xz")) { pcase = 6; ptype =
"xz"; }
2484 if (opt.
Contains(
"zx")) { pcase = 7; ptype =
"zx"; }
2485 if (opt.
Contains(
"yz")) { pcase = 8; ptype =
"yz"; }
2486 if (opt.
Contains(
"zy")) { pcase = 9; ptype =
"zy"; }
2489 Error(
"Project3D",
"No projection axis specified - return a NULL pointer");
2496 computeErrors =
kTRUE;
2513 originalRange =
kTRUE;
2523 name +=
"_"; name += opt;
2524 title +=
" "; title += ptype; title +=
" projection";
2530 computeErrors, originalRange, useUF, useOF);
2536 computeErrors, originalRange, useUF, useOF);
2542 computeErrors, originalRange, useUF, useOF);
2548 computeErrors, originalRange, useUF, useOF);
2554 computeErrors, originalRange, useUF, useOF);
2560 computeErrors, originalRange, useUF, useOF);
2566 computeErrors, originalRange, useUF, useOF);
2572 computeErrors, originalRange, useUF, useOF);
2578 computeErrors, originalRange, useUF, useOF);
2589 if (!
gPad || !
gPad->FindObject(h)) {
2594 if (padsav) padsav->
cd();
2612 if (useWeights && binSumw2.
fN <= 0) useWeights =
false;
2619 if (outBin <0)
return;
2621 if ( useWeights ) tmp = binSumw2.
fArray[outBin];
2622 p2->
Fill( u , v, w, cont);
2632 bool originalRange,
bool useUF,
bool useOF)
const 2639 if (ixmin == 0 && ixmax == 0) { ixmin = 1; ixmax = projX->
GetNbins(); }
2640 if (iymin == 0 && iymax == 0) { iymin = 1; iymax = projY->
GetNbins(); }
2652 Error(
"DoProjectProfile2D",
"Histogram with name %s must be a TProfile2D and is a %s",name,p2obj->
ClassName());
2660 if ( originalRange ) {
2681 if ( originalRange ) {
2682 if (xbins->
fN == 0 && ybins->
fN == 0) {
2685 }
else if (ybins->
fN == 0) {
2688 }
else if (xbins->
fN == 0) {
2695 if (xbins->
fN == 0 && ybins->
fN == 0) {
2698 }
else if (ybins->
fN == 0) {
2701 }
else if (xbins->
fN == 0) {
2711 const TAxis* outAxis = 0;
2722 if (useWeights ) p2->
Sumw2();
2725 Int_t *refX = 0, *refY = 0, *refZ = 0;
2726 Int_t ixbin, iybin, outbin;
2727 if ( projX ==
GetXaxis() && projY ==
GetYaxis() ) { refX = &ixbin; refY = &iybin; refZ = &outbin; }
2728 if ( projX ==
GetYaxis() && projY ==
GetXaxis() ) { refX = &iybin; refY = &ixbin; refZ = &outbin; }
2729 if ( projX ==
GetXaxis() && projY ==
GetZaxis() ) { refX = &ixbin; refY = &outbin; refZ = &iybin; }
2730 if ( projX ==
GetZaxis() && projY ==
GetXaxis() ) { refX = &iybin; refY = &outbin; refZ = &ixbin; }
2731 if ( projX ==
GetYaxis() && projY ==
GetZaxis() ) { refX = &outbin; refY = &ixbin; refZ = &iybin; }
2732 if ( projX ==
GetZaxis() && projY ==
GetYaxis() ) { refX = &outbin; refY = &iybin; refZ = &ixbin; }
2733 R__ASSERT (refX != 0 && refY != 0 && refZ != 0);
2738 if (outmin == 0 && outmax == 0) { outmin = 1; outmax = outAxis->
GetNbins(); }
2744 if (useWeights && binSumw2.
fN <= 0) useWeights =
false;
2748 for (ixbin=0;ixbin<=1+projX->
GetNbins();ixbin++) {
2750 for ( iybin=0;iybin<=1+projY->
GetNbins();iybin++) {
2755 if (poutBin <0)
continue;
2757 for (outbin = outmin; outbin <= outmax; outbin++) {
2764 if (!cont)
continue;
2768 if ( useWeights ) tmp = binSumw2.
fArray[poutBin];
2778 bool resetStats =
true;
2789 if (!useWeights) entries =
TMath::Floor( entries + 0.5);
2843 if (opt.
Contains(
"xy")) { pcase = 4; ptype =
"xy"; }
2844 if (opt.
Contains(
"yx")) { pcase = 5; ptype =
"yx"; }
2845 if (opt.
Contains(
"xz")) { pcase = 6; ptype =
"xz"; }
2846 if (opt.
Contains(
"zx")) { pcase = 7; ptype =
"zx"; }
2847 if (opt.
Contains(
"yz")) { pcase = 8; ptype =
"yz"; }
2848 if (opt.
Contains(
"zy")) { pcase = 9; ptype =
"zy"; }
2851 Error(
"Project3D",
"No projection axis specified - return a NULL pointer");
2869 originalRange =
kTRUE;
2877 name +=
"_p"; name += opt;
2878 title +=
" profile "; title += ptype; title +=
" projection";
2940 return Rebin3D(ngroup, 1, 1, newname);
2950 return Rebin3D(1, ngroup, 1, newname);
2960 return Rebin3D(1, 1, ngroup, newname);
2991 Int_t i,j,k,xbin,ybin,zbin;
3001 if ((nxgroup <= 0) || (nxgroup > nxbins)) {
3002 Error(
"Rebin",
"Illegal value of nxgroup=%d",nxgroup);
3005 if ((nygroup <= 0) || (nygroup > nybins)) {
3006 Error(
"Rebin",
"Illegal value of nygroup=%d",nygroup);
3009 if ((nzgroup <= 0) || (nzgroup > nzbins)) {
3010 Error(
"Rebin",
"Illegal value of nzgroup=%d",nzgroup);
3014 Int_t newxbins = nxbins/nxgroup;
3015 Int_t newybins = nybins/nygroup;
3016 Int_t newzbins = nzbins/nzgroup;
3034 if (newname && strlen(newname)) {
3042 bool resetStat =
false;
3046 if (newxbins*nxgroup != nxbins) {
3050 if (newybins*nygroup != nybins) {
3054 if (newzbins*nzgroup != nzbins) {
3096 if (nxgroup != 1 || nygroup != 1 || nzgroup != 1) {
3105 hnew->
SetBins(newxbins,xbins, newybins, ybins, newzbins, zbins);
3110 hnew->
SetBins(newxbins, xmin, xmax, newybins, ymin, ymax, newzbins, zmin, zmax);
3118 for (xbin = 1; xbin <= newxbins; xbin++) {
3121 for (ybin = 1; ybin <= newybins; ybin++) {
3123 for (zbin = 1; zbin <= newzbins; zbin++) {
3126 for (i = 0; i < nxgroup; i++) {
3127 if (oldxbin+i > nxbins)
break;
3128 for (j =0; j < nygroup; j++) {
3129 if (oldybin+j > nybins)
break;
3130 for (k =0; k < nzgroup; k++) {
3131 if (oldzbin+k > nzbins)
break;
3133 bin = oldxbin + i + (oldybin + j)*(nxbins + 2) + (oldzbin + k)*(nxbins + 2)*(nybins + 2);
3134 binContent += oldBins[bin];
3135 if (oldSumw2) binSumw2 += oldSumw2[bin];
3150 for (
Int_t xover = 0; xover <= 1; xover++) {
3151 for (
Int_t yover = 0; yover <= 1; yover++) {
3152 for (
Int_t zover = 0; zover <= 1; zover++) {
3156 for (xbin = xover*oldxbin; xbin <= xover*(nxbins+1); xbin++) {
3157 for (ybin = yover*oldybin; ybin <= yover*(nybins+1); ybin++) {
3158 for (zbin = zover*oldzbin; zbin <= zover*(nzbins+1); zbin++) {
3159 bin =
GetBin(xbin,ybin,zbin);
3160 binContent += oldBins[bin];
3161 if (oldSumw2) binSumw2 += oldSumw2[bin];
3166 yover*(newybins+1), zover*(newzbins+1) );
3173 Double_t binContent0, binContent2, binContent3, binContent4;
3174 Double_t binError0, binError2, binError3, binError4;
3175 Int_t oldxbin2, oldybin2, oldzbin2;
3176 Int_t ufbin, ofbin, ofbin2, ofbin3, ofbin4;
3182 for (xbin = 1; xbin<=newxbins; xbin++) {
3184 for (zbin = 1; zbin<=newzbins; zbin++) {
3185 binContent0 = binContent2 = 0;
3186 binError0 = binError2 = 0;
3187 for (i=0; i<nxgroup; i++) {
3188 if (oldxbin2+i > nxbins)
break;
3189 for (k=0; k<nzgroup; k++) {
3190 if (oldzbin2+k > nzbins)
break;
3192 ufbin = oldxbin2 + i + (nxbins+2)*(nybins+2)*(oldzbin2+k);
3193 binContent0 += oldBins[ufbin];
3194 if (oldSumw2) binError0 += oldSumw2[ufbin];
3195 for (ybin = oldybin; ybin <= nybins + 1; ybin++) {
3197 ofbin = ufbin + ybin*(nxbins+2);
3198 binContent2 += oldBins[ofbin];
3199 if (oldSumw2) binError2 += oldSumw2[ofbin];
3209 oldzbin2 += nzgroup;
3211 oldxbin2 += nxgroup;
3218 for (ybin = 1; ybin<=newybins; ybin++) {
3220 for (zbin = 1; zbin<=newzbins; zbin++) {
3221 binContent0 = binContent2 = 0;
3222 binError0 = binError2 = 0;
3223 for (j=0; j<nygroup; j++) {
3224 if (oldybin2+j > nybins)
break;
3225 for (k=0; k<nzgroup; k++) {
3226 if (oldzbin2+k > nzbins)
break;
3228 ufbin = (oldybin2 + j)*(nxbins+2) + (nxbins+2)*(nybins+2)*(oldzbin2+k);
3229 binContent0 += oldBins[ufbin];
3230 if (oldSumw2) binError0 += oldSumw2[ufbin];
3231 for (xbin = oldxbin; xbin <= nxbins + 1; xbin++) {
3233 ofbin = ufbin + xbin;
3234 binContent2 += oldBins[ofbin];
3235 if (oldSumw2) binError2 += oldSumw2[ofbin];
3245 oldzbin2 += nzgroup;
3247 oldybin2 += nygroup;
3254 for (xbin = 1; xbin<=newxbins; xbin++) {
3256 for (ybin = 1; ybin<=newybins; ybin++) {
3257 binContent0 = binContent2 = 0;
3258 binError0 = binError2 = 0;
3259 for (i=0; i<nxgroup; i++) {
3260 if (oldxbin2+i > nxbins)
break;
3261 for (j=0; j<nygroup; j++) {
3262 if (oldybin2+j > nybins)
break;
3264 ufbin = oldxbin2 + i + (nxbins+2)*(oldybin2+j);
3265 binContent0 += oldBins[ufbin];
3266 if (oldSumw2) binError0 += oldSumw2[ufbin];
3267 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3269 ofbin = ufbin + (nxbins+2)*(nybins+2)*zbin;
3270 binContent2 += oldBins[ofbin];
3271 if (oldSumw2) binError2 += oldSumw2[ofbin];
3281 oldybin2 += nygroup;
3283 oldxbin2 += nxgroup;
3290 for (xbin = 1; xbin<=newxbins; xbin++) {
3299 for (i=0; i<nxgroup; i++) {
3300 if (oldxbin2+i > nxbins)
break;
3301 ufbin = oldxbin2 + i;
3302 binContent0 += oldBins[ufbin];
3303 if (oldSumw2) binError0 += oldSumw2[ufbin];
3304 for (ybin = oldybin; ybin <= nybins + 1; ybin++) {
3305 ofbin3 = ufbin+ybin*(nxbins+2);
3306 binContent3 += oldBins[ ofbin3 ];
3307 if (oldSumw2) binError3 += oldSumw2[ofbin3];
3308 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3310 ofbin4 = oldxbin2 + i + ybin*(nxbins+2) + (nxbins+2)*(nybins+2)*zbin;
3311 binContent4 += oldBins[ofbin4];
3312 if (oldSumw2) binError4 += oldSumw2[ofbin4];
3315 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3316 ofbin2 = ufbin+zbin*(nxbins+2)*(nybins+2);
3317 binContent2 += oldBins[ ofbin2 ];
3318 if (oldSumw2) binError2 += oldSumw2[ofbin2];
3324 hnew->
SetBinContent(xbin,newybins+1,newzbins+1,binContent4);
3331 oldxbin2 += nxgroup;
3338 for (zbin = 1; zbin<=newzbins; zbin++) {
3347 for (i=0; i<nzgroup; i++) {
3348 if (oldzbin2+i > nzbins)
break;
3349 ufbin = (oldzbin2 + i)*(nxbins+2)*(nybins+2);
3350 binContent0 += oldBins[ufbin];
3351 if (oldSumw2) binError0 += oldSumw2[ufbin];
3352 for (ybin = oldybin; ybin <= nybins + 1; ybin++) {
3353 ofbin3 = ufbin+ybin*(nxbins+2);
3354 binContent3 += oldBins[ ofbin3 ];
3355 if (oldSumw2) binError3 += oldSumw2[ofbin3];
3356 for (xbin = oldxbin; xbin <= nxbins + 1; xbin++) {
3358 ofbin4 = ufbin + xbin + ybin*(nxbins+2);
3359 binContent4 += oldBins[ofbin4];
3360 if (oldSumw2) binError4 += oldSumw2[ofbin4];
3363 for (xbin = oldxbin; xbin <= nxbins + 1; xbin++) {
3364 ofbin2 = xbin +(oldzbin2+i)*(nxbins+2)*(nybins+2);
3365 binContent2 += oldBins[ ofbin2 ];
3366 if (oldSumw2) binError2 += oldSumw2[ofbin2];
3372 hnew->
SetBinContent(newxbins+1,newybins+1,zbin,binContent4);
3379 oldzbin2 += nzgroup;
3386 for (ybin = 1; ybin<=newybins; ybin++) {
3395 for (i=0; i<nygroup; i++) {
3396 if (oldybin2+i > nybins)
break;
3397 ufbin = (oldybin2 + i)*(nxbins+2);
3398 binContent0 += oldBins[ufbin];
3399 if (oldSumw2) binError0 += oldSumw2[ufbin];
3400 for (xbin = oldxbin; xbin <= nxbins + 1; xbin++) {
3401 ofbin3 = ufbin+xbin;
3402 binContent3 += oldBins[ ofbin3 ];
3403 if (oldSumw2) binError3 += oldSumw2[ofbin3];
3404 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3406 ofbin4 = xbin + (nxbins+2)*(nybins+2)*zbin+(oldybin2+i)*(nxbins+2);
3407 binContent4 += oldBins[ofbin4];
3408 if (oldSumw2) binError4 += oldSumw2[ofbin4];
3411 for (zbin = oldzbin; zbin <= nzbins + 1; zbin++) {
3412 ofbin2 = (oldybin2+i)*(nxbins+2)+zbin*(nxbins+2)*(nybins+2);
3413 binContent2 += oldBins[ ofbin2 ];
3414 if (oldSumw2) binError2 += oldSumw2[ofbin2];
3420 hnew->
SetBinContent(newxbins+1,ybin,newzbins+1,binContent4);
3427 oldybin2 += nygroup;
3470 if (!resetStat) hnew->
PutStats(stat);
3473 if (oldSumw2)
delete [] oldSumw2;
3504 if (bin < 0)
return;
3513 void TH3::Streamer(
TBuffer &R__b)
3523 TH1::Streamer(R__b);
3524 TAtt3D::Streamer(R__b);
3566 :
TH3(name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
3581 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
3594 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
3625 if (newval > -128 && newval < 128) {
fArray[bin] =
Char_t(newval);
return;}
3626 if (newval < -127)
fArray[bin] = -127;
3627 if (newval > 127)
fArray[bin] = 127;
3695 void TH3C::Streamer(
TBuffer &R__b)
3708 TH1::Streamer(R__b);
3709 TArrayC::Streamer(R__b);
3711 TAtt3D::Streamer(R__b);
3713 TH3::Streamer(R__b);
3714 TArrayC::Streamer(R__b);
3730 if (
this != &h1) ((
TH3C&)h1).
Copy(*
this);
3827 :
TH3(name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
3842 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
3855 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
3886 if (newval > -32768 && newval < 32768) {
fArray[bin] =
Short_t(newval);
return;}
3887 if (newval < -32767)
fArray[bin] = -32767;
3888 if (newval > 32767)
fArray[bin] = 32767;
3927 void TH3S::Streamer(
TBuffer &R__b)
3940 TH1::Streamer(R__b);
3941 TArrayS::Streamer(R__b);
3943 TAtt3D::Streamer(R__b);
3945 TH3::Streamer(R__b);
3946 TArrayS::Streamer(R__b);
3962 if (
this != &h1) ((
TH3S&)h1).
Copy(*
this);
4059 :
TH3(name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
4074 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4087 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4118 if (newval > -2147483647 && newval < 2147483647) {
fArray[bin] =
Int_t(newval);
return;}
4119 if (newval < -2147483647)
fArray[bin] = -2147483647;
4120 if (newval > 2147483647)
fArray[bin] = 2147483647;
4161 if (
this != &h1) ((
TH3I&)h1).
Copy(*
this);
4258 :
TH3(name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
4273 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4286 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4337 void TH3F::Streamer(
TBuffer &R__b)
4350 TH1::Streamer(R__b);
4351 TArrayF::Streamer(R__b);
4353 TAtt3D::Streamer(R__b);
4355 TH3::Streamer(R__b);
4356 TArrayF::Streamer(R__b);
4372 if (
this != &h1) ((
TH3F&)h1).
Copy(*
this);
4469 :
TH3(name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz,zlow,zup)
4484 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4497 :
TH3(name,title,nbinsx,xbins,nbinsy,ybins,nbinsz,zbins)
4548 void TH3D::Streamer(
TBuffer &R__b)
4561 TH1::Streamer(R__b);
4562 TArrayD::Streamer(R__b);
4564 TAtt3D::Streamer(R__b);
4566 TH3::Streamer(R__b);
4567 TArrayD::Streamer(R__b);
4583 if (
this != &h1) ((
TH3D&)h1).
Copy(*
this);
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title Offset is a correction factor with respect to the "s...
virtual const char * GetName() const
Returns name of object.
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
Return Global bin number corresponding to x,y,z.
virtual Float_t GetTickLength() const
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
virtual Double_t GetEffectiveEntries() const
number of effective entries of the histogram, neff = (Sum of weights )^2 / (Sum of weight^2 ) In case...
virtual void Paint(Option_t *option="")
Control routine to paint any kind of histograms.
TH3()
Default constructor.
virtual void SetParameters(const Double_t *params)
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
friend TH3D operator*(Float_t c1, TH3D &h1)
Operator *.
Double_t Floor(Double_t x)
void Set(Int_t n)
Set size of this array to n chars.
Int_t GetFirst() const
Return first bin on the axis i.e.
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
void Copy(TArrayI &array) const
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
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...
virtual TH3 * RebinX(Int_t ngroup=2, const char *newname="")
Rebin only the X axis see Rebin3D.
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.
friend TH3F operator+(TH3F &h1, TH3F &h2)
Operator +.
static Bool_t fgDefaultSumw2
flag to use under/overflows in statistics
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 ...
friend TH3F operator/(TH3F &h1, TH3F &h2)
Operator /.
virtual Float_t GetLabelOffset() const
3-D histogram with a float per channel (see TH1 documentation)}
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
friend TH3I operator+(TH3I &h1, TH3I &h2)
Operator +.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
Double_t KolmogorovProb(Double_t z)
Calculates the Kolmogorov distribution function, which gives the probability that Kolmogorov's test ...
TObject * GetParent() const
Return pointer to parent of this buffer.
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.
const Double_t * GetArray() const
Bool_t TestBit(UInt_t f) 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...
virtual Color_t GetAxisColor() const
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.
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 Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual void SetNdivisions(Int_t n=510, Bool_t optim=kTRUE)
Set the number of divisions for this axis.
virtual void SetRange(Double_t xmin, Double_t xmax)
Initialize the upper and lower bounds to draw the function.
virtual Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const
See comments in TH1::GetBin.
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 =.
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...
friend TH3D operator-(TH3D &h1, TH3D &h2)
Operator -.
virtual void AddAll(const TCollection *col)
Add all objects from collection col to this collection.
Buffer base class used for serializing objects.
friend TH3C operator+(TH3C &h1, TH3C &h2)
Operator +.
virtual Int_t GetNbinsZ() const
static THLimitsFinder * GetLimitsFinder()
Return pointer to the current finder.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual ~TH3D()
Destructor.
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.
friend TH3F operator*(Float_t c1, TH3F &h1)
Operator *.
virtual Double_t GetParError(Int_t ipar) const
Return value of parameter number ipar.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
friend TH3I operator/(TH3I &h1, TH3I &h2)
Operator /.
void Copy(TArrayC &array) const
virtual Float_t GetLabelSize() 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...
virtual Int_t FindGoodLimits(TH1 *h, Double_t xmin, Double_t xmax)
compute the best axis limits for the X axis.
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 ...
static Bool_t RecomputeAxisLimits(TAxis &destAxis, const TAxis &anAxis)
Finds new limits for the axis for the Merge function.
virtual Bool_t Multiply(TF1 *h1, Double_t c1=1)
Performs the operation: this = this*c1*f1 if errors are defined (see TH1::Sumw2), errors are also rec...
friend TH3F operator-(TH3F &h1, TH3F &h2)
Operator -.
virtual Double_t GetCovariance(Int_t axis1=1, Int_t axis2=2) const
Return covariance between axis1 and axis2.
virtual void SetLabelOffset(Float_t offset=0.005)
Set distance between the axis and the labels The distance is expressed in per cent of the pad width...
virtual 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.
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 Bool_t CanExtendAllAxes() const
returns true if all axes are extendable
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
virtual void SetLabelFont(Style_t font=62)
Set labels' font.
virtual Style_t GetMarkerStyle() const
virtual Style_t GetTitleFont() const
virtual Int_t GetDimension() const
Int_t Fill(const Double_t *v)
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 const char * ClassName() const
Returns name of class to which the object belongs.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
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...
friend TH3D operator+(TH3D &h1, TH3D &h2)
Operator +.
virtual Int_t GetVersionOwner() const =0
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 TH3 * RebinY(Int_t ngroup=2, const char *newname="")
Rebin only the Y axis see Rebin3D.
virtual Double_t GetCorrelationFactor(Int_t axis1=1, Int_t axis2=2) const
Return correlation factor between axis1 and axis2.
friend TH3C operator*(Float_t c1, TH3C &h1)
Operator *.
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
THashList * GetLabels() const
static double p2(double t, double a, double b, double c)
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
virtual void SetMarkerColor(Color_t mcolor=1)
Ssiz_t First(char c) const
Find first occurrence of a character c.
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
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...
virtual Color_t GetLabelColor() const
virtual void GetStats(Double_t *stats) const
Fill the array stats from the contents of this histogram The array stats must be correctly dimensionn...
The 3-D histogram classes derived from the 1-D histogram classes.
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
3-D histogram with an 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 Int_t GetNdivisions() const
virtual ~TH3I()
Destructor.
virtual ~TH3S()
Destructor.
void Set(Int_t n)
Set size of this array to n shorts.
virtual void ImportAttributes(const TAxis *axis)
Copy axis attributes to this.
virtual const char * GetParName(Int_t ipar) const
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 void ExtendAxis(Double_t x, TAxis *axis)
Histogram is resized along axis such that x is in the axis range.
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.
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.
friend TH3S operator-(TH3S &h1, TH3S &h2)
Operator -.
void Copy(TArrayF &array) const
Int_t GetLast() const
Return last bin on the axis i.e.
const char * GetTitle() const
Returns title of object.
Class to manage histogram axis.
friend TH3S operator+(TH3S &h1, TH3S &h2)
Operator +.
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).
virtual void SetFillColor(Color_t fcolor)
virtual Int_t GetNumberFitPoints() const
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 TObject * Remove(TObject *obj)
Remove object from the list.
unsigned int r1[N_CITIES]
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
Bool_t Permute(Int_t n, Int_t *a)
Simple recursive algorithm to find the permutations of n natural numbers, not necessarily all distinc...
Collection abstract base class.
static Int_t fgBufferSize
Double_t Mean(Long64_t n, const T *a, const Double_t *w=0)
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
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 ...
virtual Float_t GetTitleOffset() const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Copy(TObject &hnew) const
Copy this histogram structure to newth1.
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
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 void SetMarkerStyle(Style_t mstyle=1)
Int_t Fill(Double_t)
Invalid Fill method.
virtual void Copy(TObject &hnew) const
Copy.
virtual Color_t GetTitleColor() const
Double_t * fIntegral
Histogram dimension (1, 2 or 3 dim)
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.
R__EXTERN TRandom * gRandom
1-D histogram with a double per channel (see TH1 documentation)}
friend TH3I operator-(TH3I &h1, TH3I &h2)
Operator _.
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 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 Double_t RetrieveBinContent(Int_t bin) const
raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::Get...
virtual Color_t GetLineColor() 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.
friend TH3S operator/(TH3S &h1, TH3S &h2)
Operator /.
TString & Remove(Ssiz_t pos)
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Int_t GetSumw2N() const
Double_t GetChisquare() const
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Evaluate this function.
virtual Bool_t IsEmpty() const
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
virtual void Reset(Option_t *option="")
-*Reset contents of a Profile2D histogram *-* ======================================= ...
friend TH3D operator/(TH3D &h1, TH3D &h2)
Operator /.
virtual Int_t BufferEmpty(Int_t action=0)
Fill histogram with all entries in the buffer.
TH3D & operator=(const TH3D &h1)
Operator =.
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
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...
friend TH3C operator-(TH3C &h1, TH3C &h2)
Operator -.
virtual Color_t GetFillColor() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual Double_t GetEntries() const
return the current number of entries
3-D histogram with a byte per channel (see TH1 documentation)
virtual void SetBinLabel(Int_t bin, const char *label)
Set label for bin.
virtual Float_t GetTitleSize() const
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).
friend TH3I operator*(Float_t c1, TH3I &h1)
Operator *.
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
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.
virtual UInt_t SetCanExtend(UInt_t extendBitMask)
make the histogram axes extendable / not extendable according to the bit mask returns the previous bi...
Mother of all ROOT objects.
virtual Int_t GetNpar() const
friend TH3C operator/(TH3C &h1, TH3C &h2)
Operator /.
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
TVirtualHistPainter * fPainter
Integral of bins used by GetRandom.
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
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 Double_t GetParameter(Int_t ipar) const
virtual Double_t DoIntegral(Int_t ix1, Int_t ix2, Int_t iy1, Int_t iy2, Int_t iz1, Int_t iz2, Double_t &err, Option_t *opt, Bool_t doerr=kFALSE) const
internal function compute integral and optionally the error between the limits specified by the bin n...
Short_t Max(Short_t a, Short_t b)
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.
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
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.
Int_t fDimension
Pointer to directory holding this histogram.
virtual void SetTickLength(Float_t length=0.03)
Set tick mark length The length is expressed in per cent of the pad width.
virtual Double_t * GetParameters() const
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 void SetBinContent(Int_t bin, Double_t content)
Set bin content.
virtual Color_t GetMarkerColor() const
virtual Int_t GetNbinsX() const
Double_t Sqrt(Double_t x)
virtual ~TH3()
Destructor.
TH3F & operator=(const TH3F &h1)
Operator =.
friend TH3S operator*(Float_t c1, TH3S &h1)
Operator *.
virtual void Set(Int_t nbins, Double_t xmin, Double_t xmax)
Initialize axis with fix bins.
virtual Double_t Interpolate(Double_t x)
Not yet implemented.
Int_t Fill(Double_t)
Invalid Fill method.
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 void UpdateBinContent(Int_t bin, Double_t content)
raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin...
virtual Double_t GetStdDev(Int_t axis=1) const
Returns the Standard Deviation (Sigma).
void Set(Int_t n)
Set size of this array to n doubles.
void Copy(TArrayD &array) const
Long64_t BinarySearch(Long64_t n, const T *array, T value)
const TArrayD * GetXbins() const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual Style_t GetLabelFont() const
void Copy(TArrayS &array) const
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual const char * GetTitle() const
Returns title of object.
virtual Int_t GetNbinsY() const
virtual Double_t GetBinError(Int_t bin) const
Return value of error associated to bin number bin.
2-D histogram with a double per channel (see TH1 documentation)}
const char * Data() const
Array of chars or bytes (8 bits per element).
virtual TArrayD * GetBinSumw2()
TH3I & operator=(const TH3I &h1)
Operator =.