Repository navigation
CHG: Assign event IDs to HDF5 data taken through the RTB - #230
Conversation
|
One thing that this PR might not tackle yet is combining data from multiple files, without restarting the event ID at zero (or maybe it does, I did not check this yet). If the event ID resets to 1 with each file that's being read, this PR might require an additional commit. I'll keep you posted :) |
|
I also checked: in it's current implementation, nothing needs to be adjusted 😇 : Looking forward to some reviews and getting this merged quickly! :) |
|
This review was written by Claude (Anthropic's AI assistant) on behalf of @zoglauer. Thanks for this! The approach makes sense, and the non-RTB path behaves exactly as before. I found one real problem and a few smaller things. Main issue: the RTB event ID depends on a counter that only counts successful events
if (Event->GetNStripHits() == 0) { ... return false; }When an event is dropped there, the counter doesn't advance, and the next raw event gets the dropped event's ID. Examples are an event with only nearest-neighbor hits when
Suggestion: add a dedicated counter, e.g. Smaller points
The counter issue should be fixed before merging. Everything else is minor. |
|
Looking over Claude's review, I agree the counter issue should be fixed. The rest looks okay. Let me know when you've made the suggested changes and I can review again. |
|
Working on it now! |
d86fbe5 to
e6461b1
Compare
|
It doesn't have unit tests yet, but I hope I addressed all the other comments. |
|
This is probably not the most elegant way, but I created a "RTB"-like HDF5 file from the unit-test HDF5 file for 406-1, removed all event IDs and changed In the new unit tests @zoglauer Thoughts? |
88d8eed to
0789f08
Compare
|
I'm happy to merge, but maybe @zoglauer wants a check on how you've handed the unit tests for now? |

Addressing issue #215:
Data taken through the RTB has no native event IDs, but we might want to have event IDs for analysis purposes.
In this PR, I am adding consecutive event IDs (starting at 1 - as for all the data taken in unit-level data) to events loaded from an HDF5 file.
The way we can determine if data from a HDF5 file was taken through the RTB, we can check the JSON config, that has an entry
"board":"rtb"or"board":"dib"as first entry. I've only seen the"board"field in the JSON config for HDFv2 data, and I've seen both upper-case and lower-case values (i.e both"DIB"and"dib") --> this is what informed the creation of theRegexPatternto determinem_DataTakenThroughRTB.