Re: TH2:: bins contents

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Jun 01 1998 - 10:33:48 MEST


Alexander Zvyagin wrote:
> 
>                                            IHEP, Protvino, Russia, 31-MAY-1998
> 
>     Dear ROOTers!
> 
> Are there functions TH2::AddBinContent, TH2::GetBinContent, TH2::SetBinContent
> for two-dimensional (and TH3:: - three dim.) histograms? Or they are available
> for TH1 objects only?
> 
> It'll be great if we have above functions for TH2,TH3 histograms.
> 
> With best wishes,
> Alexander Zvyagin.

Alexander,
You can use these functions for all type of histograms and
all dimensions. In case of 2-d and 3-d histograms, however, you
must compute a "linearized bin number" before invoking these
functions. For example for a 3-d histogram, you can do:
   Int_t bin = h3->GetBin(binx,biny,binz);
   Float_t y = h3->GetBinContent(bin);

Rene Brun



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:33 MET