[ROOT] branch splitting

From: Mark Wallace (wallace@nscl.msu.edu)
Date: Thu Jun 10 2004 - 00:45:06 MEST


Hello,
    I'm using root 3.10/01 on debian linux.  I'm trying to understand 
how to use the splitting of a branch.  I have classes of classes of 
classes and want to make the tree containing branches of branches of 
branches and I can't seem to do that.  If I try

TTree *t2 = new TTree("t2","Test of class");
level1 *test = new level1();
t2->Branch("test","level1",&test,32000,99);

where the classes are defined below, I get a tree with only splitting of 
the first level.  I saw somewhere on the web that said this was the 
limit for branch splitting when the branch is a class.  The question I 
have is how could you do this manually.  If you can't split a class more 
then level 2, what can you split 99 times?  I would like something like 
this.

det1
        -energy
        -time
        det1
                -energy
                -time
                det1
                            -energy
                            -time
                det2
                            -energy
                            -time
        det2
                -energy
                -time
                det1
                            -energy
                            -time
                det2
                            -energy
                            -time

Can this be done? if so how?  

Thanks for help!

Mark Wallace


class level3 : public TObject {
 public:
  Float_t energy;
  Float_t time;
  level3() {};
  ~level3() {};
  ClassDef (level3,1)
};
class level2 : public TObject {
 public:
  level3 det1;
  level3 det2;
  Float_t energy;
  Float_t time;
  level2() {};
  ~level2() {};
  ClassDef (level2,1)
};
class level1 : public TObject {
 public:
  level2 det1;
  level2 det2;
  Float_t energy;
  Float_t time;
  level1() {};
  ~level1() {};
  ClassDef (level1,1)
};



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:08 MET