benchmarks/rich: fix compatibility with edm4hep-1.0, podio-1.7#307
Merged
Conversation
The benchmark failed because: 1. The output_collections list requested 'ReconstructedChargedParticleAssociationsWithDRICHPID' which no longer exists in EICrecon. Since only specified collections are written, 'ReconstructedChargedParticleAssociations' was absent from the rec file. 2. In podio >= 0.99.0, Frame::get<C>(name) throws std::runtime_error when the collection is absent or has a type mismatch, rather than returning an invalid collection as in older versions. 3. isValid() on collections is deprecated in favor of hasID(). Fix by replacing the stale collection name with the current 'ReconstructedChargedParticleAssociations', updating GetCollection() to catch the podio >= 0.99.0 throwing behavior, and replacing isValid() with hasID(). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the RICH benchmark’s breakage after upgrading to newer EDM/podio stacks by updating the requested output collection name and making collection retrieval resilient to podio’s newer exception-throwing behavior.
Changes:
- Update
run_benchmark.rbto requestReconstructedChargedParticleAssociationsinstead of the removed...WithDRICHPIDcollection. - Wrap
podio::Frame::get<C>()in a try/catch for podio ≥ 0.99 to avoid aborting when collections are missing/mismatched. - Replace deprecated collection validity check with
hasID()inReconstructedParticleAnalysis.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| benchmarks/rich/src/ReconstructedParticleAnalysis.cc | Switches association-collection validity check from deprecated isValid() to hasID(). |
| benchmarks/rich/src/benchmark.cc | Makes collection retrieval robust to podio’s throwing Frame::get behavior via try/catch and returns an empty collection on failure. |
| benchmarks/rich/run_benchmark.rb | Updates output_collections to the current EICrecon association collection name so it’s written to the rec file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Problem
The RICH benchmark failed when upgrading to edm4hep-1.0, podio-1.7, algorithms-1.3.0, k4fwcore-1.5 (CI job #7877888):
Root Cause
Three interacting issues:
Stale collection name:
run_benchmark.rbrequestedReconstructedChargedParticleAssociationsWithDRICHPIDinoutput_collections, but this collection no longer exists in EICrecon. Since JANA2's podio output writes only the explicitly listed collections,ReconstructedChargedParticleAssociationswas absent from the rec file.podio 1.7 API change:
Frame::get<C>(name)now throwsstd::runtime_errorwhen a collection is absent or has a type mismatch (podio 1.6 and earlier returned a static empty collection instead). The oldisValid()guard was therefore never reached — the exception propagated uncaught.Deprecated API:
isValid()on collections is deprecated in the edm4eic-generated headers in favour ofhasID().Note: before the podio 1.7 upgrade the stale collection name caused the
ReconstructedParticleanalysis to silently produce empty results rather than crash, sinceFrame::get<C>()returned an invalid collection without throwing.Fix
run_benchmark.rb: Replace non-existentReconstructedChargedParticleAssociationsWithDRICHPIDwithReconstructedChargedParticleAssociations(the correct current EICrecon output collection name).src/benchmark.cc: Wrapframe.get<C>()in a try-catch; return an empty collection on error so callers can continue gracefully. The try-catch is harmless for older podio versions whereget<C>()does not throw.src/ReconstructedParticleAnalysis.cc: Replace deprecatedisValid()withhasID().