TMVA - sample reweighting issue

Hi TMVA experts,

I’m having some trouble with normalizing signal samples.

I have a number of signal samples with the same resonance production process, but different resonance masses. I want to use all of these samples at the same time to train a mass-parameterized neural net. To do this, I need to normalize the signal samples to get a flat mass distribution. I know the number of weighted events in each sample, and have simply added a “1.0/nWeightedEvents” weight to each signal tree (at the AddSignalTree step). I also have set MC weights via SetSignalWeightExpression. Unfortunately, this does not give me a flat distribution, though it is flatter than when using 1.0 for each signal tree, so the weights are getting applied (see sigMass_withNormalization.png and sigMass_withoutNormalization.png). When I use the same numbers in a stand-alone ROOT macro, the samples are normalized correctly (see test.png). No cuts are applied in TMVA or the stand-alone macro. What could be the issue here? I’ve been checking and rechecking this…


sigMass_withoutNormalization sigMass_withNormalization

Just to add - this only happens when MC weights are applied. Removing the MC weights and using 1.0/nUnweightedEvents for the samples works as expected.

I think you should normalize to 1./SumOfEventWeights and not 1/nWeightedEvents