Skip to content

feat(muonshield): add concrete floor blocks under the magnets - #1544

Open
Gfrisella wants to merge 1 commit into
ShipSoft:mainfrom
Gfrisella:feat/ms-floor-concrete
Open

Gfrisella wants to merge 1 commit into
ShipSoft:mainfrom
Gfrisella:feat/ms-floor-concrete

Conversation

@Gfrisella

@Gfrisella Gfrisella commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Fill the space between the cavern floor and the muon shield magnets M2 to M7 with concrete blocks of the magnet width and length, from a floor gap above the floor to 30 cm below the magnet. A block is split where the floor steps down from TCC8 to ECN3, and none is built over the stair step itself.

The blocks are listed per shield in shield_db as [magnet row, floor gap] pairs; M5 leaves 1 m of air above the ECN3 floor for electronics. They are named FloorBlock_M<n>_<i>, without "Magn", so newMuonDIS does not count them as muon shield. Geometry files made before this do not build the blocks.

Assisted-by: Claude Code:claude-opus-5-5

Checklist

Summary by CodeRabbit

  • New Features
    • The TRY_2026 muon-shield geometry now includes concrete floor blocks beneath magnet rows 2–7. Blocks follow the cavern floor levels and stop before the stair-step area.
    • The row 5 block leaves a 1 m clearance above the ECN3 floor for electronics.
    • Geometry files created before this change do not include the new floor blocks.

@Gfrisella
Gfrisella requested a review from olantwin as a code owner November 5, 2026 16:10
@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds floor-block settings for TRY_2026 magnets M2–M7 and passes them to muon-shield geometry construction. The geometry code creates concrete blocks below configured magnets, split around the cavern stair-step interval.

Changes: Muon-shield floor blocks

Layer / File(s) Summary
Floor-block configuration and API
passive/ShipMuonShield.h, stubs/ROOT/__init__.pyi, python/geometry_config.py
The shield configuration defines floor gaps for magnet rows 2–7. ShipMuonShield adds APIs and state for cavern-step and floor-gap settings.
Runtime configuration wiring
python/shipDet_conf.py
When floor_blocks is present, configure sets the cavern step and passes each magnet and floor-gap pair to ShipMuonShield.
Concrete floor-block geometry
passive/ShipMuonShield.cxx, CHANGELOG.md
Geometry construction creates concrete blocks for configured magnets. It splits blocks across the TCC8 and ECN3 floor regions, skips the stair-step interval, and omits invalid intersections. The changelog describes the TRY_2026 block dimensions, gaps, and naming.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant ShieldConfig as shield_db TRY_2026
  participant CreateConfig as create_config
  participant Configure as configure
  participant MuonShield as ShipMuonShield
  ShieldConfig->>CreateConfig: floor_blocks settings
  CreateConfig->>Configure: c.muShield.floor_blocks
  Configure->>MuonShield: SetCavernStep and AddFloorBlock
  MuonShield->>MuonShield: CreateFloorBlocks for configured magnets
Loading

Suggested reviewers: olantwin, thanae

Merge Risk: Minimal · up to 341bb

This change adds concrete floor blocks under the muon-shield magnets M2–M7 for the TRY_2026 configuration. Older geometry files are unaffected. No actionable merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(muonshield): add concrete floor blocks under the magnets" names the main change. The changeset adds floor-block creation under the muon shield magnets in ShipMuonShield, the shield_db …
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.
Description check Passed The description explains what the PR does: concrete blocks fill the space between the cavern floor and muon shield magnets M2 to M7, with the geometry, the shield_db configuration format, the M5 air g…
Full details: Title check

Explanation

The title "feat(muonshield): add concrete floor blocks under the magnets" names the main change. The changeset adds floor-block creation under the muon shield magnets in ShipMuonShield, the shield_db configuration, and the related Python wiring. The title follows conventional commit form and is specific enough for a reader scanning history.

Full details: Description check

Explanation

The description explains what the PR does: concrete blocks fill the space between the cavern floor and muon shield magnets M2 to M7, with the geometry, the shield_db configuration format, the M5 air gap, the FloorBlock naming, and the compatibility impact on older geometry files. It also includes the template's checklist items. Both checklist items are unchecked, and the changelog summary shows the CHANGELOG.md was updated, so the checkbox state does not match the diff. The commit message conventions are not described in the description. Overall the description is mostly complete and the required content is present.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c7551b13-7b52-4dc1-b79f-eda0712134ed
Commits

Reviewing files that changed from the base of the PR and between c2f2629 and 341bb0f.

