# class TProfile2D: public TH2D

```
Profile2D histograms are used to display the mean
value of Z and its RMS for each cell in X,Y.
Profile2D histograms are in many cases an
elegant replacement of three-dimensional histograms : the inter-relation of three
measured quantities X, Y and Z can always be visualized by a three-dimensional
histogram or scatter-plot; its representation on the line-printer is not particularly
satisfactory, except for sparse data. If Z is an unknown (but single-valued)
approximate function of X,Y this function is displayed by a profile2D histogram with
much better precision than by a scatter-plot.

The following formulae show the cumulated contents (capital letters) and the values
displayed by the printing or plotting routines (small letters) of the elements for cell I, J.

2
H(I,J)  =  sum Z                  E(I,J)  =  sum Z
l(I,J)  =  sum l                  L(I,J)  =  sum l
h(I,J)  =  H(I,J)/L(I,J)          s(I,J)  =  sqrt(E(I,J)/L(I,J)- h(I,J)**2)
e(I,J)  =  s(I,J)/sqrt(L(I,J))

In the special case where s(I,J) is zero (eg, case of 1 entry only in one cell)
the bin error e(I,J) is computed from the average of the s(I,J) for all cells
if the static function TProfile2D::Approximate has been called.
This simple/crude approximation was suggested in order to keep the cell
during a fit operation. But note that this approximation is not the default behaviour.

Example of a profile2D histogram
{
TCanvas *c1 = new TCanvas("c1","Profile histogram example",200,10,700,500);
hprof2d  = new TProfile2D("hprof2d","Profile of pz versus px and py",40,-4,4,40,-4,4,0,20);
Float_t px, py, pz;
for ( Int_t i=0; i<25000; i++) {
gRandom->Rannor(px,py);
pz = px*px + py*py;
hprof2d->Fill(px,py,pz,1);
}
hprof2d->Draw();
}

```

## Function Members (Methods)

