# Condition in Tcut in TMVA

**URL:** <https://root-forum.cern.ch/t/condition-in-tcut-in-tmva/42340>\
**Category:** TMVA\
**Created:** [November 17, 2020, 4:40pm UTC](https://root-forum.cern.ch/t/condition-in-tcut-in-tmva/42340 "2020-11-17T16:40:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manuel\_Torres](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/manuel_torres/32/20053_2.png) [@Manuel\_Torres](https://root-forum.cern.ch/u/Manuel_Torres)\
**Post date:** [November 17, 2020, 4:40pm UTC](https://root-forum.cern.ch/t/condition-in-tcut-in-tmva/42340/1 "2020-11-17T16:40:25Z")

</div>

Hello root family,

I’m working in my TMVA, following the TMVAtutorialClassification [https://root.cern.ch/doc/v610/TMVAClassification\_8C.html](https://root.cern.ch/doc/v610/TMVAClassification_8C.html).

But I need to work with values \< 0.5, for this I created a Variable (Branch) with random numebers between 0 and 1,

 ![imagen](https://root-forum.cern.ch/uploads/default/original/3X/6/3/6331283a3f60bd686d1c32c925f17521684136c0.png)

my question is that I do not know how to put this condition in the TCut,

TCut mycuts = “”; //\<0.5  
TCut mycutb = “”;  
dataloader-\>PrepareTrainingAndTestTree( mycuts, mycutb,  
“SplitMode=Random:NormMode=NumEvents:!V” );

I tried just TCut mycuts=“Numeracion2 \< 0.5” , but I’m not sure if the dataloader are tacking the correct events.

Thanks for your time

---

<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:** [November 20, 2020, 9:06am UTC](https://root-forum.cern.ch/t/condition-in-tcut-in-tmva/42340/2 "2020-11-20T09:06:48Z")

</div>

Hi,

If you want to apply the same cut on both signal and background, you can do as following

```auto
TCut mycuts = "Numeracion2 < 0.5";
TCut mycutb = mycuts; 
dataloader->PrepareTrainingAndTestTree( mycuts, mycutb,"SplitMode=Random:NormMode=NumEvents:!V");

```

If you have problems doing this , please let me know

Lorenzo

---

<div class="post-metadata">

**Author:** ![Manuel\_Torres](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/manuel_torres/32/20053_2.png) [@Manuel\_Torres](https://root-forum.cern.ch/u/Manuel_Torres)\
**Post date:** [November 20, 2020, 11:10am UTC](https://root-forum.cern.ch/t/condition-in-tcut-in-tmva/42340/3 "2020-11-20T11:10:45Z")

</div>

Thanks Moneta, I already did that, to put both with

```auto
"Numeracion2 < 0.5"

```

and is working.
