# Turn off error messages from TF1::GetX()

**URL:** <https://root-forum.cern.ch/t/turn-off-error-messages-from-tf1-getx/38175>\
**Category:** Newbie\
**Created:** [February 27, 2020, 4:13pm UTC](https://root-forum.cern.ch/t/turn-off-error-messages-from-tf1-getx/38175 "2020-02-27T16:13:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marini](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/f17d59/32.png) [@marini](https://root-forum.cern.ch/u/marini)\
**Post date:** [February 27, 2020, 4:13pm UTC](https://root-forum.cern.ch/t/turn-off-error-messages-from-tf1-getx/38175/1 "2020-02-27T16:13:04Z")

</div>

Dear rooters,  
I use TF1::GetX(yvalue, xmin, xmax) to find the x corresponding to a certain yvalue of my TF1 within the [xmin,xmax] interval. I know that sometimes the x corresponding to the fvalue does not exits in the required interval.  
I’m trying to turn of the following message :

Error in TF1::GetX: [57473.434487,200000000000.000000] is not a valid interval  
xmin = 57537.6 xmax = 2e+11 npts = 100  
Error in ROOT::Math::BrentRootFinder: Interval does not contain a root

I’ve set  
Root.ErrorIgnoreLevel: Fatal  
in .rootrc and I managed to get rid of the two lines starting with “Error in…”, but no way to get rid of the  
xmin = 57537.6 xmax = 2e+11 npts = 100  
line.

It really slows down my code.  
I also tried to redirect the outputs into a file :

```auto
gSystem->RedirectOutput("mylogfile.txt", "a");

```

doing it at the beginning of the root session, but when I type it nothing happens (as if root was working), but indeed it doesn’t do anything as I didn’t lunch my analysis.

How can I get rid of this message?  
Thank you in advance  
Cheers  
Paola

* * *

\_ROOT Version: 6.18/04  
\_Platform: Centos7  
_Compiler:_ Not Provided

* * *

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [February 28, 2020, 10:10am UTC](https://root-forum.cern.ch/t/turn-off-error-messages-from-tf1-getx/38175/2 "2020-02-28T10:10:16Z")

</div>

Hi,

I have noticed that the message you mention is sent directly to the standard output and cannot be filtered, as normal ROOT Error message. Thank you for reporting this, I will provide soon a pull request to fix this.

Lorenzo

---

<div class="post-metadata">

**Author:** ![marini](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/f17d59/32.png) [@marini](https://root-forum.cern.ch/u/marini)\
**Post date:** [February 28, 2020, 10:22am UTC](https://root-forum.cern.ch/t/turn-off-error-messages-from-tf1-getx/38175/3 "2020-02-28T10:22:40Z")

</div>

Thank you very much Lorenzo!  
Cheers  
Paola
