SimCalorimeterHitProcessor: swallow exception when attenuationReferencePosition value is not available#2519
SimCalorimeterHitProcessor: swallow exception when attenuationReferencePosition value is not available#2519
Conversation
…cePosition value is not available
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Pull request overview
This PR prevents SimCalorimeterHitProcessor::init() from throwing when a DD4hep constant for attenuationReferencePositionName is missing, avoiding repeated JANA2 factory re-initialization and extremely verbose exception output.
Changes:
- Wrap lookup of
attenuationReferencePositionNameDD4hep constant in a try/catch. - Log a concise error when the constant is unavailable instead of propagating the exception.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
src/algorithms/calorimetry/SimCalorimeterHitProcessor.cc:159
- The catch block logs a generic error but doesn’t mention that the algorithm will proceed with attenuation disabled (i.e., attFactor=1 and no propagation-time shift). Consider making the log message explicit about the fallback, and using the logger’s format-string API directly (instead of pre-formatting via fmt::format) for consistency with the rest of this file.
// Map for staging output information. We have 2 levels of structure:
// - top level: (MCParticle, Merged Hit CellID)
// - second level: (Merged Contributions)
// Ideally we would want immediately create our output objects and modify the
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…cePosition value is not available (fix: iwyu) (#2520) This PR applies the include-what-you-use fixes as suggested by https://github.com/eic/EICrecon/actions/runs/22503482326. Please merge this PR into the branch `pr/attenuationReferencePosition_noexcept` to resolve failures in PR #2519. Auto-generated by [create-pull-request][1] [1]: https://github.com/peter-evans/create-pull-request Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
This doesn't help much: there are error messages for every collection: https://github.com/eic/EICrecon/actions/runs/22504700296/job/65203559100?pr=2519 |
Briefly, what does this PR introduce?
Resolves: #2516
This prevents JANA2 from repeatedly trying to init the factory with printing of a huge std::exception::what() value.
What kind of change does this PR introduce?
Please check if this PR fulfills the following:
Does this PR introduce breaking changes? What changes might users need to make to their code?
No
Does this PR change default behavior?
No