I want to create Graphs easily from ASCII-Files like in Gnuplot. Luckily, there is the class TNtuple with the convinient ReadFile() method, so i don’t have to code the reading procedure myself. However, the Draw() method from NTuple is too simple for my case. It does not support error bars, for instance.
What I want to do is to create my own TGraph oder TGraphErrors or whatever object from the entries of my TNtuple. However, I have no idea how to acess these entries (the whole TBranch and TLeaf stuff is rather confusing and does not give any information as which kind of objects the fields in my ntuple are implemented…).
I would be grateful if someone has a quick way to fill a Graph from the ntuple. Thank!
Oh, that’s great! Thanks for your quick response! But I see that this constructor uses C format strings in contrast to the TTree::ReadFromFile syntax. (Btw: something that annoys me of ROOT. The syntax and method design is rather inconsistent.)
Is there a convenient way to plot expressions like, for instance, sqrt(2nd column) or is the only way to do this to modify the TGraph entries point per point?
(EDIT: And what about things like plotting e.g. the product of 1st and 3rd column like $1*$3 in gnuplot?)