# TMVA set weights for S and B

**URL:** <https://root-forum.cern.ch/t/tmva-set-weights-for-s-and-b/20160>\
**Category:** TMVA\
**Created:** [November 6, 2015, 5:49am UTC](https://root-forum.cern.ch/t/tmva-set-weights-for-s-and-b/20160 "2015-11-06T05:49:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrluca87](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mrluca87/32/12305_2.png) [@mrluca87](https://root-forum.cern.ch/u/mrluca87)\
**Post date:** [November 6, 2015, 5:49am UTC](https://root-forum.cern.ch/t/tmva-set-weights-for-s-and-b/20160/1 "2015-11-06T05:49:20Z")

</div>

Dear Experts,

I’m using TMVA in order to optimize a selection.  
I set the weights for Signal and Backgrounds with:  
factory.AddSignalTree ( signal, signalWeight )  
factory.AddBackgroundTree( background, backgroundWeight )  
Where signalWeight and backgroundWeight are the weight for the S and B, given by the cross section and the number of events generated in the MC.  
Then, when I look at the output from TMVAGui.C I see that:  
a) All the plots like mva\_LikelihoodD.png are normalized to same area (but I know this is normal).  
b) The plots like mvaeffs\_BDT.png have written a value for S/sqrt(S/B) that is unrealistic, since here the relative normalization has not been taken into account.

The efficiencies for S and B are independent from the relative normalization, but the purity, the signal efficiency\*purity and the s/sqrt(S+B) values make no sense without the relative normalization.

So I ask:

1. How can I be sure that the normalization has been taken into account?
2. How can I have plots where the normalization is taken into account?

Thanks a lot,  
Luca

---

<div class="post-metadata">

**Author:** ![sergei](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/e495f1/32.png) [@sergei](https://root-forum.cern.ch/u/sergei)\
**Post date:** [November 6, 2015, 11:41am UTC](https://root-forum.cern.ch/t/tmva-set-weights-for-s-and-b/20160/2 "2015-11-06T11:41:30Z")

</div>

Hi Luca,

It would be good to redirect your question to the TMVA forum, where you can get answers from both TMVA experts and users:

[tmva-users@lists.sourceforge.net](mailto:tmva-users@lists.sourceforge.net)  
[sourceforge.net/p/tmva/mailman/tmva-users/](http://sourceforge.net/p/tmva/mailman/tmva-users/)

In particular, you may want to have a look at Peter’s answer to this question:  
[sourceforge.net/p/tmva/mailman/message/34431489/](http://sourceforge.net/p/tmva/mailman/message/34431489/)

Cheers,

Sergei
