Skip to content

SimCalorimeterHitProcessor: swallow exception when attenuationReferencePosition value is not available#2519

Open
veprbl wants to merge 6 commits intomainfrom
pr/attenuationReferencePosition_noexcept
Open

SimCalorimeterHitProcessor: swallow exception when attenuationReferencePosition value is not available#2519
veprbl wants to merge 6 commits intomainfrom
pr/attenuationReferencePosition_noexcept

Conversation

@veprbl
Copy link
Member

@veprbl veprbl commented Feb 27, 2026

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?

  • Bug fix (issue #__)
  • New feature (issue #__)
  • Documentation update
  • Other: __

Please check if this PR fulfills the following:

  • Tests for the changes have been added
  • Documentation has been added / updated
  • Changes have been communicated to collaborators

Does this PR introduce breaking changes? What changes might users need to make to their code?

No

Does this PR change default behavior?

No

Copilot AI review requested due to automatic review settings February 27, 2026 20:49
@github-actions github-actions bot added the topic: calorimetry relates to calorimetry label Feb 27, 2026
Copy link
Contributor

Copilot AI left a comment

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 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 attenuationReferencePositionName DD4hep 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>
Copilot AI review requested due to automatic review settings February 27, 2026 20:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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>
@veprbl
Copy link
Member Author

veprbl commented Feb 27, 2026

This doesn't help much: there are error messages for every collection: https://github.com/eic/EICrecon/actions/runs/22504700296/job/65203559100?pr=2519

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

Labels

topic: calorimetry relates to calorimetry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

too many error msg from EcalBarrelScFiPAttenuatedHitContributions when it's not included in geometry

3 participants