public:
 virtual ~TProfile2D() void TObject::AbstractMethod(const char* method) const virtual Bool_t Add(const TH1* h1, Double_t c1 = 1) virtual Bool_t Add(TF1* h1, Double_t c1 = 1, Option_t* option = "") virtual Bool_t Add(const TH1* h1, const TH1* h2, Double_t c1 = 1, Double_t c2 = 1)MENU void TArrayD::AddAt(Double_t c, Int_t i) virtual void TH2D::AddBinContent(Int_t bin) virtual void TH2D::AddBinContent(Int_t bin, Double_t w) static void TH1::AddDirectory(Bool_t add = kTRUE) static Bool_t TH1::AddDirectoryStatus() void TArrayD::Adopt(Int_t n, Double_t* array) virtual Double_t TH1::AndersonDarlingTest(const TH1* h2, Option_t* option = "") const virtual Double_t TH1::AndersonDarlingTest(const TH1* h2, Double_t& advalue) const virtual void TObject::AppendPad(Option_t* option = "") static void Approximate(Bool_t approx = kTRUE) Double_t TArrayD::At(Int_t i) const virtual void TH1::Browse(TBrowser* b) virtual Int_t BufferEmpty(Int_t action = 0) void BuildOptions(Double_t zmin, Double_t zmax, Option_t* option) virtual Bool_t TH1::CanExtendAllAxes() const virtual Double_t TH1::Chi2Test(const TH1* h2, Option_t* option = "UU", Double_t* res = 0) const virtual Double_t TH1::Chi2TestX(const TH1* h2, Double_t& chi2, Int_t& ndf, Int_t& igood, Option_t* option = "UU", Double_t* res = 0) const virtual Double_t TH1::Chisquare(TF1* f1, Option_t* option = "") const static TClass* Class() virtual const char* TObject::ClassName() const virtual void TNamed::Clear(Option_t* option = "") virtual void TH1::ClearUnderflowAndOverflow() virtual TObject* TH1::Clone(const char* newname = 0) const virtual Int_t TNamed::Compare(const TObject* obj) const virtual Double_t TH1::ComputeIntegral(Bool_t onlyPositive = false) virtual void Copy(TObject& hnew) const virtual void TObject::Delete(Option_t* option = "")MENU virtual void TH1::DirectoryAutoAdd(TDirectory*) Int_t TAttLine::DistancetoLine(Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2) virtual Int_t TH1::DistancetoPrimitive(Int_t px, Int_t py) virtual Bool_t Divide(const TH1* h1) virtual Bool_t Divide(TF1* h1, Double_t c1 = 1) virtual Bool_t Divide(const TH1* h1, const TH1* h2, Double_t c1 = 1, Double_t c2 = 1, Option_t* option = "")MENU virtual void TH1::Draw(Option_t* option = "") virtual void TObject::DrawClass() constMENU virtual TObject* TObject::DrawClone(Option_t* option = "") constMENU virtual TH1* TH1::DrawCopy(Option_t* option = "", const char* name_postfix = "_copy") const virtual TH1* TH1::DrawNormalized(Option_t* option = "", Double_t norm = 1) const virtual void TH1::DrawPanel()MENU virtual void TObject::Dump() constMENU virtual void TObject::Error(const char* method, const char* msgfmt) const virtual void TH1::Eval(TF1* f1, Option_t* option = "") virtual void TObject::Execute(const char* method, const char* params, Int_t* error = 0) virtual void TObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0) virtual void TH1::ExecuteEvent(Int_t event, Int_t px, Int_t py) virtual void ExtendAxis(Double_t x, TAxis* axis) virtual void TObject::Fatal(const char* method, const char* msgfmt) const virtual TH1* TH1::FFT(TH1* h_output, Option_t* option) virtual Int_t Fill(Double_t x, Double_t y, Double_t z) virtual Int_t Fill(Double_t x, const char* namey, Double_t z) virtual Int_t Fill(const char* namex, Double_t y, Double_t z) virtual Int_t Fill(const char* namex, const char* namey, Double_t z) virtual Int_t Fill(Double_t x, Double_t y, Double_t z, Double_t w) virtual void TNamed::FillBuffer(char*& buffer) virtual void TH2::FillN(Int_t, const Double_t*, const Double_t*, Int_t) virtual void TH2::FillN(Int_t ntimes, const Double_t* x, const Double_t* y, const Double_t* w, Int_t stride = 1) virtual void TH2::FillRandom(const char* fname, Int_t ntimes = 5000) virtual void TH2::FillRandom(TH1* h, Int_t ntimes = 5000) virtual Int_t TH1::FindBin(Double_t x, Double_t y = 0, Double_t z = 0) virtual Int_t TH2::FindFirstBinAbove(Double_t threshold = 0, Int_t axis = 1) const virtual Int_t TH1::FindFixBin(Double_t x, Double_t y = 0, Double_t z = 0) const virtual Int_t TH2::FindLastBinAbove(Double_t threshold = 0, Int_t axis = 1) const virtual TObject* TH1::FindObject(const char* name) const virtual TObject* TH1::FindObject(const TObject* obj) const virtual TFitResultPtr TH1::Fit(const char* formula, Option_t* option = "", Option_t* goption = "", Double_t xmin = 0, Double_t xmax = 0)MENU virtual TFitResultPtr TH1::Fit(TF1* f1, Option_t* option = "", Option_t* goption = "", Double_t xmin = 0, Double_t xmax = 0) static Int_t TH1::FitOptionsMake(Option_t* option, Foption_t& Foption) virtual void TH1::FitPanel()MENU virtual void TH2::FitSlicesX(TF1* f1 = 0, Int_t firstybin = 0, Int_t lastybin = -1, Int_t cut = 0, Option_t* option = "QNR", TObjArray* arr = 0)MENU virtual void TH2::FitSlicesY(TF1* f1 = 0, Int_t firstxbin = 0, Int_t lastxbin = -1, Int_t cut = 0, Option_t* option = "QNR", TObjArray* arr = 0)MENU const Double_t* TArrayD::GetArray() const Double_t* TArrayD::GetArray() TH1* TH1::GetAsymmetry(TH1* h2, Double_t c2 = 1, Double_t dc2 = 0) virtual Double_t TArrayD::GetAt(Int_t i) const virtual Color_t TH1::GetAxisColor(Option_t* axis = "X") const virtual Float_t TH1::GetBarOffset() const virtual Float_t TH1::GetBarWidth() const virtual Int_t TH2::GetBin(Int_t binx, Int_t biny, Int_t binz = 0) const virtual Double_t TH1::GetBinCenter(Int_t bin) const virtual Double_t GetBinContent(Int_t bin) const virtual Double_t GetBinContent(Int_t binx, Int_t biny) const virtual Double_t GetBinContent(Int_t binx, Int_t biny, Int_t) const virtual Double_t GetBinEffectiveEntries(Int_t bin) virtual Double_t GetBinEntries(Int_t bin) const virtual Double_t GetBinError(Int_t bin) const virtual Double_t GetBinError(Int_t binx, Int_t biny) const virtual Double_t GetBinError(Int_t binx, Int_t biny, Int_t) const virtual Double_t TH2::GetBinErrorLow(Int_t binx, Int_t biny) virtual TH1::EBinErrorOpt TH1::GetBinErrorOption() const virtual Double_t TH2::GetBinErrorUp(Int_t binx, Int_t biny) virtual Double_t TH1::GetBinLowEdge(Int_t bin) const virtual TArrayD* GetBinSumw2() virtual const TArrayD* GetBinSumw2() const virtual Double_t TH1::GetBinWidth(Int_t bin) const virtual Double_t TH1::GetBinWithContent(Double_t c, Int_t& binx, Int_t firstx = 0, Int_t lastx = 0, Double_t maxdiff = 0) const virtual Double_t TH2::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 virtual void TH1::GetBinXYZ(Int_t binglobal, Int_t& binx, Int_t& biny, Int_t& binz) const const Double_t* TH1::GetBuffer() const Int_t TH1::GetBufferLength() const Int_t TH1::GetBufferSize() const virtual Double_t TH1::GetCellContent(Int_t binx, Int_t biny) const virtual Double_t TH1::GetCellError(Int_t binx, Int_t biny) const virtual void TH1::GetCenter(Double_t* center) const virtual Int_t TH1::GetContour(Double_t* levels = 0) virtual Double_t TH1::GetContourLevel(Int_t level) const virtual Double_t TH1::GetContourLevelPad(Int_t level) const virtual Double_t TH2::GetCorrelationFactor(Int_t axis1 = 1, Int_t axis2 = 2) const virtual Double_t TH2::GetCovariance(Int_t axis1 = 1, Int_t axis2 = 2) const TH1* TH1::GetCumulative(Bool_t forward = kTRUE, const char* suffix = "_cumulative") const static Int_t TH1::GetDefaultBufferSize() static Bool_t TH1::GetDefaultSumw2() virtual Int_t TH1::GetDimension() const TDirectory* TH1::GetDirectory() const virtual Option_t* TObject::GetDrawOption() const static Long_t TObject::GetDtorOnly() virtual Double_t TH1::GetEffectiveEntries() const virtual Double_t TH1::GetEntries() const Option_t* GetErrorOption() const virtual Color_t TAttFill::GetFillColor() const virtual Style_t TAttFill::GetFillStyle() const virtual TF1* TH1::GetFunction(const char* name) const virtual const char* TObject::GetIconName() const virtual Double_t* TH1::GetIntegral() virtual Double_t TH1::GetKurtosis(Int_t axis = 1) const virtual Color_t TH1::GetLabelColor(Option_t* axis = "X") const virtual Style_t TH1::GetLabelFont(Option_t* axis = "X") const virtual Float_t TH1::GetLabelOffset(Option_t* axis = "X") const virtual Float_t TH1::GetLabelSize(Option_t* axis = "X") const virtual Color_t TAttLine::GetLineColor() const virtual Style_t TAttLine::GetLineStyle() const virtual Width_t TAttLine::GetLineWidth() const TList* TH1::GetListOfFunctions() const virtual void TH1::GetLowEdge(Double_t* edge) const virtual Color_t TAttMarker::GetMarkerColor() const virtual Size_t TAttMarker::GetMarkerSize() const virtual Style_t TAttMarker::GetMarkerStyle() const virtual Double_t TH1::GetMaximum(Double_t maxval = 3.40282347E+38F) const virtual Int_t TH1::GetMaximumBin() const virtual Int_t TH1::GetMaximumBin(Int_t& locmax, Int_t& locmay, Int_t& locmaz) const virtual Double_t TH1::GetMaximumStored() const virtual Double_t TH1::GetMean(Int_t axis = 1) const virtual Double_t TH1::GetMeanError(Int_t axis = 1) const virtual Double_t TH1::GetMinimum(Double_t minval = -3.40282347E+38F) const virtual Int_t TH1::GetMinimumBin() const virtual Int_t TH1::GetMinimumBin(Int_t& locmix, Int_t& locmiy, Int_t& locmiz) const virtual Double_t TH1::GetMinimumStored() const virtual const char* TNamed::GetName() const virtual Int_t TH1::GetNbinsX() const virtual Int_t TH1::GetNbinsY() const virtual Int_t TH1::GetNbinsZ() const virtual Int_t TH1::GetNcells() const virtual Int_t TH1::GetNdivisions(Option_t* axis = "X") const virtual Double_t TH1::GetNormFactor() const virtual char* TH1::GetObjectInfo(Int_t px, Int_t py) const static Bool_t TObject::GetObjectStat() virtual Option_t* TH1::GetOption() const TVirtualHistPainter* TH1::GetPainter(Option_t* option = "") virtual Int_t TH1::GetQuantiles(Int_t nprobSum, Double_t* q, const Double_t* probSum = 0) virtual Double_t TH1::GetRandom() const virtual void TH2::GetRandom2(Double_t& x, Double_t& y) Double_t TH1::GetRMS(Int_t axis = 1) const Double_t TH1::GetRMSError(Int_t axis = 1) const Int_t TArray::GetSize() const virtual Double_t TH1::GetSkewness(Int_t axis = 1) const virtual void GetStats(Double_t* stats) const virtual Double_t TH1::GetStdDev(Int_t axis = 1) const virtual Double_t TH1::GetStdDevError(Int_t axis = 1) const Stat_t TArrayD::GetSum() const virtual Double_t TH1::GetSumOfWeights() const virtual TArrayD* TH1::GetSumw2() virtual const TArrayD* TH1::GetSumw2() const virtual Int_t TH1::GetSumw2N() const virtual Float_t TH1::GetTickLength(Option_t* axis = "X") const virtual const char* TNamed::GetTitle() const virtual Style_t TH1::GetTitleFont(Option_t* axis = "X") const virtual Float_t TH1::GetTitleOffset(Option_t* axis = "X") const virtual Float_t TH1::GetTitleSize(Option_t* axis = "X") const virtual UInt_t TObject::GetUniqueID() const TAxis* TH1::GetXaxis() const TAxis* TH1::GetXaxis() const TAxis* TH1::GetYaxis() const TAxis* TH1::GetYaxis() const TAxis* TH1::GetZaxis() const TAxis* TH1::GetZaxis() const virtual Double_t GetZmax() const virtual Double_t GetZmin() const virtual Bool_t TObject::HandleTimer(TTimer* timer) virtual ULong_t TNamed::Hash() const virtual void TObject::Info(const char* method, const char* msgfmt) const virtual Bool_t TObject::InheritsFrom(const char* classname) const virtual Bool_t TObject::InheritsFrom(const TClass* cl) const virtual void TObject::Inspect() constMENU virtual Double_t TH2::Integral(Option_t* option = "") const virtual Double_t TH2::Integral(Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Option_t* option = "") const virtual Double_t TH2::Integral(Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Option_t* = "") const virtual Double_t TH2::IntegralAndError(Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Double_t& err, Option_t* option = "") const virtual Double_t TH2::Interpolate(Double_t x) virtual Double_t TH2::Interpolate(Double_t x, Double_t y) virtual Double_t TH2::Interpolate(Double_t x, Double_t y, Double_t z) void TObject::InvertBit(UInt_t f) virtual TClass* IsA() const Bool_t TH1::IsBinOverflow(Int_t bin) const Bool_t TH1::IsBinUnderflow(Int_t bin) const virtual Bool_t TObject::IsEqual(const TObject* obj) const virtual Bool_t TObject::IsFolder() const Bool_t TObject::IsOnHeap() const virtual Bool_t TNamed::IsSortable() const virtual Bool_t TAttFill::IsTransparent() const Bool_t TObject::IsZombie() const virtual Double_t TH2::KolmogorovTest(const TH1* h2, Option_t* option = "") const virtual void LabelsDeflate(Option_t* axis = "X") virtual void LabelsInflate(Option_t* axis = "X") virtual void LabelsOption(Option_t* option = "h", Option_t* axis = "X") virtual void TNamed::ls(Option_t* option = "") const void TObject::MayNotUse(const char* method) const virtual Long64_t Merge(TCollection* list) virtual void TAttLine::Modify() virtual Bool_t Multiply(const TH1* h1) virtual Bool_t Multiply(TF1* h1, Double_t c1 = 1) virtual Bool_t Multiply(const TH1* h1, const TH1* h2, Double_t c1 = 1, Double_t c2 = 1, Option_t* option = "")MENU virtual Bool_t TObject::Notify() void TObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const void TObject::operator delete(void* ptr) void TObject::operator delete(void* ptr, void* vp) void TObject::operator delete[](void* ptr) void TObject::operator delete[](void* ptr, void* vp) void* TObject::operator new(size_t sz) void* TObject::operator new(size_t sz, void* vp) void* TObject::operator new[](size_t sz) void* TObject::operator new[](size_t sz, void* vp) TProfile2D& operator=(const TProfile2D&) Double_t& TArrayD::operator[](Int_t i) Double_t TArrayD::operator[](Int_t i) const virtual void TH1::Paint(Option_t* option = "") virtual void TObject::Pop() virtual void TH1::Print(Option_t* option = "") const TProfile* ProfileX(const char* name = "_pfx", Int_t firstybin = 0, Int_t lastybin = -1, Option_t* option = "") constMENU TProfile* ProfileY(const char* name = "_pfy", Int_t firstxbin = 0, Int_t lastxbin = -1, Option_t* option = "") constMENU TH1D* TH2::ProjectionX(const char* name = "_px", Int_t firstybin = 0, Int_t lastybin = -1, Option_t* option = "") constMENU TH2D* ProjectionXY(const char* name = "_pxy", Option_t* option = "e") const TH1D* TH2::ProjectionY(const char* name = "_py", Int_t firstxbin = 0, Int_t lastxbin = -1, Option_t* option = "") constMENU virtual void PutStats(Double_t* stats) TH1D* TH2::QuantilesX(Double_t prob = 0.5, const char* name = "_qx") const TH1D* TH2::QuantilesY(Double_t prob = 0.5, const char* name = "_qy") const virtual Int_t TObject::Read(const char* name) static TArray* TArray::ReadArray(TBuffer& b, const TClass* clReq) virtual TH1* TH1::Rebin(Int_t ngroup = 2, const char* newname = "", const Double_t* xbins = 0)MENU virtual TProfile2D* Rebin2D(Int_t nxgroup = 2, Int_t nygroup = 2, const char* newname = "") virtual void TH1::RebinAxis(Double_t x, TAxis* axis) virtual TProfile2D* RebinX(Int_t ngroup = 2, const char* newname = "") virtual TProfile2D* RebinY(Int_t ngroup = 2, const char* newname = "") virtual void TH1::Rebuild(Option_t* option = "") virtual void TH1::RecursiveRemove(TObject* obj) virtual void Reset(Option_t* option = "") virtual void TAttFill::ResetAttFill(Option_t* option = "") virtual void TAttLine::ResetAttLine(Option_t* option = "") virtual void TAttMarker::ResetAttMarker(Option_t* toption = "") void TObject::ResetBit(UInt_t f) virtual void TH1::ResetStats() virtual void TObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU virtual void TAttFill::SaveFillAttributes(ostream& out, const char* name, Int_t coldef = 1, Int_t stydef = 1001) virtual void TAttLine::SaveLineAttributes(ostream& out, const char* name, Int_t coldef = 1, Int_t stydef = 1, Int_t widdef = 1) virtual void TAttMarker::SaveMarkerAttributes(ostream& out, const char* name, Int_t coldef = 1, Int_t stydef = 1, Int_t sizdef = 1) virtual void SavePrimitive(ostream& out, Option_t* option = "") virtual void Scale(Double_t c1 = 1, Option_t* option = "") virtual void TArrayD::Set(Int_t n) void TArrayD::Set(Int_t n, const Double_t* array) virtual void TArrayD::SetAt(Double_t v, Int_t i) virtual void TH1::SetAxisColor(Color_t color = 1, Option_t* axis = "X") virtual void TH1::SetAxisRange(Double_t xmin, Double_t xmax, Option_t* axis = "X") virtual void TH1::SetBarOffset(Float_t offset = 0.25) virtual void TH1::SetBarWidth(Float_t width = 0.5) virtual void TH2::SetBinContent(Int_t bin, Double_t content) virtual void TH2::SetBinContent(Int_t binx, Int_t biny, Double_t content) virtual void TH2::SetBinContent(Int_t binx, Int_t biny, Int_t, Double_t content) virtual void SetBinEntries(Int_t bin, Double_t w) virtual void TH1::SetBinError(Int_t bin, Double_t error) virtual void TH1::SetBinError(Int_t binx, Int_t biny, Double_t error) virtual void TH1::SetBinError(Int_t binx, Int_t biny, Int_t binz, Double_t error) virtual void TH1::SetBinErrorOption(TH1::EBinErrorOpt type) virtual void SetBins(Int_t nx, const Double_t* xBins, Int_t ny, const Double_t* yBins) virtual void SetBins(Int_t nbinsx, Double_t xmin, Double_t xmax, Int_t nbinsy, Double_t ymin, Double_t ymax) virtual void SetBinsLength(Int_t n = -1) void TObject::SetBit(UInt_t f) void TObject::SetBit(UInt_t f, Bool_t set) virtual void SetBuffer(Int_t buffersize, Option_t* option = "") virtual UInt_t TH1::SetCanExtend(UInt_t extendBitMask) virtual void TH1::SetCellContent(Int_t binx, Int_t biny, Double_t content) virtual void TH1::SetCellError(Int_t binx, Int_t biny, Double_t content) virtual void TH1::SetContent(const Double_t* content) virtual void TH1::SetContour(Int_t nlevels, const Double_t* levels = 0) virtual void TH1::SetContourLevel(Int_t level, Double_t value) static void TH1::SetDefaultBufferSize(Int_t buffersize = 1000) static void TH1::SetDefaultSumw2(Bool_t sumw2 = kTRUE) virtual void TH1::SetDirectory(TDirectory* dir) virtual void TObject::SetDrawOption(Option_t* option = "")MENU static void TObject::SetDtorOnly(void* obj) virtual void TH1::SetEntries(Double_t n) virtual void TH1::SetError(const Double_t* error) virtual void SetErrorOption(Option_t* option = "")MENU virtual void TAttFill::SetFillAttributes()MENU virtual void TAttFill::SetFillColor(Color_t fcolor) virtual void TAttFill::SetFillColorAlpha(Color_t fcolor, Float_t falpha) virtual void TAttFill::SetFillStyle(Style_t fstyle) virtual void TH1::SetLabelColor(Color_t color = 1, Option_t* axis = "X") virtual void TH1::SetLabelFont(Style_t font = 62, Option_t* axis = "X") virtual void TH1::SetLabelOffset(Float_t offset = 0.0050000000000000001, Option_t* axis = "X") virtual void TH1::SetLabelSize(Float_t size = 0.02, Option_t* axis = "X") virtual void TAttLine::SetLineAttributes()MENU virtual void TAttLine::SetLineColor(Color_t lcolor) virtual void TAttLine::SetLineColorAlpha(Color_t lcolor, Float_t lalpha) virtual void TAttLine::SetLineStyle(Style_t lstyle) virtual void TAttLine::SetLineWidth(Width_t lwidth) virtual void TAttMarker::SetMarkerAttributes()MENU virtual void TAttMarker::SetMarkerColor(Color_t mcolor = 1) virtual void TAttMarker::SetMarkerColorAlpha(Color_t mcolor, Float_t malpha) virtual void TAttMarker::SetMarkerSize(Size_t msize = 1) virtual void TAttMarker::SetMarkerStyle(Style_t mstyle = 1) virtual void TH1::SetMaximum(Double_t maximum = -1111)MENU virtual void TH1::SetMinimum(Double_t minimum = -1111)MENU virtual void TH1::SetName(const char* name)MENU virtual void TH1::SetNameTitle(const char* name, const char* title) virtual void TH1::SetNdivisions(Int_t n = 510, Option_t* axis = "X") virtual void TH1::SetNormFactor(Double_t factor = 1) static void TObject::SetObjectStat(Bool_t stat) virtual void TH1::SetOption(Option_t* option = " ") virtual void TH2::SetShowProjectionX(Int_t nbins = 1)MENU virtual void TH2::SetShowProjectionY(Int_t nbins = 1)MENU virtual void TH1::SetStats(Bool_t stats = kTRUE)MENU virtual void TH1::SetTickLength(Float_t length = 0.02, Option_t* axis = "X") virtual void TH1::SetTitle(const char* title)MENU virtual void TH1::SetTitleFont(Style_t font = 62, Option_t* axis = "X") virtual void TH1::SetTitleOffset(Float_t offset = 1, Option_t* axis = "X") virtual void TH1::SetTitleSize(Float_t size = 0.02, Option_t* axis = "X") virtual void TObject::SetUniqueID(UInt_t uid) virtual void TH1::SetXTitle(const char* title) virtual void TH1::SetYTitle(const char* title) virtual void TH1::SetZTitle(const char* title) virtual TH1* TH2::ShowBackground(Int_t niter = 20, Option_t* option = "same") virtual void ShowMembers(TMemberInspector& insp) const virtual Int_t TH2::ShowPeaks(Double_t sigma = 2, Option_t* option = "", Double_t threshold = 0.050000000000000003)MENU virtual Int_t TNamed::Sizeof() const virtual void TH2::Smooth(Int_t ntimes = 1, Option_t* option = "")MENU static void TH1::SmoothArray(Int_t NN, Double_t* XX, Int_t ntimes = 1) static void TH1::StatOverflows(Bool_t flag = kTRUE) virtual void Streamer(TBuffer&) void StreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b) virtual void Sumw2(Bool_t flag = kTRUE) virtual void TObject::SysError(const char* method, const char* msgfmt) const Bool_t TObject::TestBit(UInt_t f) const Int_t TObject::TestBits(UInt_t f) const TProfile2D() TProfile2D(const TProfile2D& profile) TProfile2D(const char* name, const char* title, Int_t nbinsx, const Double_t* xbins, Int_t nbinsy, const Double_t* ybins, Option_t* option = "") TProfile2D(const char* name, const char* title, Int_t nbinsx, const Double_t* xbins, Int_t nbinsy, Double_t ylow, Double_t yup, Option_t* option = "") TProfile2D(const char* name, const char* title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, const Double_t* ybins, Option_t* option = "") TProfile2D(const char* name, const char* title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, Double_t ylow, Double_t yup, Option_t* option = "") TProfile2D(const char* name, const char* title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, Double_t ylow, Double_t yup, Double_t zlow, Double_t zup, Option_t* option = "") static TH1* TH1::TransformHisto(TVirtualFFT* fft, TH1* h_output, Option_t* option) virtual void TH1::UseCurrentStyle() virtual void TObject::Warning(const char* method, const char* msgfmt) const virtual Int_t TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) virtual Int_t TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const static void TArray::WriteArray(TBuffer& b, const TArray* a)
