Errors in Fit

I am trying to fit a TH1F that is a sum of 3 other TH1F’s. I can fit the histogram just fine, but the associated errors with the parameters are enormous because it does not take into account the weights of the histograms. All are weighted (sigmaL)/N. So obviously I need the errors to be calculated using wSqrt(N).

Can someone help me with the code to change the errors to this calculation instead of just Sqrt(N)? Thanks in advance.

-Best Matt

Nevermind… I figured it out. Does anyone know how I can get SetFillColor() to work when I use Sumw2()? I want it to store the weighted errors but I also want to fill the histogram with color. Thanks

You can do:

h.Sumw2(); h.SetFillColor(kRed); h.Draw("hist"); h.SetMarkerStyle(21); h.Draw("same");

Rene

Thanks very much!