Working with a histogram

Hi everyone,

I am newbie, and I have a quick question. Hopefully, you will be able to help me. I have a 1D histogram, which is a projectionX() of a TH2D histogram, and I am wondering if it is possible to get the entries from the 1D histogram. In essence, is it possible to get the x and y values into an array or variable? Please, let me know if anything above does not make sense.

Thanks a lot in advance!

Read about GetBincenter and GetBinContent in the documentation for histograms:
In short, loop over the bins (from 1 to nbins) and use those methods to get the info.

1 Like

@dastudillo Thank you so much for your help.