[ROOT] AddFriend of TChain

From: Junichi.Tanaka@cern.ch
Date: Tue Aug 12 2003 - 23:37:00 MEST


Dear all,

I have two questions about "AddFriend" of TChain.
I'm using 3.05.05 and 3.05.07.

In CBNT/h3780, there are two variables,
   Int_t           aj_ncelllarem;
   Float_t         aj_ce_etalarem[35000];   //[aj_ncelllarem]
In CBNT/h3781, there are two variables,
   Int_t           aj_ncelllarem;
   Float_t         aj_ce_philarem[35000];   //[aj_ncelllarem]
The root file, "tau.root", was converted from ntuple by using h2root.

(1) I tried to turn on/off the status of all branches,
    even if the branches are added by "AddFriend".
    However I could get the status of branch "aj_ce_philarem"
    but I could not set the status of this branch.
    Is this correct? How should I do?

root [0] TChain t1("CBNT/h3780");
root [1] t1.Add("tau.root");
root [2] TChain t2("CBNT/h3781");
root [3] t2.Add("tau.root");
root [4] t1.AddFriend("CBNT/h3781");
root [5] t1.GetBranchStatus("aj_ce_etalarem")
(const Bool_t)1
root [6] t1.GetBranchStatus("aj_ce_philarem")
(const Bool_t)1
root [7] t1.SetBranchStatus("aj_ce_etalarem",0)
root [8] t1.SetBranchStatus("aj_ce_philarem",0)
Error in <TTree::SetBranchStatus>: unknown branch -> aj_ce_philarem

(2) In the Users Guide, there is a statemate that
we can access variables by "chainname.branchname.varname".
But I could not do this in some cases. How should I do?

root [9] t1.GetBranchStatus("CBNT/h3780.aj_ncelllarem")
(const Bool_t)0
root [10] t1.SetBranchStatus("CBNT/h3780.aj_ncelllarem",1)
Error in <TTree::SetBranchStatus>: unknown branch -> CBNT/h3780.aj_ncelllarem
root [11] t1.SetBranchStatus("aj_ncelllarem",1)
root [12] t1.Draw("aj_ncelllarem")
root [13] t1.Draw("CBNT/h3780.aj_ncelllarem")

*ERROR 26 : 
 Unknown name : "CBNT"

Best Regards,
Junichi.Tanaka@cern.ch



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:14 MET