Hi, I have what I hope is an easily solvable problem in that I want to draw some values from a TTree but multiplied by a scale factor. For example
TChain * tree = new TChain("ntp"); int nFile = tree->Add("some_root_file"); TH1F *hist=new TH1F("hist","",100,10000,500000); tree->Draw("some_value_in_the_tree*10>>hist");
Works fine and multiplies all the
some_value_in_the_tree by 10. However, if I instead define the scale factor as a variable rather than putting it in directly I get a bad numerical expression error. So the
tree->Draw line becomes.
double scale_value = 10; tree->Draw("some_value_in_the_tree*scale_value>>hist");
Any help on how to achieve this without the bad numerical expression error would be greatly appreciated.
I’m running ROOT 6.04/14 through a terminal on a Windows 10 machine