Integral function in root

Hello,
I was using the integral function in root for calculating the area under a histogram in between two bins.

 double area=hist->Integral(hist->FindBin(0), hist->FindBin(5)); 

I felt little confused what is being calculated here. Is it the sum of bin contents between the two limits? Or is it the literal geometrical area? sum(bincontent * binwidth) ? My strong guess is that it is the first way and I was wondering if there is any distinction for the integral function to calculate the literal geometric area and the sum of bin contents
ROOT Version: 6.26
Platform: Ubuntu 22.04
Compiler: gcc


https://root.cern/doc/master/classTH1.html#aaf053a4b487c46b9e20c0bf534b34012
You can find the code by following the link at “Definition at line…” (eventually reaching the code for DoIntegral).

1 Like

Thanks a lot. This was exactly what I was looking for.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.