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.
Thanks for the reply! That solution works perfectly. I have one followup question though, if I want to add some more information to the drawing line as in the example below, how do I do that?
Where I want to introduce the cut CoincidenceCut and have the plot on the same canvas as some other histogram. The example above gives the errors error: cannot pass non-trivial object of type 'TString' to variadic function; expected type from format string was 'double' [-Wnon-pod-varargs],
warning: data argument not used by format string [-Wformat-extra-args],
and error: cannot pass object of non-trivial type 'TString' through variadic function; call will abort at runtime [-Wnon-pod-varargs]
For the last three bits of the draw line respectively.