Error Propagation IntegralAndError for Variable Binning

I have a histogram with about ~1000 bins, and the variable binned ones with ~50. I am using the IntegralAndError method. Here’s the example

[quote]// for for normal histogram
double minBin = h->GetXaxis()->GetBin(10);
double maxBin = h->GetXaxis()->GetBin(100);
double integ = h->IntegralAndError(minBin, maxBin, err, “error”);

// for Variable binned histogram
double minVarBin = hVar->GetXaxis()->GetBin(10);
double maxVarBin = hVar->GetXaxis()->GetBin(100);
double integVar = hVar->IntegralAndError(minVarBin, maxVarBin, errVar, “error”);[/quote]

=================Variable binning==================
minBin:28 maxBin:36
Error: 106.576
Integral: 58859.5
Bin content minBin 30951 ,Bin content maxBin 248.895
=================Normal binning==================
minBin:101 maxBin:501
Error: 534.08
Integral: 285241
Bin content minBin 7848 ,Bin content maxBin 46

The numbers don’t make sense, do these values actually have to be close to each other i.e. integral for variable binning ~ integral for normal binning ?

Hi,

I guess the histograms are filled with the same data.
The discrepancy between the two integrals depends on how the variable binning is defined.
Did you check ‘by hand’ what you expect by summing on the bin ranges?

G Ganis