Skip to content

Add unix_ts_usec to charge/events#195

Merged
mjkramer merged 3 commits intodevelopfrom
mjkramer/feature/unix_ts_usec
Jun 23, 2025
Merged

Add unix_ts_usec to charge/events#195
mjkramer merged 3 commits intodevelopfrom
mjkramer/feature/unix_ts_usec

Conversation

@mjkramer
Copy link
Member

@mjkramer mjkramer commented Jun 9, 2025

The unix_ts_usec field is intended to provide a reasonably robust/precise timestamp (to within a few ms) for Mx2 matching. It is calculated by taking the LArPix timestamps and applying a correction for the slowly-drifting offset between the PPS and the GPS clock. This offset is measured by the new PPSDelayExtractor class.

@mjkramer mjkramer requested a review from krwood June 9, 2025 16:02
@mjkramer mjkramer force-pushed the mjkramer/feature/unix_ts_usec branch 2 times, most recently from 8a23578 to 07902d4 Compare June 10, 2025 03:08
@mjkramer
Copy link
Member Author

The real money plot will be the one that shows good track matching performance in the CAFs, and I'm still working on that. But here's a plot that shows the extracted PPS delays from the first sandbox file (IO group 7 apparently had a unsynced system clock at the time; this is why we take the median of the measured delays across all IO groups!):

image

And here's what the charge/events dataset looks like at the end of the day. You can see the expected 0.2 s shift (relative to ts_start) in the new unix_ts_usec

image

@mjkramer
Copy link
Member Author

mjkramer commented Jun 10, 2025

And here's the money plot (using a 5ms trigger-matching tolerance in the CAF maker):

image

This is consistent with what the distribution of Mx2/2x2 track displacements used to look like, back when we only were including beam events in the 2x2 data and didn't need much timing precision for trigger matching.

@mjkramer mjkramer force-pushed the mjkramer/feature/unix_ts_usec branch 2 times, most recently from 0fb8fec to c946938 Compare June 23, 2025 15:52
@mjkramer mjkramer mentioned this pull request Jun 23, 2025
@mjkramer
Copy link
Member Author

Merging this since it seems to perform as intended for the 2x2 sandbox data. For simulations and for FSD data, we can just leave the extraction/correction disabled. For 2x2 data outside the sandbox, there is a potential corner case that could arise when the PPS pulses and GPS ticks are "close" (as in, less than ~50 ms apart). That discussion continues in #198.

@mjkramer mjkramer merged commit ec20f83 into develop Jun 23, 2025
2 checks passed
@mjkramer mjkramer deleted the mjkramer/feature/unix_ts_usec branch June 23, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants