ROOT Version: 6.22/01
Platform: Not Provided
I’m using a program to read events from many different root files each with their own TTree. Each of my trees has 7 or so branches, out of which 6 are of large s(30,000 elements) array. I need to randomly choose one of the entries each time, so I’m using the code below to do so. The problem is, this takes a significant amount of run time. It took about 11 minutes to run the code below about 250,000 iterations, and I need to eventually do this 10,000 times. In the overall scheme, I’ll end up reading each entry about 200 times, but optimizing that is difficult due to memory constraints since I would have to store each array. I’m wondering if there’s any simple way to optimize the reading of the entries. At the same time, it seems that the size of my trees also affects the run time, so I might need to optimize that tooo. I’m already using implicit multithreading. Thanks for the help.
jentry = gRandom->Integer(nentries);
Long64_t ientry = LoadTree(jentry);
nb = fChain->GetEntry(jentry);