Fill ROOT 2d histogram with already binned data

Hello ROOTers

I have a txt file containing already binned data (frequency values for each bin) for a 2d histogram. I can read in into a ((100,100)) np array in python. Is it possible to create a ROOT histogram from this array of frequency values. I have the bin edges.

I want to make a ROOT histogram so that I can use the object with Roofit kde stuff.

Any ideas?

Thanks a lot

Alex

See constructors which take “xbins” and “ybins” in the TH2D Class Reference
TH2::SetBinContent()
TH1::SetBinError()

Ah brilliant I had no idea about these!

Thanks a lot!

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