125:
TH2D(
name,title,nx,xlow,xup,ny,ylow,yup)
135:
TH2D(
name,title,nx,xbins,ny,ylow,yup)
144:
TH2D(
name,title,nx,xlow,xup,ny,ybins)
168TProfile2D::TProfile2D(
const char *
name,
const char *title,
Int_t nx,
Double_t xlow,
Double_t xup,
Int_t ny,
Double_t ylow,
Double_t yup,
Double_t zlow,
Double_t zup,
Option_t *option)
169:
TH2D(
name,title,nx,xlow,xup,ny,ylow,yup)
207 profile2d.TProfile2D::Copy(*
this);
212 if (
this != &profile2d)
213 profile2d.TProfile2D::Copy(*
this);
222 Error(
"Add",
"Function not implemented for TProfile2D");
232 Error(
"Add",
"Attempt to add a non-existing profile");
236 Error(
"Add",
"Attempt to add a non-profile2D object");
251 Error(
"Add",
"Attempt to add a non-existing profile");
255 Error(
"Add",
"Attempt to add a non-profile2D object");
259 Error(
"Add",
"Attempt to add a non-profile2D object");
295 if (!nbentries)
return 0;
298 if (action == 0)
return 0;
299 nbentries = -nbentries;
310 for (
Int_t i=1;i<nbentries;i++) {
333 for (
Int_t i=0;i<nbentries;i++) {
334 Fill(buffer[4*i+2],buffer[4*i+3],buffer[4*i+4],buffer[4*i+1]);
362 nbentries = -nbentries;
392 if (
auto other =
dynamic_cast<const TProfile2D *
>(h2); other) {
394 Error(
"Chi2Test",
"Chi2 tests need TProfiles in 'error of mean' mode.");
402 Error(
"Chi2Test",
"TProfiles need to be tested with the 'W' option. Either use option 'WW' or use "
403 "histogram.Chi2Test(<profile>, 'UW')");
421 for (
int bin=0;bin<
fNcells;bin++) {
444 Error(
"Divide",
"Function not implemented for TProfile2D");
459 Error(
"Divide",
"Attempt to divide a non-existing profile2D");
463 Error(
"Divide",
"Attempt to divide a non-profile2D object");
474 Error(
"Divide",
"Attempt to divide profiles with different number of bins");
479 Error(
"Divide",
"Attempt to divide profiles with different number of bins");
492 for (binx =0;binx<=nx+1;binx++) {
493 for (biny =0;biny<=ny+1;biny++) {
494 bin = biny*(
fXaxis.GetNbins()+2) + binx;
517 else fSumw2.fArray[bin] = (e0*
c1*
c1 + e1*c0*c0)/(c12*c12);
525 Warning(
"Divide",
"Cannot preserve during the division of profiles the sum of bin weight square");
545 Error(
"Divide",
"Attempt to divide a non-existing profile2D");
549 Error(
"Divide",
"Attempt to divide a non-profile2D object");
554 Error(
"Divide",
"Attempt to divide a non-profile2D object");
565 Error(
"Divide",
"Attempt to divide profiles with different number of bins");
570 Error(
"Divide",
"Attempt to divide profiles with different number of bins");
574 Error(
"Divide",
"Coefficient of dividing profile cannot be zero");
592 for (binx =0;binx<=nx+1;binx++) {
593 for (biny =0;biny<=ny+1;biny++) {
594 bin = biny*(
fXaxis.GetNbins()+2) + binx;
597 if (b2) w =
c1*b1/(
c2*b2);
617 if (!b2)
fSumw2.fArray[bin] = 0;
622 fSumw2.fArray[bin] = ac1*ac2*(e1*b2*b2 + e2*b1*b1)/(b22*b22);
648 if (binx <0 || biny <0)
return -1;
651 fSumw2.fArray[bin] += z*z;
654 if (binx == 0 || binx >
fXaxis.GetNbins()) {
657 if (biny == 0 || biny >
fYaxis.GetNbins()) {
679 Int_t bin, binx, biny;
689 if (binx < 0 || biny < 0)
return -1;
690 bin = biny * (
fXaxis.GetNbins() + 2) + binx;
692 fSumw2.fArray[bin] += u * z * z;
698 if (binx == 0 || binx >
fXaxis.GetNbins()) {
701 if (biny == 0 || biny >
fYaxis.GetNbins()) {
729 biny =
fYaxis.FindBin(namey);
730 if (binx <0 || biny <0)
return -1;
731 bin = biny*(
fXaxis.GetNbins()+2) + binx;
733 fSumw2.fArray[bin] += u * z * z;
739 if (binx == 0 || binx >
fXaxis.GetNbins()) {
742 if (biny == 0 || biny >
fYaxis.GetNbins())
return -1;
773 binx =
fXaxis.FindBin(namex);
774 biny =
fYaxis.FindBin(namey);
775 if (binx < 0 || biny < 0)
777 bin = biny * (
fXaxis.GetNbins() + 2) + binx;
779 fSumw2.fArray[bin] += u * z * z;
785 if (binx == 0 || binx >
fXaxis.GetNbins())
return -1;
786 if (biny == 0 || biny >
fYaxis.GetNbins())
return -1;
818 binx =
fXaxis.FindBin(namex);
820 if (binx <0 || biny <0)
return -1;
821 bin = biny*(
fXaxis.GetNbins()+2) + binx;
824 fSumw2.fArray[bin] += u * z * z;
830 if (binx == 0 || binx >
fXaxis.GetNbins())
return -1;
831 if (biny == 0 || biny >
fYaxis.GetNbins()) {
860 if (bin < 0 || bin >=
fNcells)
return 0;
873 if (bin < 0 || bin >=
fNcells)
return 0;
953 Int_t bin, binx, biny;
956 for (bin=0;bin<9;bin++) stats[bin] = 0;
965 if (firstBinX == 1) firstBinX = 0;
966 if (lastBinX ==
fXaxis.GetNbins() ) lastBinX += 1;
969 if (firstBinY == 1) firstBinY = 0;
970 if (lastBinY ==
fYaxis.GetNbins() ) lastBinY += 1;
973 for (biny = firstBinY; biny <= lastBinY; biny++) {
974 y = (!labelYaxis) ?
fYaxis.GetBinCenter(biny) : 0;
975 for (binx = firstBinX; binx <= lastBinX; binx++) {
979 x = (!labelXaxis) ?
fXaxis.GetBinCenter(binx) : 0;
988 stats[8] +=
fSumw2.fArray[bin];
1039 if (ax[0] ==
'y' || ax[0] ==
'Y') axis =
GetYaxis();
1042 Warning(
"LabelsOption",
"Cannot sort. No labels");
1075 if (sort < 0)
return;
1078 Int_t n = labels->GetSize();
1083 Int_t lastLabelBin = -1;
1084 for (
Int_t i = 0; i <
n; ++i) {
1085 Int_t bin = labels->At(i)->GetUniqueID();
1086 if (bin < firstLabelBin)
1087 firstLabelBin = bin;
1088 if (bin > lastLabelBin)
1091 if (firstLabelBin != 1 || lastLabelBin - firstLabelBin + 1 !=
n) {
1092 Error(
"LabelsOption",
1093 "%s of TProfile2D %s contains bins without labels. Sorting will not work correctly - return",
1100 "axis %s of TProfile2D %s has extra following bins without labels. Sorting will work only for first label bins",
1104 std::vector<Int_t>
a(
n);
1105 Int_t i, j, k, ibin, bin;
1106 std::vector<Double_t> sumw(
fNcells);
1107 std::vector<Double_t> errors(
fNcells);
1108 std::vector<Double_t> ent(
fNcells);
1109 std::vector<Double_t> binsw2;
1123 std::vector<TObject *> labold(
n);
1124 for (i = 0; i <
n; i++)
1125 labold[i] =
nullptr;
1126 TIter nextold(labels);
1128 while ((obj = nextold())) {
1130 if (bin>=1 && bin<=
n)
1131 labold[bin-1] = obj;
1137 std::vector<Double_t> pcont;
1138 std::vector<Double_t> econt;
1144 for (i = 0; i < nx; i++) {
1145 for (j = 0; j < ny; j++) {
1148 errors[bin] =
fSumw2.fArray[bin];
1157 if (sort > 0 &&
fBinEntries.fArray[bin] != 0 && k > 0 && k <
n) {
1165 for (k = 0; k <
n; ++k) {
1168 pcont[k] /= econt[k];
1178 std::vector<std::string> vecLabels(
n);
1179 for (i = 0; i <
n; i++) {
1180 vecLabels[i] = labold[i]->GetName();
1188 for (i = 0; i <
n; i++) {
1194 std::cout <<
"bin " << i + 1 <<
" setting new labels for axis " << labold.at(
a[i])->GetName() <<
" from "
1195 <<
a[i] << std::endl;
1198 for (i = 0; i < nx; i++) {
1199 for (j = 0; j < ny; j++) {
1203 ibin =
GetBin(
a[i - 1] + 1, j);
1205 if (j == 0)
continue;
1208 fArray[bin] = sumw[ibin];
1209 fSumw2.fArray[bin] = errors[ibin];
1217 bool labelsAreSorted =
kFALSE;
1218 for (i = 0; i <
n; ++i) {
1220 labelsAreSorted =
kTRUE;
1224 if (labelsAreSorted) {
1264 Error(
"Multiply",
"Function not implemented for TProfile2D");
1275 Error(
"Multiply",
"Multiplication of profile2D histograms not implemented");
1286 Error(
"Multiply",
"Multiplication of profile2D histograms not implemented");
1323 if (pname.
IsNull() || pname ==
"_pxy")
1332 if (xbins->fN == 0 && ybins->
fN == 0) {
1334 }
else if (xbins->fN == 0) {
1336 }
else if (ybins->
fN == 0) {
1351 if (computeErrors || binWeight || (binEntries &&
fBinSumw2.fN) )
h1->Sumw2();
1354 Int_t bin,binx, biny;
1356 for (binx =0;binx<=nx+1;binx++) {
1357 for (biny =0;biny<=ny+1;biny++) {
1365 h1->SetBinContent(bin ,cont);
1368 if (computeErrors )
h1->SetBinError(bin ,
GetBinError(bin) );
1371 if (binWeight)
h1->GetSumw2()->fArray[bin] =
fSumw2.fArray[bin];
1375 h1->GetSumw2()->fArray[bin] =
fBinSumw2.fArray[bin];
1429 bool originalRange = opt.
Contains(
"o");
1431 TString expectedName = ( onX ?
"_pfx" :
"_pfy" );
1444 if (bins->
fN == 0) {
1468 TString opt1 = (originalRange) ?
"o" :
"";
1469 TH1D * h1W = (onX) ? h2dW->
ProjectionX(
"h1temp-W",firstbin,lastbin,opt1) : h2dW->
ProjectionY(
"h1temp-W",firstbin,lastbin,opt1);
1470 TH1D * h1N = (onX) ? h2dN->
ProjectionX(
"h1temp-N",firstbin,lastbin,opt1) : h2dN->
ProjectionY(
"h1temp-N",firstbin,lastbin,opt1);
1478 for (
int i = 0; i < p1->
fN ; ++i) {
1581 if((nxgroup != 1) || (nygroup != 1)){
1588 if ((nxgroup <= 0) || (nxgroup > nxbins)) {
1589 Error(
"Rebin",
"Illegal value of nxgroup=%d",nxgroup);
1592 if ((nygroup <= 0) || (nygroup > nybins)) {
1593 Error(
"Rebin",
"Illegal value of nygroup=%d",nygroup);
1597 Int_t newxbins = nxbins/nxgroup;
1598 Int_t newybins = nybins/nygroup;
1601 if(newxbins*nxgroup != nxbins) {
1602 Warning(
"Rebin",
"nxgroup=%d should be an exact divider of nxbins=%d",nxgroup,nxbins);
1604 if(newybins*nygroup != nybins) {
1605 Warning(
"Rebin",
"nygroup=%d should be an exact divider of nybins=%d",nygroup,nybins);
1617 for(
Int_t ibin=0; ibin < (nxbins+2)*(nybins+2); ibin++){
1618 oldBins[ibin] = cu1[ibin];
1619 oldCount[ibin] = en1[ibin];
1620 oldErrors[ibin] = er1[ibin];
1621 if (ew1 &&
fBinSumw2.fN) oldBinw2[ibin] = ew1[ibin];
1626 if(newname && strlen(newname) > 0) {
1632 if(newxbins*nxgroup != nxbins) {
1633 xmax =
fXaxis.GetBinUpEdge(newxbins*nxgroup);
1636 if(newybins*nygroup != nybins) {
1637 ymax =
fYaxis.GetBinUpEdge(newybins*nygroup);
1642 if((
fXaxis.GetXbins()->GetSize() > 0) || (
fYaxis.GetXbins()->GetSize() > 0)){
1645 for(
Int_t i=0; i < newxbins+1; i++)
1646 xbins[i] =
fXaxis.GetBinLowEdge(1+i*nxgroup);
1647 for(
Int_t j=0; j < newybins+1; j++)
1648 ybins[j] =
fYaxis.GetBinLowEdge(1+j*nygroup);
1649 hnew->
SetBins(newxbins,xbins,newybins,ybins);
1663 Double_t binContent, binCount, binError, binSumw2;
1670 for(
Int_t xbin = 1; xbin <= newxbins; xbin++){
1672 for(
Int_t ybin = 1; ybin <= newybins; ybin++){
1677 for(
Int_t i=0; i < nxgroup; i++){
1678 if(oldxbin + i > nxbins)
break;
1679 for(
Int_t j=0; j < nygroup; j++){
1680 if(oldybin + j > nybins)
break;
1681 bin = oldxbin + i + (nxbins+2)*(oldybin+j);
1682 binContent += oldBins[bin];
1683 binCount += oldCount[bin];
1684 binError += oldErrors[bin];
1685 if(
fBinSumw2.fN) binSumw2 += oldBinw2[bin];
1688 bin = xbin + (newxbins + 2)*ybin;
1689 cu2[bin] = binContent;
1690 er2[bin] = binError;
1691 en2[bin] = binCount;
1699 cu2[0] = oldBins[0];
1700 er2[0] = oldErrors[0];
1701 en2[0] = oldCount[0];
1709 for(
Int_t i=oldxbin; i <= nxbins+1; i++){
1710 for(
Int_t j=oldybin; j <= nybins+1; j++){
1712 bin = i + (nxbins+2)*j;
1713 binContent += oldBins[bin];
1714 binCount += oldCount[bin];
1715 binError += oldErrors[bin];
1716 if(
fBinSumw2.fN) binSumw2 += oldBinw2[bin];
1719 bin = (newxbins+2)*(newybins+2)-1;
1720 cu2[bin] = binContent;
1721 er2[bin] = binError;
1722 en2[bin] = binCount;
1729 for(
Int_t i=oldxbin; i <= nxbins+1; i++){
1731 binContent += oldBins[bin];
1732 binCount += oldCount[bin];
1733 binError += oldErrors[bin];
1734 if(
fBinSumw2.fN) binSumw2 += oldBinw2[bin];
1737 cu2[bin] = binContent;
1738 er2[bin] = binError;
1739 en2[bin] = binCount;
1746 for(
Int_t i=oldybin; i <= nybins+1; i++){
1747 bin = i*(nxbins + 2);
1748 binContent += oldBins[bin];
1749 binCount += oldCount[bin];
1750 binError += oldErrors[bin];
1751 if(
fBinSumw2.fN) binSumw2 += oldBinw2[bin];
1753 bin = (newxbins + 2)*(newybins + 1);
1754 cu2[bin] = binContent;
1755 er2[bin] = binError;
1756 en2[bin] = binCount;
1759 Double_t binContentuf, binCountuf, binErroruf, binSumw2uf;
1760 Double_t binContentof, binCountof, binErrorof, binSumw2of;
1763 for(
Int_t xbin = 1; xbin <= newxbins; xbin++){
1772 for(
Int_t i = 0; i < nxgroup; i++){
1774 ufbin = (oldxbin2 + i);
1775 binContentuf += oldBins[ufbin];
1776 binCountuf += oldCount[ufbin];
1777 binErroruf += oldErrors[ufbin];
1778 if(
fBinSumw2.fN) binSumw2uf += oldBinw2[ufbin];
1779 for(
Int_t j = oldybin; j <= nybins+1; j++)
1781 ofbin = ufbin + j*(nxbins + 2);
1782 binContentof += oldBins[ofbin];
1783 binCountof += oldCount[ofbin];
1784 binErrorof += oldErrors[ofbin];
1785 if(
fBinSumw2.fN) binSumw2of += oldBinw2[ofbin];
1790 ofbin = ufbin + (newybins + 1)*(newxbins + 2);
1791 cu2[ufbin] = binContentuf;
1792 er2[ufbin] = binErroruf;
1793 en2[ufbin] = binCountuf;
1794 if(
fBinSumw2.fN) ew2[ufbin] = binSumw2uf;
1795 cu2[ofbin] = binContentof;
1796 er2[ofbin] = binErrorof;
1797 en2[ofbin] = binCountof;
1798 if(
fBinSumw2.fN) ew2[ofbin] = binSumw2of;
1800 oldxbin2 += nxgroup;
1804 for(
Int_t ybin = 1; ybin <= newybins; ybin++){
1813 for(
Int_t i = 0; i < nygroup; i++){
1815 ufbin = (oldybin2 + i)*(nxbins+2);
1816 binContentuf += oldBins[ufbin];
1817 binCountuf += oldCount[ufbin];
1818 binErroruf += oldErrors[ufbin];
1819 if(
fBinSumw2.fN) binSumw2uf += oldBinw2[ufbin];
1820 for(
Int_t j = oldxbin; j <= nxbins+1; j++)
1823 binContentof += oldBins[ofbin];
1824 binCountof += oldCount[ofbin];
1825 binErrorof += oldErrors[ofbin];
1826 if(
fBinSumw2.fN) binSumw2of += oldBinw2[ofbin];
1830 ufbin = ybin * (newxbins + 2);
1831 ofbin = newxbins + 1 + ufbin;
1832 cu2[ufbin] = binContentuf;
1833 er2[ufbin] = binErroruf;
1834 en2[ufbin] = binCountuf;
1835 if(
fBinSumw2.fN) ew2[ufbin] = binSumw2uf;
1836 cu2[ofbin] = binContentof;
1837 er2[ofbin] = binErrorof;
1838 en2[ofbin] = binCountof;
1839 if(
fBinSumw2.fN) ew2[ofbin] = binSumw2of;
1841 oldybin2 += nygroup;
1846 delete [] oldErrors;
1847 if (oldBinw2)
delete [] oldBinw2;
1853 if(newname && (strlen(newname) > 0))
1865 return Rebin2D(ngroup,1,newname);
1873 return Rebin2D(1,ngroup,newname);
1900 out << sxaxis <<
".data()";
1906 out << syaxis <<
".data()";
1916 Int_t numentries = 0, numcontent = 0, numerrors = 0;
1923 content[bin] =
fArray[bin];
1933 if ((numentries < 100) && (numcontent < 100) && (numerrors < 100)) {
1937 out <<
" " << hname <<
"->SetBinEntries(" << bin <<
"," << entries[bin] <<
");\n";
1941 out <<
" " << hname <<
"->SetBinContent(" << bin <<
"," << content[bin] <<
");\n";
1946 out <<
" " << hname <<
"->SetBinError(" << bin <<
"," << errors[bin] <<
");\n";
1949 if (numentries > 0) {
1951 out <<
" for (Int_t bin = 0; bin < " <<
fNcells <<
"; bin++)\n";
1952 out <<
" if (" << vect <<
"[bin])\n";
1953 out <<
" " << hname <<
"->SetBinEntries(bin, " << vect <<
"[bin]);\n";
1955 if (numcontent > 0) {
1957 out <<
" for (Int_t bin = 0; bin < " <<
fNcells <<
"; bin++)\n";
1958 out <<
" if (" << vect <<
"[bin])\n";
1959 out <<
" " << hname <<
"->SetBinContent(bin, " << vect <<
"[bin]);\n";
1961 if (numerrors > 0) {
1963 out <<
" for (Int_t bin = 0; bin < " <<
fNcells <<
"; bin++)\n";
1964 out <<
" if (" << vect <<
"[bin])\n";
1965 out <<
" " << hname <<
"->SetBinError(bin, " << vect <<
"[bin]);\n";
2036 if (bufsize < 100) bufsize = 100;
2088 R__b >> zmin;
fZmin = zmin;
2089 R__b >> zmax;
fZmax = zmax;
int Int_t
Signed integer 4 bytes (int).
short Version_t
Class version identifier (short).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
long long Long64_t
Portable signed long integer 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
void Fatal(const char *location, const char *msgfmt,...)
Use this function in case of a fatal error. It will abort the program.
TArrayD()
Default TArrayD ctor.
const Double_t * GetArray() const
Class to manage histogram axis.
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 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
Collection abstract base class.
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.
Int_t fNcells
Number of bins(1D), cells (2D) +U/Overflows.
Double_t fTsumw
Total Sum of weights.
Double_t fTsumw2
Total Sum of squares of weights.
Double_t fTsumwx2
Total Sum of weight*X*X.
virtual Int_t GetNbinsY() const
@ 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 Int_t GetNbinsX() const
Int_t fBufferSize
fBuffer size
TString ProvideSaveName(Option_t *option, Bool_t testfdir=kFALSE)
Provide variable name for histogram for saving as primitive Histogram pointer has by default the hist...
static Int_t fgBufferSize
! Default buffer size for automatic histograms
virtual void SavePrimitiveHelp(std::ostream &out, const char *hname, Option_t *option="")
Helper function for the SavePrimitive functions from TH1 or classes derived from TH1,...
UInt_t GetAxisLabelStatus() const
Internal function used in TH1::Fill to see which axis is full alphanumeric, i.e.
@ kNstat
Size of statistics data (up to TProfile3D).
virtual Double_t Chi2Test(const TH1 *h2, Option_t *option="UU", Double_t *res=nullptr) const
test for comparing weighted and unweighted histograms.
Double_t fEntries
Number of entries.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual TArrayD * GetSumw2()
TAxis fXaxis
X axis descriptor.
TArrayD fSumw2
Array of sum of squares of weights.
Bool_t GetStatOverflowsBehaviour() const
TObject * Clone(const char *newname="") const override
Make a complete copy of the underlying object.
TAxis fYaxis
Y axis descriptor.
virtual void SetBins(Int_t nx, Double_t xmin, Double_t xmax)
Redefine x axis parameters.
virtual void SetEntries(Double_t n)
Double_t fTsumwx
Total Sum of weight*X.
void Streamer(TBuffer &) override
Stream an object of class TH2D.
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.
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).
Double_t fTsumwxy
Total Sum of weight*X*Y.
Double_t fTsumwy2
Total Sum of weight*Y*Y.
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).
Double_t fTsumwy
Total Sum of weight*Y.
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...
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
Mother of all ROOT objects.
Bool_t TestBit(UInt_t f) const
virtual UInt_t GetUniqueID() const
Return the unique object id.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
virtual TClass * IsA() const
static TString SavePrimitiveVector(std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Int_t flag=0)
Save array in the output stream "out" as vector.
Long64_t Merge(TCollection *list) override
Merge all histograms in the collection in this histogram.
void PutStats(Double_t *stats) override
Replace current statistics with the values in array stats.
Int_t BufferFill(Double_t, Double_t) override
accumulate arguments in buffer.
Double_t fTsumwz
Total Sum of weight*Z.
Int_t Fill(const Double_t *v)
TClass * IsA() const override
TH2D * ProjectionXY(const char *name="_pxy", Option_t *option="e") const
Project this profile2D into a 2-D histogram along X,Y.
Bool_t Multiply(TF1 *h1, Double_t c1=1) override
Performs the operation: this = this*c1*f1.
void LabelsDeflate(Option_t *axis="X") override
Reduce the number of bins for this axis to the number of bins having a label.
Double_t GetBinError(Int_t bin) const override
Return bin error of a Profile2D histogram.
static void Approximate(Bool_t approx=kTRUE)
Static function, set the fgApproximate flag.
EErrorType fErrorMode
Option to compute errors.
Double_t fZmin
Lower limit in Z (if set).
TProfile2D * RebinX(Int_t ngroup=2, const char *newname="") override
Rebin only the X axis.
void SetBuffer(Int_t bufsize, Option_t *option="") override
Set the buffer size in units of 8 bytes (double).
virtual void SetBinEntries(Int_t bin, Double_t w)
Bool_t fScaling
! True when TProfile2D::Scale is called
virtual Double_t GetBinEffectiveEntries(Int_t bin)
Return bin effective entries for a weighted filled Profile histogram.
Option_t * GetErrorOption() const
Return option to compute profile2D errors.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
TArrayD fBinSumw2
Array of sum of squares of weights per bin.
void ExtendAxis(Double_t x, TAxis *axis) override
Profile histogram is resized along axis such that x is in the axis range.
TProfile * ProfileY(const char *name="_pfy", Int_t firstxbin=0, Int_t lastxbin=-1, Option_t *option="") const
Project a 2-D histogram into a profile histogram along X.
TProfile2D * RebinY(Int_t ngroup=2, const char *newname="") override
Rebin only the Y axis.
void Scale(Double_t c1=1, Option_t *option="") override
Multiply this histogram by a constant c1.
void Copy(TObject &hnew) const override
Copy a Profile2D histogram to a new profile2D histogram.
TProfile * DoProfile(bool onX, const char *name, Int_t firstbin, Int_t lastbin, Option_t *option) const override
Implementation of ProfileX or ProfileY for a TProfile2D.
TProfile * ProfileX(const char *name="_pfx", Int_t firstybin=0, Int_t lastybin=-1, Option_t *option="") const
Project a 2-D histogram into a profile histogram along X.
void LabelsOption(Option_t *option="h", Option_t *axis="X") override
Set option(s) to draw axis with labels.
TProfile2D()
Default constructor for Profile2D histograms.
void Sumw2(Bool_t flag=kTRUE) override
Create/Delete structure to store sum of squares of weights per bin.
TArrayD fBinEntries
Number of entries per bin.
void SetBins(const Int_t *nbins, const Double_t *range)
~TProfile2D() override
Default destructor for Profile2D histograms.
void Streamer(TBuffer &) override
Stream an object of class TProfile2D.
static Bool_t fgApproximate
Bin error approximation option.
Bool_t Divide(TF1 *h1, Double_t c1=1) override
Performs the operation: this = this/(c1*f1) .
TProfile2D * Rebin2D(Int_t nxgroup=2, Int_t nygroup=2, const char *newname="") override
Rebin this histogram grouping nxgroup/nygroup bins along the xaxis/yaxis together.
Int_t BufferEmpty(Int_t action=0) override
Fill histogram with all entries in the buffer.
void LabelsInflate(Option_t *axis="X") override
Double the number of bins for axis.
void GetStats(Double_t *stats) const override
Fill the array stats from the contents of this profile.
virtual Double_t GetBinEntries(Int_t bin) const
Return bin entries of a Profile2D histogram.
Double_t fZmax
Upper limit in Z (if set).
void SetBinsLength(Int_t n=-1) override
Multiply this profile2D by a constant c1.
void BuildOptions(Double_t zmin, Double_t zmax, Option_t *option)
Set Profile2D histogram structure and options.
Bool_t Add(TF1 *h1, Double_t c1=1, Option_t *option="") override
Performs the operation: this = this + c1*f1 .
TProfile2D & operator=(const TProfile2D &profile)
Double_t fTsumwz2
Total Sum of weight*Z*Z.
Double_t Chi2Test(const TH1 *h2, Option_t *option="WW", Double_t *res=nullptr) const override
Run a Chi2Test between a TProfile2D and another histogram.
virtual void SetErrorOption(Option_t *option="")
Set option to compute profile2D errors.
Double_t GetBinContent(Int_t bin) const override
Return bin content of a Profile2D histogram.
static void LabelsInflate(T *p, Option_t *)
static Double_t GetBinError(T *p, Int_t bin)
static T * ExtendAxis(T *p, Double_t x, TAxis *axis)
static void Sumw2(T *p, Bool_t flag)
static void SetBinEntries(T *p, Int_t bin, Double_t w)
static void Scale(T *p, Double_t c1, Option_t *option)
static void SetErrorOption(T *p, Option_t *opt)
static Long64_t Merge(T *p, TCollection *list)
static void BuildArray(T *p)
static Bool_t Add(T *p, const TH1 *h1, const TH1 *h2, Double_t c1, Double_t c2=1)
static Double_t GetBinEffectiveEntries(T *p, Int_t bin)
static void LabelsDeflate(T *p, Option_t *)
virtual TArrayD * GetBinSumw2()
virtual void SetBinEntries(Int_t bin, Double_t w)
Set the number of entries in bin.
void Sumw2(Bool_t flag=kTRUE) override
Create/delete structure to store sum of squares of weights per bin.
void ToLower()
Change string to lower-case.
TString & ReplaceSpecialCppChars()
Find special characters which are typically used in printf() calls and replace them by appropriate es...
TString & ReplaceAll(const TString &s1, const TString &s2)
void ToUpper()
Change string to upper case.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Double_t Sqrt(Double_t x)
Returns the square root of x.
void Sort(Index n, const Element *a, Index *index, Bool_t down=kTRUE)
Sort the n elements of the array a of generic templated type Element.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.