Normalisation of Error bars

Hi!

I have 2 histograms. I am able to get the errors per bin for both. I have normalized my histograms but it seems that the errors are not normalized. The errors are far bigger.

One of the histo-H1 has weight 1 and the other histo -H2 has different weights.
I am using:
histogram.Sumw2() for both histograms.

I don’t understand how I could solve it?
@bellenot @moneta Could you help?

May be a small script reproducing the issue would help ?

for i in range(bin):
    error = histo.GetBinError(i)
    print(error)
mean = histo.GetMean()
print(mean)
mean_error = histo.GetMeanError()
print(mean_error)
if histo.GetEntries() > 0:
    histo.Scale(100.0 / numberOfPrimaries)
    histo = prepareHisto(histo, xLabel, yLabel)

For filling histogram:

> histogram.Sumw2()       
 if useWeight:
    histogram.Fill(event.Energy, event.Weight)
 else:
    histogram.Fill(event.Energy)

Hi,

the Sumw2() is called for htemp, but you are filling the histogram. Maybe that’s the issue here?

Nope perhaps that was a copying error!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.