Re: [ROOT] How do I disable reading of a leaf in a TChain

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Oct 16 2001 - 18:42:53 MEST


Thomas,

Thomas Bretz wrote:
> 
> Hi Rene,
> 
> did I understood you correctly, that enabeling a leaf results in
> enabeling the whole branch. Before your previous mail I also tried to
> use
> SetBranchStatus("mybranch") (to stick to your example) but this didn't
> work.

Enabling a leaf does not make sense. You can only enable/disable branches.
I cannot tell you more on your problem without looking at your code.


> Another question. Assuming I have two different objects (MYClass1,
> MyClass2) stored as subbranches of one tree. Both classes are containing
> a variable called (fMyValue). What would be the result of:
> SetBranchStatus("fMyValue")
> 
   Suppose a top class MyTop *top, where 
      class MyTop : pyublic TObject {
        MyClass1   fA;
        myClass2   fB;

and you create a top level branch with:
  tree.Branch("top","MyTop",&top);

you can do now:
  tree.SetBranchStatus("*",0); //to disable all branches
  tree.SetBranchStatus("fA.fMyValue",1); //to activate only this branch
  tree.GetEntry(i); //to read entry i and only teh active branch

> Is it possible to enhance the documentation of SetBranchStatus? I think
> it is an very important function, and until now I'm not really sure
> whether I understood correctly what it is doing.

The documentation of TTree::SetBranchStatus is available at:
    http://root.cern.ch/root/htmldoc/TTree.html#TTree:SetBranchStatus

Rene Brun



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:03 MET