Hi Francesco, When you create yourself branches with objects of the same class, you should specify the "." at the end of the branch name to disambiguate the leaf names: tdat->Branch("p4datrad." ,"TLorentzVector" ,&p4datrad); tdat->Branch("p4dateta." ,"TLorentzVector" ,&p4dateta); tdat->Branch("p4datetasys_pim.","TLorentzVector" ,&p4datetasys_pim); tdat->Branch("p4datetasys_pip.","TLorentzVector" ,&p4datetasys_pip); tdat->Branch("p4datetasys_piz.","TLorentzVector" ,&p4datetasys_piz); see "IMPORTANT NOTE about branch names" at http://root.cern.ch/root/htmldoc/TTree.html#TTree:Bronch This is done automatically if you create a top level class containing the above pointers. Rene Brun On Fri, 18 Oct 2002, Perfetto Francesco wrote: > Hi all, > I have this problem: in my c++ code I have done a tree in which some of > branchs are variables of type TLorentzVector. > {... > TLorentzVector *p4datrad = new TLorentzVector(); > TLorentzVector *p4dateta = new TLorentzVector(); > TLorentzVector *p4datetasys_pim = new TLorentzVector(); > TLorentzVector *p4datetasys_pip = new TLorentzVector(); > TLorentzVector *p4datetasys_piz = new TLorentzVector(); > > TTree *tdat = new TTree("tdat","Tree for resolution"); > > tdat->Branch("p4datrad" ,"TLorentzVector" ,&p4datrad); > tdat->Branch("p4dateta" ,"TLorentzVector" ,&p4dateta); > tdat->Branch("p4datetasys_pim","TLorentzVector" ,&p4datetasys_pim); > tdat->Branch("p4datetasys_pip","TLorentzVector" ,&p4datetasys_pip); > tdat->Branch("p4datetasys_piz","TLorentzVector" ,&p4datetasys_piz); > > for (Int_t jentry=0; jentry<nentries;jentry++) > ... > } > If by cint I do: tdat->Draw("p4dateta.fE") or Draw("p4dateta.fP.fX") > or draw other variables I haven't any problem ( all variables are draw > exactly) but if I want use the TBrowser for draw some of variables of type > TLorentzVector (the sames above) the browser draw always the same > picture (that related at first variable in the code-program "p4datrad") > for all my variables TLorentzVector (my procedure in this case is: > open TBrowser, click on the leaf p4dateta, after click on p4daeta root see > to me 2 leaf "fE and fP" cliking on fE it draw the plot of p4datrad.fE and > so for any variables). > > My root version is 3.02/06 and I use a sun enterpise 250. > > Regards > Francesco. >
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:15 MET