I used to fill a TH2 histogram from TTree:::Draw().
TH2 * h = new TH2(“hname”,…)
tree->Draw(“var>>hname”)
this works great but now I need an histogram where I join only some bins with low statistics.
I’ve done it by using TH2Poly. But when I try to fill it in the same way as I fill the normal TH2 it doesn’t work.
The TH2Poly allows to define polygonal bins of arbitrary shape.
The standard TH2[CSIFD] allows to define variable size bins of rectangular shape (note: it may also have fix size bins along X and variable size bins along Y or vice versa) -> maybe this will be sufficient for you.