Mu2eG4: fix the S0/S1 findings from the static-review audit (#1947) - #1948
Mu2eG4: fix the S0/S1 findings from the static-review audit (#1947)#1948oksuzian wants to merge 8 commits into
Conversation
…f copy number Both disk-edge nestTubs calls named the volume with vdIdDiskEdge but passed vdIdDiskSurf - by then already advanced to the next disk's SurfIn value - as the G4 copy number, which Mu2eG4SensitiveDetector stores as the StepPointMC volumeId. Disk-0 EdgeIn and EdgeOut both wrote id 75, disk-1 both wrote 77. Also restores vdIsVisible in the second call, where a literal 1 sat in the visibility slot. Mu2e#1947 finding 1 (S0). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
saveSimParticleStart admits tracks while the incremented counter is <= _sizeLimit, but saveSimParticleEnd returned at >=, so the track that reached exactly _sizeLimit was persisted with a default-constructed end: endDefined()==false, trackLength -1, although G4 tracked it normally. Match the Start boundary. Mu2e#1947 finding 2 (S1). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
98.5% G4_Al + 1.5% G4_C at 8.05 g/cm3 is mild steel's recipe with Fe replaced by Al - a one-token typo. RackSteel is the STM shielding house SteelMaterial (constructSTM.cc) and 66% of RackElectronics, so the simulated STM shielding was substantially more transparent than steel. Mu2e#1947 finding 3 (S1). Changes STM simulation results; needs STM group sign-off. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… offset The rod-side overlap offset used tan(angle)/spokeRadius - the reciprocal of the correct expression, dimensionally 1/length used as a length. constructStickmanTarget already carries the corrected form with the comment 'seems to be a typo in the hayman'; apply the same expression here. Mu2e#1947 finding 4 (S1). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The notch box spans +-notchWidth/2, so the chord-sagitta correction must use the half-width. With the live v04 values the extension was 15.18 mm instead of 3.76 mm - an ~11.4 mm oversized cut into support ring 2. Mu2e#1947 finding 5 (S1). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The comparator lacked the equality guards of a lexicographic compare, so A<B and B<A could both hold and duplicate z-planes could escape the polycone validity check. Mu2e#1947 finding 6 (S1). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…xpects finishNesting() uses the backwards interpretation of rotations; every sibling ExtMon call site passes rotationInParent.inverse() and documents why. The chiller mother volume passed the un-inverted rotation, placing the three hall chillers with a wrong-signed rotation. Mu2e#1947 finding 7 (S1). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
☔ The build tests failed for 61546d6.
N.B. These results were obtained from a build of this Pull Request at 61546d6 after being merged into the base branch at a7a1ca9. For more information, please check the job page here. |
|
@FNALbuild run build test |
|
⌛ The following tests have been triggered for 61546d6: build (Build queue - API unavailable) |
|
☀️ The build tests passed at 61546d6.
N.B. These results were obtained from a build of this Pull Request at 61546d6 after being merged into the base branch at a7a1ca9. For more information, please check the job page here. |
| void Mu2eG4TrackingAction::saveSimParticleEnd(const G4Track* trk){ | ||
|
|
||
| if( _sizeLimit>0 && _currentSize>=_sizeLimit ) return; | ||
| if( _sizeLimit>0 && _currentSize>_sizeLimit ) return; |
There was a problem hiding this comment.
@gaponenko, can you please also check ExtMon part?
|
On "S1 — Hayman target spoke offset uses an inverted, dimensionally wrong formula": |
|
📝 The HEAD of |
gaponenko
left a comment
There was a problem hiding this comment.
Please revert #61546d68b53c32b85e1a6224c84b08d0469c194e
It breaks geometry.
|
On "STM Racksteel": Joey confirmed the materials are supposed to be steel. |
…estBox expects" This reverts commit 61546d6, per review: it breaks the geometry. constructExtMonFNALChillersInHall composes its rotateY angle (with swapped wall-vector components) to match the callee un-inverted rotation use, so caller and callee are self-consistent as they stand; adding the inverse in the callee flipped the hall chillers out of their tuned orientation. The audit finding stands corrected on the issue. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@gaponenko Reverted in 675ab3e — thank you for catching it. For the record of why the original claim was wrong: |

Fixes the S0 and all six S1 findings from #1947 (static-review audit of
Mu2eG4/). Seven commits, one per finding, so each can be reviewed and reverted on its own. Every finding was hand-verified at the source before fixing; the issue carries the full evidence and arithmetic.EMC_Disk_*_Edge*VD planes now write their own volumeId (77–80) instead of 75/77; the contaminated Disk_1_SurfIn / Disk_0_EdgeIn streams become pure. Any analysis that "used" edge-VD hits before was reading mislabeled data.saveSimParticleEndboundarymaxSimParticleCollectionSize, the last admitted SimParticle now carries real end-of-track info instead ofendDefined()==false.constructStickmanTargetalready uses (its comment: "seems to be a typo in the hayman"). Rod-side spoke-wire endpoints move by the tan²θ error factor; only the +1 mm padding is kept as-is.pConePlane::operator<.inverse()every sibling call site applies; their rotation flips to the intended sign.Validation
g++ -std=c++20 -Wall -Wextra -fsyntax-onlyagainst the Musing include paths (the two-Wunused-parameterwarnings inconstructExtMonFNALInfrastructure.cc:570are in an untouched function and present onmain).gdmldump+ overlap-check pass in CI, and the RackSteel commit a before/after STM rate check by someone with a suitable setup.Productionormu2e-trig-configPR is required.Deliberately not in this PR
The 29 S2 / 2 S3 findings from #1947 (dead code, dormant guards, hand-run-path bugs). Several want maintainer decisions (e.g. whether
sourceProfileReader,DuplicateLogicalVolumeCheckerandconstructStudyEnv_v00*should exist at all) and none affects live production output.🤖 Generated with Claude Code