protected:
 Bool_t TArray::BoundsOk(const char* where, Int_t at) const virtual Int_t BufferFill(Double_t, Double_t) virtual Int_t BufferFill(Double_t, Double_t, Double_t) virtual Int_t BufferFill(Double_t x, Double_t y, Double_t z, Double_t w) static bool TH1::CheckAxisLimits(const TAxis* a1, const TAxis* a2) static bool TH1::CheckBinLabels(const TAxis* a1, const TAxis* a2) static bool TH1::CheckBinLimits(const TAxis* a1, const TAxis* a2) static bool TH1::CheckConsistency(const TH1* h1, const TH1* h2) static bool TH1::CheckConsistentSubAxes(const TAxis* a1, Int_t firstBin1, Int_t lastBin1, const TAxis* a2, Int_t firstBin2 = 0, Int_t lastBin2 = 0) static bool TH1::CheckEqualAxes(const TAxis* a1, const TAxis* a2) virtual void TObject::DoError(int level, const char* location, const char* fmt, va_list va) const virtual void TH1::DoFillN(Int_t ntimes, const Double_t* x, const Double_t* w, Int_t stride = 1) virtual void TH2::DoFitSlices(bool onX, TF1* f1, Int_t firstbin, Int_t lastbin, Int_t cut, Option_t* option, TObjArray* arr) virtual Double_t TH1::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 virtual TProfile* DoProfile(bool onX, const char* name, Int_t firstbin, Int_t lastbin, Option_t* option) const virtual TH1D* TH2::DoProjection(bool onX, const char* name, Int_t firstbin, Int_t lastbin, Option_t* option) const virtual TH1D* TH2::DoQuantiles(bool onX, const char* name, Double_t prob) const Int_t Fill(const Double_t* v) virtual Int_t Fill(Double_t, Double_t) virtual Bool_t TH1::FindNewAxisLimits(const TAxis* axis, const Double_t point, Double_t& newMin, Double_t& newMax) virtual Double_t GetBinErrorSqUnchecked(Int_t bin) const void TObject::MakeZombie() Bool_t TArray::OutOfBoundsError(const char* where, Int_t i) const static Bool_t TH1::RecomputeAxisLimits(TAxis& destAxis, const TAxis& anAxis) virtual Double_t RetrieveBinContent(Int_t bin) const static Bool_t TH1::SameLimitsAndNBins(const TAxis& axis1, const TAxis& axis2) virtual void TH1::SavePrimitiveHelp(ostream& out, const char* hname, Option_t* option = "") void SetBins(const Int_t* nbins, const Double_t* range) virtual void TH2D::UpdateBinContent(Int_t bin, Double_t content)
