How to apply BDT cut value?

Hi all,

I am new to TMVA. So far, I define my signal and background region and prepare an output to use for TMVA. I am using BDT(boosted decision tree) method. I know how to obtain optimal cut value from the histogram I attached. In this case, I’ll cut it near at 0.0.

My question is, how to apply this BDT cut value on data, i,e. how to make a roofit histogram of mass distribution of my particle with that BDT cut? I am having hard times to figure it out since the cuts are correlated with each other so it is not possible to apply cut one after the other.
bdtmva.pdf (237 KB)


For applying the BDT cut you just need to compute the BDT value on the data and then you apply the desired cut retaining only the events that pass your chosen cut value.
See the TMVA tutorial macro tutorials/tmva/TMVAClassificationApplication.C

Best Regards


Hi Lorenzo,

thanks for the reply. I have some naive questions.

Actually, I am not sure how. So far, what I get is, lets assume maximum S/S+B (purity) and the corresponding BDT value. Then how to apply these values i.e, on a mass spectrum ?

I checked the code and found this which could work:
int effS = 0.6;

if (Use[“BDT”]) {
// Cuts is a special case: give the desired signal efficiency
Bool_t passed = reader->EvaluateMVA( “BDT”, effS );
if (passed)

but I do not want to get the BDT output value distribution. I need a particle mass spectrum(which is indeed used as a variable-var1- during BDT process.)

I’m having doubts about the prediction cut too… But I’m not sure if the training uses a default cut or something, because I’m not defining any.


Thanks for posing a question. However, please refrain from posting to old threads, instead create a new one. This is not to be unfriendly, just to have some order on the forum :slight_smile:

The training is not using a cut on the output, if this is what you are asking. If I misunderstood, please elaborate a bit more.


1 Like

Once you have done the cut, you can save the relevant branches of input variables to a root file. Please see the TMVAClassificationApplication.C example for details.


thanks a lot. I think I have managed to do it via TMVAClassificationApplication.C

But is the training optimizing a cut (between what’s background and signal) somewhere (?).
In another question of the forum I found the command Method.GetSignalReferenceCut() that you can get after the training… What exactly does this return?

Hi anprodri,

Please ask this as a new question and I will be more than happy to elaborate!