Improve Event Building with EUDAQ2 EventLoader
Initially I set out to remove the requirement to decode M26 data multiple times - I failed. They are packaged within a single subevent and only after decoding reveal their plane numbers and names. So no chance.
Then I decided to at least match the plane name against the current detector (this is the only place where we know which detector this is from, in actual name since the event description contains e.g. NiRawData
or CaribouRawData
) but this is not possible because the TLU does not define planes and would fall through this raster.
The problem of processing sub-events multiple times is still there, but at least for now relatively academic. Observe this simple example with one M26 detector and one TLU. My (simmplified) config is:
[EventLoaderEUDAQ2]
name = "TLU"
file_name = "run000283_ni_190329095902.raw"
[EventLoaderEUDAQ2]
name = "MIMOSA26_0"
file_name = "run000283_ni_190329095902.raw"
which produces:
|16:36:54.758| (STATUS) ========================| Event loop |========================
|16:36:54.758| (TRACE) [R:EventLoaderEUDAQ2:TLU] Reading new EUDAQ event from file
|16:36:54.758| (TRACE) [R:EventLoaderEUDAQ2:TLU] Buffer contains 1 (sub-) events:
|16:36:54.758| (TRACE) [R:EventLoaderEUDAQ2:TLU] (sub-) event of type NiRawDataEvent
|16:36:54.758| (DEBUG) [R:EventLoaderEUDAQ2:TLU] NiRawDataEvent: EventConverter returned true
|16:36:54.758| (DEBUG) [R:EventLoaderEUDAQ2:TLU] NiRawDataEvent: Event has no timestamp, comparing trigger number
|16:36:54.758| (DEBUG) [R:EventLoaderEUDAQ2:TLU] Trigger ID 0 not found in current event.
|16:36:54.758| (TRACE) [R:EventLoaderEUDAQ2:TLU] Reading new EUDAQ event from file
|16:36:54.758| (TRACE) [R:EventLoaderEUDAQ2:TLU] Buffer contains 2 (sub-) events:
|16:36:54.758| (TRACE) [R:EventLoaderEUDAQ2:TLU] (sub-) event of type NiRawDataEvent
|16:36:54.758| (TRACE) [R:EventLoaderEUDAQ2:TLU] (sub-) event of type TluRawDataEvent
|16:36:54.758| (DEBUG) [R:EventLoaderEUDAQ2:TLU] NiRawDataEvent: EventConverter returned true
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:TLU] NiRawDataEvent: Event has no timestamp, comparing trigger number
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:TLU] Trigger ID 1 not found in current event.
|16:36:54.759| (TRACE) [R:EventLoaderEUDAQ2:TLU] Buffer contains 1 (sub-) events:
|16:36:54.759| (TRACE) [R:EventLoaderEUDAQ2:TLU] (sub-) event of type TluRawDataEvent
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:TLU] TluRawDataEvent: EventConverter returned true
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:TLU] event_start = 27915us, event_end = 27915us
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:TLU] Defining Corryvreckan event: 27915us - 27915us, length 25ns
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:TLU] Shifted Corryvreckan event: 27915us - 27915us, length 25ns
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:TLU] Stored trigger ID 1 at 27915us
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:TLU] Is within current Corryvreckan event, storing data
|16:36:54.759| (TRACE) [R:EventLoaderEUDAQ2:TLU] Reading new EUDAQ event from file
|16:36:54.759| (TRACE) [R:EventLoaderEUDAQ2:TLU] Buffer contains 2 (sub-) events:
|16:36:54.759| (TRACE) [R:EventLoaderEUDAQ2:TLU] (sub-) event of type NiRawDataEvent
|16:36:54.759| (TRACE) [R:EventLoaderEUDAQ2:TLU] (sub-) event of type TluRawDataEvent
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:TLU] NiRawDataEvent: EventConverter returned true
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:TLU] NiRawDataEvent: Event has no timestamp, comparing trigger number
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:TLU] Trigger ID 2 not found in current event.
|16:36:54.759| (TRACE) [R:EventLoaderEUDAQ2:TLU] Buffer contains 1 (sub-) events:
|16:36:54.759| (TRACE) [R:EventLoaderEUDAQ2:TLU] (sub-) event of type TluRawDataEvent
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:TLU] TluRawDataEvent: EventConverter returned true
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:TLU] event_start = 28738.4us, event_end = 28738.4us
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:TLU] Corryvreckan event found on clipboard.
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:TLU] Event end after Corryvreckan event: 28738.4us > 27915us
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:TLU] Triggers on clipboard event: 1
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:TLU] ID: 1, time: 27915us
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:TLU] Finished Corryvreckan event
|16:36:54.759| (TRACE) [R:EventLoaderEUDAQ2:MIMOSA26_0] Reading new EUDAQ event from file
|16:36:54.759| (TRACE) [R:EventLoaderEUDAQ2:MIMOSA26_0] Buffer contains 1 (sub-) events:
|16:36:54.759| (TRACE) [R:EventLoaderEUDAQ2:MIMOSA26_0] (sub-) event of type NiRawDataEvent
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:MIMOSA26_0] NiRawDataEvent: EventConverter returned true
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:MIMOSA26_0] NiRawDataEvent: Event has no timestamp, comparing trigger number
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:MIMOSA26_0] Trigger ID 0 not found in current event.
|16:36:54.759| (TRACE) [R:EventLoaderEUDAQ2:MIMOSA26_0] Reading new EUDAQ event from file
|16:36:54.759| (TRACE) [R:EventLoaderEUDAQ2:MIMOSA26_0] Buffer contains 2 (sub-) events:
|16:36:54.759| (TRACE) [R:EventLoaderEUDAQ2:MIMOSA26_0] (sub-) event of type NiRawDataEvent
|16:36:54.759| (TRACE) [R:EventLoaderEUDAQ2:MIMOSA26_0] (sub-) event of type TluRawDataEvent
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:MIMOSA26_0] NiRawDataEvent: EventConverter returned true
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:MIMOSA26_0] NiRawDataEvent: Event has no timestamp, comparing trigger number
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:MIMOSA26_0] Assigning trigger time 27915us to event with trigger ID 1
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:MIMOSA26_0] event_start = 27915us, event_end = 27915us
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:MIMOSA26_0] Corryvreckan event found on clipboard.
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:MIMOSA26_0] Stored trigger ID 1 at 27915us
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:MIMOSA26_0] Is within current Corryvreckan event, storing data
|16:36:54.759| (TRACE) [R:EventLoaderEUDAQ2:MIMOSA26_0] mimosa26_0 (0 out of 6) with 4 hit pixels
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:MIMOSA26_0] Found correct plane.
|16:36:54.759| (DEBUG) [R:EventLoaderEUDAQ2:MIMOSA26_0] Read pixel (col, row) = (1139, 227) from EUDAQ2 event data (before masking).
Observe how the TluRawData
sub-event is processed by both the MIMOSA26_0
instance and the TLU
instance of the event loader module (Stored trigger ID 1 at 27915us
appears twice in the log).
Below there are a few small fixes, none of which change the functionality apart from removing the sorting-by-name which is not necessary since we add the TLU as separate (auxiliary) detector.
This fixes #55 (closed) This fixes #60 (closed)