Skip to content

Conversation

@sly2j
Copy link
Contributor

@sly2j sly2j commented Nov 6, 2025

Briefly, what does this PR introduce?

Currently, SimCalorimeterHitProcessor links primary generated particles with the detector hits, which takes care of early showering particles leading to calorimeter hits being associated with a large number of particles. However, this inadvertently also gets rid of e.g. single photons radiated in the detector. This PR changes the primary particle lookup so it stops when it encounters a particle where the parent is a primary and the primary only has two daughters. This should be gentle enough to not re-introduce the previous issue we dealt with when introducing the primary lookup while adding most of the crucial information related to the originator of calorimeter clusters back in.

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?

Does this PR change default behavior?

…like radiative photons from a primary electrons
@github-actions github-actions bot added the topic: calorimetry relates to calorimetry label Nov 6, 2025
@veprbl veprbl requested a review from ruse-traveler November 6, 2025 21:53
wdconinc
wdconinc previously approved these changes Nov 6, 2025
Copy link
Contributor

@wdconinc wdconinc left a comment

Choose a reason for hiding this comment

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

Looks sensible.

// we stop looking if we find the parent has status 1 but with only 2 daughters
// so we don't merge radiative photons with the primary electron as this prevents us
// from properly linking the clusters back to the event geometry
// @TODO this should be a shared utiliy function in the edm4xxx
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you file this as an issue in edm4eic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do - there are multiple copies of this function across multiple algorithms that we could get rid of.

Copy link
Contributor

Choose a reason for hiding this comment

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

Been meaning to ask copilot for code duplication... And enable that as a pre-commit or clang-tidy check...

Copy link
Member

Choose a reason for hiding this comment

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

We should modify other copies too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm unsure as I don't know how they are used - I could see a case where this function could be somewhat configurable depending on use case - it wouldn't be too hard to add a parameter (could be templated or not) to steer the behavior. And/or have multiple versions with explicit different names that should be called by the user for clarity.

Copy link
Member

Choose a reason for hiding this comment

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

It also doesn't make sense to have different definitions under the same name.

I would just make the change and @ruse-traveler can confirm about other use cases.

ruse-traveler
ruse-traveler previously approved these changes Nov 6, 2025
Copy link
Contributor

@ruse-traveler ruse-traveler left a comment

Choose a reason for hiding this comment

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

Good catch!

mhkim-anl
mhkim-anl previously approved these changes Nov 7, 2025
Copy link
Contributor

@mhkim-anl mhkim-anl left a comment

Choose a reason for hiding this comment

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

Looks sensible to me as well

@sly2j sly2j dismissed stale reviews from mhkim-anl, ruse-traveler, and wdconinc via c1133e1 November 7, 2025 21:23
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.

6 participants