Hello,
When fitting a TH1 with the binned likelihood method (fit option “L”), how can I force
the fitter to use some value other than sqrt (bin content) as the error per bin?
In the “Associated Errors” section of the Users Guide v5.26, it is suggested that this can be
accomplished by calling the Sumw2() method of the TH1 being fitted, but this does not
seem to work. When I execute the example below (in root version 5.24/00), I expect the
uncertainty on the fit parameter to be different for h0 and h1, but it is not. Is this
somehow a property of the likelihood fit, which I am overlooking?
Thanks,
Jim
TH1F h0(“h0”,“h0”,3,-0.5,2.5)
h0.Sumw2()
h0.SetBinContent(1,100.)
h0.SetBinContent(2,100.)
h0.SetBinContent(3,100.)
h0.SetBinError(1,10.)
h0.SetBinError(2,10.)
h0.SetBinError(3,10.)
h0.Fit(“pol0”,“LN”)
TH1F h1(“h1”,“h1”,3,-0.5,2.5)
h1.Sumw2()
h1.SetBinContent(1,100.)
h1.SetBinContent(2,100.)
h1.SetBinContent(3,100.)
h1.SetBinError(1,1.)
h1.SetBinError(2,1.)
h1.SetBinError(3,1.)
h1.Fit(“pol0”,“LN”)