Re: [ROOT] TH1 : X coordinate -> BinContent ?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Sep 25 2003 - 19:22:12 MEST


do:

int bin = h->GetXaxis()->FindBin(x);
h->GetBinContent(bin);

There is no loop involved in this process.

Rene Brun

On Thu, 25 Sep 2003, Julien 
Bolmont 
wrote:

> 
> Hello rooters !
> 
> I use ROOT 3.04.02.
> 
> Is there any solution to get the bin content directly with the X 
> coordinate ?
> 
> One possible solution is:
> - With the X coordinate, find the number of the corresponding bin (with a 
> loop, which is time consuming !)
> - Get the bin content with GetBinContent(number_of_the_bin).
> 
> Is there any better solution ?
> 
> Thanks a lot.
> Julien
> 
> 



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:15 MET