# Why do I get negative values for bkg eff. when using 4 variables, but not when using 3 or less?

**URL:** <https://root-forum.cern.ch/t/why-do-i-get-negative-values-for-bkg-eff-when-using-4-variables-but-not-when-using-3-or-less/48551>\
**Category:** TMVA\
**Created:** [January 25, 2022, 12:22pm UTC](https://root-forum.cern.ch/t/why-do-i-get-negative-values-for-bkg-eff-when-using-4-variables-but-not-when-using-3-or-less/48551 "2022-01-25T12:22:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![naikal\_mc](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/bc8723/32.png) [@naikal\_mc](https://root-forum.cern.ch/u/naikal_mc)\
**Post date:** [January 25, 2022, 12:22pm UTC](https://root-forum.cern.ch/t/why-do-i-get-negative-values-for-bkg-eff-when-using-4-variables-but-not-when-using-3-or-less/48551/1 "2022-01-25T12:22:10Z")

</div>

Hello all,

I am using TMVA with “Cuts” method and I keep getting negative values for bkg efficiency (and hence no cuts) when I add 4 variables to the dataloader. When using 3 or less variables, I don’t get this problem and the cut values are similar to what I expect from other methods. Do you know what could be happening? All variables are independent.

Example of what I get:

```auto

Cut values for requested signal efficiency: 0.6
                         : Corresponding background efficiency : -0.1
                         : Transformation applied to input variables : None
                         : ----------------------------------------
                         : Cut[0]: 0 < var1 <= 0
                         : Cut[1]: 0 < var2 <= 0
                         : Cut[2]: 0 < var3 <= 0
                         : Cut[3]: 0 < var4 <= 0

```

Adding variables to dataloader:

```auto

   dataloader->AddVariable( "var1", 'F' );
   dataloader->AddVariable( "var2", 'F' );
   dataloader->AddVariable( "var3", 'F');
   dataloader->AddVariable( "var4", 'F');

```

Cheers.

---

<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:** [January 25, 2022, 3:06pm UTC](https://root-forum.cern.ch/t/why-do-i-get-negative-values-for-bkg-eff-when-using-4-variables-but-not-when-using-3-or-less/48551/2 "2022-01-25T15:06:33Z")

</div>

Hi,  
This is strange. Can you please post your macro including the input data file needed tp reproduce this problem ?

Cheers

Lorenzo

---

<div class="post-metadata">

**Author:** ![naikal\_mc](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/bc8723/32.png) [@naikal\_mc](https://root-forum.cern.ch/u/naikal_mc)\
**Post date:** [January 26, 2022, 10:07am UTC](https://root-forum.cern.ch/t/why-do-i-get-negative-values-for-bkg-eff-when-using-4-variables-but-not-when-using-3-or-less/48551/3 "2022-01-26T10:07:31Z")

</div>

Dear moneta,

here are the files:

I am running with " root -l ‘TMVAClassification.C(“Cuts”)’ ". Root version 6.14/04.

[test\_tree\_80\_150.root](https://root-forum.cern.ch/uploads/short-url/h36p8dkiPDOc5gm3nnE283bdQbk.root) (103.0 KB)  
[TMVAClassification.C](https://root-forum.cern.ch/uploads/short-url/1UF5mIOZPh19stAAZUfuyYddC09.C) (27.8 KB)

---

<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:** [January 26, 2022, 1:59pm UTC](https://root-forum.cern.ch/t/why-do-i-get-negative-values-for-bkg-eff-when-using-4-variables-but-not-when-using-3-or-less/48551/4 "2022-01-26T13:59:05Z")

</div>

Hi,  
If you obtain this negative value, means that there are no events left to compute a background efficiency. The value of -0.1 is the initial un-computed value. Probably it should be set to 0, I will investigate if this can be done

Lorenzo

---

<div class="post-metadata">

**Author:** ![naikal\_mc](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/bc8723/32.png) [@naikal\_mc](https://root-forum.cern.ch/u/naikal_mc)\
**Post date:** [January 31, 2022, 1:39pm UTC](https://root-forum.cern.ch/t/why-do-i-get-negative-values-for-bkg-eff-when-using-4-variables-but-not-when-using-3-or-less/48551/5 "2022-01-31T13:39:40Z")

</div>

Dear Lorenzo,

have you found a solution for this issue?

Best regards

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [February 7, 2022, 9:26am UTC](https://root-forum.cern.ch/t/why-do-i-get-negative-values-for-bkg-eff-when-using-4-variables-but-not-when-using-3-or-less/48551/6 "2022-02-07T09:26:30Z")

</div>

I think @moneta gave the relevant hint: all events are part of the signal fits; no events “remain” which would allow to compute the background efficiency.
