Home | News | Documentation | Download

Condition in Tcut in TMVA

Hello root family,

I’m working in my TMVA, following the TMVAtutorialClassification 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,

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

Hi,

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

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

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

"Numeracion2 < 0.5"

and is working.