#include <RootSizeOnDisk.h>
Definition at line 30 of file RootSizeOnDisk.h.
art::RootSizeOnDisk::RootSizeOnDisk |
( |
std::string const & |
aFileName, |
|
|
TFile * |
aFile |
|
) |
| |
Definition at line 113 of file RootSizeOnDisk.cc.
123 set<RootSizeOnDisk::Record> topKeys;
124 TList*
keys = file->GetListOfKeys();
126 for_each(iter.Begin(),
TIter::End(), MyObjects(topKeys));
129 contents_.assign(topKeys.begin(), topKeys.end());
135 file->GetObject(
key.name().c_str(),
tree);
138 double const f = double(size) / double(
size_);
142 }
else if (
key.isTKey()) {
143 TKey* tkey = file->FindKey(
key.name().c_str());
144 Long64_t
const size = tkey->GetNbytes();
146 double const f = double(size) / double(
size_);
void fillLevel2(Record &, TTree *)
void sort_all(RandCont &)
Long64_t sizeOnDisk(TTree *t)
bool greaterBySize(RootSizeOnDisk::Record const &lhs, RootSizeOnDisk::Record const &rhs)
Records_t const& art::RootSizeOnDisk::contents |
( |
| ) |
const |
|
inline |
std::string const& art::RootSizeOnDisk::filename |
( |
| ) |
const |
|
inline |
void art::RootSizeOnDisk::fillLevel2 |
( |
Record & |
key, |
|
|
TTree * |
tree |
|
) |
| |
|
private |
Definition at line 160 of file RootSizeOnDisk.cc.
162 TObjArray* branches =
tree->GetListOfBranches();
163 size_t n = branches->GetEntries();
167 for (
size_t i = 0;
i <
n; ++
i) {
168 auto subbr =
static_cast<TBranch*
>(branches->At(
i));
170 double const f = double(size) / double(
key.size());
171 branchInfo.emplace_back(subbr->GetName(),
"TBranch",
size,
f);
175 key.contents(branchInfo);
void sort_all(RandCont &)
std::vector< Record > Records_t
Long64_t sizeOnDisk(TTree *t)
bool greaterBySize(RootSizeOnDisk::Record const &lhs, RootSizeOnDisk::Record const &rhs)
double art::RootSizeOnDisk::fraction |
( |
| ) |
const |
|
inline |
void art::RootSizeOnDisk::print |
( |
std::ostream & |
os, |
|
|
double |
minimumFraction |
|
) |
| const |
Definition at line 62 of file RootSizeOnDisk.cc.
65 os <<
"\nSize on disk for the file: " <<
filename() <<
"\n" 66 <<
"Total size on disk: " <<
size() <<
"\n" 68 os << setw(18) <<
"Size in bytes" << setw(10) <<
" Fraction" 69 <<
" TTree/TKey Name" << endl;
70 for (RootSizeOnDisk::Record
const&
key :
contents()) {
71 if (
key.isTree() ||
key.isTKey()) {
72 os << setw(18) <<
key.size() <<
" " 76 os << setw(18) <<
key.size() <<
" " 78 <<
" (skipped because not a TTree or a TKey; it is a" 79 <<
key.className() <<
")" << endl;
82 os <<
"------------------------------\n" 87 os <<
"Details for each TTree that occupies more than the fraction " 88 << minimumFraction <<
" of the size on disk.\n" 91 for (RootSizeOnDisk::Record
const&
key :
contents()) {
92 if (
key.isTree() && (
key.fraction() > minimumFraction)) {
93 os <<
"\nDetails for branch: " <<
key.name() <<
"\n" << endl;
94 os << setw(18) <<
"Size in bytes" << setw(10) <<
" Fraction" 95 <<
" Data Product Name" << endl;
98 for (
auto const& branch :
key.contents()) {
100 os << setw(18) << branch.size() <<
" " 102 << branch.name() << endl;
105 os <<
"------------------------------\n"
std::string const & filename() const
static std::string format(PyObject *obj, unsigned int pos, unsigned int indent, unsigned int maxlen)
Records_t const & contents() const
Long64_t art::RootSizeOnDisk::size |
( |
| ) |
const |
|
inline |
Long64_t art::RootSizeOnDisk::sum |
( |
| ) |
const |
|
inline |
double art::RootSizeOnDisk::fraction_ |
|
private |
Long64_t art::RootSizeOnDisk::size_ |
|
private |
Long64_t art::RootSizeOnDisk::sum_ |
|
private |
The documentation for this class was generated from the following files: