Re: [5.28.00a] GetBranch/SetAddress not working for TChains w/ multiple files ?

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Wed, 9 Mar 2011 14:27:54 +0100


use TChain::SetBranchAddress and TChain::SetBranchStatus

Rene

On 09/03/2011 14:23, Sebastien Binet wrote:
> hi there,
>
> in ROOT 5.28.00(a) it seems that one can do the following:
>
> void MyClass::init_branches(TTree *t)
> {
> TBranch *b = t->GetBranch("some_br_name");
> if (!b) { panic(); }
> b->SetAddress(&this->m_some_var);
> b->SetStatus(1);
> }
>
> that's great b/c it doesn't clutter the class MyClass with all the
> TBranch* data members.
>
> but it seems it only works for a TTree or TChain with only 1 file.
> (otherwise, the content of m_some_var is just the default c-tor value.)
>
> so, is the above piece of code meant to be working ? or am I missing
> some mandatory snippet of code ?
> (or should I just bite the bullet and still stick all of these TBranch*
> data members ?)
>
> -s
>
Received on Wed Mar 09 2011 - 14:27:57 CET

This archive was generated by hypermail 2.2.0 : Wed Mar 09 2011 - 17:50:01 CET