Skip to content

Feature/gp overlay fix#653

Open
mvicenzi wants to merge 10 commits into
SBNSoftware:release/SBN2025Afrom
PetrilloAtWork:feature/gp_overlayFix
Open

Feature/gp overlay fix#653
mvicenzi wants to merge 10 commits into
SBNSoftware:release/SBN2025Afrom
PetrilloAtWork:feature/gp_overlayFix

Conversation

@mvicenzi

@mvicenzi mvicenzi commented May 18, 2026

Copy link
Copy Markdown
Member

Description

This PR supports improvements to the trigger shifting module for overlays, included nut not limited to:

  • AdjustSimForTrigger produces a raw::Trigger data product for future time reference;
  • AdjustSimForTrigger reproduces associations with PMT baselines;
  • AdjustSimForTrigger produces a "shifted" sbn::ExtraTriggerInfo too;
  • Standard Record utility to determine which was the default construct value of a variable;
  • CAFMaker does not time-shift some time variables when their value is invalid.

This is required by:

@mvicenzi mvicenzi added enhancement New feature or request dependent An issue or PR depending on another labels May 18, 2026
@mvicenzi mvicenzi requested a review from PetrilloAtWork May 18, 2026 21:47
@mvicenzi mvicenzi marked this pull request as ready for review May 18, 2026 21:56
@mvicenzi mvicenzi requested a review from francescopoppi June 3, 2026 13:27
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 PetrilloAtWork left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested with ICARUS Run2 overlay simulation, both from scratch and reprocessing.
Works ok.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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/Utilities with a header-only association rebinding helper (sbn::RebindAssociatedProducts).
  • Update AdjustSimForTrigger to (optionally) emit shifted trigger products, duplicate sbn::ExtraTriggerInfo, and rebind raw::OpDetWaveformicarus::WaveformBaseline assns when shifting waveforms.
  • Add caf::SRDefaults and use it in CAFMaker to 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.

Comment thread sbncode/DetSim/AdjustSimForTrigger_module.cc
Comment thread sbncode/DetSim/AdjustSimForTrigger_module.cc
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`.
Comment thread sbncode/DetSim/AdjustSimForTrigger_module.cc Outdated
Comment thread sbncode/DetSim/AdjustSimForTrigger_module.cc Outdated
Comment thread sbncode/DetSim/AdjustSimForTrigger_module.cc Outdated
Comment thread sbncode/Utilities/AssnsUtils.h
@PetrilloAtWork

Copy link
Copy Markdown
Member

Conflicts will be resolved at the time when the merge destination branch is finalised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependent An issue or PR depending on another enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants