# About TMVA application

**URL:** <https://root-forum.cern.ch/t/about-tmva-application/31972>\
**Category:** TMVA\
**Tags:** python\
**Created:** [December 12, 2018, 9:09am UTC](https://root-forum.cern.ch/t/about-tmva-application/31972 "2018-12-12T09:09:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JungChang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/3e96dc/32.png) [@JungChang](https://root-forum.cern.ch/u/JungChang)\
**Post date:** [December 12, 2018, 9:09am UTC](https://root-forum.cern.ch/t/about-tmva-application/31972/1 "2018-12-12T09:09:08Z")

</div>

Dear Sir,

I’m training TMVA with backgrounds, and applied the classifier on each back separately.  
I got a background efficiency from the training. After application, I will obtained efficiency for each background.  
When I compare the background efficiency after training and application, I found they are similar but different.

May I ask, is it ok to apply classifier this way to see the contribution from each backgrounds?

Thanks.

Best,  
Jung

---

<div class="post-metadata">

**Author:** ![kialbert](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/kialbert/32/16537_2.png) [@kialbert](https://root-forum.cern.ch/u/kialbert)\
**Post date:** [December 12, 2018, 3:02pm UTC](https://root-forum.cern.ch/t/about-tmva-application/31972/2 "2018-12-12T15:02:49Z")

</div>

Hi,

Let me understand your setup!

You train with signal + bkg1 + bk2 to get a classifier `model` and get a training efficiency `model(signal + bkg1 + bkg2) > 0.5 = eff_sig`

You then apply the trained classifier to each background in separation, `model(signal + bkg1) > 0.5 = eff_sigbkg1` and `model(signal + bkg2) < 0.5 = eff_sigbkg2` to arrive at some efficiencies.

In this setting it makes sense to me that they are similar but different. I would further hazard that `eff_sig <= min(eff_sigbkg1, eff_sigbkg2)` since adding more background should confuse the classifier.

To my limited understanding, this seems a reasonable operation. But you should talk to someone involved in physics analysis to be sure.

Cheers,  
Kim

---

<div class="post-metadata">

**Author:** ![JungChang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/3e96dc/32.png) [@JungChang](https://root-forum.cern.ch/u/JungChang)\
**Post date:** [December 13, 2018, 1:07am UTC](https://root-forum.cern.ch/t/about-tmva-application/31972/3 "2018-12-13T01:07:02Z")

</div>

Dear Kim,

Thanks for the reply.

Let me explain and ask more clearly.

After training with signal + bkg1 + bkg2, I got a output ROC curve and background efficiency versus signal efficiency.

I applied this classifier on bkg1 and bkg2 by modify Application function in TMVAMultiBackground.C.

TString method = “BDT method”;

reader0-\>BookMVA( “BDT method”, “data\_set/weights/TMVAClassification\_BDT.weights.xml” );

reader1-\>BookMVA( “BDT method”, “data\_set/weights/TMVAClassification\_BDT.weights.xml” );

Then I got one root file with different backgrounds and signal with different classID.

I used TCutLoop.C to cut the BDT response to got the new background efficiency and signal efficiency.

This bkgefficiency obtained by #of events (bkg1+bkg2)/total events (bkg1 + bkg2)

When I compare the bkgefficiency(signal+bkg1+bkg2) and bkgefficiency(bkg1)+bkgefficiency(bkg2), they are similar but different.

May I ask, is this way correct?

Thanks.

Best,

Jung

---

<div class="post-metadata">

**Author:** ![YilinZhou0715](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/yilinzhou0715/32/31260_2.png) [@YilinZhou0715](https://root-forum.cern.ch/u/YilinZhou0715)\
**Post date:** [October 21, 2022, 3:11am UTC](https://root-forum.cern.ch/t/about-tmva-application/31972/4 "2022-10-21T03:11:12Z")

</div>

hi,  
I just want to ask for the TCutLoop.C. I cannot find it in the package of TMVA.

Would you tell me where should I find it ?

Thanks.  
Best,  
Yilin
