TTree::Draw for Graphs?


I really like the TTree::Draw method since it is an easy and very fast way to apply some cuts and visualize my data as a histogram. Now I would like to have the same feature for TGraph visualizations. Asume a tree with x and y coordinates and some other vars used for cutting. Is there a way to do something similar to

tree->Draw("y:x", "(n==100)&&(a==1)")

for a TGraph. This means the above line of code should generate a TGraph with the specified y and x coordinates after applying the specified cuts. This would be much more elegant than looping over all events and checking the cuts for myself.

Cheers, Mathias

see section " How to obtain more info from TTree::Draw" at … DrawSelect


Thx Rene, thats exactly what I was searching for. The docs for many features of root seem to be hidden in the Reference Guide rather than the User’s Guide.