Normalizing histograms with error bars

Hi,
I know how to normalize a histogram from the User Guide like this:
Double_t scale = 1/h->Integral();
h->Scale(scale);
But how to normalize the error together with this? I do this to a histogram and draw it and find the error bar very big because it doesn’t change with normalizing. How to solve this? Get every bin’s error and scale it? Doesn’t seem so convenient since I have a lot of histograms. :smiley:

Before scaling, for each of your histograms:
your_histogram->Sumw2(kTRUE);

Or, before you create your histograms:
TH1::SetDefaultSumw2(kTRUE);

[quote=“Pepe Le Pew”]Before scaling, for each of your histograms:
your_histogram->Sumw2(kTRUE);

Or, before you create your histograms:
TH1::SetDefaultSumw2(kTRUE);[/quote]
Thank you! It works perfectly.