I’m trying to compare two binned histograms with “KolmogorovTest” to check if they are compatible in shape and also in absolute values (for each bin). Both histograms have 17 bins, the “# of counts” goes from 0.1 to 1 and each bin has its corresponding error (not just statistical). Before do the check, both histograms were scaled by a factor 100. I’m calling the function like this:

prob = hist1->KolmogorovTest(hist2,“N”);

and the result is prob = 0.0528. The first bin in “hist2” has a huge error and within the error that point in “hist2” agrees with “hist1”. The problem appears when I redo the test removing the first bin. The prob jumps from 0.0528 to 0.9860. Since the error of that point is so big, that point should not affect that much the resulting probability. It seems that the function just take sqrt of the counts instead of the real error in the histogram. If this is true how can I perform the test using the error in that bin content?

I’m using ROOT Version 5.15/08 on LinuxRH9 and CINT/ROOT C/C++ Interpreter version 5.16.19

the Kolmogorov test is based on the differences (distances) in the empirical cumulative distributions. It looks therefore only at the bin contents and it does not consider the errors.
If you want to use the bin errors (i.e. weighted histograms) you should use the chi2 test with option “WW”.
(see root.cern.ch/root/htmldoc/TH1.html#TH1:Chi2Test)

Thanks for your fast reply. Actually its not clear to me why I should use “WW”. I thought the correct option should be “UU”. Using the “WW” option and calling:

Now I understand better how to deal with these options.
Concerning the versions, I was using the version 5.18 and I was getting that error message (I don’t know why??)

Using 5.22 version, now I get the same result as you.
Thank you for your help.