Variable rebinning for a 2D histogram

Hello,

I would like to rebin the X and Y axes of a 2D histogam using something analogous to:
TH1F::Rebin(Int_t ngroup = 2, const char* newname = “”, const Double_t* xbins = 0)
i.e. passing an array to perform a variable bin width rebinning.

I’ve had a look through the documentation, but I didn’t manage to find any function to do it. Does this functionality exist?

Cheers
Heather

Hi,

This functionality is not supported in TH2::Rebin2D. If you really needed it, you will have to implement yourself, maybe looking at what is done in TH1::Rebin.

Lorenzo

Hi,

an absurd alternative would be to use THnSparse::RebinnedAdd() root.cern.ch/root/html/THnSparse … ebinnedAdd :slight_smile:

Cheers, Axel.