TProfile2D SetBins not implmented

Hello everyone,

I see that

is currently not implemented in TProfile2D.
This prevents the Rebin2D method to work correctly when the TProfile2D has some variable bins.

Is there a good reason for that ?
I’ve hacked my own version of SetBins like this :

[code]void TProfile2D::SetBins(Int_t nx, const Double_t xBins, Int_t ny, const Double_t yBins)
{
//
-
-------Redefine x axis parameters-----------*
//- ===========================

TH1::SetBins(nx,xBins,ny,yBins);
fBinEntries.Set(fNcells);
if (fBinSumw2.fN) fBinSumw2.Set(fNcells);
}
[/code]

and it seems to work well. Could this be implemented by default in ROOT ? or am I’m missing something important ?

P.A.

Hi,

Thank you for finding this out and providing the implementation. It is now in the ROOT svn trunk for TProfile2D and also TProfile3D.

Best Regards

Lorenzo