Skip to content

Size the degrader mother volume to its contents - #1927

Merged
oksuzian merged 1 commit into
mainfrom
run1b-degrader-fix
Aug 10, 2026
Merged

Size the degrader mother volume to its contents#1927
oksuzian merged 1 commit into
mainfrom
run1b-degrader-fix

Conversation

@oksuzian

@oksuzian oksuzian commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Sizes the pion degrader's mother volume to its contents.

The bug

The mother's half-width was computed as 2*filter_hl + frame_hl + 1 while its
children were placed from a different expression, so the mother overran its
contents downstream — by 1.9 mm in nominal geometries and 9.65 mm with
geom_run1_b_v40.txt, whose filter is 8.75 mm half-length rather than 1.00 mm.

On v40 that overrun produced two real Geant4 overlaps:

Overlap is detected for volume Degrader:0 (G4Box) with protonabs3:0 (G4SubtractionSolid)
  overlap at local point (219.934,-404.385,-2025.8) by 3.7 mm  (max of 73 cases)
Overlap is detected for volume degraderSupportPlate:0 (G4Box) with Degrader:0 (G4Box)
  overlap at local point (287.173,-70.8224,22.55) by 2.3 mm  (max of 175 cases)

Both reproduce exactly from the geometry constants. The support-plate case:
the old v40 mother's downstream face sits at 4258.85 + 24.85 = 4283.70, and
the plate's front face at 4235 + 245 - 186 - 6.25 - 0.1 - 6.25 = 4281.40
a 2.30 mm overlap, matching what Geant4 reports.

Nominal was never affected: its mother face at 4252.70 is already 8.7 mm clear
of a plate face at 4261.40.

The fix

Size the mother as filter_hl + frame_hl + 0.1 and place the filter at its
upstream edge with the frame directly downstream. With surface checking
enabled (g4.doSurfaceCheck = true), v40 goes from 2 overlaps to 0.

Effect on nominal running

The degrader is built in nominal geometries — degrader_v02.txt sets
degrader.build = true, and "off by default" means rotation = 120.0, swung
out of the beam rather than absent. So this is not dead code and the nominal
gdml dump does change. It changes in a bounded way:

No material moves. The Degrader mother is filled with DSVacuum and sits
inside DS2Vacuum, which is also DSVacuum — resizing it displaces nothing.
The filter, frame, rod and counterweight all keep their exact absolute z:

volume absolute z, nominal absolute z, v40
filter 4236.00 → 4236.00 4243.75 → 4243.75
frame 4243.35 → 4243.35 4258.85 → 4258.85
rod 4243.35 → 4243.35 4258.85 → 4258.85
counterweight 4243.35 → 4243.35 4258.85 → 4258.85

The normalized gdml diff against geom_common.txt and geom_run1_a.txt is 39
lines each and identical between them. 34 of those lines are file reordering
(the filter is now emitted before the frame; degraderFrame's solid is
byte-identical). The remaining changes are the degraderOutline box dimension,
the degraderMother placement, and three compensating child offsets that exist
precisely so the absolute positions above stay fixed. x and y are untouched
throughout, and no volume outside the degrader assembly appears in either diff.

Step boundaries do shift even where material does not, so re-simulations will
not be bit-reproducible against earlier output.

One deliberate deviation from the Run1B branch

The branch also rewrote location2InMu2e to reuse the mother-centre
expression, which dragged degraderCounterweight upstream by 0.90 mm in
nominal and 8.65 mm on v40 — leaving it non-coplanar with the rod it
counterbalances. That reads as incidental rather than intended, so this PR
keeps the original dgr_z0 + 2.0*filterDims.at(2) + frameDims.at(2). Neither
overlap involves the counterweight, and the 0-overlap result was re-measured
after the revert to confirm the fix still holds. @sdifalco / Run1B authors:
please confirm this was not deliberate.

Minor, noted not fixed

The filter's upstream face is exactly flush with the mother wall — all 0.2 mm
of slack sits downstream. Legal and overlap-free, but coincident surfaces are
generally discouraged, and on v40 that filter is in the beam. Happy to bias the
filter 0.1 mm downstream if reviewers prefer.

