Linked events


I was wondering if a technology already exists in ROOT to have linked events, such that one event could point to another event without having to go through a second GetEntry(iLater) call. The use case is for example if one has delayed signals then one might need to match together a certain event with a later event. After having formed the algorithm to match certain events to later events with this feature one could do the analysis faster/cleaner than always having to search/find that particular other event.

For the big fraction of applications (LHC, etc) I guess all events are uncorrelated and that is why perhaps such a use case might be actually quite rate. I was just wondering if anything like this exist already?

(Of course naively I can store the Eventid of that particular other later events in the current event and make a second GetEntry(iLater) call and then jump back to the current one after the information is processed, etc).

Thanks for information,

Hi Balint,

ROOT does not have such a capability. As you point out, the entries in a TTree are independent one from another and this perfectly match the statistical properties of collision events.
On the other hand, I realise that treating some kind of correlation might help for example in presence of searches for extremely long lived BSM particles. I think that at this stage there are some solutions available. One is the one you describe in your previous post. The limitation I see is the runtime performance hit due to the “jump” on the file. Another one could consist in keeping in memory some sort of “signatures’ registry” which could be queried faster than the tree itself.


As a side note … for performance reasons, if you want to access several different entries of a tree simultaneously, you should “retrieve” / “get” the same tree several times from your ROOT file (so that you have something like “tree_instance_0->GetEntry(i)”, “tree_instance_1->GetEntry(i_another_1)”, “tree_instance_2->GetEntry(i_another_2)”, …).
Of course, you can have just “one instance” of your tree and “jump” between its different entries, but this will heavily decrease your analysis performance.

Hello Balint,

As far as I am understanding your post, I think what you need is not a jumptoevent(xy) but an event-Merger.

A couple of years ago I was working for a testbeam experiment CERN SPS. We were using two different types of detectors and sometimes it happend that These were running out of sync, means that the datasets of the two detectors were offsetted a few event-numbers.

What I did in order to solve this problem was to write an event merger. I simply had a used a queue with n Elemets (think 10 or so), Looping over the tree meant that at first the queue was filled with the first tree-elements, then the oldest element was kicked out and fille with the next and so on.

This mechanismn is realively fast (because you can do this within the normal loop), but of course you can only correlate Events which not too far away from each other.

If you want I could provide you some of my old code