Use of IntegralAndError method!

Dear All,
I would like to calculate an Integral of a histogram and it’s error, and I thought the IntegralAndError method could do it, but I am struggling to use it. I thought something like that should work:

Hist->IntegralAndError(10,70,X,"error");

where 10 and 70 define the bin range, but I have no idea what X should be, could someone help please ?
Cheers
Diallo

1 Like
Double_t error;
Double_t integral = Hist->IntegralAndError(10, 70, error, ""); // "" ... or ... "width"
std::cout << "Hist integral = " << interal << " +- " << error << std::endl;

Hi,
Thanks, that works :slight_smile:
cheers,
Diallo

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