Details on "I" option in TH1::Fit

Hello Rooters,

I am looking for detailed information on how the integral is calculated when using TH1::Fit with the “I” option. I haven’t found what I need in the manual or on the TH1 profile online. Sorry if I am overlooking the answer…

Here are the questions I need to answer:

I have a bin with lower edge x1 and upper edge x2, and a discontinuous fitting function

f(x) = f1(x) for x<=x1,
f(x) = f2(x) for x>x1.

Q1: What will be the value of the integral used by the fit on this bin? It should be the integral of f2(x) on the bin. Will the discontinuity at x1 mess up the calculation?

Q2: Does the answer change if the discontinuity is on the upper edge? Ie.

f(x) = f1(x) for x<=x2,
f(x) = f2(x) for x>x2,

and the correct integral is the integral of f1(x) on the bin. I’m guessing this case is more obviously correct…

Does someone know the answers or know what I should read to find out?

Many thanks,

Using option “I”, a numerical integral of the function in the bin is computed. If the function changes at the bin edge (e.g. an histogram function), I don’t think is a problem, the computation of the integral in the bin should work. In case the integral computation has problems, normally an error is reported.

Best Regards


With ROOT, always try to use:
f(x) = f1(x) for x < x_edge (i.e. UP TO and EXCLUDING “x_edge”)
f(x) = f2(x) for x >= x_edge (i.e. FROM and INCLUDING “x_edge”)
And it would be a good idea to keep your histograms’ bins “aligned” with your “x edges” (note: ROOT histograms’ bins always INCLUDE their “low-edges” and EXCLUDE their “upper-edges”).