# Getting error when trying to use fabs

**URL:** <https://root-forum.cern.ch/t/getting-error-when-trying-to-use-fabs/37365>\
**Category:** Newbie\
**Tags:** roofit\
**Created:** [December 29, 2019, 6:10pm UTC](https://root-forum.cern.ch/t/getting-error-when-trying-to-use-fabs/37365 "2019-12-29T18:10:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Federico\_G](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/f/ecd19e/32.png) [@Federico\_G](https://root-forum.cern.ch/u/Federico_G)\
**Post date:** [December 29, 2019, 6:10pm UTC](https://root-forum.cern.ch/t/getting-error-when-trying-to-use-fabs/37365/1 "2019-12-29T18:10:38Z")

</div>

* * *

I have been getting the following error

```auto
 RooFormula::eval(fabs(Muon1_eta)<1.05&&fabs(Muon2_eta)<1.05): Formula doesn't compile: fabs(Muon1_eta)<1.05&&fabs(Muon2_eta)<1.05

```

My code resulting in this error is as follows:

```auto
 RooDataSet data("data", "Jpsi data set", tree,RooArgSet(jpsi, eta1, eta2), "fabs(Muon1_eta)<1.05&&fabs(Muon2_eta)<1.05");

```

I suspect it’s because I’m trying to use #include wrong. So far I’ve tried #include “math.h”, #include “\<math.h\>” and #include \<math.h\>. So far none of these are working and I’m left wondering what I’ve done wrong. Any help would be appreciated  
_ROOT Version:_ 6.14  
_Platform:_ Windows 10  
_Compiler:_ mobatek

* * *

---

<div class="post-metadata">

**Author:** ![StephanH](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@StephanH](https://root-forum.cern.ch/u/StephanH)\
**Post date:** [January 2, 2020, 3:15pm UTC](https://root-forum.cern.ch/t/getting-error-when-trying-to-use-fabs/37365/2 "2020-01-02T15:15:20Z")

</div>

Try `TMath::Abs`. The RooFormula doesn’t support all kinds of C++ expressions, but it should support the stuff in TMath:  
[https://root.cern.ch/doc/master/namespaceTMath.html](https://root.cern.ch/doc/master/namespaceTMath.html)
