TH2Poly support in rdataframe::Histo2D

Dear experts,
It seems that currently rdataframe::Histo2D only supports TH2D. If this is true, do you plan to add support for TH2Poly? Thanks.

Hi,
there are currently no add a specific method for TH2Poly, but at least in C++ you can fill a TH2Poly with RDataFrame using the generic Fill action:

auto h2poly = df.Fill<float, float>(TH2Poly(/*constructor arguments*/), {"x", "y"});

where h2poly is the usual RDF smart pointer to a result, that you can use as if it was a pointer to h2poly, but it actually only fills the underlying object upon first access.

Hope this helps,
Enrico

Thanks for the quick reply and nice suggestion. I will try it. Is it possible to also apply a weight for each entry?

Yes, RDataFrame will just call yourobject.Fill(branch1, branch2, ....) using the types and the names of the branches that you provide.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.