private:
 Double_t* GetB() Double_t* GetB2() Double_t* GetW() Double_t* GetW2() virtual void SetBins(Int_t, const Double_t*) virtual void SetBins(Int_t, Double_t, Double_t) virtual void SetBins(Int_t, const Double_t*, Int_t, const Double_t*, Int_t, const Double_t*) virtual void SetBins(Int_t, Double_t, Double_t, Int_t, Double_t, Double_t, Int_t, Double_t, Double_t)

## Data Members

public:
 Double_t* TArrayD::fArray [fN] Array of fN doubles Int_t TArray::fN Number of array elements static TH1::(anonymous) TH1::kAllAxes static TObject::(anonymous) TObject::kBitMask static TObject::EStatusBits TObject::kCanDelete static TH1::(anonymous) TH1::kCanRebin static TObject::EStatusBits TObject::kCannotPick static TObject::EStatusBits TObject::kHasUUID static TObject::EStatusBits TObject::kInvalidObject static TH1::(anonymous) TH1::kIsAverage static TH1::(anonymous) TH1::kIsNotW static TObject::(anonymous) TObject::kIsOnHeap static TObject::EStatusBits TObject::kIsReferenced static TH1::(anonymous) TH1::kIsZoomed static TH1::(anonymous) TH1::kLogX static TObject::EStatusBits TObject::kMustCleanup static TH1::(anonymous) TH1::kNoAxis static TObject::EStatusBits TObject::kNoContextMenu static TH1::(anonymous) TH1::kNoStats static TH1::(anonymous) TH1::kNoTitle static TH1::EBinErrorOpt TH1::kNormal static TObject::(anonymous) TObject::kNotDeleted static TH1::(anonymous) TH1::kNstat static TObject::EStatusBits TObject::kObjInCanvas static TObject::(anonymous) TObject::kOverwrite static TH1::EBinErrorOpt TH1::kPoisson static TH1::EBinErrorOpt TH1::kPoisson2 static TObject::(anonymous) TObject::kSingleKey static TH1::(anonymous) TH1::kUserContour static TObject::(anonymous) TObject::kWriteDelete static TH1::(anonymous) TH1::kXaxis static TH1::(anonymous) TH1::kYaxis static TH1::(anonymous) TH1::kZaxis static TObject::(anonymous) TObject::kZombie
protected:
 Short_t TH1::fBarOffset (1000*offset) for bar charts or legos Short_t TH1::fBarWidth (1000*width) for bar charts or legos TArrayD fBinEntries number of entries per bin TH1::EBinErrorOpt TH1::fBinStatErrOpt option for bin statistical errors TArrayD fBinSumw2 Array of sum of squares of weights per bin Double_t* TH1::fBuffer [fBufferSize] entry buffer Int_t TH1::fBufferSize fBuffer size TArrayD TH1::fContour Array to display contour levels Int_t TH1::fDimension !Histogram dimension (1, 2 or 3 dim) TDirectory* TH1::fDirectory !Pointer to directory holding this histogram Double_t TH1::fEntries Number of entries EErrorType fErrorMode Option to compute errors Color_t TAttFill::fFillColor fill area color Style_t TAttFill::fFillStyle fill area style TList* TH1::fFunctions ->Pointer to list of functions (fits and user) Double_t* TH1::fIntegral !Integral of bins used by GetRandom Color_t TAttLine::fLineColor line color Style_t TAttLine::fLineStyle line style Width_t TAttLine::fLineWidth line width Color_t TAttMarker::fMarkerColor Marker color index Size_t TAttMarker::fMarkerSize Marker size Style_t TAttMarker::fMarkerStyle Marker style Double_t TH1::fMaximum Maximum value for plotting Double_t TH1::fMinimum Minimum value for plotting TString TNamed::fName object identifier Int_t TH1::fNcells number of bins(1D), cells (2D) +U/Overflows Double_t TH1::fNormFactor Normalization factor TString TH1::fOption histogram options TVirtualHistPainter* TH1::fPainter !pointer to histogram painter Double_t TH2::fScalefactor Scale factor Bool_t fScaling !True when TProfile2D::Scale is called TArrayD TH1::fSumw2 Array of sum of squares of weights TString TNamed::fTitle object title Double_t TH1::fTsumw Total Sum of weights Double_t TH1::fTsumw2 Total Sum of squares of weights Double_t TH1::fTsumwx Total Sum of weight*X Double_t TH1::fTsumwx2 Total Sum of weight*X*X Double_t TH2::fTsumwxy Total Sum of weight*X*Y Double_t TH2::fTsumwy Total Sum of weight*Y Double_t TH2::fTsumwy2 Total Sum of weight*Y*Y Double_t fTsumwz Total Sum of weight*Z Double_t fTsumwz2 Total Sum of weight*Z*Z TAxis TH1::fXaxis X axis descriptor TAxis TH1::fYaxis Y axis descriptor TAxis TH1::fZaxis Z axis descriptor Double_t fZmax Upper limit in Z (if set) Double_t fZmin Lower limit in Z (if set) static Bool_t TH1::fgAddDirectory !flag to add histograms to the directory static Bool_t fgApproximate bin error approximation option static Int_t TH1::fgBufferSize !default buffer size for automatic histograms static Bool_t TH1::fgDefaultSumw2 !flag to call TH1::Sumw2 automatically at histogram creation time static Bool_t TH1::fgStatOverflows !flag to use under/overflows in statistics

