This macro can be used to get aggregate information on the size take on disk or in memory by the various branches in a TTree.
root [] printBranchSummary(tree->
GetBranch(
"event"));
The branch "event" takes 3760313 bytes on disk
Its sub-branch "TObject" takes 581 bytes on disk
Its sub-branch "fType[20]" takes 640 bytes on disk
Its sub-branch "fEventName" takes 855 bytes on disk
Its sub-branch "fNtrack" takes 506 bytes on disk
Its sub-branch "fNseg" takes 554 bytes on disk
Its sub-branch "fNvertex" takes 507 bytes on disk
Its sub-branch "fFlag" takes 420 bytes on disk
Its sub-branch "fTemperature" takes 738 bytes on disk
Its sub-branch "fMeasures[10]" takes 1856 bytes on disk
Its sub-branch "fMatrix[4][4]" takes 4563 bytes on disk
Its sub-branch "fClosestDistance" takes 2881 bytes on disk
Its sub-branch "fEvtHdr" takes 847 bytes on disk
Its sub-branch "fTracks" takes 3673982 bytes on disk
Its sub-branch "fHighPt" takes 59640 bytes on disk
Its sub-branch "fMuons" takes 1656 bytes on disk
Its sub-branch "fLastTrack" takes 785 bytes on disk
Its sub-branch "fWebHistogram" takes 596 bytes on disk
Its sub-branch "fH" takes 10076 bytes on disk
Its sub-branch "fTriggerBits" takes 1699 bytes on disk
Its sub-branch "fIsValid" takes 366 bytes on disk
for(
size_t i = 0; i <
n; ++ i ) {
result += GetBasketSize( dynamic_cast<TBranch*>( branches->
At( i ) ), ondisk, inclusive );
}
}
if (b) {
} else {
}
if (inclusive) {
}
}
}
}
if (ondisk)
else
return GetBasketSize(br, ondisk, inclusive) + size;
}
for(
size_t i = 0; i <
n; ++ i ) {
result += GetTotalSize( dynamic_cast<TBranch*>( branches->
At( i ) ), ondisk,
true );
cerr <<
"After " << branches->
At( i )->
GetName() <<
" " << result << endl;
}
}
}
if (key) {
} else {
}
}
if (ondisk) {
} else {
}
}
if (ondisk) {
} else {
}
}
return GetTotalSize(t, true);
}
{
return GetTotalSize(branch, true, inclusive);
}
void printBranchSummary(
TBranch *br)
{
cout <<
"The branch \"" << br->
GetName() <<
"\" takes " << sizeOnDisk(br,
true) <<
" bytes on disk\n";
for(
size_t i = 0; i <
n; ++ i ) {
cout <<
" Its sub-branch \"" << subbr->
GetName() <<
"\" takes " << sizeOnDisk(subbr,
true) <<
" bytes on disk\n";
}
}
void printTreeSummary(
TTree *t)
{
cout <<
"The TTree \"" << t->
GetName() <<
"\" takes " << sizeOnDisk(t) <<
" bytes on disk\n";
for(
size_t i = 0; i <
n; ++ i ) {
cout <<
" Its branch \"" << br->
GetName() <<
"\" takes " << sizeOnDisk(br,
true) <<
" bytes on disk\n";
}
}
void printSizes() {}