TH2Poly has no TProfile equivalent?


I think TH2Poly is a very nice and highly useful class. However, I think it would be very useful to have a TProfile version of it as well, something like TProfile2D is for TH2. Will this be implemented sometime in the near future?

Also, I am missing this constructor:

TH2Poly(const TH2Poly&)

It is mentioned on the webpage, but the link is empty: … :TH2Poly@3

Is it a bug, or in development?


This constructor is the copy constructor automatically generated by the compiler. So it exist.

I am not sur how you would make a TProfile with a Th2Poly as the bins can have any shapes…
What would be a TProfile of the histogram produced by $ROOTSYS/tutorials/hist/th2polyEurope.C ?

Ah, right, I missed the copy constructor, thanks.

I think I was misleading about the profile. I was not referring to an equivalent of TH2::ProfileX/Y, that would of course not be possible. Instead, to have a TProfile2D with custom-shaped bins, like TH2Poly.

So, as for the map of Europe goes, the TProfile2D equivalent would be exactly the same, since you are always shooting with ones: … C.html#107

What I meant was to have a possibility for the bin content to show the average of the filling values instead of it’s sum, like it’s done here: … x.html#811

In other words, to have a TH2Poly-like TProfile2D (or a more simpler version - a TH2Poly with storing additional information to have a TProfile2D capability), so one can profit from the custom-shaped bins.

I hope it’s clearer now. In principle, I could build some helper class to get around it, but in my opinion it would certainly be useful to have it included.