2-dim plot from serparate trees

I’m just wondering if there’s an easy way to create a 2-dim histogram using variables from two different root files? Something akin to the syntax used when creating one from two variables within the same root file:

tree1.Draw(“deltaE:mES”);

say I have two files each containing a tree (tree1 and tree2) and I want to plot tree1->var1 vs tree2->var2.

Thanks,
Brandon

Maybe this help:[code]
Int_t ne = 1000; // “common” num of events
tree1->Draw(“var1”,"",“goff”);
tree2->Draw(“var2”,"",“goff”);

TGraph *gr = new TGraph(ne, tree1->GetV1(), tree2->GetV1());
gr->Draw(“AP”);[/code]
Jan

Hi,

You can used the friend facility:tree1->AddFriend(tree2); tree1->Draw("deltaE:mES");
Cheers,
Philippe.