Getting specific x-y axis values from 2D histogram

Dear all,

After filling a 2D histogram, I need to store

  1. the bin content higher than a given threshold and
  2. its corresponding x-y positions.

How to proceed to get these latter?
In my case, I would need for example to get the values “5200” and “3400” in fig2-zoomed.png.

Cheers,

Diego

plotDataV2.C (2.2 KB)

You mean the bin contain just above a given threshold: the minimum of the values above the threshold ?

You may have several bins containing this value. So a single x,y position does not make sense.

Dear Couet, thanks for answering. I just need the values of the axis for a given bin. In the example above, a given bin with 240 entries, the values are 5200 for x and 3400 for y. So I would like to get that automatically, without looking to the image.

Cheers,

Diego

Something like plotDataV3.C (2.3 KB)
(Didn’t test)

1 Like

Thanks! It was exactly what I was looking for!

Cheers,

Diego

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