Hi all,
I want to compare two histograms in terms of chi-squared (LaTeX equation):
\chi ^{2}= \sum (\frac{(n^{data}-n^{mc})^{2}}{\sigma_{data}^{2}+\sigma_{mc}^{2} })
where we sum over all bins
n is the number od entries for data and mc respectively
sigma is statistic uncertainty for data and mc respectively
I know there is a built-in option in ROOT like GetChisquare() but I don`t know how to use it for two histograms comparison
Now, let h1 be “data” histogram and h2 “mc” histogram
TH1F *h1 = new TH1F(*data)
TH1F *h2 = new TH1F(*mc)
How can I get Chi-squared from the equation above between h1 and h2?
Thanks in advance