Files selected for processing: 6

  • CHANGELOG.md
  • passive/ShipMuonShield.cxx
  • passive/ShipMuonShield.h
  • python/geometry_config.py
  • python/shipDet_conf.py
  • stubs/ROOT/__init__.pyi

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@olantwin

Copy link
Copy Markdown
Contributor

This seems more complicated than it needs to be. Review comments to follow, including some suggestions for simplification, but in general this could be a lot simpler, if we just remove the shield_db. With TRY2026, it has now outlived its purpose and we can just implement the one shield configuration directly in C++.

@olantwin

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@olantwin

Copy link
Copy Markdown
Contributor

Please resolve the merge conflicts and trigger a coderabbit review

@olantwin olantwin 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.

One real problem is the block naming, which the muon DIS code picks up (inline). I also think the configuration can be cut down a lot without changing which blocks get built; there's a suggestion inline.

Please rebase to resolve the merge conflicts.

Comment thread passive/ShipMuonShield.cxx Outdated
if (z2 <= z1 || y_top <= y_bottom) {
continue;
}
TString name = magnetName + Form("_FloorBlock%d", ++n_blocks);

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.

The blocks are named Magn2_FloorBlock1 and so on, and newMuonDIS decides what belongs to the muon shield by looking for "Magn" in the volume name (MuGeoProcessor::CacheGeometry, MuonPath::GetLabel). The concrete therefore ends up in fShieldVolumes and is labelled "MS". It counts towards the 20 cm kMuonShieldTailZ cut-off in backward tracing, and DIS sampled "in the shield" can land in it. Could you give the blocks a name without "Magn", e.g. FloorBlock_M2_1?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the blocks are renamed FloorBlock_M_, so newMuonDIS no longer picks them up.

Comment thread python/geometry_config.py Outdated
# FloorGap above the floor and MagnetGap below the magnet. Set FirstMagnet
# to -1 to build none.
c.muShield.FloorBlocks = AttrDict()
c.muShield.FloorBlocks.FirstMagnet = 2

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.

I think this could be simpler for the same result. M4 and M5 are the only magnets over the stair step, and NoStairStep = [4, 5] skips both, so the stair segment never builds a block. The three knobs are also row numbers for TRY_2026 that get set for every shieldName.

How about one list per shield in shield_db, next to params:

# [magnet row, floor gap]: concrete from the floor (+ gap) to 30 cm below the magnet. 
# M5 leaves 1 m of air above the ECN3 floor for electronics.
"floor_blocks": [[2, 0.1], [3, 0.1], [4, 0.1], [5, 100.0], [6, 0.1], [7, 0.1]], 

and never building over the stair? CreateFloorBlocks then only needs two floor levels (TCC8 up to z_transition, ECN3 from the end of the step), and the C++ side gets a single AddFloorBlock(magnet, floor_gap). That removes FirstMagnet and its -1 sentinel, NoStairStep, SkipFloorBlockOnStair and FloorGapPerMagnet. It also makes a new shield state its own blocks. (Pairs rather than a dict, since dumps_json would turn int keys into strings.)

Or as mentioned in my previous comment, we could probably now just hard code things and remove a lot of config code for the muon shield.

Comment thread python/shipDet_conf.py Outdated
ship_geo.cave.z_transition,
ship_geo.cave.stair_step_length,
)
for magnet in blocks.get("NoStairStep", []): # absent in older geometry files

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.

With the list above this becomes a single for magnet, gap in ship_geo.muShield.get("floor_blocks", []):. As it stands, the .get() fallbacks for NoStairStep/FloorGapPerMagnet aren't needed: those keys arrived with FloorBlocks. And a typo would quietly build the stair blocks.

Comment thread passive/ShipMuonShield.cxx Outdated
continue;
}
TString name = magnetName + Form("_FloorBlock%d", ++n_blocks);
LOG(info) << "Floor block " << name << ": y = [" << y_bottom << ", "

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.

CreateMagnet logs at debug; info here adds six lines to every job.

Fill the space between the cavern floor and the muon shield magnets
M2 to M7 with concrete blocks of the magnet width and length, from a
floor gap above the floor to 30 cm below the magnet. A block is split
where the floor steps down from TCC8 to ECN3, and none is built over
the stair step itself.

The blocks are listed per shield in shield_db as [magnet row, floor
gap] pairs; M5 leaves 1 m of air above the ECN3 floor for electronics.
They are named FloorBlock_M<n>_<i>, without "Magn", so newMuonDIS does
not count them as muon shield. Geometry files made before this do not
build the blocks.

Assisted-by: Claude Code:claude-opus-5-5
@Gfrisella
Gfrisella force-pushed the feat/ms-floor-concrete branch from 234e139 to 341bb0f Compare November 16, 2026 08:53

This branch has not been deployed

No deployments
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.

2 participants