[ROOT] TObjArray and TTree

From: J D (final_overrider@mail.ru)
Date: Thu May 27 2004 - 14:09:08 MEST


Hello, ROOT'ers.

The first code sample:

I have a class
/////////////////////////////////////////////////
class Test : public TObject
{
public:
   //ctors e.t.c.
private:
   int i_;
   int j_;
   ClassDef(Test, 1)
};

void SomeWhere()
{
    TClonesArray cl("Test", number);
  ////
    TTree tree("test", "test");
    tree.Branch("test_branch", &p, 32000, splitlevel);//splitlevel != 0
    tree.Fill();
   //here I open the file and save tree to file.
}
////////////////////////////
Now, I can open this file in TBrowser and I'l see i_ and j_ leafs there.
Can I get this functionality using TObjArray, not TClonesArray ? 
If I try
//////////
void SomeWhere()
{
    TObjArray cl;
  ////Filling cl with Test objects
    TTree tree("test", "test");
    tree.Branch("test_branch", "TObjArray", &p, 32000, splitlevel);//splitlevel != 0
    tree.Fill();
   //here I open the file and save tree to file.
}
/////////////////////
I'll only see TObjArray's data members in browser, but I want to see i_'s and j_'s, as in the first case. Is it possible?

Thanks.



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