The degrader mother half-width came from 2*filter_hl + frame_hl + 1
while its children were placed from a different expression, leaving the
mother oversized and overrunning its contents downstream. Sizes it as
filter_hl + frame_hl + 0.1 and places the filter at its upstream edge
with the frame directly downstream.

No material moves. The mother volume is DSVacuum sitting inside
DS2Vacuum, which is also DSVacuum, so resizing and re-centring it
displaces nothing; and the filter, frame and rod keep identical
absolute z, read out of the gdml dumps -- nominal filter z = 4236.00
mm, frame and rod z = 4243.35 mm; with geom_run1_b_v40.txt filter
z = 4243.75 mm, frame and rod z = 4258.85 mm. Their offsets inside the
mother change only to compensate for the mother's own shift.

The mother half-width goes 9.35 -> 7.45 mm in nominal geometries and
24.85 -> 15.20 mm with geom_run1_b_v40.txt's 1.75 cm plate, and its
centre moves upstream by 0.90 mm and 8.65 mm respectively. On v40 the
old downstream face sat at z = 4283.70 mm and overlapped protonabs3 by
3.7 mm and degraderSupportPlate by 2.3 mm. A surface-check run
(g4.doSurfaceCheck over 10486 volumes) reports both overlaps before the
change and none after.

degraderCounterweight is deliberately left at its original expression,
z0 + 2*filter_hl + frame_hl. That is a one-line deviation from the
Run1B branch, which retied it to the new mother-centre expression and
so moved it 8.65 mm out of plane with the rod it counterbalances on
v40. Leaving it alone costs nothing -- the v40 surface check still
reports zero overlaps -- and keeps the counterweight coplanar with the
frame and rod.

Note the degrader IS built in nominal running -- degrader_v02.txt sets
degrader.build = true, and 'off by default' means rotation = 120 deg,
out of the beam. The nominal gdml diff is therefore non-empty but
bounded: 39 lines against both gdmldump.fcl and gdmldump_run1_a.fcl,
covering the degraderOutline box z, the Degrader mother placement, the
three compensating child offsets, and the reordering that follows from
placing the filter before the frame. Every volume outside the degrader
assembly is byte-identical.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@FNALbuild

Copy link
Copy Markdown
Collaborator

Hi @oksuzian,
You have proposed changes to files in these packages:

  • Mu2eG4

which require these tests: build.

@Mu2e/write, @Mu2e/fnalbuild-users have access to CI actions on main.

⌛ The following tests have been triggered for fd1a90b: build (Build queue - API unavailable)

About FNALbuild. Code review on Mu2e/Offline.

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

This looks good to me, bringing in the degrader positioning fixes

@FNALbuild

Copy link
Copy Markdown
Collaborator

☀️ The build tests passed at fd1a90b.

Test Result Details
test with Command did not list any other PRs to include
merge Merged fd1a90b at 1891b32
build (prof) Log file. Build time: 04 min 19 sec
ceSimReco Log file.
g4test_03MT Log file.
transportOnly Log file.
POT Log file.
g4study Log file.
cosmicSimReco Log file.
cosmicOffSpill Log file.
ceSteps Log file.
ceDigi Log file.
muDauSteps Log file.
ceMix Log file.
rootOverlaps Log file.
g4surfaceCheck Log file.
trigger Log file.
check_cmake Log file.
FIXME, TODO ➡️ TODO (2) FIXME (2) in 1 files
clang-tidy ➡️ 2 errors 267 warnings
whitespace check no whitespace errors found

N.B. These results were obtained from a build of this Pull Request at fd1a90b after being merged into the base branch at 1891b32.

For more information, please check the job page here.
Build artifacts are deleted after 5 days. If this is not desired, select Keep this build forever on the job page.

@sdifalco sdifalco left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The suggested fix solves the problem

@oksuzian
oksuzian merged commit ec715c3 into main Aug 10, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants