# Problem in fitting (in function!)

**URL:** <https://root-forum.cern.ch/t/problem-in-fitting-in-function/38785>\
**Category:** ROOT\
**Created:** [April 9, 2020, 8:05am UTC](https://root-forum.cern.ch/t/problem-in-fitting-in-function/38785 "2020-04-09T08:05:03Z")\
**Posts on this page:** 1\
**Showing post:** 90

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [April 21, 2020, 9:41am UTC](https://root-forum.cern.ch/t/problem-in-fitting-in-function/38785/90 "2020-04-21T09:41:22Z")

</div>

You anyhow go through an “intermediate” histogram so maybe use its integral.

Otherwisse, you would need to create a [TF2](https://root.cern/doc/master/classTF2.html) from your 2D graph and integrate this new function.  
An example of a [TF1](https://root.cern/doc/master/classTF1.html) created from a 1D graph can be found in: “[Integral of TGraph](https://root-forum.cern.ch/t/integral-of-tgraph/4745)”

---

_[View the full topic](https://root-forum.cern.ch/t/problem-in-fitting-in-function/38785)._