## Class Charts ## Function documentation

```Default constructor for Profile2D histograms*-*-*-
*-*        ============================================
```

```Default destructor for Profile2D histograms*-*-*-
*-*        ===========================================
```
TProfile2D(const char* name, const char* title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, Double_t ylow, Double_t yup, Option_t* option = "")
```Normal Constructor for Profile histograms*-*-*-*-
*-*        ==========================================

The first eight parameters are similar to TH2D::TH2D.
All values of z are accepted at filling time.
To fill a profile2D histogram, one must use TProfile2D::Fill function.

Note that when filling the profile histogram the function Fill
checks if the variable z is betyween fZmin and fZmax.
If a minimum or maximum value is set for the Z scale before filling,
then all values below zmin or above zmax will be discarded.
Setting the minimum or maximum value for the Z scale before filling
has the same effect as calling the special TProfile2D constructor below
where zmin and zmax are specified.

H(I,J) is printed as the cell contents. The errors computed are s(I,J) if CHOPT='S'
(spread option), or e(I,J) if CHOPT=' ' (error on mean).

See TProfile2D::BuildOptions for explanation of parameters

see other constructors below with all possible combinations of
fix and variable bin size like in TH2D.
```
TProfile2D(const char* name, const char* title, Int_t nbinsx, const Double_t* xbins, Int_t nbinsy, Double_t ylow, Double_t yup, Option_t* option = "")
```  Create a 2-D Profile with variable bins in X and fix bins in Y
```
TProfile2D(const char* name, const char* title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, const Double_t* ybins, Option_t* option = "")
```  Create a 2-D Profile with fix bins in X and variable bins in Y
```
TProfile2D(const char* name, const char* title, Int_t nbinsx, const Double_t* xbins, Int_t nbinsy, const Double_t* ybins, Option_t* option = "")
```  Create a 2-D Profile with variable bins in X and variable bins in Y
```
TProfile2D(const char* name, const char* title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, Double_t ylow, Double_t yup, Double_t zlow, Double_t zup, Option_t* option = "")
```Constructor for Profile2D histograms with range in z
*-*        ====================================================
The first eight parameters are similar to TH2D::TH2D.
Only the values of Z between ZMIN and ZMAX will be considered at filling time.
zmin and zmax will also be the maximum and minimum values
on the z scale when drawing the profile2D.

See TProfile2D::BuildOptions for more explanations on errors

```
void BuildOptions(Double_t zmin, Double_t zmax, Option_t* option)
```Set Profile2D histogram structure and options*-*-
*-*          =============================================

zmin:  minimum value allowed for z
zmax:  maximum value allowed for z
if (zmin = zmax = 0) there are no limits on the allowed z values (zmin = -inf, zmax = +inf)

option:  this is the option for the computation of the t error of the profile ( TProfile2D::GetBinError )
possible values for the options are documented in TProfile2D::SetErrorOption
```
TProfile2D(const TProfile2D& profile)
``` Copy constructor.
```
Bool_t Add(TF1* h1, Double_t c1 = 1, Option_t* option = "")
``` Performs the operation: this = this + c1*f1
```
Bool_t Add(const TH1* h1, Double_t c1 = 1)
``` Performs the operation: this = this + c1*h1
```
Bool_t Add(const TH1* h1, const TH1* h2, Double_t c1 = 1, Double_t c2 = 1)
```-*-*Replace contents of this profile2D by the addition of h1 and h2
*-*      ===============================================================

this = c1*h1 + c2*h2

```
void Approximate(Bool_t approx = kTRUE)
```     static function
set the fgApproximate flag. When the flag is true, the function GetBinError
will approximate the bin error with the average profile error on all bins
in the following situation only
- the number of bins in the profile2D is less than 10404 (eg 100x100)
- the bin number of entries is small ( <5)
- the estimated bin error is extremely small compared to the bin content
(see TProfile2D::GetBinError)
```
Int_t BufferEmpty(Int_t action = 0)
``` Fill histogram with all entries in the buffer.
action = -1 histogram is reset and refilled from the buffer (called by THistPainter::Paint)
action =  0 histogram is filled from the buffer
action =  1 histogram is filled and buffer is deleted
The buffer is automatically deleted when the number of entries
in the buffer is greater than the number of entries in the histogram
```

``` accumulate arguments in buffer. When buffer is full, empty the buffer
fBuffer = number of entries in buffer
fBuffer = w of first entry
fBuffer = x of first entry
fBuffer = y of first entry
fBuffer = z of first entry
```
void Copy(TObject& hnew) const
```-*-*-*-*Copy a Profile2D histogram to a new profile2D histogram
*-*            =======================================================
```
Bool_t Divide(TF1* h1, Double_t c1 = 1)
``` Performs the operation: this = this/(c1*f1)
This function is not implemented
```
Bool_t Divide(const TH1* h1)
```Divide this profile2D by h1*-*-
*-*                  ===========================

this = this/h1

This function return kFALSE if the divide operation failed
```
Bool_t Divide(const TH1* h1, const TH1* h2, Double_t c1 = 1, Double_t c2 = 1, Option_t* option = "")
```-*-*Replace contents of this profile2D by the division of h1 by h2
*-*      ==============================================================

this = c1*h1/(c2*h2)

This function return kFALSE if the divide operation failed
```

```-*-*-*Fill a Profile2D histogram (no weights)
*-*                  =======================================
```
Int_t Fill(Double_t x, const char* namey, Double_t z)
``` Fill a Profile2D histogram (no weights)

```
Int_t Fill(const char* namex, const char* namey, Double_t z)
``` Fill a Profile2D histogram (no weights)

```
Int_t Fill(const char* namex, Double_t y, Double_t z)
``` Fill a Profile2D histogram (no weights)

```

```-*-*-*Fill a Profile2D histogram with weights
*-*                  =======================================
```
Double_t GetBinContent(Int_t bin) const
```Return bin content of a Profile2D histogram*-*-
*-*          ===========================================
```
Double_t GetBinEntries(Int_t bin) const
```Return bin entries of a Profile2D histogram*-*-
*-*          ===========================================
```

```            Return bin effective entries for a weighted filled Profile histogram.
In case of an unweighted profile, it is equivalent to the number of entries per bin
The effective entries is defined as the square of the sum of the weights divided by the
sum of the weights square.
TProfile::Sumw2() must be called before filling the profile with weights.
Only by calling this method the  sum of the square of the weights per bin is stored.

*-*          =========================================
```
Double_t GetBinError(Int_t bin) const
``` *-*-*-*-*-*-*Return bin error of a Profile2D histogram*-*-*-*-*-*-*-*-*

Computing errors: A moving field

The computation of errors for a TProfile2D has evolved with the versions
of ROOT. The difficulty is in computing errors for bins with low statistics.
- prior to version 3.10, we had no special treatment of low statistic bins.
As a result, these bins had huge errors. The reason is that the
expression eprim2 is very close to 0 (rounding problems) or 0.
- The algorithm is modified/protected for the case
when a TProfile2D is projected (ProjectionX). The previous algorithm
generated a N^2 problem when projecting a TProfile2D with a large number of
bins (eg 100000).
- in version 3.10/02, a new static function TProfile::Approximate
is introduced to enable or disable (default) the approximation.
(see also comments in TProfile::GetBinError)
```
Option_t * GetErrorOption() const
```-*-*Return option to compute profile2D errors
*-*                =========================================
```
void GetStats(Double_t* stats) const
``` fill the array stats from the contents of this profile
The array stats must be correctly dimensionned in the calling program.
stats = sumw
stats = sumw2
stats = sumwx
stats = sumwx2
stats = sumwy
stats = sumwy2
stats = sumwxy
stats = sumwz
stats = sumwz2

If no axis-subrange is specified (via TAxis::SetRange), the array stats
is simply a copy of the statistics quantities computed at filling time.
If a sub-range is specified, the function recomputes these quantities
from the bin contents in the current axis range.
```
void LabelsDeflate(Option_t* axis = "X")
``` Reduce the number of bins for this axis to the number of bins having a label.
```
void LabelsInflate(Option_t* axis = "X")
``` Double the number of bins for axis.
Refill histogram
This function is called by TAxis::FindBin(const char *label)
```
void LabelsOption(Option_t* option = "h", Option_t* axis = "X")
```  Set option(s) to draw axis with labels
option = "a" sort by alphabetic order
= ">" sort by decreasing values
= "<" sort by increasing values
= "h" draw labels horizonthal
= "v" draw labels vertical
= "u" draw labels up (end of label right adjusted)
= "d" draw labels down (start of label left adjusted)
```
Long64_t Merge(TCollection* list)
```Merge all histograms in the collection in this histogram.
This function computes the min/max for the axes,
compute a new number of bins, if necessary,
add bin contents, errors and statistics.
If overflows are present and limits are different the function will fail.
The function returns the total number of entries in the result histogram
if the merge is successfull, -1 otherwise.

IMPORTANT remark. The 2 axis x and y may have different number
of bins and different limits, BUT the largest bin width must be
a multiple of the smallest bin width and the upper limit must also
be a multiple of the bin width.
```
Bool_t Multiply(TF1* h1, Double_t c1 = 1)
``` Performs the operation: this = this*c1*f1
```
Bool_t Multiply(const TH1* h1)
```Multiply this profile2D by h1*-
*-*                  =============================

this = this*h1

```
Bool_t Multiply(const TH1* h1, const TH1* h2, Double_t c1 = 1, Double_t c2 = 1, Option_t* option = "")
```-*-*-*Replace contents of this profile2D by multiplication of h1 by h2
*-*      ================================================================

this = (c1*h1)*(c2*h2)

```
TH2D * ProjectionXY(const char* name = "_pxy", Option_t* option = "e") const
```Project this profile2D into a 2-D histogram along X,Y*-*-
*-*      =====================================================

The projection is always of the type TH2D.

if option "E" is specified  the errors of the projected histogram are computed and set
to be equal to the errors of the profile.
Option "E" is defined as the default one in the header file.
if option "" is specified the histogram errors are simply the sqrt of its content
if option "B" is specified, the content of bin of the returned histogram
will be equal to the GetBinEntries(bin) of the profile,
if option "C=E" the bin contents of the projection are set to the
bin errors of the profile
if option "W" is specified the bin content of the projected histogram  is set to the
product of the bin content of the profile and the entries.
With this option the returned histogram will be equivalent to the one obtained by
filling directly a TH2D using the 3-rd value as a weight.
This option makes sense only for profile filled with all weights =1.
When the profile is weighted (filled with weights different than 1) the
bin error of the projected histogram (obtained using this option "W") cannot be
correctly computed from the information stored in the profile. In that case the
obtained histogram contains as bin error square the weighted sum of the square of the
profiled observable (TProfile2D::fSumw2[bin] )
```
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*-*-*-*-*-*
*-*      ========================================================

The projection is made from the channels along the Y axis
ranging from firstybin to lastybin included.
The result is a 1D profile which contains the combination of all the considered bins along Y
By default, bins 1 to ny are included
When all bins are included, the number of entries in the projection
is set to the number of entries of the 2-D histogram, otherwise
the number of entries is incremented by 1 for all non empty cells.

The option can also be used to specify the projected profile error type.
Values which can be used are 's', 'i', or 'g'. See TProfile::BuildOptions for details

