Skip to content

Transition benchmark analyses from Associations to Links - #325

Merged
wdconinc merged 1 commit into
masterfrom
copilot/transition-associations-to-links
Sep 3, 2026
Merged

Transition benchmark analyses from Associations to Links#325
wdconinc merged 1 commit into
masterfrom
copilot/transition-associations-to-links

Conversation

Copilot AI commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

The benchmark analyses were still consuming the legacy *Associations collections and the older getSimID()/getRecID() traversal pattern. EICrecon has moved to link-based truth/reco navigation, so the benchmark code needs to follow the current *Links model to remain compatible with generated output.

  • Summary

    • This patch updates the benchmark code paths that read/reuse reconstructed-truth relations to the current EICrecon link API.
    • It covers the DRICH, tracking performance, and nHCal analyses that were still relying on deprecated association collections.
  • What changed

    • Renamed collection usage from *Associations to *Links and updated the corresponding C++ collection types from MCReco*AssociationCollection to MCReco*LinkCollection.
    • Replaced legacy association traversal (getSimID(), getRecID()) with the link-based accessors (getTo(), getFrom()).
    • Updated the TTree branch names used by the tracking analyses to the current link-backed branches, including CentralCKFTrackLinks.weight and CentralCKFTruthSeededTrackLinks.weight.
    • Kept the fix scoped to the affected benchmark consumers rather than changing unrelated analysis logic.
  • Example

// before
for (const auto& assoc : assocs) {
  if (assoc.getSimID() == mc_idx) {
    auto reco = recParts.at(assoc.getRecID());
    ...
  }
}

// after
for (const auto& link : links) {
  auto sim = link.getTo();
  auto reco = link.getFrom();
  if (sim.isAvailable() && reco.isAvailable()) {
    ...
  }
}
  • Scope
    • RICH benchmark runner and analysis code
    • DIS tracking performance analysis
    • nHCal dimuon and pion rejection analyses

Copilot AI linked an issue Aug 30, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Transition from associations to links in benchmark code Transition benchmark analyses from Associations to Links Aug 30, 2026
Copilot AI requested a review from wdconinc August 30, 2026 16:18
@wdconinc
wdconinc marked this pull request as ready for review August 30, 2026 16:50
Copilot AI lite review requested due to automatic review settings August 30, 2026 16:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates detector benchmark analyses to consume EICrecon’s current link-based truth↔reco navigation model, replacing deprecated *Associations collections and legacy ID-based traversal so the benchmarks remain compatible with modern EICrecon PODIO output.

Changes:

  • Switched benchmark inputs from *Associations to *Links collections (including collection/type updates in the RICH benchmark and collection lists in runner scripts).
  • Updated DIS tracking benchmark configuration and analysis to read link-backed CentralCKF*TrackLinks.weight branches.
  • Migrated nHCal analyses from association ID traversal (getSimID()/getRecID()) to link handle navigation (getTo()/getFrom()).

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
benchmarks/tracking_performances_dis/Snakefile Requests CentralCKF*TrackLinks collections in produced PODIO output.
benchmarks/tracking_performances_dis/analysis/trk_dis_plots.cxx Updates plot annotations/comments to refer to links rather than associations.
benchmarks/tracking_performances_dis/analysis/trk_dis_analysis.cxx Reads CentralCKF*TrackLinks.weight branches instead of association weights.
benchmarks/rich/src/ReconstructedParticleAnalysis.cc Switches reco↔MC traversal to MCRecoParticleLinkCollection using getFrom()/getTo().
benchmarks/rich/src/RawHitAnalysis.cc Updates raw-hit truth navigation to MCRecoTrackerHitLinkCollection.
benchmarks/rich/src/benchmark.cc Updates frame collection names/types to *Links for RICH processing.
benchmarks/rich/run_benchmark.rb Updates requested output collections to DRICHRawHitsLinks and ReconstructedChargedParticleLinks.
benchmarks/rich/include/ReconstructedParticleAnalysis.h Updates includes/signature from association to link collection.
benchmarks/rich/include/RawHitAnalysis.h Updates includes/signature from association to link collection.
benchmarks/nhcal_pion_rejection/scripts/pion_rejection_analysis.cxx Migrates MC↔reco matching to MCRecoParticleLinkCollection (getTo()/getFrom()).
benchmarks/nhcal_dimuon_photoproduction/scripts/dimuon_photoproduction_analysis.cxx Migrates MC↔reco matching to MCRecoParticleLinkCollection (getTo()/getFrom()).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@wdconinc
wdconinc requested a review from veprbl August 30, 2026 22:40
@wdconinc

Copy link
Copy Markdown
Contributor

@veprbl This passes a full CI run (for what that's worth). It would need to be uploaded into hydra with all channels activated for actual comparison since there are 1934 artifacts. But based on a download of the artifact archive here and for a reference run, and running ImageMagick's compare there are some strange differences. So don't merge yet :-)

@wdconinc

Copy link
Copy Markdown
Contributor

@wdconinc

Copy link
Copy Markdown
Contributor

…llections

Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
@wdconinc
wdconinc force-pushed the copilot/transition-associations-to-links branch from 3d0a2dc to 9dd7989 Compare September 1, 2026 17:12
@wdconinc

wdconinc commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@wdconinc
wdconinc enabled auto-merge (squash) September 3, 2026 00:39
@wdconinc
wdconinc merged commit 21354a7 into master Sep 3, 2026
4 checks passed
@wdconinc
wdconinc deleted the copilot/transition-associations-to-links branch September 3, 2026 02:04
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.

Transition from Associations to Links

3 participants