Reweight using TTree->Draw()

Hi all,

Probably making a silly mistake, but I’m very confused about why this doesn’t work. I’m trying to multiply a variable by a double, calculated in my code by double reweight = x/y (it’s the same for all events). Essentially I need to multiply jet pt by this constant.

If I use TTree->Draw, I can do TTree->Draw("10*jet_pt","mcEventWeight"). But when I try TTree->Draw("reweight*jet_pt","mcEventWeight") I get a 'bad numerical expression: reweight" error.

Printing out reweight shows it is non-zero. Is there another reason why this wouldn’t work?

Thanks for any help!

Try:
TTree->Draw(TString::Format("%g * jet_pt", reweight), "mcEventWeight")

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.