# Applying two options in the chi square evaluation

Dear experts,

I need to calculate the chi-square between two MC (weighted) histograms. And I want the value of the chi-square. Following the documentation here:

https://root.cern.ch/doc/master/classTH1.html#a6c281eebc0c0a848e7a0d620425090a5

I tried something like:

h1.Chi2Test(h2,“CHI2”, “WW”)`

But it didn’t work, it returns me the error: “could not convert argument 3”. So, how can I do this?

And can I apply the test just to some interval instead of the whole histogram?

Best Regards

There is only one Option_t argument in Chi2Test, so you need to put all options within the same quotations, e.g. `h1.Chi2Test(h2, "CHI2 WW")`.

1 Like

That solved the problem, thank you!

But, there is a way to calculate the chi square only in a certain region of the histograms?