Efficient way of event mixing form TTree

Dera Expert,
I am trying to perform a mixed event from a single root file having a TTree. Here I loop over the TTree first and then in another for loop, I get a random entry from the tree to have the second event which I use for the mixed event. However, I see the efficiency of this method is very low (Consuming too much memory and time). Is there a better way to do the mixed event in the root @rene?

Many thanks in advance.

ROOT Version: Not Provided
_Platform: MAC
Compiler: Not Provided

Dear @arvindkhuntia ,

I would say that in general what you are doing is inefficient. Just the fact of randomly reading an event of the same tree in the inner loop, which could belong to a completely different part of the file, will involve a lot more I/O operations than just reading the file sequentially.

Cheers,
Vincenzo

Thank you @vpadulan,

Could you please let me know if there are any alternate ways to achieve this?

Many thanks.

Hi,

If the entries are not correlated then reading them two by two and mix should achieve the same thing, no? And be much faster.

Just an idea, might not work in your case

Cheers

Joa

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.