Hello
I am using ROOT v 4.04/02.
I would like two know if it is possible to use the TTree proxy mechanism to draw a variable that belongs to a friend TTree.
Are there any limitations ?
To give a concrete example
I have two trees, one named tree1 and the other named tree2.
I declare the second tree as a friend of the first one.
tree1->AddFriend(tree2);
Then I create a file difference.cxx :
Float_t difference () {
return (mPT-MissPT)
}
where mPT belongs to tree1 and MissPT belongs to tree2.
If I execute tree1->Draw(“difference.cxx”)
I get :
root [0] .x draw_missPT.C
Info in <TTreePlayer::DrawScript>: Will process tree/chain using generatedSel.h+
Info in <TUnixSystem::ACLiC>: creating shared library /cms4/ribeiro/new_Analysis/pro_macros/./generatedSel_h.so
In file included from /cms4/ribeiro/new_Analysis/pro_macros/filesmYD6T.h:32,
from /cms4/ribeiro/new_Analysis/pro_macros/filesmYD6T.cxx:16:
/cms4/ribeiro/new_Analysis/pro_macros/difference.cxx: In member function
`Float_t generatedSel::difference()':
/cms4/ribeiro/new_Analysis/pro_macros/difference.cxx:2: `MissPT' undeclared
(first use this function)
/cms4/ribeiro/new_Analysis/pro_macros/difference.cxx:2: (Each undeclared
identifier is reported only once for each function it appears in.)
g++: /cms4/ribeiro/new_Analysis/pro_macros/./filesmYD6T.o: No such file or directory
Error in <ACLiC>: Compilation failed!
Error in <TSelector::GetSelector>: file generatedSel.h+ does not have a valid class deriving from TSelector
Am I doing something wrong ?
Of course this is a dummy example, because to plot the difference between the two variables I can do tree1->Draw(“mPT-MissPT”) and it works.
Best Regards
Pedro Ribeiro