void drawAllBranches() { TCanvas *c1 = new TCanvas("c1"); TFile *f = new TFile("tp_01b1s3r12Boff_22395-22397.root"); TTree *t = (TTree*)f->Get("h202"); cout << t->GetEntries() << endl; // -- Get list of branches for the tree TObjArray *o = t->GetListOfBranches(); int m = o->GetEntries(); cout << "Number of branches: " << m << endl; // -- Loop over all, and draw their variables into TCanvas c1 int cnt(0); for (int i = 0; i < m; ++i) { cnt = t->Draw(((TBranch*)(*o)[i])->GetName()); c1.Update(); } }