22#include "services/function_set.h"
31 for (
size_t i = 0;
i <
n;
i++)
41 if (ondisk && b->GetZipBytes() > 0)
42 result = b->GetZipBytes();
44 result = b->GetTotBytes();
47 result +=
GetBasketSize(b->GetListOfBranches(), ondisk,
true);
60 f.WriteObject(br,
"thisbranch");
61 TKey* key = f.GetKey(
"thisbranch");
64 size = key->GetNbytes();
66 size = key->GetObjlen();
74 for (
size_t i = 0;
i <
n;
i++) {
76 cerr <<
"After " << branches->
At(
i)->
GetName() <<
" " << result << endl;
90 ondiskSize = key->GetNbytes();
91 totalSize = key->GetObjlen();
99 ondiskSize = key->GetNbytes();
100 totalSize = key->GetObjlen();
132 for (
size_t i = 0;
i <
n;
i++) {
135 <<
" on disk" << endl;
143 for (
size_t i = 0;
i <
n;
i++) {
146 <<
" on disk" << endl;
157 for (
size_t i = 0;
i <
n;
i++) {
162 TFile* branch_file =
new TFile(
"cloned_branch_size.root",
"recreate");
164 branch_tree->
Write();
165 branch_file->
Close();
174 printf(
"RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime);
179 gSystem->ExpandPathName(root_file_path);
182 if (
gSystem->AccessPathName(root_file_path.
Data())) {
183 cerr <<
"Error: file does not exist or is not accessible: " << root_file_path << endl;
188 bmnChain->
Add(root_file_path);
193 cerr <<
"Error: TTree \"bmndata\" not found or empty in file: " << root_file_path << endl;
#define R__ADD_INCLUDE_PATH(PATH)
R__EXTERN TSystem * gSystem
TObjArray * GetListOfBranches()
TTree * GetTree() const override
virtual Int_t Add(const char *name, Long64_t nentries=TTree::kMaxEntries)
Long64_t LoadTree(Long64_t entry) override
Long64_t GetEntries() const override
virtual TKey * GetKey(const char *, Short_t=9999) const
Int_t GetCompressionSettings() const
void Close(Option_t *option="") override
const char * GetName() const override
Int_t GetEntries() const override
TObject * At(Int_t idx) const override
virtual const char * GetName() const
void Start(Bool_t reset=kTRUE)
const char * Data() const
virtual void SetBranchStatus(const char *bname, bool status=true, UInt_t *found=nullptr)
TFile * GetCurrentFile() const
TDirectory * GetDirectory() const
virtual TBranchRef * GetBranchRef() const
Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const override
virtual TTree * CloneTree(Long64_t nentries=-1, Option_t *option="")
virtual TObjArray * GetListOfBranches()
string byte_size_to_human(uint64_t byte_size, unsigned precision=2)
*brief user defined string literal for JSON values *sa std::size_t n
Long64_t sizeOnDisk(TTree *t)
void printTreeSummary(TTree *t)
void calculate_size(TString root_file_path)
void printBranchSummary(TBranch *br)
void cloned_branch_sizez(TTree *t)
Long64_t GetTotalSize(TBranch *b, bool ondisk, bool inclusive)
Long64_t GetBasketSize(TBranch *b, bool ondisk, bool inclusive)