How to get the minimum and maximum value of 1 bin in a 2D histogram

I have a 2D histogram h, and I want to get the minimum and maximum value of each bin in the x axis.
Does someone have any idea?


Do a main loop along the y-axis and then for each bin in y you scan all the bins along X and compute de minimum. (GetBinContent will be the method to use).

no, I want to get each bin value of x axis, not the bincontent.

TH1 → Convention for numbering bins

ibinx = 0 ... histo->GetXaxis()->GetNbins() + 1
histo->GetXaxis()->GetBinLowEdge(ibinx) /* included */
histo->GetXaxis()->GetBinUpEdge(ibinx) /* excluded */

ibiny = 0 ... histo->GetYaxis()->GetNbins() + 1
histo->GetYaxis()->GetBinLowEdge(ibiny) /* included */
histo->GetYaxis()->GetBinUpEdge(ibiny) /* excluded */

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