[ROOT] RE: Why can I not enable reading of a split branch?

From: koblitz@poly.in2p3.fr
Date: Thu Jul 17 2003 - 18:28:51 MEST


Hi Philippe,

thanks for the help. Maybe it would be a good idea to update the 
documentation for 
void TTree::SetBranchStatus(const char *bname, Bool_t status)
to say something about split branches.

Cheers,
  Birger 


On Thu, 17 Jul 2003, Philippe Canal wrote:

> Hi Birger,
> 
> Currently SetBranchStatus work only on a name matching basis.  Hence if you do not use a regular expression, SetBranchStatus will only affect one branch object (in particular it will NOT affect its potential sub-branches).  
> 
> To obtain the result you expected just do:
> 
>    inputChain->SetBranchStatus("BRawHeader*",1);  <- This is a split branch
> 
> Cheers,
> Philippe.
> 
> -----Original Message-----
> From: koblitz@poly.in2p3.fr [mailto:koblitz@poly.in2p3.fr]
> Sent: Thursday, July 17, 2003 10:20 AM
> To: Philippe Canal
> Cc: Rene Brun; roottalk@pcroot.cern.ch
> Subject: Why can I not enable reading of a split branch?
> 
> 
> Hi Philippe,
> 
> following my questions from yesterday I spend another afternoon hunting 
> bugs in root (at least I consider this to be a bug).
> What I do is (same file/library as yesterday):
> 1. Create a chain inputChain
> 2. Add a file to it
> 3. Then
>    inputChain->SetBranchStatus("*",0);
>    inputChain->SetBranchStatus("BRawHeader",1);  <- This is a split branch
>    b_header=inputChain->GetBranch("BRawHeader");
>    TRawHeader *header=0;
>    b_header->SetAddress(&header);
>    inputChain->GetEntry(3)
>    -> No byte is read, but lots of constructors called, we had that 
>       yesterday...
>    header->Print()
>    -> header is not filled, but at least no crash...
> 
> You can now nicely enable the individual branches of the split branch but 
> enabling them all via inputChain->SetBranchStatus("BRawHeader",1); does 
> not seem to work. This is especially problematic as I don't know in my 
> code which input branches I have to expect. I consider this behaviour a 
> bug, since enabling a branch should work irrespective of its split status.
> 
> Cheers,
>   Birger
> 
> 

-- 
 Birger Koblitz                Tel: +33/1 69 33 31 73
 Ecole Polytechnique - LLR
 Route de Saclay
 F-91128 Palaiseau



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