Re: [ROOT] GetBranch versus SetBranchStatus

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Nov 15 2000 - 18:00:02 MET


Hi George,
Yes, I agree with you that TTree::SetBranchStatus should be a bit more
clever. I will support the case with "Tracks" synonym of "Tracks*"

Rene Brun


Rene Brun


On Tue, 14 Nov 2000, George A. Heintzelman wrote:

> 
> Hi rooters,
> 
> I have a tree which has a branch on this class:
> 
> class GAHTreeElem: public TObject {
> public:
>   // Not using f convention because this is a struct:
>   GAHTreeElem() {};
>   GAHTreeElem(int Create);
>   GAHEventElem fEvent;
>   TClonesArray *Tracks;
>   TClonesArray *Pairs;
>   void Clear();
> ClassDef(GAHTreeElem,1)
> };
> 
> created with 
> 
> fTree->Branch("Tracks","GAHTreeElem"); 
> 
> (Note that the classes aside from the TClonesArrays aren't important).
> 
> So, when I do:
> 
> fTree->GetBranch("Tracks") 
> 
> I get a non-zero pointer to a TBranch. Great. 
> 
> But when I try:
> 
> fTree->SetBranchStatus("Tracks",0),
> 
> it tells me that Tracks is an unknown branch.
> 
> I realize that I can do fTree->SetBranchStatus("Tracks*",0) and get 
> basically what I want (as long as I don't have any other branches 
> starting with that name, in which case I'd have to separately do 
> "Tracks.*" and "Tracks_") but it seems bizarre to have this 
> inconsistency, and shouldn't be hard to fix, I would think.
> 
> George Heintzelman
> gah@bnl.gov
> 
> 
> 



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:37 MET