Skip to content

feat(target): implement 2026 BDF target design - #76

Open
olantwin wants to merge 1 commit into
mainfrom
target-2026
Open

feat(target): implement 2026 BDF target design#76
olantwin wants to merge 1 commit into
mainfrom
target-2026

Conversation

@olantwin

@olantwin olantwin commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the 2026 BDF/SHiP target design, extracted from CATIA model ST1A07710_01_AB.02, replacing the legacy target (19 Ta-clad disks in an Inconel vessel with steel enclosure). This is the GeoModel counterpart of the FairShip TGeo implementation in ShipSoft/FairShip#1361; the two are numerically identical.

  • 33 solid tungsten disks (30–455 mm thick, r 125 mm; the 455 mm rear block has r 157 mm), separated by 4–5 mm He slits, total length 1460 mm
  • Steel core: the two CAD clamp halves merged into one axisymmetric GeoPcon (bore r 125 → 157 mm, outer r 195 → 207 → 190 mm) with the serpentine He cooling grooves subtracted as GeoTubs segments (61° arcs staggered between the upper and lower half, plus a 49° groove around the rear block); the removed volume fills with the parent helium
  • Jacket tube (r 217–225 mm) with front and rear flanges; He annulus between core and jacket
  • Domed rear endcap (8 mm shell) as a single GeoPcon
  • He container spans z −35.8…1509.7 mm (r 237 mm); target frame unchanged (z = 0 at the front face of the first disk = SHiP global origin); vacuum box, Cu/Fe shielding and world placement untouched

The GeoModel mapping is more compact than the TGeo one: the stepped core and the endcap are single polycones instead of boolean unions/cone stacks, leaving only the 10 groove subtractions as boolean nodes.

Design

Cross-sections of the implemented geometry (drawings from the FairShip PR; z = 0 at the first disk front face, dimensions in mm):

x–y section (z ≈ 420 mm)

x-y section

z–x section (horizontal plane, no grooves)

z-x section

z–y section (vertical plane, staggered cooling grooves)

z-y section

