Error on a integral

Dear all,
I am calculating the integral and the error associated of my histograms, by using this method

Double_t A = Impact_mu_A->IntegralAndError(0,100,error_A, "");
 std::cout << "Int_A = " << A<< " +- " <<error_A << std::endl;

It works well but I got such a big error, for instance this is what I print like:
Int_A = 2867.37 ± 1439.48
Could anyone tell me if this is nornal to have such a huge error please ?
I also attached the root file where you can find Impact_mu_Ahistos.root (14.6 KB)
histogram
cheers,
Diallo.

1 Like

Well, you will need to check how you fill your histogram as Impact_mu_A->Print("all"); shows big bin errors:

TH1.Print Name  = Impact_mu_A, Entries= 4, Total sum= 2867.37
 fSumw[0]=0, x=-0.5, error=0 # the underflow bin
 fSumw[1]=645.963, x=0.5, error=645.963
 fSumw[2]=2221.41, x=1.5, error=1286.41
 fSumw[3]=0, x=2.5, error=0
(...)
 fSumw[100]=0, x=99.5, error=0
 fSumw[101]=0, x=100.5, error=0 # the overflow bin

BTW. You probably want (excluding underflow and overflow bins):

Double_t error_A;
Double_t A = Impact_mu_A->IntegralAndError(1, Impact_mu_A->GetNbinsX(), error_A, ""); // "" or "width"

or (including underflow and overflow bins):

Double_t error_A;
Double_t A = Impact_mu_A->IntegralAndError(0, (Impact_mu_A->GetNbinsX() + 1), error_A, ""); // "" or "width"

Hi,
Thanks for replying!! actually I was filling my histograms with a weight (since it’s a MC bkg samples), but if I removed the weight and put 1 for instance I got something more reasonable like this for instance:

Int_A = 4 +- 2

for the integral of Impact_mu_A histogram, but it’s still a huge error I guess. It doesn’t change the result if I include or not underflow and overflow bins. I attached the root file again.
cheers,
Diallohistos.root (12.3 KB)

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