Re: Looping over all bins with a TH1*

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Mon, 25 Aug 2008 10:18:15 +0200


Assuming a TH1* h

int nbinsx = h->GetXaxis()->GetNbins();

Rene Brun

Philip Rodrigues wrote:
> Hi roottalk,
> Given a pointer to a TH1 (which may point to a 1D or 2D histogram), how can I
> loop over all the bins? It looks like I want a function that returns fNCells,
> which I could use along with the 1D version of GetBinContent(), but I can't
> see one.
>
> Thanks,
> Philip
>
>
Received on Mon Aug 25 2008 - 10:18:48 CEST

This archive was generated by hypermail 2.2.0 : Mon Aug 25 2008 - 23:50:02 CEST