# Set event weights

**URL:** <https://root-forum.cern.ch/t/set-event-weights/28621>\
**Category:** TMVA\
**Created:** [April 9, 2018, 9:42am UTC](https://root-forum.cern.ch/t/set-event-weights/28621 "2018-04-09T09:42:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![calbet](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/4af34b/32.png) [@calbet](https://root-forum.cern.ch/u/calbet)\
**Post date:** [April 9, 2018, 9:42am UTC](https://root-forum.cern.ch/t/set-event-weights/28621/1 "2018-04-09T09:42:05Z")

</div>

Dear experts,  
I have several weights in my tree that I want to apply. SetSignalWeightExpression take a parameter a single branch value. Is there a way (or another method) to do something like SetSignalWeightExpression (“weight1_weight2_…\*weightn”)?  
Regards

---

<div class="post-metadata">

**Author:** ![calbet](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/4af34b/32.png) [@calbet](https://root-forum.cern.ch/u/calbet)\
**Post date:** [April 9, 2018, 11:22am UTC](https://root-forum.cern.ch/t/set-event-weights/28621/2 "2018-04-09T11:22:51Z")

</div>

Dear experts,  
any idea?  
Regards

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [April 9, 2018, 4:01pm UTC](https://root-forum.cern.ch/t/set-event-weights/28621/3 "2018-04-09T16:01:29Z")

</div>

Hi

The weight expression should take more than one Tree branch as it does DataLoader::AddVariable

Lorenzo

---

<div class="post-metadata">

**Author:** ![calbet](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/4af34b/32.png) [@calbet](https://root-forum.cern.ch/u/calbet)\
**Post date:** [April 9, 2018, 4:14pm UTC](https://root-forum.cern.ch/t/set-event-weights/28621/4 "2018-04-09T16:14:41Z")

</div>

Dear Lorenzo,

- ok, thank you.
- I saw from your talk today in IML that there is an automatic way to optimize parameters “Hyper-parameter optimisation”, is that correct? if yes how can I do that for DNN? Is it available only for BDT?  
Regards

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [April 10, 2018, 2:03pm UTC](https://root-forum.cern.ch/t/set-event-weights/28621/5 "2018-04-10T14:03:52Z")

</div>

Hi,

At the moment this is not yet available for the DNN. It is presently not very practicable in that case because it will require training every time a new DNN, which is very time consuming

Best Regards

Lorenzo

---

<div class="post-metadata">

**Author:** ![calbet](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/4af34b/32.png) [@calbet](https://root-forum.cern.ch/u/calbet)\
**Post date:** [April 12, 2018, 8:56am UTC](https://root-forum.cern.ch/t/set-event-weights/28621/6 "2018-04-12T08:56:29Z")

</div>

Dear Lorenzo,  
I have a weight w, and a boolean variable v in my tree. I also have a number n which is not in the tree.  
I want to apply a total weight to each event: w \* n \* (v\<1).  
Is it possible to do that with “SetSignalWeightExpression” this way:  
SetSignalWeightExpression( " w \* n \* (v\<1)" );

Indeed as n is not a variable in the tree, I not sure I can’t do that. But if indeed I can’t, is it still possible to do:  
SetSignalWeightExpression( " w \* (v\<1)" );

Regards
