19 void getBranchSizes(TTree *tree) {
22 printf(
"File: %s \n",tree->GetCurrentFile()->GetName());
23 printf(
" (%i entries) \n",(
int) tree->GetEntries());
25 printf(
" Container File Size Size/evt\n");
26 printf(
" --------------- ------------------ ------------\n");
28 Int_t nBytes = 0, nBytesBranch2 = 0;
29 TObjArray *array2 = 0, *array3 = 0, *array4 = 0;
30 TBranch *branch1 = 0, *branch2 = 0, *branch3 = 0, *branch4 = 0;
32 TObjArray *fBranches = tree->GetListOfBranches();
34 for(Int_t i=0;i<fBranches->GetEntries();i++) {
36 branch1 = (TBranch*) fBranches->At(i);
37 array2 = branch1->GetListOfBranches();
40 for(Int_t j=0;j<array2->GetEntries();j++) {
42 branch2 = (TBranch*) array2->At(j);
43 nBytesBranch2 += (int) branch2->GetZipBytes();
44 array3 = branch2->GetListOfBranches();
45 Int_t nBranch2 = array3->GetEntries();
47 for(Int_t k=0;k<nBranch2;k++) {
49 branch3 = (TBranch*) array3->At(k);
50 nBytesBranch2 += (int) branch3->GetZipBytes();
54 if(nBytesBranch2) printf(
" %20s %11i (%4.1f%%) %6.1f bytes\n",
55 branch1->GetName(),nBytesBranch2,
56 nBytesBranch2*100./tree->GetZipBytes(),
57 nBytesBranch2/branch1->GetEntries() );
59 nBytes += nBytesBranch2;
62 printf(
" ------------------ ------------\n");
63 printf(
" %11i (%4.1f%%) %6.3f kB/event\n",
64 nBytes,nBytes*100./tree->GetZipBytes(), nBytes/branch1->GetEntries()/1024. );