// ROOT macro void readFakeTree() { TFile* tf = new TFile("fakeTree.root", "READ"); TTree* tt = static_cast(tf->Get("tt")); TBranch* blen = tt->GetBranch("len"); TBranch* bx = tt->GetBranch("x"); int len; float x[12]; blen->SetAddress(&len); blen->SetAddress(x); int nEntries = tt->GetEntries(); for (int i=0; i < nEntries; i++) { tt->GetEntry(i); for (int j=0; j < len; j++) cout << x[j] << " "; cout << endl; } }