Problem with different weights TMVA

Hi everybody,

I am starting to use TMVA package and I have a problem to set the right weight for the input file. Better explanation:

I have 2 files where one is completely background, and I set like the following rows:

factory->AddBackgroundTree(my_tree_back1,3); where 3 is the weight.

For the second file the only difference between the background and signal is the weight (due for different energy spectrum).

factory->AddSignalTree(my_tree_signal);
factory->SetSignalWeightExpression(“weight0”); → because the weight come from a branch.

And for the second background I need to use SetBackgroundWeightExpression, because like the signal come from the inside branch (“weight1”).

Therefore, I cannot use the last expression because I already added the first background.

How I can resolve that problem?

I tried to use MultiBackground (so two different data loader and two different reader in application) but I think is not correct.

Thank you in advance,

M.

Hi,

Which error are you getting ?
It is possible that every background tree should have the variable weight1 defined as event weight for the background. If your first background tree is not having it, maybe you should try adding it in the first tree with value equal to 1.
Otherwise I could try add such a fix in TMVA, but can you, if possible, post your code and your file, to see exactly what the error is ?

Cheers

Lorenzo

1 Like