# Applying two options in the chi square evaluation

**URL:** <https://root-forum.cern.ch/t/applying-two-options-in-the-chi-square-evaluation/47771>\
**Category:** Newbie\
**Tags:** python, root\
**Created:** [November 22, 2021, 8:31pm UTC](https://root-forum.cern.ch/t/applying-two-options-in-the-chi-square-evaluation/47771 "2021-11-22T20:31:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cesar1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@Cesar1](https://root-forum.cern.ch/u/Cesar1)\
**Post date:** [November 22, 2021, 8:31pm UTC](https://root-forum.cern.ch/t/applying-two-options-in-the-chi-square-evaluation/47771/1 "2021-11-22T20:31:42Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [November 23, 2021, 4:37am UTC](https://root-forum.cern.ch/t/applying-two-options-in-the-chi-square-evaluation/47771/2 "2021-11-23T04:37:41Z")

</div>

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")`.

---

<div class="post-metadata">

**Author:** ![Cesar1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@Cesar1](https://root-forum.cern.ch/u/Cesar1)\
**Post date:** [November 23, 2021, 5:18pm UTC](https://root-forum.cern.ch/t/applying-two-options-in-the-chi-square-evaluation/47771/3 "2021-11-23T17:18:46Z")

</div>

That solved the problem, thank you!

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