Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Jan 16, 2024

Conversation

seg188
Copy link
Member

@seg188 seg188 commented Jan 16, 2024

  • Fixed issuing of timestamp packets (more closely matches real data with {almost} 1:1 matching data:timestamp)
  • Fixed issuing of sync packets (incorrect packet ordering and issue frequency) + rollover for sync packet timestamp
  • Fixed backtracking for packets-->Segments

Copy link
Member

@krwood krwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks for catching these subtle bugs Stephen! Would be great to post some of the validation plots here for the record, but this is good to go.

@seg188
Copy link
Member Author

seg188 commented Jan 16, 2024

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

@seg188 seg188 merged commit b584551 into develop Jan 16, 2024
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