Feature/gp overlay fix#653
Open
mvicenzi wants to merge 10 commits into
Open
Conversation
Contains `sbn::RebindAssociatedProducts()` to make a copy of an association with the data product on one side replaced by another one.
…rms and baselines
4 tasks
Prevents things like magic "invalid" values like -9999.0 from becoming -9997.8 after a 1.2 us shift. Introduced an utility `caf::SRdefaults` for fetching those magic values.
Must be explicitly disabled if not desired. The data is currently not shifted (not clear what a shift on timestamps would mean).
PetrilloAtWork
approved these changes
Jun 12, 2026
PetrilloAtWork
left a comment
Member
There was a problem hiding this comment.
Tested with ICARUS Run2 overlay simulation, both from scratch and reprocessing.
Works ok.
There was a problem hiding this comment.
Pull request overview
This PR extends time-shifting support around trigger overlays by enhancing AdjustSimForTrigger outputs (shifted raw::Trigger, optional sbn::ExtraTriggerInfo, and rebinding of waveform–baseline associations) and by adding small utilities to preserve semantic defaults in CAF-making.
Changes:
- Add
sbncode/Utilitieswith a header-only association rebinding helper (sbn::RebindAssociatedProducts). - Update
AdjustSimForTriggerto (optionally) emit shifted trigger products, duplicatesbn::ExtraTriggerInfo, and rebindraw::OpDetWaveform–icarus::WaveformBaselineassns when shifting waveforms. - Add
caf::SRDefaultsand use it inCAFMakerto avoid time-shifting Standard Record fields that are still at their “defaulted” value.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| sbncode/CMakeLists.txt | Adds the new Utilities subdirectory to the build. |
| sbncode/Utilities/CMakeLists.txt | Defines a header-only Utilities interface library target and installs headers/sources. |
| sbncode/Utilities/AssnsUtils.h | Introduces sbn::RebindAssociatedProducts() for one-to-one association pointer rebinding. |
| sbncode/DetSim/CMakeLists.txt | Updates DetSim module link libraries and adds dependency on sbncode::Utilities. |
| sbncode/DetSim/AdjustSimForTrigger_module.cc | Expands functionality: shifted trigger output, optional ExtraTriggerInfo copy, optional waveform–baseline assn rebinding, and updated documentation. |
| sbncode/CAFMaker/SRDefaults.h | Declares caf::SRDefaults for retrieving “defaulted” Standard Record object values. |
| sbncode/CAFMaker/SRDefaults.cxx | Implements static initialization of defaulted Standard Record objects via setDefault(). |
| sbncode/CAFMaker/RecoUtils/CMakeLists.txt | Adds sbnanaobj::StandardRecord dependency. |
| sbncode/CAFMaker/CAFMaker_module.cc | Uses SRDefaults to avoid shifting invalid/default flash-match timing fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| art::InputTag fBindWaveformBaselines; ///< Tag of OpDetWaveform-baseline associations to be rebound. | ||
| double fAdditionalOffset; | ||
| bool fDropTriggerProduct; ///< Do not put the shifted trigger data product into the event. | ||
| bool fSkipExtraTriggerInfo; ///< Copy input `sbn::ExtraTriggerInfo`. |
Member
|
Conflicts will be resolved at the time when the merge destination branch is finalised. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR supports improvements to the trigger shifting module for overlays, included nut not limited to:
AdjustSimForTriggerproduces araw::Triggerdata product for future time reference;AdjustSimForTriggerreproduces associations with PMT baselines;AdjustSimForTriggerproduces a "shifted"sbn::ExtraTriggerInfotoo;CAFMakerdoes not time-shift some time variables when their value is invalid.This is required by: