Sorry I have another question. I created the reweighted tree. However there is a difference between the two distributions.
In detail:
Case 1 : Draw a branch tp_mass with weight “genTotalweight”
Tree->Draw(“tp_mass”,“genTotalweight”)
gives me Screen Shot 2017-10-11 at 11.28.48 AM
Case 2 : From the reweighted tree I created (using the method you suggested)
On drawing the reweighted branch I get Screen Shot 2017-10-11 at 11.29.55 AM
Its clear that the two distributions are not the same , whereas I think they should be.
Is there a difference between the two methods of drawing with weights?
I misinterpreted your first request: my bad. You cannot save the value and its weight in a single value by multiplying those
The plot is telling us that
Right, to give some background: you have values for tp_mass, say 5, 10, 7, 100. These values are stored in the branch tp_mass. Each of those entries has a different weight: 0.1, 0.2, 100, 0.01. No multiplication or addition or whatsoever can combine these, they are completely independent numbers. You will need to keep two branches, and weight each tp_mass entry by the genweight value - as you did with TTree::Draw().