[ROOT] tree and TClonesArray

From: HP Wei (hp@rentec.com)
Date: Fri Dec 06 2002 - 20:26:12 MET


I have a tree with one branch ("T") into which I populate with
TClonesArray of objects of class CL:

Class CL : public TObject {
public:
   double f1;
   double f2;
   int    f3;
   int    f4;
   
   ....
};

The split is set to 1 when the tree is filled with data.

Now, I want to read data from the resulting root file.
As in the tcl.C example,  I do the following:
TClonesArray *arr =0;
tree->SetBranchAddress("T", &arr);
tree->GetEvent(event_number);

This will extract data for f1, f2, f3, and f3... (all data fields defined
in class CL.)

Suppose I want only f1, and f2.
What is the best way ?

--HP



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:22 MET