# Creating TF1 from TGraph

**URL:** <https://root-forum.cern.ch/t/creating-tf1-from-tgraph/10522>\
**Category:** ROOT\
**Created:** [July 9, 2010, 11:23am UTC](https://root-forum.cern.ch/t/creating-tf1-from-tgraph/10522 "2010-07-09T11:23:35Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Pepe\_Le\_Pew](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pepe_le_pew/32/12365_2.png) [@Pepe\_Le\_Pew](https://root-forum.cern.ch/u/Pepe_Le_Pew)\
**Post date:** [January 26, 2017, 8:08pm UTC](https://root-forum.cern.ch/t/creating-tf1-from-tgraph/10522/10 "2017-01-26T20:08:56Z")

</div>

Why are you still complaining ❓ ![[-(](https://root-forum.cern.ch/uploads/default/original/2X/f/fadb7d404686f72bab06e8fbe47dcd5d84f43484.gif "Not talking")  
You now have three different integral values, so you can choose the one you like the most ❗ ![:mrgreen:](https://root-forum.cern.ch/uploads/default/original/2X/2/2799b3ea86c419a02327c767288415b2a17e6ee1.gif "Mr. Green")

Using “ROOT::Math::IntegratorOneDimOptions::SetDefaultIntegrator(…);”, you could try all different available ROOT’s “1-dim integrators”: “Gauss”, “GaussLegendre”, “Adaptive”, “AdaptiveSingular” and “NonAdaptive”. 😉  
You will then have six different integral values to choose from ❗ ![:mrgreen:](https://root-forum.cern.ch/uploads/default/original/2X/2/2799b3ea86c419a02327c767288415b2a17e6ee1.gif "Mr. Green")

BTW. ROOT’s “integrators” are well known to misbehave in all cases when the function “changes rapidly” or if there are “narrow / sharp peaks” inside. I think that, in vast majority of cases like yours, people “blindly” use the returned “integral” without noticing that it is wrong. What’s even worse, “integrals” are quietly calculated and used internally by some methods in various classes (users may not even realize that this happens).

---

_[View the full topic](https://root-forum.cern.ch/t/creating-tf1-from-tgraph/10522)._