Simplifications relative to the CAD model: bolt lugs, key-ways, pipe stubs, fasteners and survey hardware omitted; the endcap dome approximated by three cone segments; the flange/jacket boundary placed at the end of the core front step (55.2 mm instead of the CAD's stepped flange bore at 64.2 mm).

Verification

  • All 43 tests pass, including the geometry-wide OverlapCheck and new target unit tests (disk table positions/radii, tungsten volume sum, He container dimensions, groove subtraction present)
  • build_geometry + validate_geometry succeed; polycone planes and groove tube segments verified in the SQLite output against the CAD extraction
  • GDML export (pixi run gdml) succeeds, confirming Geant4-compatible shapes

Summary by CodeRabbit

  • New Features

    • Updated the target geometry to the 2026 BDF design, featuring 33 tungsten disks, a grooved steel core, steel jacket and flanges, and a domed endcap.
    • Added detailed documentation describing the updated geometry, materials, dimensions, and CATIA-based design.
  • Tests

    • Added coverage validating helium volume, disk placement and dimensions, tungsten volume, and the grooved steel core.

Replace the legacy target (19 Ta-clad disks in an Inconel vessel with
steel enclosure) with the 2026 BDF design extracted from CATIA model
ST1A07710_01_AB.02, simplified to axisymmetric shapes:

- 33 solid tungsten disks (30..455 mm thick, r 125 mm; 455 mm rear
  block with r 157 mm), separated by 4-5 mm He slits, 1460 mm total
- steel core as a single polycone (bore r 125 -> 157, outer
  r 195 -> 207 -> 190) with the serpentine He cooling grooves
  subtracted as tube segments (61 deg arcs staggered top/bottom, plus
  a 49 deg groove around the rear block)
- steel jacket tube (r 217-225) with front and rear flanges and a He
  annulus between core and jacket
- domed rear endcap (8 mm shell) as a single polycone

The He container spans z -35.8..1509.7 mm with r 237 mm; all target z
coordinates are measured from the front face of the first disk (the
SHiP global origin), unchanged from the previous implementation.

Matches the FairShip TGeo implementation of the same design
(ShipSoft/FairShip#1361).
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Target subsystem was migrated from the previous 19-slab design to the 2026 BDF target: 33 tungsten disks in a grooved Steel316L core with helium volume, jacket, flanges, and endcap. Documentation, geometry construction, constants, and tests were updated accordingly.

Changes

2026 BDF Target Geometry

Layer / File(s) Summary
Target geometry contract and documentation
subsystems/Target/include/Target/TargetFactory.h, subsystems/Target/README.md, README.md
Target constants, helper declarations, component hierarchy, materials, dimensions, and implementation-status documentation now describe the 2026 BDF design.
Helium volume and steel-core construction
subsystems/Target/src/TargetFactory.cpp
TargetFactory places the helium volume, constructs the groove-subtracted steel core, and assembles tungsten disks, jacket, flanges, and rear endcap.
2026 geometry validation
subsystems/Target/test_target.cpp
Tests validate helium-volume structure, disk dimensions and aggregate volume, and the Steel316L subtraction shape.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TargetFactory
  participant HeVolume
  participant SteelCoreShape
  participant TargetComponents
  TargetFactory->>HeVolume: create and place helium volume
  HeVolume->>TargetComponents: place 33 tungsten disks
  HeVolume->>SteelCoreShape: create grooved steel core
  SteelCoreShape->>TargetComponents: subtract cooling grooves
  HeVolume->>TargetComponents: add jacket, flanges, and endcap
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: implementing the 2026 BDF target design.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch target-2026

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
subsystems/Target/src/TargetFactory.cpp (1)

68-79: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Hoist heCentreZ into a header constant.

The same derived value is recomputed at line 179 in createHeVolume(). A static constexpr double s_heCentreZ = 0.5 * (s_heZMin + s_heZMax); next to the He bounds keeps the two placements provably consistent.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@subsystems/Target/src/TargetFactory.cpp` around lines 68 - 79, Define a
static constexpr s_heCentreZ beside the existing helium bounds constants, then
replace the local heCentreZ calculation in the placement code and the duplicate
computation inside createHeVolume() with this shared constant. Preserve both
existing placement calculations while ensuring they use the same derived center
value.
subsystems/Target/include/Target/TargetFactory.h (1)

117-132: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Tie the array extent to s_numDisks.

createHeVolume() loops to s_numDisks and indexes s_diskZ[i], so a future edit to one and not the other becomes a silent out-of-bounds read instead of a compile error. Values themselves check out (33 entries, 1330 mm W, 0–1460 mm span).

♻️ Proposed change
-    static constexpr std::array<std::array<double, 2>, 33> s_diskZ = {{
+    static constexpr std::array<std::array<double, 2>, static_cast<std::size_t>(s_numDisks)>
+        s_diskZ = {{

Or keep the literal and add static_assert(s_diskZ.size() == static_cast<std::size_t>(s_numDisks));.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@subsystems/Target/include/Target/TargetFactory.h` around lines 117 - 132, Tie
the s_diskZ array extent directly to s_numDisks so createHeVolume() cannot
iterate beyond its declared storage after future edits. Replace the hard-coded
extent in s_diskZ with the existing s_numDisks symbol, or add a static_assert
comparing s_diskZ.size() with s_numDisks if the literal must remain.
subsystems/Target/test_target.cpp (1)

58-59: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider asserting the jacket/flange/endcap children too.

Children 34–37 are currently only covered by the count check. A few assertions on jacket RMin/RMax (217/225), the flange z spans, and the endcap polycone plane count/last-plane z would lock down the He-annulus and rear-closure numbers introduced here.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@subsystems/Target/test_target.cpp` around lines 58 - 59, Extend the
assertions near the existing heVolume child-count check to validate children
34–37 individually: assert the jacket RMin/RMax values of 217/225, verify both
flange z spans, and check the endcap polycone plane count and final-plane z.
Keep the existing child-count assertion and use the established child-volume
access and geometry APIs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@subsystems/Target/include/Target/TargetFactory.h`:
- Around line 117-132: Tie the s_diskZ array extent directly to s_numDisks so
createHeVolume() cannot iterate beyond its declared storage after future edits.
Replace the hard-coded extent in s_diskZ with the existing s_numDisks symbol, or
add a static_assert comparing s_diskZ.size() with s_numDisks if the literal must
remain.

In `@subsystems/Target/src/TargetFactory.cpp`:
- Around line 68-79: Define a static constexpr s_heCentreZ beside the existing
helium bounds constants, then replace the local heCentreZ calculation in the
placement code and the duplicate computation inside createHeVolume() with this
shared constant. Preserve both existing placement calculations while ensuring
they use the same derived center value.

In `@subsystems/Target/test_target.cpp`:
- Around line 58-59: Extend the assertions near the existing heVolume
child-count check to validate children 34–37 individually: assert the jacket
RMin/RMax values of 217/225, verify both flange z spans, and check the endcap
polycone plane count and final-plane z. Keep the existing child-count assertion
and use the established child-volume access and geometry APIs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 64f31197-1673-47af-85c1-5ac6f93edb41

📥 Commits

Reviewing files that changed from the base of the PR and between 626e0bb and 54835e8.

📒 Files selected for processing (5)
  • README.md
  • subsystems/Target/README.md
  • subsystems/Target/include/Target/TargetFactory.h
  • subsystems/Target/src/TargetFactory.cpp
  • subsystems/Target/test_target.cpp

@olantwin olantwin linked an issue Jul 29, 2026 that may be closed by this pull request
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.

Implement new target design

1 participant