DUNE / larnd-sim

Simulation framework for a pixelated Liquid Argon TPC
Apache License 2.0
10 stars 26 forks source link

Fixed Sync/Timestamp + Packets-->Segments Backtracking #192

Closed seg188 closed 6 months ago

seg188 commented 6 months ago
seg188 commented 6 months ago

Before the changes in this PR, we saw that the validation code was reporting that reconstructed charge events were not ~1:1 with true events:

Screen Shot 2024-01-16 at 10 09 28 AM

This issue was two fold. Firstly, due to a bug in the packet-->segment backtracking where the index of the segments was stored instead of the segment_id from edep-sim, the actual backtracking was giving the wrong event IDs. The second issue was with the sync packet logic--the packets were issue every 1e8 instead of 1e7 due to a mis-conversion of clock ticks to microseconds. The effect of this is most obvious when trying to use the sync to reconstruct the global timestamp (packet timestamp + rollover). The previous behavior is here (note duration is shorted than expected 231 seconds, and timestamps are not monotonically increasing):

Screen Shot 2024-01-16 at 10 20 14 AM

Corrected behavior is here:

Screen Shot 2024-01-16 at 10 15 47 AM

Finally, the corrected behavior associating events:

Screen Shot 2024-01-16 at 10 22 29 AM