Re: TH1 questions/problems

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Sun, 15 Jul 2007 07:50:40 +0200


Tom Roberts wrote:
> Two questions/problems about TH1-s:
>
> a) The errorbars are wrong.

I am afraid that you are wrong ::)
Please read carefully the documentation of the histogram classes (chapter in the Users guide
or simply http://root.cern.ch/root/htmldoc/TH1.html (search for errors or Sumw2)
Have a look at the class TProfile too:
http://root.cern.ch/root/htmldoc/TProfile.html

Rene Brun

> They are displayed as sqrt(sum of weights)
> but they should be (sum of weights)/sqrt(N) where N is the number of
> entries in the bin. The workaround of using a TGraphErrors and
> doing it myself is quite cumbersome.... And worse, it would prevent
> the user from using the canvas editor to manipulate it as usual.
> I realize this requires an additional int per bin -- do we need
> another class (analogous to TGraphErrors)? Or better, a new function
> AccumulateErrorbars(bool) that allocates the additional array and
> causes Fill() to fill it and Draw("E?") to draw errorbars correctly
> (and if never called things can work as they do now).
>
> b) The option to Draw "E1 X0" still draws the X errorbars. But
> gStyle->SetErrorX(0) does remove them.
>
> I'm using a TH1D if it matters (probably not). This is Root 5.12 on
> Linux.
>
>
> Tom Roberts
Received on Sun Jul 15 2007 - 07:50:42 CEST

This archive was generated by hypermail 2.2.0 : Mon Jul 16 2007 - 05:50:02 CEST