```
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*-*-*-*-*-*
*-*      ========================================================

The projection is made from the channels along the X axis
ranging from firstybin to lastybin included.
The result is a 1D profile which contains the combination of all the considered bins along X
By default, bins 1 to ny are included
When all bins are included, the number of entries in the projection
is set to the number of entries of the 2-D histogram, otherwise
the number of entries is incremented by 1 for all non empty cells.

The option can also be used to specify the projected profile error type.
Values which can be used are 's', 'i', or 'g'. See TProfile::BuildOptions for details

```
TProfile * DoProfile(bool onX, const char* name, Int_t firstbin, Int_t lastbin, Option_t* option) const
``` implementation of ProfileX or ProfileY for a TProfile2D
Do correctly the combination of the bin averages when doing the projection
```
void PutStats(Double_t* stats)
``` Replace current statistics with the values in array stats
```
void Reset(Option_t* option = "")
```-*-*Reset contents of a Profile2D histogram
*-*                =======================================
```
void ExtendAxis(Double_t x, TAxis* axis)
``` Profile histogram is resized along axis such that x is in the axis range.
The new axis limits are recomputed by doubling iteratively
the current axis range until the specified value x is within the limits.
The algorithm makes a copy of the histogram, then loops on all bins
of the old histogram to fill the extended histogram.
Takes into account errors (Sumw2) if any.
The axis must be extendable before invoking this function.
Ex: h->GetXaxis()->SetCanExtend(kTRUE)
```
TProfile2D * Rebin2D(Int_t nxgroup = 2, Int_t nygroup = 2, const char* newname = "")
```   -*-*-*Rebin this histogram grouping nxgroup/nygroup bins along the xaxis/yaxis together*-*-*-*-

if newname is not blank a new profile hnew is created.
else the current histogram is modified (default)
The parameter nxgroup/nygroup indicate how many bins along the xaxis/yaxis of this
have to be merged into one bin of hnew
If the original profile has errors stored (via Sumw2), the resulting
profile has new errors correctly calculated.

examples: if hpxpy is an existing TProfile2D profile with 40 x 40 bins
hpxpy->Rebin2D();  // merges two bins along the xaxis and yaxis in one
// Carefull: previous contents of hpxpy are lost
hpxpy->Rebin2D(3,5);  // merges 3 bins along the xaxis and 5 bins along the yaxis in one
// Carefull: previous contents of hpxpy are lost
hpxpy->RebinX(5); //merges five bins along the xaxis in one in hpxpy
TProfile2D *hnew = hpxpy->RebinY(5,"hnew"); // creates a new profile hnew
// merging 5 bins of hpxpy along the yaxis in one bin

NOTE : If nxgroup/nygroup is not an exact divider of the number of bins,
along the xaxis/yaxis the top limit(s) of the rebinned profile
is changed to the upper edge of the xbin=newxbins*nxgroup resp.
ybin=newybins*nygroup and the remaining bins are added to
the overflow bin.
Statistics will be recomputed from the new bin contents.
```
TProfile2D * RebinX(Int_t ngroup = 2, const char* newname = "")
``` Rebin only the X axis
see Rebin2D
```
TProfile2D * RebinY(Int_t ngroup = 2, const char* newname = "")
``` Rebin only the Y axis
see Rebin2D
```
void SavePrimitive(ostream& out, Option_t* option = "")
``` Save primitive as a C++ statement(s) on output stream out
```
void Scale(Double_t c1 = 1, Option_t* option = "")
``` *-*-*-*-*Multiply this profile2D by a constant c1*-*-*-*-*-*-*-*-*
*-*      ========================================

this = c1*this

This function uses the services of TProfile2D::Add

```
void SetBinEntries(Int_t bin, Double_t w)
```Set the number of entries in bin*-*-*-
*-*              ================================
```
void SetBins(Int_t nbinsx, Double_t xmin, Double_t xmax, Int_t nbinsy, Double_t ymin, Double_t ymax)
```Redefine  x and y axis parameters*-*-*-
*-*              ===========================
```
void SetBins(Int_t nx, const Double_t* xBins, Int_t ny, const Double_t* yBins)
```*-*Redefine  x and y axis parameters for variable bin sizes
*-*              ===========================
```
void SetBinsLength(Int_t n = -1)
``` Set total number of bins including under/overflow
Reallocate bin contents array
```
void SetBuffer(Int_t buffersize, Option_t* option = "")
``` set the buffer size in units of 8 bytes (double)
```
void SetErrorOption(Option_t* option = "")
```-*-*Set option to compute profile2D errors
*-*                =======================================
The computation of the bin errors is based on the parameter option:
option:
' '  (Default) The bin errors are the standard error on the mean of the bin profiled values (Z),
i.e. the standard error of the bin contents.
Note that if TProfile::Approximate()  is called, an approximation is used when
the spread in Z is 0 and the number of bin entries  is > 0

's'            The bin errors are the standard deviations of the Z bin values
Note that if TProfile::Approximate()  is called, an approximation is used when
the spread in Z is 0 and the number of bin entries is > 0

'i'            Errors are as in default case (standard errors of the bin contents)
The only difference is for the case when the spread in Z is zero.
In this case for N > 0 the error is  1./SQRT(12.*N)

'g'            Errors are 1./SQRT(W)  for W not equal to 0 and 0 for W = 0.
W is the sum in the bin of the weights of the profile.
This option is for combining measurements z +/- dz,
and  the profile is filled with values y and weights z = 1/dz**2

See TProfile::BuildOptions for a detailed explanation of all options
```
void Streamer(TBuffer& )
``` Stream an object of class TProfile2D.
```
void Sumw2(Bool_t flag = kTRUE)
``` Create/Delete structure to store sum of squares of weights per bin  *-*-*-*-*-*-*-*
This is needed to compute  the correct statistical quantities
of a profile filled with weights

This function is automatically called when the histogram is created
if the static function TH1::SetDefaultSumw2 has been called before.
If flag is false the structure is deleted
```

`{return -2;}`

`{return -2;}`
void SetBins(const Int_t* nbins, const Double_t* range)
``` helper methods for the Merge unification in TProfileHelper
```
Int_t Fill(const Double_t* v)
`{ return Fill(v, v, v, v); }`

`{return TH2::Fill(0); }`
Double_t RetrieveBinContent(Int_t bin) const
```virtual void     UpdateBinContent(Int_t bin, Double_t content);
```
`{ return (fBinEntries.fArray[bin] > 0) ? fArray[bin]/fBinEntries.fArray[bin] : 0; }`
Double_t GetBinErrorSqUnchecked(Int_t bin) const
`{ Double_t err = GetBinError(bin); return err*err; }`
Double_t * GetB()
`{return &fBinEntries.fArray;}`

`{return (fBinSumw2.fN ? &fBinSumw2.fArray : 0 ); }`
Double_t * GetW()
`{return &fArray;}`

`{return &fSumw2.fArray;}`
void SetBins(Int_t , Double_t , Double_t )
`{ MayNotUse("SetBins(Int_t, Double_t, Double_t"); }`
void SetBins(Int_t , const Double_t* )
`{ MayNotUse("SetBins(Int_t, const Double_t*"); }`

`{ MayNotUse("SetBins(Int_t, Double_t, Double_t, Int_t, Double_t, Double_t, Int_t, Double_t, Double_t"); }`
void SetBins(Int_t , const Double_t* , Int_t , const Double_t* , Int_t , const Double_t* )
`{ MayNotUse("SetBins(Int_t, const Double_t*, Int_t, const Double_t*, Int_t, const Double_t*"); }`
Double_t GetBinContent(Int_t bin) const
Double_t GetBinContent(Int_t binx, Int_t biny) const
`{return GetBinContent(GetBin(binx,biny));}`
Double_t GetBinError(Int_t bin) const
Double_t GetBinError(Int_t binx, Int_t biny) const
`{return GetBinError(GetBin(binx,biny));}`

`{return &fBinSumw2;}`
const TArrayD * GetBinSumw2() const
`{return &fBinSumw2;}`
Double_t GetZmin() const
`{return fZmin;}`
Double_t GetZmax() const
`{return fZmax;}`