Fill 2D histogram using TTree Draw()

Dear ROOT experts!

Is there a possibility to fill 2D histogram (not TGraph) using TTree Draw() method?
For example, is such code valid?:

TH2F* h= new TH2F(“hist”,"",10,20,30,10,20,30);
tree.Draw(“sqrt(x):(x+y*y)>>hist”,“x>0”,“goff”);

Regards
defo900

1 Like

Yes, it is possible.

Check:
root.cern.ch/root/htmldoc/guide … -ttreedraw

Dear Ferhue

Ok, thank you a lot for answer!

Regards
defo900