RE: Changing branch name ...

From: Anton Fokin (fokin@tsl.uu.se)
Date: Wed Mar 15 2000 - 21:07:51 MET


Thanks Rene,
it makes things easier. I can skip f in the member field name for the sake
of poor users and go for

TTree::Draw("dE:E");

/Anton

-----Original Message-----
From: Rene Brun [mailto:brun@pcbrun.cern.ch]
Sent: Wednesday, March 15, 2000 9:06 PM
To: Anton Fokin
Cc: Rene Brun; roottalk
Subject: RE: Changing branch name ...


Hi Anton,
I did not say that it was impossible to implement. But, as mentionned
by Victor, this generates several side-effects.
Note that you can perfectly do:
 TTree::Draw("fdE:fE");
instead of
 TTree::Draw("fTrack.fdE:fTrack.fE");
if you have only one branch called fTrack.

Rene Brun


On Wed, 15 Mar 2000, Anton Fokin wrote:

> Hi Rene,
>
> hmmm... , why? I mean it is good to know it's not implemented but in
genaral
> I believe it would be useful to have. For example I want to keep
fTrack.fdE
> or fTrack->GetdE() facility for advanced use inside programs/macros, but
for
> an "ordinary" user it would be nice to simplify things to
>
> TTree::Draw("dE:E");
>
> instead of current
>
> TTree::Draw("fTrack.fdE:fTrack.fE");
>
> The latter is confusing for a number of people who know Paw only ...
>
> /Anton
>
> -----Original Message-----
> From: owner-roottalk@pcroot.cern.ch
> [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Rene Brun
> Sent: Wednesday, March 15, 2000 8:18 AM
> To: Anton Fokin
> Cc: roottalk
> Subject: Re: Changing branch name ...
>
>
> Hi Anton,
> Currently, you cannot and should not change the name of a branch in a
> tree.
> SetName should be redefined in TBranch and derivatives.
>
> Rene Brun
>
> Anton Fokin wrote:
> >
> > Hi rooters,
> >
> > is it possible to change name of a branch in a tree? I have tryed
(before
> > writing tree with split level 1 from Event example)
> >
> > TBranch* Branch = Tree->GetBranch("fNTrack");
> > Branch->SetName("Hello");
> >
> > It doesn't crash and "Hello" branch is acceptable from a root session,
but
> > Event->GetNTrack() starts to return zero every time I read an event in
my
> > compiled program.
> >
> > Is there any trick/recommendations about changing branch names?
> >
> > Best,
> > Anton
>



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