Properly fill histogram with error

Dear experts,

in my analysis I’m filling several histograms, in order to perform several operations later (scaling, dividing, filling THStak…). In order to properly handle the statistical errors (during this later operation), I wonder if before the histogram filling I should call a specific method (for the error)?

Regards

Search for “Sumw2” and “kIsAverage” in the TH1 class description.

Dear Coyote,

I still wonder if I can apply these method after I’ve filled the histogram (or am I obliged to call them before I fill the histogram)? So for example, if I fill my 2 histograms (without Sumw2()):
h1->Fill();
h2->Fill();

then I call Sumw2();
h1->Sumw2();
h2->Sumw2();

then I divide:
h1->Divide(h2);

Are the errors still handle properly?

Regards

I think it really only makes sense to call Sumw2 before filling (but others may disagree, of course).

Dear Coyote,

ok, thank you for your help.

Regards