Read N events from disk resident tree into memory


I would like to benchmark a few different ways of doing the same thing, but without including disk IO in this. The idea is to read some fixed number N of events into the RAM, and then do what is supposed to be done with the events. I could of course allocate a bit of memory and read the entries from my tree and copy them into the allocated memory. My question is, can I have the TTree class to do this for me? Can I ask it to read in chunks of events into the memory (my events are not all of the same length) and can I then just loop over the events as ususal, at for each N events the tree will reload the memory with events and then read from memory and not the disk? I could then time the time for N events with disk IO, right?



Make a memory-resident Tree with N events and save/read chunk from disk whenever you need it