# \[TMVA\] tune cuts in categories question

**URL:** <https://root-forum.cern.ch/t/tmva-tune-cuts-in-categories-question/13308>\
**Category:** TMVA\
**Created:** [November 4, 2011, 1:50pm UTC](https://root-forum.cern.ch/t/tmva-tune-cuts-in-categories-question/13308 "2011-11-04T13:50:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nik232](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/77aa72/32.png) [@nik232](https://root-forum.cern.ch/u/nik232)\
**Post date:** [November 4, 2011, 1:50pm UTC](https://root-forum.cern.ch/t/tmva-tune-cuts-in-categories-question/13308/1 "2011-11-04T13:50:47Z")

</div>

Dear ROOT and TMVA experts,

I am wondering whether I could use TMVA to train a classifier  
which uses cuts in categories.

There are 2 levels of this problem:

1st level (the simple one).  
Suppose that you want to tune the same cuts, but in different  
regions of the phase space (e.g. barrel-endcaps configuration)

I suppose that you could define  
myVar1New := (abs(eta)\<2.0)\*myVar1  
but is there a better way?

2nd level (more involved)  
Suppose that some variables are used only in classification and  
some others only to cut on and we want to tune both category boundaries  
and cut-values. (e.g. electron Identification in CMS, ATLAS cut-based electron veto)

For example assume 2 variables var1, var2.  
and say that the classifier is such that

if (var1 \> X1) then if (var2 \< X2) return true  
if (var1 \< X1) then if (var2 \< X3) return true  
else return false

and we want to optimize X1, X2, X3.  
Is there any easy way to do that in TMVA?

In general, is there a way to define through TFormula a discriminant  
function with free parameters and use TMVA to tune them?

Thank you very much for your time.

Kind Regards,

Nikos
