DUNE-DAQ / DUNE-DAQ/dfmodules

Add a heuristic time offset to data products to allow crude calculation of wallclock time

Open
#42 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
3
Forks
5
Avg merge
4h 42m
Merged PRs (30d)
6

Description

Here are some proposals. I will check that all of them are acceptable:

  1. this change will only affect the dataformats and dfmodules repos
  2. a new field should be added to the TriggerRecordHeader
    • its data type should be timestamp_t
    • its name should be heuristic_time_offset ???
    • should we also add this field to the FragmentHeader so that Fragments could have their timestamps reasonably interpreted without needing an accompanying TRH?
  3. in the dfmodules package, the primary change will be to populate this field. This change could be made in the FragmentReceiver or the DataWriter. The algorithm for populating this field should be something like the following:
    • within each run, when the first TriggerRecord is created or received, look up the current Linux system time in number of seconds since the Epoch, convert that number of seconds into DUNE clock ticks (e.g. multiply by 5e7 for a 50 MHz clock), and determine the difference between that number of clock ticks and the trigger_timestamp that is stored in the TriggerRecordHeader. This value is the heuristic_time_offset for all TRs in the run, and this value should be stored in the TRH::heuristic_time_offset field of all TRs in the run.
  4. another change in the dfmodules package will be to update the hdf5_dump.py script to make use of this new field to produce a human-readable string for timestamp(s) in each TR and Fragment, as needed

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the TriggerRecordHeader and FragmentHeader definitions in the dataformats repository, then inspect FragmentReceiver, DataWriter, and hdf5_dump.py in dfmodules. Confirm where the first TriggerRecord is available and how timestamps are currently represented. Done means the agreed header field is populated consistently for a run and hdf5_dump.py renders human-readable timestamps for TriggerRecords and Fragments.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.