Software (Anti)-Coincidence

Dear rooters,

at the moment I am trying to implement an anticoincidence algorithm within my data aquisition.
It should offer a time window and a delay.
I want to use it for filling a histogram with only events from channel 1 if channel 2 has no event in the corresponding window.

The problem is, however, that the data stream is serial an the channels from which the data come
are read out in sequence.
Unfortunately the data, which comes in bursts resulting in arrays which are not equally long, nor the time stamps within are correlated.
In other words it could be that when I fill my first array with values from channel one, than in sequence my second array with values from channel two and switch back to channel one I may not be able to perform an anticoincidence check as there is an offset between the timestamps.
This offset is random in value and also could be positive or negative.

So at the moment I am totally confused and don’t know where to start from here.

Maybe someone here had made some attemps in applying anticoincidence algorithms at data streams.

Offline using TTree structure is no problem but it would be nice to have it implemented in the data acquisition.

Cheers
Johannes

Hi,

You could use two circular buffer to collect the data streams from the channels. Then you prune old stuff once the stream from the relevant time stamps from the other channel arrives. You could even use a deque to dynamically grow your ring buffer should it need to (because the other channel doesn’t send its data for too long).

In general I don’t see how you can do (anti)coincidence cuts without a synchronized clock.

Cheers, Axel.