Hi,
I have a root file from which I have to plot two variables against each other, for example, velocity on y axis and momentum on the x axis.
How would I proceed with this?
Any help would be greatly appreciated!
Thank you.
Hi,
I have a root file from which I have to plot two variables against each other, for example, velocity on y axis and momentum on the x axis.
How would I proceed with this?
Any help would be greatly appreciated!
Thank you.
Hi,
What type of data do you have?
Hi,
Thank you for your reply!
The data file in question contains kinematic variables produced at the generator level. (px,py,pz,en,ma).
I want to draw beta(v/c) on the y axis and momentum on the x axis, however, I can’t seem to change the y axis to beta as it only seems to plot the number of events.
Should I still process with the link you kindly provided?
Thank you!
If your data are stored in a tree, I would suggest TChain https://root.cern.ch/doc/master/classTChain.html to read the values of your variables per event, then you can use TGraph to plot
Hi try like tree->Draw(“y:x”), where tree is your own tree name.