Re: [ROOT] TH1::AddBinContent() and TH1::Sumw2()

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Mar 02 2001 - 18:30:15 MET


Hi Cynthia,
Why are you calling AddBinContent and not Fill ?
TH1::Fill calls:
  - AddBinContent
  - increments the sum of squares of weights for the bin

see:  http://root.cern.ch/root/html225/src/TH1.cxx.html#TH1:Fill

Rene Brun


Hadjidakis Cynthia wrote:
> 
> Hi,
> 
> I have a problem with filling my histogram with TH1::AddBincontent()
> combined with TH1::Sumw2() : my error bar is always null.
> 
> TH1F *histo = new TH1F("histo","histo",10,0,10);
> histo->Sumw2();
>   histo->AddBinContent(1,2);
>   histo->AddBinContent(1,3);
> 
> cout<<"error "<<histo->GetBinError(1)<<endl;
> 
> It returns : error 0
> 
> TH1::Sumw2() works perfectly with the TH1::Fill() method but not in this
> case.
> Does anybody know why ?
> 
> Thanks,
> 
> Cynthia
> 
> ps : I work on the 2.25 ROOT version



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:38 MET