# Different branches in signal and background trees for TMVA

**URL:** <https://root-forum.cern.ch/t/different-branches-in-signal-and-background-trees-for-tmva/41472>\
**Category:** TMVA\
**Created:** [September 16, 2020, 12:40pm UTC](https://root-forum.cern.ch/t/different-branches-in-signal-and-background-trees-for-tmva/41472 "2020-09-16T12:40:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![testa](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/958977/32.png) [@testa](https://root-forum.cern.ch/u/testa)\
**Post date:** [September 16, 2020, 12:40pm UTC](https://root-forum.cern.ch/t/different-branches-in-signal-and-background-trees-for-tmva/41472/1 "2020-09-16T12:40:42Z")

</div>

Dear experts,  
in my signal tree I’ve additional branches wrt the background tree,  
and I want to use them to apply a cut on the signal events  
using TCut mycuts = “tree\_FJ\_ishs == 1”,  
while for the background selection I use  
variables with are common to both trees.

I get a runtime error:  
– DataSetFactory : Create training and testing trees – looping over class “Signal” …  
— DataSetFactory : Weight expression for class ‘Signal’: “”  
– DataSetFactory : Weight expression for class ‘Background’: “”  
Error in TTreeFormula::Compile: Bad numerical expression : “tree\_FJ\_ishs”  
— DataSetFactory : Expression tree\_FJ\_ishs==1 could not be resolved to a valid formula.

Is that expected?  
I’m confused that the tree\_FJ\_ishs variable seems to be used for the bckground dataset preparation.

---

<div class="post-metadata">

**Author:** ![jblomer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@jblomer](https://root-forum.cern.ch/u/jblomer)\
**Post date:** [September 16, 2020, 9:13pm UTC](https://root-forum.cern.ch/t/different-branches-in-signal-and-background-trees-for-tmva/41472/2 "2020-09-16T21:13:37Z")

</div>

Hi,

In order to reproduce the problem, could you provide a reproducer macro and a snapshot of the data?

Cheers,  
Jakob

---

<div class="post-metadata">

**Author:** ![JustAnotherROOTuser](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/8e8cbc/32.png) [@JustAnotherROOTuser](https://root-forum.cern.ch/u/JustAnotherROOTuser)\
**Post date:** [February 18, 2021, 11:27pm UTC](https://root-forum.cern.ch/t/different-branches-in-signal-and-background-trees-for-tmva/41472/3 "2021-02-18T23:27:16Z")

</div>

@testa Hi, I am encountering the same problem. Did you find a solution to this?  
Thanks in advance.

Cheers.

---

<div class="post-metadata">

**Author:** ![testa](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/958977/32.png) [@testa](https://root-forum.cern.ch/u/testa)\
**Post date:** [February 19, 2021, 7:50am UTC](https://root-forum.cern.ch/t/different-branches-in-signal-and-background-trees-for-tmva/41472/4 "2021-02-19T07:50:12Z")

</div>

Hi, unfortunately not. At the end I added the variable also to the tree for the background.
