Randomized access in a tree

Ahaaaaa!! Now I see my memory usage skyrocket to 1.6GBytes (the actual file size)! I bet my code will run faster now – I’ll check and let you know in 10min.

So what was the difference? Rather than do LoadBaskets() on ptree, I did it on the actual branch – is that it?

And, to answer your questions, here’s the output:


root [4] cout << b->GetListOfBaskets()->GetEntries() << '\n';
479
root [5] gROOT->ProcessLine("ptree->Dump(); > ptree.dump");
root [6] gROOT->ProcessLine(".! grep TotalBuffers ptree.dump");
fTotalBuffers                 2625134592          ! Total number of bytes in branch buffers

root [8] b = ptree->GetBranch("tlv_header");
root [9] b->LoadBaskets();
root [10] cout << b->GetListOfBaskets()->GetEntries() << '\n';
135
root [11] gROOT->ProcessLine("ptree->Dump(); > ptree.dump");
root [12] gROOT->ProcessLine(".! grep TotalBuffers ptree.dump");
fTotalBuffers                 3364995072          ! Total number of bytes in branch buffers

It also appears that the total number of bytes in branch buffers is 2x of what it should be…