Micromegas decoder update#4297
Conversation
check the difference between the requested BCO and the last BCO found in the TPOT data stream, including some extra delay corresponding to how much time it takes for TPOT to send all the data for said trigger.
- also store per FEE packet id.
- do not save hits for which there is no waveforms.
…rollover. Based on Jin's code.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThis PR refactors Micromegas BCO matching and raw-hit processing to use rollover-aware signed/unsigned clock-difference utilities, restructure internal state from separate "first" fields to a paired reference type, and change FillPool from event-count-based to target-BCO-driven control flow with per-FEE waveform recovery. ChangesBCO Matching and Raw-Hit Refactor
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
offline/framework/fun4allraw/SingleMicromegasPoolInput_v2.cc (1)
964-990:⚠️ Potential issue | 🟠 Major | ⚡ Quick winDo not publish zero-waveform hits.
This path always allocates and registers a
MicromegasRawHit, even if waveform extraction produced no ADC segments. That creates hits with no payload in both the streaming manager and the per-FEE cache, which is the same invalid state the recovery path already filters out.Suggested fix
- // create new hit + if (payload.waveforms.empty()) + { + continue; + } + + // create new hit auto newhit = std::make_unique<MicromegasRawHit_impl>();
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a6bf1576-7fe2-427d-814d-4c545b5f1eaf
📒 Files selected for processing (7)
offline/framework/ffarawobjects/MicromegasRawHitv3.ccoffline/framework/ffarawobjects/MicromegasRawHitv3.hoffline/framework/fun4allraw/Fun4AllStreamingInputManager.ccoffline/framework/fun4allraw/MicromegasBcoMatchingInformation_v2.ccoffline/framework/fun4allraw/MicromegasBcoMatchingInformation_v2.hoffline/framework/fun4allraw/SingleMicromegasPoolInput_v2.ccoffline/framework/fun4allraw/SingleMicromegasPoolInput_v2.h
Build & test reportReport for commit a2a8dfbcd55646e696c2446241acc63d192faa92:
Automatically generated by sPHENIX Jenkins continuous integration |
Build & test reportReport for commit ad81fd1d7703e94161f65b0c495008fade9bd1fe:
Automatically generated by sPHENIX Jenkins continuous integration |
Build & test reportReport for commit 820ad8a3b0a3d82fc1023177660ee072d82270bd:
Automatically generated by sPHENIX Jenkins continuous integration |
- added some debug output.
Build & test reportReport for commit ac03253aeb9b091d5e4169a3df5808e4d4e7b3af:
Automatically generated by sPHENIX Jenkins continuous integration |
… to the next GTM BCO. 60 FEE clocks corresponds to 16 GTM BCO which is the minimum distance between two consecutive triggers.
|
None of the Clang-tidy errors are related to this commit. |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 945a40aa-ade7-43b2-90c5-cf5d6626e331
📒 Files selected for processing (3)
offline/framework/fun4allraw/MicromegasBcoMatchingInformation_v2.ccoffline/framework/fun4allraw/SingleMicromegasPoolInput_v2.ccoffline/framework/fun4allraw/SingleMicromegasPoolInput_v2.h
🚧 Files skipped from review as they are similar to previous changes (1)
- offline/framework/fun4allraw/SingleMicromegasPoolInput_v2.h
Build & test reportReport for commit d06234147a0d8aa68b1a91bbf3c73b580d397069:
Automatically generated by sPHENIX Jenkins continuous integration |
Build & test reportReport for commit d55e4d36719f1e24eae377541e6e18e4a0496f9e:
Automatically generated by sPHENIX Jenkins continuous integration |





This is TPOT fix for overlapping time frames, similar to #4292
TPOT decoder still uses taggers (GTM and enddat) to associate FEE data to 40bits gtm BCO, unlike the TPC, but this is really an orthogonal change.
Types of changes
What kind of change does this PR introduce? (Bug fix, feature, ...)
TODOs (if applicable)
Links to other PRs in macros and calibration repositories (if applicable)
Micromegas decoder update (TPOT): fix overlapping time frames
Motivation / context
TPOT Micromegas decoding could mis-associate FEE data to neighboring 40-bit GTM BCOs when time frames overlap. This PR improves the rollover-aware GTM↔FEE BCO matching and updates the streaming/pool filling workflow so evaluation and (optional) truncated/overlapping waveform recovery are driven by a target BCO.
Key changes
m_max_gtm_bco_diff = 60andm_max_fee_sync_time = 1024 * 96.FillPool(...)API changed toFillPool(const uint64_t target_bco)and is now filled in a loop controlled byis_more_data_required(target_bco).fill_evaluation_tree(target_bco)and (if enabled)recover_truncated_waveforms(target_bco).FillMicromegasPool()the streaming manager computes/passes aref_bco_minus_rangeinto micromegasFillPool(...).recover_truncated_waveforms(target_bco)to scan for an overlapping BCO, create shifted/truncated waveform copies for missing channels, and reinsert recovered hits for downstream use.m_recover_truncated_waveforms/SetRecoverTruncatedWaveforms(...).MicromegasRawHitv3now exposesget_adc_waveforms()for waveform access.MicromegasRawHitv3.cc(typo in warning text).Potential risk areas
FillPoolsignature and the “fill → evaluate → recover” sequencing are changed; verify downstream expectations for evaluation-tree fields and stored raw-hit bookkeeping.MicromegasRawHitv3added a public accessor—confirm consumer compatibility.Possible future improvements