AddFriend

From: Marc Escalier <escalier_at_lal.in2p3.fr>
Date: Sun, 24 Jan 2010 22:24:19 +0100


Dear roottalkers,

I have a question from Henso, who is not yet subscribed to this forum

Let's suppose we have two trees (tree0 and tree1) which have a same given variable name inside : "myvariable"

how to do something like

tree0->Draw("myvariable_from_tree0 - myvariable_from_tree1")

and how to do something like :

mydifference = tree0->GetValueOf n-th event of

             myvariable_from_tree0 - myvariable_from_tree0"

AddFriend would be useful if the two tree would have different name of variables, but here, the variables have the same names

(where myvariable is the same name in the two trees)

thanks in advance for Henso



>>>> TFile *f0 = new TFile("f0.root");
>>>> TTree *tree0 = (TTree*)f0->Get("tree");
>>>> TFile *f1 = new TFile("f1.root");
>>>> TTree *tree1 = (TTree*)f1->Get("tree");
>>>>
>>>> // get variable pt of tree0 and keep it in float pt0
>>>> // get variable pt of tree0 and keep it in float pt1
>>>> //we wish :
>>>> // pt0 - pt1 .
>>>>
>>>> }
Received on Sun Jan 24 2010 - 22:24:28 CET

This archive was generated by hypermail 2.2.0 : Sun Jan 24 2010 - 23:50:01 CET