RE: normalized histograms errors

From: Tobias Raufer <>
Date: Thu, 24 Nov 2005 10:17:58 -0000

Hi Ben,

>From quickly running your macro I can't see anything wrong with the
error bars. You have two separate histograms H and K, one with 9 entries in total and one with 3. So when you normalize them, they get of course scaled by different factors. That's why after the normalization, the x=6 bin has a larger error bar rhan the x=3 bin.

To confirm this, put all your entries in a single histogram. Then the errors on both these bins stay exactly the same.



Tobias Raufer
Denys Wilkinson Building
Keble Road, Oxford OX1 3RH, UK

Tel.  +44 (0)1865 273385
Fax. +44 (0)1865 273418

>-----Original Message-----
>[] On Behalf Of Ben Kilminster
>Sent: 23 November 2005 20:07
>Subject: [ROOT] normalized histograms errors
>The errors on my normalized histograms are not what I'd expect
>them to be. To demonstrate this, I have included a macro (see below).
>In the following macro, I plot two histograms on the same
>canvas. The top histogram has two histograms overlayed. The
>bottom canvas is the
>same but with the histograms normalized. Notice that in the bottom
>canvas the errors are larger for the x=6 bin than for the x=3
>bin even though they have the same number of entries, and have
>the same-sized error bars in the top canvas.
>Is this the desired behavior ?
>If so, is there a way I can switch the errors of normalized
>histograms so that their errors are relatively comparable
>(Ie, error in bin 3 is the same as the error in bin 6) ?
>I have tried using TH1F::Sumw2() before plotting them in the
>second plot, but no luck.
>TH1F *K = new TH1F("K","No norm",10,0,10); TH1F *H = new
>TCanvas *C = new TCanvas("C", "test", 600,800);
>// top canvas has no normalization
>K->DrawCopy("same, elp");
>// bottom canvas is normalized
>H->Draw("same, elp");
Received on Thu Nov 24 2005 - 11:18:04 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:13 MET