Skip to content

fix: encapsulate solenoid components in unified detector plugin#1127

Open
wdconinc wants to merge 3 commits into
mainfrom
solenoid-encapsulation
Open

fix: encapsulate solenoid components in unified detector plugin#1127
wdconinc wants to merge 3 commits into
mainfrom
solenoid-encapsulation

Conversation

@wdconinc

@wdconinc wdconinc commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Briefly, what does this PR introduce?

This PR refactors the solenoid magnet geometry to encapsulate all three components (EndcapN, Barrel, EndcapP) within a single tube volume, using a unified detector plugin. This optimizes the geometry navigation in the world volume to avoid queries for all layers, and replaces it with a single cylinder envelope.

Changes:

  • Unified three separate detector instances into a single Solenoid detector with component-based structure
  • Created envelope tube volume to contain all solenoid components
  • Merged barrel (epic_Solenoid) and endcap (epic_SolenoidEndcap) detector logic into single plugin
  • Restructured compact/solenoid.xml with <component> elements for EndcapN, Barrel, and EndcapP
  • Maintained all existing material constants and dimensional parameters
  • Preserved DetElement hierarchy but removed PhysVolID scheme

Benefits:

  • Improved geometry organization with logical encapsulation
  • Cleaner XML structure with component-based hierarchy
  • Single detector plugin reduces code duplication
  • Easier to maintain and extend

What is the urgency of this PR?

  • Low

What kind of change does this PR introduce?

  • Optimization (structural refactoring)

Please check if any of the following apply

  • This PR changes default behavior.

All three solenoid components are now contained within a single detector instance with an envelope volume, changing the detector hierarchy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 7, 2026 14:48

Copilot AI left a comment

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.

Pull request overview

This PR refactors the solenoid geometry to use a single epic_Solenoid detector plugin with an envelope tube volume and three nested <component> sections (EndcapN, Barrel, EndcapP), replacing the previous multiple-detector layout in compact/solenoid.xml.

Changes:

  • Introduces an explicit solenoid envelope tube volume in Solenoid_geo.cpp and places component assemblies inside it.
  • Merges barrel and endcap construction logic into one plugin driven by <component type="barrel|disk"> XML elements.
  • Restructures compact/solenoid.xml into a single <detector name="Solenoid"> containing <envelope> and <component> children.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Solenoid_geo.cpp Implements unified solenoid detector: envelope volume + component iteration for barrel/endcaps.
compact/solenoid.xml Replaces 3 detectors (barrel/endcaps) with one detector containing <envelope> and <component> blocks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Solenoid_geo.cpp
wdconinc and others added 2 commits June 7, 2026 09:54
The SimpleDiskDetector plugin was only used for the solenoid endcaps
(epic_SolenoidEndcap and epic_ref_SolenoidEndcap). Since the endcap
geometry logic has been merged into the unified Solenoid plugin, this
file is no longer needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The solenoid is purely passive material (magnet cryostat structure)
with no sensitive detectors. It never produces hits, so PhysVolID
assignments are unnecessary and have been removed to simplify the code.

This addresses the PR feedback about the changed PhysVolID scheme.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@wdconinc wdconinc changed the title Encapsulate solenoid components in unified detector plugin fix: encapsulate solenoid components in unified detector plugin Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants