98 :
TH1(
name,title,nbinsx,xlow,xup)
103 if (nbinsy <= 0) {
Warning(
"TH2",
"nbinsy is <=0 - set to nbinsy = 1"); nbinsy = 1; }
104 fYaxis.Set(nbinsy,ylow,yup);
132 if (nbinsy <= 0) {
Warning(
"TH2",
"nbinsy is <=0 - set to nbinsy = 1"); nbinsy = 1; }
133 fYaxis.Set(nbinsy,ylow,yup);
155 :
TH1(
name,title,nbinsx,xlow,xup)
160 if (nbinsy <= 0) {
Warning(
"TH2",
"nbinsy is <=0 - set to nbinsy = 1"); nbinsy = 1; }
161 if (ybins)
fYaxis.Set(nbinsy,ybins);
162 else fYaxis.Set(nbinsy,0,1);
189 if (nbinsy <= 0) {
Warning(
"TH2",
"nbinsy is <=0 - set to nbinsy = 1"); nbinsy = 1; }
190 if (ybins)
fYaxis.Set(nbinsy,ybins);
191 else fYaxis.Set(nbinsy,0,1);
219 if (nbinsy <= 0) {
Warning(
"TH2",
"nbinsy is <=0 - set to nbinsy = 1"); nbinsy = 1; }
220 if (ybins)
fYaxis.Set(nbinsy,ybins);
221 else fYaxis.Set(nbinsy,0,1);
249 if (nbentries == 0)
return 0;
250 if (nbentries < 0 && action == 0)
return 0;
254 nbentries = -nbentries;
263 const bool xbinAuto =
fXaxis.GetXmax() <=
fXaxis.GetXmin();
264 const bool ybinAuto =
fYaxis.GetXmax() <=
fYaxis.GetXmin();
271 for (
Int_t i=1;i<nbentries;i++) {
283 if (xbinAuto || ybinAuto) {
299 for (
Int_t i=0;i<nbentries;i++) {
300 Fill(buffer[3*i+2],buffer[3*i+3],buffer[3*i+1]);
327 nbentries = -nbentries;
365 Error(
"Fill",
"Invalid signature - do nothing");
389 Int_t binx, biny, bin;
393 if (binx <0 || biny <0)
return -1;
394 bin = biny*(
fXaxis.GetNbins()+2) + binx;
397 if (binx == 0 || binx >
fXaxis.GetNbins()) {
400 if (biny == 0 || biny >
fYaxis.GetNbins()) {
433 Int_t binx, biny, bin;
437 if (binx <0 || biny <0)
return -1;
438 bin = biny*(
fXaxis.GetNbins()+2) + binx;
442 if (binx == 0 || binx >
fXaxis.GetNbins()) {
445 if (biny == 0 || biny >
fYaxis.GetNbins()) {
477 Int_t binx, biny, bin;
479 binx =
fXaxis.FindBin(namex);
480 biny =
fYaxis.FindBin(namey);
481 if (binx <0 || biny <0)
return -1;
482 bin = biny*(
fXaxis.GetNbins()+2) + binx;
486 if (binx == 0 || binx >
fXaxis.GetNbins())
return -1;
487 if (biny == 0 || biny >
fYaxis.GetNbins())
return -1;
524 Int_t binx, biny, bin;
526 binx =
fXaxis.FindBin(namex);
528 if (binx <0 || biny <0)
return -1;
529 bin = biny*(
fXaxis.GetNbins()+2) + binx;
533 if (binx == 0 || binx >
fXaxis.GetNbins())
return -1;
534 if (biny == 0 || biny >
fYaxis.GetNbins()) {
570 Int_t binx, biny, bin;
573 biny =
fYaxis.FindBin(namey);
574 if (binx <0 || biny <0)
return -1;
575 bin = biny*(
fXaxis.GetNbins()+2) + binx;
579 if (binx == 0 || binx >
fXaxis.GetNbins()) {
582 if (biny == 0 || biny >
fYaxis.GetNbins())
return -1;
618 Int_t binx, biny, bin, i;
625 for (i=0;i<ntimes;i+=stride) {
631 if (i < ntimes &&
fBuffer==
nullptr)
638 for (i=ifirst;i<ntimes;i+=stride) {
642 if (binx <0 || biny <0)
continue;
643 bin = biny*(
fXaxis.GetNbins()+2) + binx;
648 if (binx == 0 || binx >
fXaxis.GetNbins()) {
651 if (biny == 0 || biny >
fYaxis.GetNbins()) {
686 Int_t bin, binx, biny, ibin, loop;
688 TF2 *
f1 =
dynamic_cast<TF2*
>(function);
689 if (!
f1) {
Error(
"FillRandom",
"Function: %s is not a TF2, is a %s",function->GetName(),function->IsA()->GetName());
return; }
708 Int_t nbins = nbinsx*nbinsy;
714 for (biny=1;biny<=nbinsy;biny++) {
715 for (binx=1;binx<=nbinsx;binx++) {
718 integral[ibin] = integral[ibin-1] + fint;
723 if (integral[nbins] == 0 ) {
725 Error(
"FillRandom",
"Integral = zero");
return;
727 for (bin=1;bin<=nbins;bin++) integral[bin] /= integral[nbins];
730 for (loop=0;loop<ntimes;loop++) {
734 binx = 1 + ibin - nbinsx*biny;
762 if (!
h) {
Error(
"FillRandom",
"Null histogram");
return; }
764 Error(
"FillRandom",
"Histograms with different dimensions");
return;
767 if (
h->ComputeIntegral() == 0)
return;
772 for (loop=0;loop<ntimes;loop++) {
797 if (firstbin == 0 && lastbin == 0) {
802 if (firstbin < 0) firstbin = 0;
803 if (lastbin < 0 || lastbin > nbins + 1) lastbin = nbins + 1;
804 if (lastbin < firstbin) {firstbin = 0; lastbin = nbins + 1;}
811 if (i1>=0 && i2>i1) {
812 proj_opt += opt(i1,i2-i1+1);
823 Int_t nstep = ngroup;
833 if (npar <= 0)
return;
835 f1->GetParameters(parsave);
845 char *
name =
new char[2000];
846 char *title =
new char[2000];
852 Int_t nOutBins = lastOutBin-firstOutBin+1;
854 if (bins->
fN == 0) nOutBins /= nstep;
855 for (ipar=0;ipar<npar;ipar++) {
857 snprintf(title,2000,
"Fitted value of par[%d]=%s",ipar,
f1->GetParName(ipar));
862 hlist[ipar] =
new TH1D(
name,title, nOutBins, &bins->
fArray[firstOutBin-1]);
867 (*arr)[ipar] = hlist[ipar];
871 TH1D *hchi2 =
nullptr;
875 hchi2 =
new TH1D(
name,
"chisquare", nOutBins, &bins->
fArray[firstOutBin-1]);
880 (*arr)[npar] = hchi2;
890 for (bin=firstbin;bin+ngroup-1<=lastbin;bin += nstep) {
892 hp=
ProjectionX(
"_temp",bin,bin+ngroup-1,proj_opt);
894 hp=
ProjectionY(
"_temp",bin,bin+ngroup-1,proj_opt);
895 if (hp ==
nullptr)
continue;
900 Info(
"DoFitSlices",
"Slice %d skipped, the number of entries is zero or smaller than the given cut value, n=%f",bin,
nentries);
903 f1->SetParameters(parsave);
908 Int_t npfits =
f1->GetNumberFitPoints();
909 if (npfits > npar && npfits >= cut) {
910 for (ipar=0;ipar<npar;ipar++) {
918 Info(
"DoFitSlices",
"Fitted slice %d skipped, the number of fitted points is too small, n=%d",bin,npfits);
987 DoFitSlices(
true,
f1, firstybin, lastybin, cut, option, arr);
1052 DoFitSlices(
false,
f1, firstxbin, lastxbin, cut, option, arr);
1059 if (biny < 0) biny = 0;
1060 if (biny > ofy) biny = ofy;
1092 Error(
"GetBinWithContent2",
"function is only valid for 2-D histograms");
1095 if (firstxbin < 0) firstxbin = 1;
1096 if (lastxbin < firstxbin) lastxbin =
fXaxis.GetNbins();
1097 if (firstybin < 0) firstybin = 1;
1098 if (lastybin < firstybin) lastybin =
fYaxis.GetNbins();
1100 for (
Int_t j = firstybin; j <= lastybin; j++) {
1101 for (
Int_t i = firstxbin; i <= lastxbin; i++) {
1103 if (diff <= 0) {binx = i; biny=j;
return diff;}
1104 if (diff < curmax && diff <= maxdiff) {curmax = diff, binx=i; biny=j;}
1116 if (axis1 < 1 || axis2 < 1 || axis1 > 2 || axis2 > 2) {
1117 Error(
"GetCorrelationFactor",
"Wrong parameters");
1120 if (axis1 == axis2)
return 1;
1122 if (stddev1 == 0)
return 0;
1124 if (stddev2 == 0)
return 0;
1134 if (axis1 < 1 || axis2 < 1 || axis1 > 2 || axis2 > 2) {
1135 Error(
"GetCovariance",
"Wrong parameters");
1148 if (sumw == 0)
return 0;
1149 if (axis1 == 1 && axis2 == 1) {
1150 return TMath::Abs(sumwx2/sumw - sumwx/sumw*sumwx/sumw);
1152 if (axis1 == 2 && axis2 == 2) {
1153 return TMath::Abs(sumwy2/sumw - sumwy/sumw*sumwy/sumw);
1155 return sumwxy/sumw - sumwx/sumw*sumwy/sumw;
1174 Int_t nbins = nbinsx*nbinsy;
1184 if (integral == 0 ) {
x = 0;
y = 0;
return;}
1191 Int_t biny = ibin/nbinsx;
1192 Int_t binx = ibin - nbinsx*biny;
1193 x =
fXaxis.GetBinLowEdge(binx+1);
1230 std::fill(stats, stats + 7, 0);
1239 if (firstBinX == 1) firstBinX = 0;
1240 if (lastBinX ==
fXaxis.GetNbins() ) lastBinX += 1;
1243 if (firstBinY == 1) firstBinY = 0;
1244 if (lastBinY ==
fYaxis.GetNbins() ) lastBinY += 1;
1251 for (
Int_t biny = firstBinY; biny <= lastBinY; ++biny) {
1253 for (
Int_t binx = firstBinX; binx <= lastBinX; ++binx) {
1305 return DoIntegral(firstxbin,lastxbin,firstybin,lastybin,-1,0,
err,option);
1318 return DoIntegral(firstxbin,lastxbin,firstybin,lastybin,-1,0,error,option,
kTRUE);
1326 Error(
"Interpolate",
"This function must be called with 2 arguments for a TH2");
1345 Error(
"Interpolate",
"Cannot interpolate outside histogram domain.");
1350 dx =
fXaxis.GetBinUpEdge(bin_x)-
x;
1351 dy =
fYaxis.GetBinUpEdge(bin_y)-
y;
1352 if (dx<=
fXaxis.GetBinWidth(bin_x)/2 && dy<=
fYaxis.GetBinWidth(bin_y)/2)
1354 if (dx>
fXaxis.GetBinWidth(bin_x)/2 && dy<=
fYaxis.GetBinWidth(bin_y)/2)
1356 if (dx>
fXaxis.GetBinWidth(bin_x)/2 && dy>
fYaxis.GetBinWidth(bin_y)/2)
1358 if (dx<=
fXaxis.GetBinWidth(bin_x)/2 && dy>
fYaxis.GetBinWidth(bin_y)/2)
1362 x1 =
fXaxis.GetBinCenter(bin_x);
1363 y1 =
fYaxis.GetBinCenter(bin_y);
1364 x2 =
fXaxis.GetBinCenter(bin_x+1);
1365 y2 =
fYaxis.GetBinCenter(bin_y+1);
1368 x1 =
fXaxis.GetBinCenter(bin_x-1);
1369 y1 =
fYaxis.GetBinCenter(bin_y);
1370 x2 =
fXaxis.GetBinCenter(bin_x);
1371 y2 =
fYaxis.GetBinCenter(bin_y+1);
1374 x1 =
fXaxis.GetBinCenter(bin_x-1);
1375 y1 =
fYaxis.GetBinCenter(bin_y-1);
1376 x2 =
fXaxis.GetBinCenter(bin_x);
1377 y2 =
fYaxis.GetBinCenter(bin_y);
1380 x1 =
fXaxis.GetBinCenter(bin_x);
1381 y1 =
fYaxis.GetBinCenter(bin_y-1);
1382 x2 =
fXaxis.GetBinCenter(bin_x+1);
1383 y2 =
fYaxis.GetBinCenter(bin_y);
1387 if(bin_x1<1) bin_x1=1;
1391 if(bin_y1<1) bin_y1=1;
1403 f = 1.0*q11/
d*(x2-
x)*(y2-
y)+1.0*q21/
d*(
x-x1)*(y2-
y)+1.0*q12/
d*(x2-
x)*(
y-y1)+1.0*q22/
d*(
x-x1)*(
y-y1);
1413 Error(
"Interpolate",
"This function must be called with 2 arguments for a TH2");
1448 if (h2 ==
nullptr)
return 0;
1449 const TAxis *xaxis1 =
h1->GetXaxis();
1451 const TAxis *yaxis1 =
h1->GetYaxis();
1460 Error(
"KolmogorovTest",
"Histograms must be 2-D\n");
1466 Error(
"KolmogorovTest",
"Number of channels in X is different, %d and %d\n",ncx1,ncx2);
1470 Error(
"KolmogorovTest",
"Number of channels in Y is different, %d and %d\n",ncy1,ncy2);
1480 if (diff1 > difprec || diff2 > difprec) {
1481 Error(
"KolmogorovTest",
"histograms with different binning along X");
1486 if (diff1 > difprec || diff2 > difprec) {
1487 Error(
"KolmogorovTest",
"histograms with different binning along Y");
1492 Int_t ibeg = 1, jbeg = 1;
1493 Int_t iend = ncx1, jend = ncy1;
1494 if (opt.
Contains(
"U")) {ibeg = 0; jbeg = 0;}
1495 if (opt.
Contains(
"O")) {iend = ncx1+1; jend = ncy1+1;}
1502 for (i = ibeg; i <= iend; i++) {
1503 for (j = jbeg; j <= jend; j++) {
1504 sum1 +=
h1->GetBinContent(i,j);
1516 Error(
"KolmogorovTest",
"Integral is zero for h1=%s\n",
h1->GetName());
1520 Error(
"KolmogorovTest",
"Integral is zero for h2=%s\n",h2->
GetName());
1528 esum1 = sum1 * sum1 / w1;
1533 esum2 = sum2 * sum2 / w2;
1537 if (afunc2 && afunc1) {
1538 Error(
"KolmogorovTest",
"Errors are zero for both histograms\n");
1547 for (i=ibeg;i<=iend;i++) {
1548 for (j=jbeg;j<=jend;j++) {
1549 rsum1 +=
s1*
h1->GetBinContent(i,j);
1558 for (j=jbeg;j<=jend;j++) {
1559 for (i=ibeg;i<=iend;i++) {
1560 rsum1 +=
s1*
h1->GetBinContent(i,j);
1570 else factnm =
TMath::Sqrt(esum1*sum2/(esum1+esum2));
1573 Double_t dfmax = 0.5*(dfmax1+dfmax2);
1580 if (opt.
Contains(
"N") && !(afunc1 || afunc2 ) ) {
1584 Double_t chi2 = d12*d12/(esum1+esum2);
1587 if (prb > 0 && prb2 > 0) prb = prb*prb2*(1-
TMath::Log(prb*prb2));
1593 printf(
" Kolmo Prob h1 = %s, sum1=%g\n",
h1->GetName(),sum1);
1594 printf(
" Kolmo Prob h2 = %s, sum2=%g\n",h2->
GetName(),sum2);
1595 printf(
" Kolmo Probabil = %f, Max Dist = %g\n",prb,dfmax);
1597 printf(
" Kolmo Probabil = %f for shape alone, =%f for normalisation alone\n",prb1,prb2);
1600 if (
TMath::Abs(rsum1-1) > 0.002)
Warning(
"KolmogorovTest",
"Numerical problems with h1=%s\n",
h1->GetName());
1603 if(opt.
Contains(
"M"))
return dfmax;
1615 return Rebin2D(ngroup, 1, newname);
1625 return Rebin2D(1, ngroup, newname);
1636 if (xbins !=
nullptr) {
1637 Error(
"Rebin",
"Rebinning a 2-d histogram into variable bins is not supported (it is possible only for 1-d histograms). Return a nullptr");
1640 Info(
"Rebin",
"Rebinning only the x-axis. Use Rebin2D for rebinning both axes");
1641 return RebinX(ngroup, newname);
1673 Int_t nx = nxbins + 2;
1674 Int_t ny = nybins + 2;
1681 Error(
"Rebin2D",
"Histogram must be TH2. This histogram has %d dimensions.",
GetDimension());
1684 if ((nxgroup <= 0) || (nxgroup > nxbins)) {
1685 Error(
"Rebin2D",
"Illegal value of nxgroup=%d",nxgroup);
1688 if ((nygroup <= 0) || (nygroup > nybins)) {
1689 Error(
"Rebin2D",
"Illegal value of nygroup=%d",nygroup);
1693 Int_t newxbins = nxbins / nxgroup;
1694 Int_t newybins = nybins / nygroup;
1695 Int_t newnx = newxbins + 2;
1696 Int_t newny = newybins + 2;
1710 if (newname && strlen(newname)) {
1715 bool resetStat =
false;
1718 if(newxbins * nxgroup != nxbins) {
1719 xmax =
fXaxis.GetBinUpEdge(newxbins * nxgroup);
1722 if(newybins * nygroup != nybins) {
1723 ymax =
fYaxis.GetBinUpEdge(newybins * nygroup);
1754 if (nxgroup != 1 || nygroup != 1) {
1755 if(
fXaxis.GetXbins()->GetSize() > 0 ||
fYaxis.GetXbins()->GetSize() > 0){
1758 for(
Int_t i = 0; i <= newxbins; ++i) xbins[i] =
fXaxis.GetBinLowEdge(1 + i * nxgroup);
1760 for(
Int_t i = 0; i <= newybins; ++i) ybins[i] =
fYaxis.GetBinLowEdge(1 + i * nygroup);
1761 hnew->
SetBins(newxbins, xbins, newybins, ybins);
1770 if (oldErrors) hnew->
fSumw2[0] = 0;
1773 for(
Int_t binx = 1, oldbinx = 1; binx < newnx; ++binx, oldbinx += nxgroup){
1774 Double_t binContent = 0.0, binErrorSq = 0.0;
1775 for (
Int_t i = 0; i < nxgroup && (oldbinx + i) < nx; ++i) {
1776 Int_t bin = oldbinx + i;
1777 binContent += oldBins[bin];
1778 if(oldErrors) binErrorSq += oldErrors[bin];
1780 Int_t newbin = binx;
1782 if (oldErrors) hnew->
fSumw2[newbin] = binErrorSq;
1786 for(
Int_t biny = 1, oldbiny = 1; biny < newny; ++biny, oldbiny += nygroup){
1787 Double_t binContent = 0.0, binErrorSq = 0.0;
1788 for (
Int_t j = 0; j < nygroup && (oldbiny + j) < ny; ++j) {
1789 Int_t bin = (oldbiny + j) * nx;
1790 binContent += oldBins[bin];
1791 if(oldErrors) binErrorSq += oldErrors[bin];
1793 Int_t newbin = biny * newnx;
1795 if (oldErrors) hnew->
fSumw2[newbin] = binErrorSq;
1799 for (
Int_t binx = 1, oldbinx = 1; binx < newnx; ++binx, oldbinx += nxgroup) {
1800 for (
Int_t biny = 1, oldbiny = 1; biny < newny; ++biny, oldbiny += nygroup) {
1801 Double_t binContent = 0.0, binErrorSq = 0.0;
1802 for (
Int_t i = 0; i < nxgroup && (oldbinx + i) < nx; ++i) {
1803 for (
Int_t j = 0; j < nygroup && (oldbiny + j) < ny; ++j) {
1804 Int_t bin = oldbinx + i + (oldbiny + j) * nx;
1805 binContent += oldBins[bin];
1806 if (oldErrors) binErrorSq += oldErrors[bin];
1809 Int_t newbin = binx + biny * newnx;
1811 if (oldErrors) hnew->
fSumw2[newbin] = binErrorSq;
1817 fXaxis.SetNdivisions(nXdivisions);
1818 fXaxis.SetAxisColor(xAxisColor);
1819 fXaxis.SetLabelColor(xLabelColor);
1820 fXaxis.SetLabelFont(xLabelFont);
1821 fXaxis.SetLabelOffset(xLabelOffset);
1822 fXaxis.SetLabelSize(xLabelSize);
1823 fXaxis.SetTickLength(xTickLength);
1824 fXaxis.SetTitleOffset(xTitleOffset);
1825 fXaxis.SetTitleSize(xTitleSize);
1826 fXaxis.SetTitleColor(xTitleColor);
1827 fXaxis.SetTitleFont(xTitleFont);
1829 fYaxis.SetNdivisions(nYdivisions);
1830 fYaxis.SetAxisColor(yAxisColor);
1831 fYaxis.SetLabelColor(yLabelColor);
1832 fYaxis.SetLabelFont(yLabelFont);
1833 fYaxis.SetLabelOffset(yLabelOffset);
1834 fYaxis.SetLabelSize(yLabelSize);
1835 fYaxis.SetTickLength(yTickLength);
1836 fYaxis.SetTitleOffset(yTitleOffset);
1837 fYaxis.SetTitleSize(yTitleSize);
1838 fYaxis.SetTitleColor(yTitleColor);
1839 fYaxis.SetTitleFont(yTitleFont);
1844 if (oldErrors)
delete [] oldErrors;
1859 cut = opt(i1,i2-i1+1);
1862 bool originalRange = opt.
Contains(
"o");
1863 bool useWidth = opt.
Contains(
"width");
1868 const char *expectedName = ( onX ?
"_pfx" :
"_pfy" );
1881 if (firstbin == 0 && lastbin == 0)
1887 if (firstbin < 0) firstbin = 1;
1888 if (lastbin < 0) lastbin = inN;
1889 if (lastbin > inN+1) lastbin = inN;
1892 char *pname = (
char*)
name;
1893 if (
name && strcmp(
name, expectedName) == 0) {
1895 pname =
new char[nch];
1904 Error(
"DoProfile",
"Histogram with name %s must be a TProfile and is a %s",
name,h1obj->
ClassName());
1913 if (xbins->fN == 0) {
1914 if ( originalRange )
1921 h1->SetBins(outAxis.
GetNbins(),xbins->fArray);
1923 h1->SetBins(lastOutBin-firstOutBin+1,&xbins->fArray[firstOutBin-1]);
1929 ((
TH2 *)
this)->GetPainter();
1935 if (bins->
fN == 0) {
1936 if ( originalRange )
1950 if (pname !=
name)
delete [] pname;
1953 h1->GetXaxis()->ImportAttributes( &outAxis);
1972 TArrayD & binSumw2 = *(
h1->GetBinSumw2());
1974 if (useWeights && (binSumw2.
fN !=
h1->GetNcells()) )
h1->Sumw2();
1985 for (
Int_t outbin = 0; outbin <= outAxis.
GetNbins() + 1; ++outbin) {
1990 Int_t binOut =
h1->GetXaxis()->FindBin( xOut );
1991 if (binOut <0)
continue;
1993 for (
Int_t inbin = firstbin ; inbin <= lastbin ; ++inbin) {
1995 if (onX) { binx = outbin; biny=inbin; }
1996 else { binx = inbin; biny=outbin; }
1999 if (!
fPainter->IsInside(binx,biny))
continue;
2003 double step = useWidth ? inAxis.
GetBinWidth(inbin) : 1;
2008 if ( useWeights ) tmp = binSumw2.
fArray[binOut];
2010 if ( useWeights ) binSumw2.
fArray[binOut] = tmp +
fSumw2.fArray[bin];
2022 h1->SetEntries(
h1->GetEffectiveEntries() );
2149 const char *expectedName =
nullptr;
2151 const TAxis* outAxis;
2152 const TAxis* inAxis;
2159 cut = opt(i1,i2-i1+1);
2162 bool originalRange = opt.
Contains(
"o");
2163 bool useWidth = opt.
Contains(
"width");
2167 expectedName =
"_px";
2168 inNbin =
fYaxis.GetNbins();
2174 expectedName =
"_py";
2175 inNbin =
fXaxis.GetNbins();
2191 if (firstbin == 0 && lastbin == 0)
2197 if (firstbin < 0) firstbin = 0;
2198 if (lastbin < 0) lastbin = inNbin + 1;
2199 if (lastbin > inNbin+1) lastbin = inNbin + 1;
2202 char *pname = (
char*)
name;
2203 if (
name && strcmp(
name,expectedName) == 0) {
2205 pname =
new char[nch];
2215 Error(
"DoProjection",
"Histogram with name %s must be a TH1D and is a %s",
name,h1obj->
ClassName());
2224 if (xbins->fN == 0) {
2225 if ( originalRange )
2232 h1->SetBins(outAxis->
GetNbins(),xbins->fArray);
2234 h1->SetBins(lastOutBin-firstOutBin+1,&xbins->fArray[firstOutBin-1]);
2240 ((
TH2 *)
this)->GetPainter();
2246 if (bins->
fN == 0) {
2247 if ( originalRange )
2262 if (pname !=
name)
delete [] pname;
2265 h1->GetXaxis()->ImportAttributes(outAxis);
2285 Bool_t computeErrors =
h1->GetSumw2N();
2292 if ( labels && extendable )
h1->GetXaxis()->SetCanExtend(
kFALSE);
2293 for (
Int_t outbin = 0; outbin <= outAxis->
GetNbins() + 1; ++outbin) {
2298 for (
Int_t inbin = firstbin ; inbin <= lastbin ; ++inbin) {
2300 if (onX) { binx = outbin; biny=inbin; }
2301 else { binx = inbin; biny=outbin; }
2304 if (!
fPainter->IsInside(binx,biny))
continue;
2307 double step = useWidth ? inAxis->
GetBinWidth(inbin) : 1;
2309 if (computeErrors) {
2316 h1->SetBinContent(binOut ,cont);
2317 if (computeErrors)
h1->SetBinError(binOut,
TMath::Sqrt(err2));
2321 if ( labels )
h1->GetXaxis()->SetCanExtend(extendable);
2324 bool reuseStats =
false;
2330 double eps = 1.E-12;
2335 if (ncuts) reuseStats =
false;
2337 bool reuseEntries = reuseStats;
2339 reuseEntries &= (firstbin==0 && lastbin == inNbin+1);
2344 stats[2] = stats[4];
2345 stats[3] = stats[5];
2347 h1->PutStats(stats);
2353 h1->SetEntries(
h1->GetEffectiveEntries() );
2364 if (
h1->GetSumw2N()) entries =
h1->GetEffectiveEntries();
2365 h1->SetEntries( entries );
2516 const TAxis *outAxis =
nullptr;
2525 if (qname.
IsNull() || qname ==
"_qx" || qname ==
"_qy") {
2526 const char * qtype = (onX) ?
"qx" :
"qy";
2534 h1 =
dynamic_cast<TH1D*
>(h1obj);
2536 Error(
"DoQuantiles",
"Histogram with name %s must be a TH1D and is a %s",qname.
Data(),h1obj->
ClassName());
2553 h1->SetBins(lastOutBin-firstOutBin+1,&xbins->fArray[firstOutBin-1]);
2559 TH1D * slice =
nullptr;
2560 for (
int ibin = outAxis->
GetFirst() ; ibin <= outAxis->GetLast() ; ++ibin) {
2565 if (slice->
GetSum() == 0)
continue;
2567 h1->SetBinContent(ibin,qq[0]);
2577 h1->SetBinError(ibin, error);
2579 if (slice)
delete slice;
2607 if (bin < 0)
return;
2668 return (
TH1 *)
gROOT->ProcessLineFast(
2669 TString::Format(
"TSpectrum2::StaticBackground((TH1*)0x%zx,%d,%d,\"%s\")", (
size_t)
this, nIterX, nIterY, option)
2686 (
size_t)
this,
sigma, option, threshold).Data());
2716 Double_t k5a[5][5] = { { 0, 0, 1, 0, 0 },
2720 { 0, 0, 1, 0, 0 } };
2721 Double_t k5b[5][5] = { { 0, 1, 2, 1, 0 },
2725 { 0, 1, 2, 1, 0 } };
2726 Double_t k3a[3][3] = { { 0, 1, 0 },
2731 Warning(
"Smooth",
"Currently only ntimes=1 is supported");
2738 if (opt.
Contains(
"k5b")) kernel = &k5b[0][0];
2740 kernel = &k3a[0][0];
2755 Int_t bufSize = (nx+2)*(ny+2);
2762 for (i=ifirst; i<=ilast; i++){
2763 for (j=jfirst; j<=jlast; j++){
2771 Int_t x_push = (ksize_x-1)/2;
2772 Int_t y_push = (ksize_y-1)/2;
2775 for (i=ifirst; i<=ilast; i++){
2776 for (j=jfirst; j<=jlast; j++) {
2785 if ( (xb >= 1) && (xb <= nx) && (yb >= 1) && (yb <= ny) ) {
2791 content += k*buf[bin];
2792 if (ebuf) error += k*k*ebuf[bin]*ebuf[bin];
2798 if ( norm != 0.0 ) {
2801 error /= (norm*norm);
2869 :
TH2(
name,title,nbinsx,xlow,xup,nbinsy,ylow,yup)
2884 :
TH2(
name,title,nbinsx,xbins,nbinsy,ylow,yup)
2897 :
TH2(
name,title,nbinsx,xlow,xup,nbinsy,ybins)
2910 :
TH2(
name,title,nbinsx,xbins,nbinsy,ybins)
2923 :
TH2(
name,title,nbinsx,xbins,nbinsy,ybins)
2936 h2c.TH2C::Copy(*
this);
2958 if (newval > -128 && newval < 128) {
fArray[bin] =
Char_t(newval);
return;}
2959 if (newval < -127)
fArray[bin] = -127;
2960 if (newval > 127)
fArray[bin] = 127;
3036 h2c.TH2C::Copy(*
this);
3132 :
TH2(
name,title,nbinsx,xlow,xup,nbinsy,ylow,yup)
3147 :
TH2(
name,title,nbinsx,xbins,nbinsy,ylow,yup)
3160 :
TH2(
name,title,nbinsx,xlow,xup,nbinsy,ybins)
3173 :
TH2(
name,title,nbinsx,xbins,nbinsy,ybins)
3186 :
TH2(
name,title,nbinsx,xbins,nbinsy,ybins)
3199 h2s.TH2S::Copy(*
this);
3221 if (newval > -32768 && newval < 32768) {
fArray[bin] =
Short_t(newval);
return;}
3222 if (newval < -32767)
fArray[bin] = -32767;
3223 if (newval > 32767)
fArray[bin] = 32767;
3299 h2s.TH2S::Copy(*
this);
3395 :
TH2(
name,title,nbinsx,xlow,xup,nbinsy,ylow,yup)
3410 :
TH2(
name,title,nbinsx,xbins,nbinsy,ylow,yup)
3423 :
TH2(
name,title,nbinsx,xlow,xup,nbinsy,ybins)
3436 :
TH2(
name,title,nbinsx,xbins,nbinsy,ybins)
3449 :
TH2(
name,title,nbinsx,xbins,nbinsy,ybins)
3462 h2i.TH2I::Copy(*
this);
3484 if (newval > -INT_MAX && newval < INT_MAX) {
fArray[bin] =
Int_t(newval);
return;}
3485 if (newval < -INT_MAX)
fArray[bin] = -INT_MAX;
3486 if (newval > INT_MAX)
fArray[bin] = INT_MAX;
3527 h2i.TH2I::Copy(*
this);
3623 :
TH2(
name,title,nbinsx,xlow,xup,nbinsy,ylow,yup)
3638 :
TH2(
name,title,nbinsx,xbins,nbinsy,ylow,yup)
3651 :
TH2(
name,title,nbinsx,xlow,xup,nbinsy,ybins)
3664 :
TH2(
name,title,nbinsx,xbins,nbinsy,ybins)
3677 :
TH2(
name,title,nbinsx,xbins,nbinsy,ybins)
3690 h2l.TH2L::Copy(*
this);
3712 if (newval > -LLONG_MAX && newval < LLONG_MAX) {
fArray[bin] = newval;
return;}
3713 if (newval < -LLONG_MAX)
fArray[bin] = -LLONG_MAX;
3714 if (newval > LLONG_MAX)
fArray[bin] = LLONG_MAX;
3755 h2l.TH2L::Copy(*
this);
3851 :
TH2(
name,title,nbinsx,xlow,xup,nbinsy,ylow,yup)
3866 :
TH2(
name,title,nbinsx,xbins,nbinsy,ylow,yup)
3879 :
TH2(
name,title,nbinsx,xlow,xup,nbinsy,ybins)
3892 :
TH2(
name,title,nbinsx,xbins,nbinsy,ybins)
3905 :
TH2(
name,title,nbinsx,xbins,nbinsy,ybins)
3917:
TH2(
"TMatrixFBase",
"",
m.GetNcols(),
m.GetColLwb(),1+
m.GetColUpb(),
m.GetNrows(),
m.GetRowLwb(),1+
m.GetRowUpb())
3920 Int_t ilow =
m.GetRowLwb();
3921 Int_t iup =
m.GetRowUpb();
3922 Int_t jlow =
m.GetColLwb();
3923 Int_t jup =
m.GetColUpb();
3924 for (
Int_t i=ilow;i<=iup;i++) {
3925 for (
Int_t j=jlow;j<=jup;j++) {
3938 h2f.TH2F::Copy(*
this);
4014 h2f.TH2F::Copy(*
this);
4122 :
TH2(
name,title,nbinsx,xlow,xup,nbinsy,ylow,yup)
4137 :
TH2(
name,title,nbinsx,xbins,nbinsy,ylow,yup)
4150 :
TH2(
name,title,nbinsx,xlow,xup,nbinsy,ybins)
4163 :
TH2(
name,title,nbinsx,xbins,nbinsy,ybins)
4176 :
TH2(
name,title,nbinsx,xbins,nbinsy,ybins)
4188:
TH2(
"TMatrixDBase",
"",
m.GetNcols(),
m.GetColLwb(),1+
m.GetColUpb(),
m.GetNrows(),
m.GetRowLwb(),1+
m.GetRowUpb())
4191 Int_t ilow =
m.GetRowLwb();
4192 Int_t iup =
m.GetRowUpb();
4193 Int_t jlow =
m.GetColLwb();
4194 Int_t jup =
m.GetColUpb();
4195 for (
Int_t i=ilow;i<=iup;i++) {
4196 for (
Int_t j=jlow;j<=jup;j++) {
int Int_t
Signed integer 4 bytes (int).
short Version_t
Class version identifier (short).
char Char_t
Character 1 byte (char).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
short Short_t
Signed Short integer 2 bytes (short).
double Double_t
Double 8 bytes.
short Color_t
Color number (short).
long long Long64_t
Portable signed long integer 8 bytes.
short Style_t
Style number (short).
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
TH2C operator+(TH2C const &h1, TH2C const &h2)
Operator +.
TH2C operator*(Float_t c1, TH2C const &h1)
Operator *.
TH2C operator/(TH2C const &h1, TH2C const &h2)
Operator /.
TH2C operator-(TH2C const &h1, TH2C const &h2)
Operator -.
TMatrixTBase< Double_t > TMatrixDBase
TMatrixTBase< Float_t > TMatrixFBase
TArrayC()
Default TArrayC ctor.
void Streamer(TBuffer &) override
Stream a TArrayC object.
void Set(Int_t n) override
Set size of this array to n chars.
Array of doubles (64 bits per element).
void Streamer(TBuffer &) override
Stream a TArrayD object.
void Set(Int_t n) override
Set size of this array to n doubles.
TArrayD()
Default TArrayD ctor.
TArrayF()
Default TArrayF ctor.
void Set(Int_t n) override
Set size of this array to n floats.
void Streamer(TBuffer &) override
Stream a TArrayF object.
void Set(Int_t n) override
Set size of this array to n ints.
TArrayI()
Default TArrayI ctor.
void Set(Int_t n) override
Set size of this array to n long64s.
TArrayL64()
Default TArrayL64 ctor.
void Set(Int_t n) override
Set size of this array to n shorts.
TArrayS()
Default TArrayS ctor.
void Streamer(TBuffer &) override
Stream a TArrayS object.
virtual Color_t GetFillColor() const
Return the fill area color.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual Color_t GetLineColor() const
Return the line color.
virtual Style_t GetMarkerStyle() const
Return the marker style.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual Color_t GetMarkerColor() const
Return the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
Class to manage histogram axis.
const char * GetTitle() const override
Returns title of object.
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
const TArrayD * GetXbins() const
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
Int_t GetLast() const
Return last bin on the axis i.e.
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
Int_t GetFirst() const
Return first bin on the axis i.e.
THashList * GetLabels() const
Buffer base class used for serializing objects.
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
1-D histogram with a double per channel (see TH1 documentation)
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
Double_t * fBuffer
[fBufferSize] entry buffer
virtual Double_t GetEffectiveEntries() const
Number of effective entries of the histogram.
virtual Bool_t Multiply(TF1 *f1, Double_t c1=1)
Performs the operation:
Int_t fNcells
Number of bins(1D), cells (2D) +U/Overflows.
void Copy(TObject &hnew) const override
Copy this histogram structure to newth1.
Double_t fTsumw
Total Sum of weights.
Double_t fTsumw2
Total Sum of squares of weights.
virtual Double_t DoIntegral(Int_t ix1, Int_t ix2, Int_t iy1, Int_t iy2, Int_t iz1, Int_t iz2, Double_t &err, Option_t *opt, Bool_t doerr=kFALSE) const
Internal function compute integral and optionally the error between the limits specified by the bin n...
Double_t fTsumwx2
Total Sum of weight*X*X.
virtual Double_t GetStdDev(Int_t axis=1) const
Returns the Standard Deviation (Sigma).
virtual Int_t GetNbinsY() const
virtual Double_t GetBinError(Int_t bin) const
Return value of error associated to bin number bin.
virtual Double_t GetMean(Int_t axis=1) const
For axis = 1,2 or 3 returns the mean value of the histogram along X,Y or Z axis.
virtual Int_t GetDimension() const
void Streamer(TBuffer &) override
Stream a class object.
@ kIsNotW
Histogram is forced to be not weighted even when the histogram is filled with weighted.
virtual Bool_t CanExtendAllAxes() const
Returns true if all axes are extendable.
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
TVirtualHistPainter * GetPainter(Option_t *option="")
Return pointer to painter.
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
Fit histogram with function fname.
virtual Int_t GetBin(Int_t binx, Int_t biny=0, Int_t binz=0) const
Return Global bin number corresponding to binx,y,z.
virtual Int_t GetNbinsX() const
virtual Bool_t Add(TF1 *h1, Double_t c1=1, Option_t *option="")
Performs the operation: this = this + c1*f1 if errors are defined (see TH1::Sumw2),...
Int_t fBufferSize
fBuffer size
Int_t fDimension
! Histogram dimension (1, 2 or 3 dim)
virtual void SetBinError(Int_t bin, Double_t error)
Set the bin Error Note that this resets the bin eror option to be of Normal Type and for the non-empt...
static Int_t fgBufferSize
! Default buffer size for automatic histograms
virtual Double_t GetBinErrorSqUnchecked(Int_t bin) const
virtual void SetBuffer(Int_t bufsize, Option_t *option="")
Set the maximum number of entries to be kept in the buffer.
UInt_t GetAxisLabelStatus() const
Internal function used in TH1::Fill to see which axis is full alphanumeric, i.e.
Double_t * fIntegral
! Integral of bins used by GetRandom
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
virtual Double_t GetBinLowEdge(Int_t bin) const
Return bin lower edge for 1D histogram.
virtual Double_t GetEntries() const
Return the current number of entries.
virtual Double_t RetrieveBinContent(Int_t bin) const =0
Raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::Get...
void SetName(const char *name) override
Change the name of this histogram.
virtual void ResetStats()
Reset the statistics including the number of entries and replace with values calculated from bin cont...
@ kNstat
Size of statistics data (up to TProfile3D).
Double_t fEntries
Number of entries.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
TAxis fXaxis
X axis descriptor.
virtual void ExtendAxis(Double_t x, TAxis *axis)
Histogram is resized along axis such that x is in the axis range.
TArrayD fSumw2
Array of sum of squares of weights.
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
virtual Double_t ComputeIntegral(Bool_t onlyPositive=false, Option_t *option="")
Compute integral (normalized cumulative sum of bins) w/o under/overflows The result is stored in fInt...
virtual Int_t GetSumw2N() const
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
Return Global bin number corresponding to x,y,z.
Bool_t GetStatOverflowsBehaviour() const
virtual Int_t GetQuantiles(Int_t n, Double_t *xp, const Double_t *p=nullptr)
Compute Quantiles for this histogram.
TObject * Clone(const char *newname="") const override
Make a complete copy of the underlying object.
virtual Bool_t Divide(TF1 *f1, Double_t c1=1)
Performs the operation: this = this/(c1*f1) if errors are defined (see TH1::Sumw2),...
TAxis fYaxis
Y axis descriptor.
TVirtualHistPainter * fPainter
! Pointer to histogram painter
virtual void SetBins(Int_t nx, Double_t xmin, Double_t xmax)
Redefine x axis parameters.
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
static Bool_t fgDefaultSumw2
! Flag to call TH1::Sumw2 automatically at histogram creation time
virtual void UpdateBinContent(Int_t bin, Double_t content)=0
Raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin...
Double_t fTsumwx
Total Sum of weight*X.
void Reset(Option_t *option="") override
Reset this histogram: contents, errors, etc.
TClass * IsA() const override
void Streamer(TBuffer &) override
Stream an object of class TH2C.
void AddBinContent(Int_t bin) override
Increment bin content by 1.
TH2C & operator=(const TH2C &h1)
Operator =.
~TH2C() override
Destructor.
void Copy(TObject &hnew) const override
Copy.
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
void Streamer(TBuffer &) override
Stream an object of class TH2D.
TClass * IsA() const override
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
~TH2D() override
Destructor.
void Copy(TObject &hnew) const override
Copy.
TH2D & operator=(const TH2D &h1)
Operator =.
TClass * IsA() const override
TH2F & operator=(const TH2F &h1)
Operator =.
~TH2F() override
Destructor.
void Copy(TObject &hnew) const override
Copy.
void Streamer(TBuffer &) override
Stream an object of class TH2F.
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
void Copy(TObject &hnew) const override
Copy.
void AddBinContent(Int_t bin) override
Increment bin content by 1.
~TH2I() override
Destructor.
TH2I & operator=(const TH2I &h1)
Operator =.
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
TH2L & operator=(const TH2L &h1)
Operator =.
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
~TH2L() override
Destructor.
void Copy(TObject &hnew) const override
Copy.
void AddBinContent(Int_t bin) override
Increment bin content by 1.
void AddBinContent(Int_t bin) override
Increment bin content by 1.
~TH2S() override
Destructor.
TH2S & operator=(const TH2S &h1)
Operator =.
void Copy(TObject &hnew) const override
Copy.
void Streamer(TBuffer &) override
Stream an object of class TH2S.
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
TClass * IsA() const override
TH1D * ProjectionY(const char *name="_py", Int_t firstxbin=0, Int_t lastxbin=-1, Option_t *option="") const
Project a 2-D histogram into a 1-D histogram along Y (integration along X).
void GetStats(Double_t *stats) const override
Fill the array stats from the contents of this histogram The array stats must be correctly dimensione...
Int_t ShowPeaks(Double_t sigma=2, Option_t *option="", Double_t threshold=0.05) override
Interface to TSpectrum2::Search the function finds peaks in this histogram where the width is > sigma...
virtual Double_t GetCorrelationFactor(Int_t axis1=1, Int_t axis2=2) const
Return correlation factor between axis1 and axis2.
virtual TProfile * DoProfile(bool onX, const char *name, Int_t firstbin, Int_t lastbin, Option_t *option) const
virtual void GetRandom2(Double_t &x, Double_t &y, TRandom *rng=nullptr, Option_t *option="")
Return 2 random numbers along axis x and y distributed according to the cell-contents of this 2-D his...
Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const override
Statistical test of compatibility in shape between THIS histogram and h2, using Kolmogorov test.
virtual void FitSlicesY(TF1 *f1=nullptr, Int_t firstxbin=0, Int_t lastxbin=-1, Int_t cut=0, Option_t *option="QNR", TObjArray *arr=nullptr)
Project slices along Y in case of a 2-D histogram, then fit each slice with function f1 and make a hi...
virtual Double_t GetBinWithContent2(Double_t c, Int_t &binx, Int_t &biny, Int_t firstxbin=1, Int_t lastxbin=-1, Int_t firstybin=1, Int_t lastybin=-1, Double_t maxdiff=0) const
compute first cell (binx,biny) in the range [firstxbin,lastxbin][firstybin,lastybin] for which diff =...
TProfile * ProfileX(const char *name="_pfx", Int_t firstybin=1, Int_t lastybin=-1, Option_t *option="") const
Project a 2-D histogram into a profile histogram along X (integration along Y).
TH2 * Rebin(Int_t ngroup=2, const char *newname="", const Double_t *xbins=nullptr) override
Override TH1::Rebin as TH2::RebinX Rebinning in variable binning as for TH1 is not allowed If a non-n...
void FillN(Int_t, const Double_t *, const Double_t *, Int_t) override
Fill this histogram with an array x and weights w.
void FillRandom(TF1 *function, Int_t ntimes=5000, TRandom *rng=nullptr) override
Fill histogram following distribution in function function.
TH1D * QuantilesY(Double_t prob=0.5, const char *name="_qy") const
Compute the Y distribution of quantiles in the other variable X name is the name of the returned hist...
void AddBinContent(Int_t binx, Int_t biny)
Increment 2D bin content by 1.
TProfile * ProfileY(const char *name="_pfy", Int_t firstxbin=1, Int_t lastxbin=-1, Option_t *option="") const
Project a 2-D histogram into a profile histogram along Y (integration along X).
void Copy(TObject &hnew) const override
Copy.
virtual TH1D * DoQuantiles(bool onX, const char *name, Double_t prob) const
Implementation of quantiles for x or y.
Double_t fTsumwxy
Total Sum of weight*X*Y.
void SetBinContent(Int_t bin, Double_t content) override
Set bin content.
Int_t BufferEmpty(Int_t action=0) override
Fill histogram with all entries in the buffer.
virtual void DoFitSlices(bool onX, TF1 *f1, Int_t firstbin, Int_t lastbin, Int_t cut, Option_t *option, TObjArray *arr)
TH1D * QuantilesX(Double_t prob=0.5, const char *name="_qx") const
Compute the X distribution of quantiles in the other variable Y name is the name of the returned hist...
virtual void SetShowProjectionY(Int_t nbins=1)
When the mouse is moved in a pad containing a 2-d view of this histogram a second canvas shows the pr...
TClass * IsA() const override
void Reset(Option_t *option="") override
Reset this histogram: contents, errors, etc.
Double_t fScalefactor
Scale factor.
virtual TH1 * ShowBackground2D(Int_t nIterX=20, Int_t nIterY=20, Option_t *option="same")
This function calculates the background spectrum in this histogram.
virtual TH1D * DoProjection(bool onX, const char *name, Int_t firstbin, Int_t lastbin, Option_t *option) const
Internal (protected) method for performing projection on the X or Y axis called by ProjectionX or Pro...
TH2 * RebinX(Int_t ngroup=2, const char *newname="") override
Rebin only the X axis see Rebin2D.
Double_t fTsumwy2
Total Sum of weight*Y*Y.
virtual Double_t GetCovariance(Int_t axis1=1, Int_t axis2=2) const
Return covariance between axis1 and axis2.
Int_t GetBin(Int_t binx, Int_t biny, Int_t binz=0) const override
Return Global bin number corresponding to binx,y,z.
TH1D * ProjectionX(const char *name="_px", Int_t firstybin=0, Int_t lastybin=-1, Option_t *option="") const
Project a 2-D histogram into a 1-D histogram along X (integration along Y).
void Smooth(Int_t ntimes=1, Option_t *option="") override
Smooth bin contents of this 2-d histogram using kernel algorithms similar to the ones used in the ras...
~TH2() override
Destructor.
Double_t GetBinContent(Int_t binx, Int_t biny) const override
virtual Double_t IntegralAndError(Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Double_t &err, Option_t *option="") const
Return integral of bin contents in range [firstxbin,lastxbin],[firstybin,lastybin] for a 2-D histogra...
Double_t fTsumwy
Total Sum of weight*Y.
TH2()
2-D histogram default constructor.
Double_t Interpolate(Double_t x) const override
illegal for a TH2
virtual void SetShowProjectionX(Int_t nbins=1)
When the mouse is moved in a pad containing a 2-d view of this histogram a second canvas shows the pr...
void Streamer(TBuffer &) override
Stream an object of class TH2.
Int_t Fill(Double_t) override
Invalid Fill method.
virtual TH2 * Rebin2D(Int_t nxgroup=2, Int_t nygroup=2, const char *newname="")
Rebin this histogram grouping nxgroup/nygroup bins along the xaxis/yaxis together.
virtual void FitSlicesX(TF1 *f1=nullptr, Int_t firstybin=0, Int_t lastybin=-1, Int_t cut=0, Option_t *option="QNR", TObjArray *arr=nullptr)
Project slices along X in case of a 2-D histogram, then fit each slice with function f1 and make a hi...
virtual Int_t BufferFill(Double_t x, Double_t y, Double_t w)
accumulate arguments in buffer.
virtual void SetShowProjectionXY(Int_t nbinsY=1, Int_t nbinsX=1)
When the mouse is moved in a pad containing a 2-d view of this histogram two canvases show the projec...
Double_t Integral(Option_t *option="") const override
Return integral of bin contents.
void PutStats(Double_t *stats) override
Replace current statistics with the values in array stats.
virtual TH2 * RebinY(Int_t ngroup=2, const char *newname="")
Rebin only the Y axis see Rebin2D.
static THLimitsFinder * GetLimitsFinder()
Return pointer to the current finder.
virtual Int_t FindGoodLimitsXY(TH1 *h, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Int_t newbinsx=0, Int_t newbinsy=0)
Compute the best axis limits for the X and Y axis if the corresponding newbins variable is set to 0,...
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void Expand(Int_t newSize)
Expand or shrink the array to newSize elements.
Collectable string class.
Mother of all ROOT objects.
Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual TClass * IsA() const
TObject()
TObject constructor.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
This is the base class for the ROOT Random number generators.
Double_t Rndm() override
Machine independent random number generator.
void ToLower()
Change string to lower-case.
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
void ToUpper()
Change string to upper case.
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
small helper class to store/restore gPad context in TPad methods
Double_t Gaus(Double_t x, Double_t mean=0, Double_t sigma=1, Bool_t norm=kFALSE)
Calculates a gaussian function with mean and sigma.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Prob(Double_t chi2, Int_t ndf)
Double_t QuietNaN()
Returns a quiet NaN as defined by IEEE 754.
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than x.
Double_t Log(Double_t x)
Returns the natural logarithm of x.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Double_t KolmogorovProb(Double_t z)
Long64_t BinarySearch(Long64_t n, const T *array, T value)
Binary search in an array of n values to locate value.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.