How can I find all TH2 bins that contain a specific range of values without using for loops?

Hi all. I’m trying to avoid using for loops and manually querying all the bins in a TH2 that I have, and I’m wondering if ROOT has some functionality that lets me get back a list of all bin indices whose bins have a certain range of values? Something like “FindBinsWithThisValue” as a function in TH2 would be great, does something like that exist?

I’m using ROOT version 6.10. Thanks!

TH2 Class Reference

Thanks for the answer, @Wile_E_Coyote. The best that I could find in the documentation was GetBinWithContent2, which only returns a single set of bin indices. That means that I’d still need to work this function into a loop, and make sure that the loop is adjusting where it’s directing GetBinWithContent2 to look, which is what I wanted to avoid. Is there any way around this, something like “GetAllBinsWithContent”?

I guess that it cannot be done without a loop.