Skip to content

Smart tracking volume#69

Draft
DraTeots wants to merge 18 commits into
mainfrom
smart-tracking-volume
Draft

Smart tracking volume#69
DraTeots wants to merge 18 commits into
mainfrom
smart-tracking-volume

Conversation

@DraTeots
Copy link
Copy Markdown
Contributor

Briefly, what does this PR introduce? Please link to any relevant presentations or discussions.

Adds a new DD4hep/Geant4 plugin Geant4TVEicParticleHandler in
npsim/src/plugins/. It runs the standard tracking-volume filter (verbatim
from upstream Geant4TVUserParticleHandler) and then layers an EIC-specific
regional cut: drop particles ending at endZ > ForwardRegionZ or
endZ < BackwardRegionZ whose |p| is below the configured threshold,
unless they are primary, KEEP_ALWAYS, or made a tracker hit. Calorimeter
hits are optionally protected via the KeepCaloHitParticles property
(default off — matches upstream policy and reduces shower bloat).

Configurable plugin properties (all in DD4hep units):

  • ForwardRegionZ (default +335 cm),
  • BackwardRegionZ (-175 cm),
  • ForwardMomentumMin (100 MeV),
  • BackwardMomentumMin (100 MeV),
  • KeepCaloHitParticles (false).

User-facing doc: npsim/src/plugins/doc/Geant4TVEicParticleHandler.md.
Closes #__.

What is the urgency of this PR?

  • High
  • Medium
  • Low

What kind of change does this PR introduce?

  • Bug fix
  • New feature (issue #__)
  • Optimization
  • Updated documentation
  • other

Please check if any of the following apply

  • This PR introduces breaking changes.
  • This PR changes default behavior. (Opt-in: nothing changes unless the user sets SIM.part.userParticleHandler = "Geant4TVEicParticleHandler".)
  • AI was used in preparing this PR. Mainly for user-facing markdown doc and comments in code.

There are several considerations made:

  1. I thought putting variables to epic tracking_region.xml and reading them as parameters. But that would require both canges here and in epic. So I decided not to overcomplicate things. At least until they are thoroughly tested.
  2. Do flexible parameters such as to add regions and define pmin for each region - again, decided not to complicate stuff.
  3. Save particles that made hits to calorimeters. Made off by default to test how this influence stuff.

@DraTeots DraTeots requested a review from veprbl May 28, 2026 19:03
@DraTeots DraTeots marked this pull request as draft May 28, 2026 19:04
@DraTeots
Copy link
Copy Markdown
Contributor Author

Will now put some plots how this affect stuff

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

Comment thread .idea/editor.xml Outdated
/// are dropped (p.reason = 0), subject to the must-keep guards in end().
/// Defaults match the legacy tracker_region_zmax / tracker_region_zmin
/// constants from epic/compact/tracking_region.xml.
double m_forwardZ{335 * dd4hep::cm}; ///< +Z dead-zone boundary (positive)
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.

Explicit geometry values should be gotten from geometry, not hardcoded here.

Comment thread src/plugins/src/Geant4TVEicParticleHandler.md Outdated
Comment thread src/dd4pod/python/npsim.py Fixed
DraTeots and others added 2 commits May 29, 2026 14:48
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Comment thread src/dd4pod/python/npsim.py Fixed
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Comment thread src/dd4pod/python/npsim.py Fixed
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.

3 participants