The behaviour of this function with option “I” is very weird to me. I would thought this function should integrate the function h1 over the bin and then divided by the bin width. However, in really, the function multiply by the bin width instead.
In the line 816 of the source code
cu += c1*f1->Integral(fXaxis.GetBinLowEdge(binx), fXaxis.GetBinUpEdge(binx)) * fXaxis.GetBinWidth(binx);
I also don’t understand what is the point of 815 line
I agree this function is weird and certainly not correct the way it is implemented.
One should just compute the integral and dived by the bin width.
I see the code has been like this for more than 10 years. This means nobody has used this functionality. For curiosity what is your use case to use TH1::Add with a function and for using it with the integral option ?
Thank you for the response.
I want to smooth a function to a certain resolution which corresponding to the bin width of the histogram created. I believe the integral option will automatically do this for me, if it works appropriately.