4 #include "TBranchRef.h" 14 size_t n = branches->GetEntries();
15 for (
size_t i = 0;
i <
n; ++
i) {
17 GetBasketSize(static_cast<TBranch*>(branches->At(
i)), ondisk, inclusive);
27 if (ondisk && b->GetZipBytes() > 0) {
28 result = b->GetZipBytes();
30 result = b->GetTotBytes();
33 result +=
GetBasketSize(b->GetListOfBranches(), ondisk,
true);
43 TMemFile
f(
"buffer",
"CREATE");
44 if (br->GetTree()->GetCurrentFile()) {
45 f.SetCompressionSettings(
46 br->GetTree()->GetCurrentFile()->GetCompressionSettings());
48 f.WriteObject(br,
"thisbranch");
49 TKey*
key = f.GetKey(
"thisbranch");
52 size = key->GetNbytes();
54 size = key->GetObjlen();
62 size_t n = branches->GetEntries();
63 for (
size_t i = 0;
i <
n; ++
i) {
65 GetTotalSize(static_cast<TBranch*>(branches->At(
i)), ondisk,
true);
74 if (t->GetDirectory()) {
75 key = t->GetDirectory()->GetKey(t->GetName());
77 Long64_t ondiskSize = 0;
78 Long64_t totalSize = 0;
80 ondiskSize = key->GetNbytes();
81 totalSize = key->GetObjlen();
83 TMemFile
f(
"buffer",
"CREATE");
84 if (t->GetCurrentFile()) {
85 f.SetCompressionSettings(t->GetCurrentFile()->GetCompressionSettings());
88 key = f.GetKey(t->GetName());
89 ondiskSize = key->GetNbytes();
90 totalSize = key->GetObjlen();
92 if (t->GetBranchRef()) {
131 os <<
"The branch \"" << br->GetName() <<
"\" takes " <<
sizeOnDisk(br,
true)
132 <<
" bytes on disk\n";
133 size_t n = br->GetListOfBranches()->GetEntries();
134 for (
size_t i = 0;
i <
n; ++
i) {
135 TBranch* subbr =
static_cast<TBranch*
>(br->GetListOfBranches()->At(
i));
136 os <<
" It's sub-branch \"" << subbr->GetName() <<
"\" takes " 137 <<
sizeOnDisk(subbr,
true) <<
" bytes on disk\n";
144 os <<
"The TTree \"" << t->GetName() <<
"\" takes " <<
sizeOnDisk(t)
145 <<
" bytes on disk\n";
146 size_t n = t->GetListOfBranches()->GetEntries();
147 for (
size_t i = 0;
i <
n; ++
i) {
148 TBranch* br =
static_cast<TBranch*
>(t->GetListOfBranches()->At(
i));
149 os <<
" It's branch \"" << br->GetName() <<
"\" takes " 150 <<
sizeOnDisk(br,
true) <<
" bytes on disk\n";
Long64_t GetTotalSize(TBranch *br, bool ondisk, bool inclusive)
void printBranchSummary(std::ostream &os, TBranch *br)
Long64_t GetBasketSize(TObjArray *branches, bool ondisk, bool inclusive)
void printTreeSummary(std::ostream &os, TTree *t)
Long64_t sizeOnDisk(TTree *t)