#include "TFile.h" #include "TTree.h" #include "TBranch.h" #include "TString.h" #include "TKey.h" #include void sizetree(TString fname) { int totsize = 0; TString name[1000]; int size[1000]; int n[1000]; int br[1000]; int cnt=0; TFile *f=new TFile(fname,"READ"); if (!f->IsZombie()) { TKey *key; TIter next(f->GetListOfKeys()); while ( (key = (TKey*)next()) ) { TObject *obj = key->ReadObj(); if (!obj->InheritsFrom("TTree")) continue; name[cnt] = obj->GetName(); TTree* t = (TTree*) obj; n[cnt] = t->GetEntries(); br[cnt] = t->GetNbranches(); int s = 0; TObjArray* branches = t->GetListOfBranches(); for(int i=0; i<=branches->GetLast(); ++i) { TBranch* branch = (TBranch*)branches->UncheckedAt(i); s += branch->GetZipBytes(); } size[cnt++]=s; totsize += s; } } f->Close(); cout <1;--i) { for (int j=0;j