Fix decoding of VeloPix data
This merge request fixes the issue found with VeloPix hits not always being correctly assigned to events (see plots of event number vs number of hits).
The issue is caused by a small number of events being out of order in the file, the causes the current logic to update m_vpxTimer
and jump forward in time. I've quickly fixed this by requiring two consecutive events to wrap around in orbit number before updating m_vpxTimer
. I also print a warning, see this log file to get an idea of the frequency with which this happens (shown by WARNING Found 1 out of order events
).
You can see a diff which isn't polluted by !1 (merged) by looking here.
@tevans, @hschindl, @kakiba and @vanbeuze does this seem like a reasonable solution?
Telescope:
VeloPix DuT before this change:
VeloPix DuT after this change: