Getting integral for a function

HI ,
I am using the following code:

binc[2] = new TH1F(“binc_2”,“3<Enu<4”,20,2,3);
// then fill binc[2]
TF1 *f3 = new TF1(“f3”,“pol3”);

I am a little confused because I see a non zero value returned for the f3 integral between 1.0 and 2.0. But since my historgram is between 2 and 3, i would expect the f3 to be between 2 and 3 and 0 outside this range. Is f3 extrapolating for the region outside the 2 and 3 limits ?

No, TF1 does not remember the range of the histogram used for the fit.
It is up to you to be coherent with what you expect.