GetMinimumBin with range specified

Hi,

Is there a way to get the minimum bin in a specified range of a TH1D?

So for example if I have a TH1D with x axis from 0. to 10., can I say look for the minimum bin in the range x=4 to 7?

Can I do this without the use of a for loop? My histograms are of variable sizes, and the range I want to look for a minimum depends on the histogram…

  • Sujeewa

I’m sorry, I meant to say, can I do this without the use of a for loop? My histograms are of variable sizes, and the range I want to look for a minimum depends on the histogram…

root.cern.ch/root/htmldoc/TH1.ht … MinimumBin
root.cern.ch/root/htmldoc/TAxis. … s:SetRange

[quote]Int_t GetMinimumBin()
-----Return location of bin with minimum value in the range-
[/quote]so in your case:histo->GetXaxis()->SetRangeUser(4, 7); // specified range Int_t minb = histo->GetMinimumBin(); histo->GetXaxis()->UnZoom(); // full rangeJan

thank you Jan!