Repository navigation
KinKalGeom passive material: match the G4 strongbacks, DS end walls, concrete and hatch; add KinKalGeomCheck - #2109
Conversation
|
Hi @RobMina,
which require these tests: build. @Mu2e/write, @Mu2e/fnalbuild-users have access to CI actions on main. ⌛ The following tests have been triggered for 7fcbd6a: build (Build queue - API unavailable) |
|
☀️ The build tests passed at 7fcbd6a.
N.B. These results were obtained from a build of this Pull Request at 7fcbd6a after being merged into the base branch at b24d416. For more information, please check the job page here. |
oksuzian
left a comment
There was a problem hiding this comment.
PR Review Summary — #2109
Reviewed at head 7fcbd6a7b365052a79f33f7da3330dbd885b6b1b. First pass.
Decision
- 🟢 approve. This review covers only the new commit
7fcbd6a7("Fixes for KinKal geometry"). The other four commits are Offline#2084, which my review there covers (approved at445cd49a). I checked every fix the description lists against GDML dumps of the Run 1A and Run 2 G4 geometries, independently of the PR's new check module, and every element I compared agrees with G4 to 0.1 mm. On the 9,314-event off-spill sample no fit losesFitOK, the strongback double counting my #2084 review found is gone, and the CRV-T1/T2 seam now adds one module of material instead of two. One question, not blocking: the commit doubles the DS thermal-shield end walls, which G4 does not have at all (finding 1). FNALbuild build 3562 passed every test at this head.
Scope understood
KinKalGeomMaker.cc(+183 −305): strongbacks built from the CRV aluminium sheet 0 of each sector's modules, at full thickness; DS cryostat and shield end walls at full thickness over rIn2..rOut1; the Run 1A hatch slab with the hall's axis mapping; the Run 2ExtShieldDownstreamconcrete decoded block by block into one slab per row.KinKalGeom/inc/CRV.hhandKKExtrap.hh: each CRV sector carries its layers' offsets and bar spans, and a CRV crossing addslayerFractionof the module thickness, so two overlapping sectors add one module together.- New
KinKalGeomCheckmodule, helper and three fcl files: a geometry-only job that checks the KinKal elements for overlaps and, given a GDML file, against G4. It is not in any production or validation job; a CI job needs a separateMu2e/codetoolschange, as the description says. - Merge order: this PR contains #2084 and must merge after it.
Findings
-
🟡 [S2] The DS thermal-shield end walls now carry the full 12.7 mm of aluminium, but G4 has no such walls.
- Evidence:
KinKalGeomMaker.cc:362-365buildsDS_Front/DS_Backindex 2 at r 1022.7-1237.3 with2.0*ds->shield_endWallHalfLength().constructDS.cc:222-240builds only the inner and outer shield cylinders (DSInnerThShieldShell,DSOuterThShieldShell). The PR's own check confirms it: with the G4 GDML, every sampled point ofDS_Front_2andDS_Back_2isDSVacuum(match 0, both geometries). On the off-spill sample with the production setting, 126KKCHmucrossings of these two walls now lose a median 17.2-17.7 MeV/c each, up from 8.0-8.9. - The description lists the missing G4 walls as an open question, but the commit still doubles them, which moves KinKal further from the G4 geometry the PR aims to match.
- Suggested fix: either drop the two shield end walls until the geometry question is settled, or say why the real shield has end walls and leave a note (or an issue) to add them to G4.
- Evidence:
-
⚪ [S3] Small items.
KinKalGeomCheck.cc(262 lines, used only by the check module) is compiled intolibmu2e_KinKalGeom, which every reconstruction job loads (KinKalGeom/CMakeLists.txt:7,SConscript). It could live with the plugin.- Please link #2109 from #2084's description, which still has a
<follow-up PR link>placeholder for the seam handling.
Checked against the G4 geometry (GDML of the CI build of main b24d4163, which this PR does not change)
- 🟢 Strongbacks. Each KinKal strongback equals the union of its sector's G4
CRSAluminumSheet_*_*_0boxes: all 2 in Run 1A and all 23 in Run 2, in position, extent and 12.7 mm thickness, to 0.1 mm. In Run 1A, T1 spans z 4088.4-18135.2 and T2 18138.9-20614.7, a 3.7 mm gap; at445cd49athey overlapped, which is where my #2084 re-review found coincident strongback crossings. The CRV-U strongback sits at z −2416.0, upstream of its sector midplane (−2355.8), and the D1-D4 strongbacks at z 18688.5, downstream of theirs (18628.3), as the G4 sheets do (z −2422.4 to −2409.7 and 18682.2 to 18694.9). - 🟢 DS cryostat end walls. KinKal r 969.05-1303, 30 mm thick at z 3254 and 14124, equal to G4
DSUpEndWallShellandDSDownEndWallShell(z 3239-3269 and 14109-14139). - 🟢 Run 1A hatch. The KinKal slabs span x −7587 to −221, y 3631.6 to 4546.0, z 3962.5 to 22707.7 and 22707.75 to 25542.25, equal to G4
dsAreaHatchBlockanddsAreaHatchBlockE. - 🟢 Run 2 concrete. The main roof slab (x −6365.5 to −1442.5, y 1549.15 to 2463.05, z 2694.75 to 18542.05), the upstream roof (x −6345.3 to 552.5, z −2232.9 to 2690.1) and the north wall (x −2352.1 to −1442.7, y −2311.7 to 1548.9, z 2948.9 to 15745.5) match the envelopes of the G4
ExtShieldDownstreamBoxblocks of those rows. The endcap side columns start at z 15745.55, where the side walls end, and stop at the roof's bottom face. G4 blocks outside these rows, such as the north-wall block at z 1463 to 3401, have no KinKal slab, consistent with the description's list of concrete not modelled. - 🟢
KinKalGeomCheckas committed.kinkalGeomCheck.fclandkinkalGeomCheck_run2.fclexit 0 with "internal PASS": no overlapping elements, no coplanar same-material planes, and in every CRV overlap band (Run 1A T1/T2; 12 pairs in Run 2) the summed layer fraction stays between 0.75 and 1. With the G4 GDML, the CRV layer spans agree with the G4 scintillator on 99.8 to 99.9 % of points in every sector, and the tracker-to-CRV column density reproduces the description's table (Run 1A T1 368 against 378 g/cm², T2 583 against 608). The G4 comparison is report-only, so both jobs print "G4 FAIL" and exit 0: on the coil (0.70), the two shield end walls (finding 1) and, in Run 2, the concrete the description lists as not modelled.
Measured, this head against 445cd49a (the #2084 head)
- 🟢 Off-spill cosmics, 9,314 events, validation setting (
KKCHmufield correction on). Track counts,FitOKandExtrapolationFailedare unchanged in every collection.- Hatch concrete: 8 crossings before, 7,585 after (two Gauss planes per slab crossing), with a median of 268 MeV/c per plane.
RangedOutonKKCHmu: 52 tracks before, 80 after (31 gained, 3 lost).- Strongbacks: median |dP| per crossing 3.0 MeV/c before, 6.3 after.
- Seams: the 5 coincident strongback pairs are gone. The CRV-T1/T2 pair on 1430:0:90791 is still recorded on both sectors, but adds 34.8 + 34.8 MeV/c instead of 71.5 + 71.6.
- Cryostat end walls: median |dP| doubles (20 to 41 MeV/c at the back, 44 to 90 at the front), and the 3 coincident
DS_CryoInner/DS_Backpairs are gone with the rIn2 inner edge. - 14
KKCHmufit summaries change (saved segments, and momentum at t0 on 7), all through the extrapolated pieces.
- 🟢 Production setting (field correction off). Again no
FitOKorExtrapolationFailedchange.RangedOutgoes from 106 to 149 tracks (45 gained, 2 lost). The 2 strongback pairs are gone, and the T1/T2 pair on 1430:0:50204 adds 83.9 + 26.7 MeV/c instead of 113.2 + 113.4. 56KKCHmusummaries change, the momentum at t0 on 34, by a median 117 MeV/c, a median 0.29 of the reported error. - 🟢 Nightly
reco_03, all 16,508 events, defaults. Every printedKalSeedin every collection is identical to445cd49a: track counts, fit summaries, flags and every intersection. The on-spill fits do not reach the CRV, the concrete or the DS end walls. - 🟢 Build and test. A full
muse buildof this head (Production94a4d81f, mu2e-trig-config5999ffa2, p110) finished with exit status 0 and no warnings, andExtrapolateSweepTestreports "all checks passed". The clang-tidy errors in build 3562 are all incetlib/LibraryManager.h.
Validation check
- Build/tests run: yes. One
muse build,ExtrapolateSweepTest, fourKinKalGeomCheckjobs (Run 1A and Run 2, with and without the G4 GDML), the off-spill sample in both settings andreco_03on all 16,508 events. All jobs exited with status 0. - Config contract check: pass. The new module uses validated FHiCL; no existing fcl or parameter changes.
- Cross-repo consistency: pass. Nothing outside Offline configures
KinKalGeomCheck.
Residual risk
- Not checked: a Run 2 reconstruction sample (the Run 2 changes are checked here by geometry only, as in the description), resolution against MC truth at the CRV (the description's truth comparison is the author's), a Regrow job and the extracted geometry.
Author follow-ups
- Decide what to do with the shield end walls (finding 1).
- Optional: the small items in finding 2.
|
Thanks for this Rob. |
brownd1978
left a comment
There was a problem hiding this comment.
Can you please add a comment what execution time change these additions cause? Thanks.
|
Thanks Dave, I moved the KinKalGeomCheck code into the module itself so that it no longer compiles into the library. In testing for this PR I see execution time changes of <1%, smaller than the run-to-run spread of times for the same build. |
oksuzian
left a comment
There was a problem hiding this comment.
PR Review Summary — #2109
Reviewed at head 2fc98b79ff4025133fb4d2d70208a5c4f4eef3f9. Re-review of 7fcbd6a.
Decision
- 🟡 comment now, approve when green. I would approve this code. The merge of
mainchanges nothing in this PR's own diff, and the new commit is a pure move that fixes my small item about the check code living in the reconstruction library. Againstmainb6462a04, the off-spill outputs change exactly as they did against #2084's head, and nightlyreco_03is identical. The question about the DS thermal-shield end walls is still open and does not block (finding 1). FNALbuild has not built this head:mu2e/buildtesthas no status at2fc98b79(checked 23:40 UTC). I am triggering it and will approve once the build at2fc98b79is green.
What changed since 7fcbd6a
5f8edc2amergesmainb6462a04, which now has #2084, #2103 and #2106. The PR's diff againstmainat5f8edc2aequals its old diff against #2084's head445cd49aline for line (12 files, +944 −307), so nothing from #2084, #2103 or #2106 is reverted or repeated.2fc98b79deletesKinKalGeom/inc/KinKalGeomCheck.hhandsrc/KinKalGeomCheck.ccand moves their code intoKinKalGeomCheck_module.cc, in an unnamed namespace (+290 −318). Every non-trivial line of the old two files is in the module and nothing else is added.
Prior findings (from my review at 7fcbd6a7)
- 🟡 [S2, open] Finding 1: the DS thermal-shield end walls carry 12.7 mm of aluminium that G4 does not have. The lines are unchanged (
KinKalGeomMaker.cc:362-365), and the check with the G4 GDML still reportsDS_Front_2andDS_Back_2asDSVacuumin both geometries. - 🟢 [was ⚪ S3] The check code was compiled into
libmu2e_KinKalGeom, which every reconstruction job loads. FIXED. At this head the library exports noKKGeomChecksymbol (15 at7fcbd6a7) and is 572 kB instead of 854 kB; the code is inlibmu2e_KinKalGeom_KinKalGeomCheck_module.so. CMake drops the source from the library, and SCons builds the library fromsrc/*.cc, so the deleted file leaves no stale target. Nothing else in Offline includes the deleted header. - The other S3 item, the
<follow-up PR link>in #2084's description, no longer applies now that #2084 has merged.
Checked, no action needed
- 🟢 Interaction with #2106. Its track-CRV matching takes the CRV sector rectangles from
KinKalGeom(CRVReco/src/TrkCrvGeom.cc). This PR builds those rectangles exactly as before (KinKalGeomMaker.cc,sector.sector_unchanged) and only adds the layer lists, so the matching geometry is the same. The CRV crossings it reads change as described below. I did not run the matcher. - 🟢 Interaction with #2103, which turned on
AddCaloMaterialin the LoopHelix fits. This PR changes no calorimeter element, and on both samples no LoopHelix fit changes betweenmainand this head. - 🟢 Execution time, which Dave asked about. On one run each on a shared node, the mean off-spill event time is 1.3 % (validation setting) and 2.2 % (production setting) higher than
main. That is within run-to-run noise there, and consistent with the author's "<1 %".
Measured, this head against main b6462a04 (both full builds, same Production and mu2e-trig-config)
- 🟢 Off-spill cosmics, 9,314 events. With either setting, every change is identical to my first review's comparison of
7fcbd6a7with445cd49a: the same 14 (validation) and 56 (production)KKCHmufit summaries, the sameRangedOutchanges (+31 −3 and +45 −2), and the same added and removed crossings on every surface (hatch concrete +7,585, strongbacks +10 −31, and so on). Track counts andFitOKdo not change. The comparison reports differ only in rows that are equal on both sides and moved withmain's calorimeter material. - 🟢 Nightly
reco_03, all 16,508 events: every printedKalSeedin every collection is identical. - 🟢
KinKalGeomCheck, Run 1A and Run 2, with and without the G4 GDML: all four jobs exit with status 0, and their output is identical to my runs at7fcbd6a7apart from paths. That confirms the move did not change the check.
Validation check
- Build/tests run: yes. Full
muse buildof this head and ofmainb6462a04(Production94a4d81f, mu2e-trig-config5999ffa2, p110): both exit status 0, no warnings. The 17 jobs above all exited with status 0. - Config contract check: pass. No fcl change in the increment.
- Cross-repo consistency: pass.
Residual risk
- Unchanged from my first review: no Run 2 reconstruction sample, no truth comparison at the CRV, no Regrow job.
Author follow-ups
- Decide what to do with the shield end walls (finding 1).
|
@FNALbuild run build test |
|
⌛ The following tests have been triggered for 2fc98b7: build (Build queue - API unavailable) |
|
☀️ The build tests passed at 2fc98b7.
N.B. These results were obtained from a build of this Pull Request at 2fc98b7 after being merged into the base branch at b6462a0. For more information, please check the job page here. |
oksuzian
left a comment
There was a problem hiding this comment.
PR Review Summary — #2109
Reviewed at head 2fc98b79ff4025133fb4d2d70208a5c4f4eef3f9. Follow-up to my comment review at the same head.
Decision
- 🟢 approve. FNALbuild build 3573 has now built this head, merged on
mainb6462a04, and every test passed: the prof build, all eleven validation jobs,rootOverlaps,g4surfaceCheck,trigger,check_cmakeand the whitespace check. The FIXME/TODO count and clang-tidy rows are informational. This is the approval my comment review promised once the build was green. Finding 1, the DS thermal-shield end walls, still stands and does not block.
This PR includes #2084 and should be merged second.
Summary
The KinKal passive-material model (
KinKalGeomMaker, introduced in #1868) disagrees with the Geant4 geometry itstands for in several places. Found by comparing it element by element with the GDML of the Run 1A and Run 2
geometries. This PR fixes them and adds
KinKalGeomCheck, a geometry-only art job that checks the KinKal model foroverlaps and, given a GDML file, against G4.
Fixes in
GeometryService/src/KinKalGeomMaker.ccplane per sector covering its modules. Before, the plane copied the sector rectangle, whose width includes the
3 x 42 mm layer stagger, so every R/L/T strongback was 126 mm too wide on one side and adjacent strongbacks
overlapped by 122 mm (G4 has a 3.66 mm gap).
layer-stacking direction, which for these sectors is the far side (120.5 mm along the normal).
KKShellXingusesPassiveMaterialPlane::thickness_as the full thickness (path = t/|cos|), asthe DS cylinders and the concrete Gauss pairs do. The strongback and the four DS end-wall planes carried half
their thickness (6.35 mm instead of 12.7 mm Al; 15 mm instead of 30 mm steel). The end walls also span
rIn2..rOut1 now, as in
constructDS, instead of rIn1..rOut2, which double counted the shell ends.(
constructHallrotation,Mu2eEnvelope). The slab sat at x 21768, z -18604 (detector) instead of over the DS(Mu2e x -7587..-221, z 3963..22708), so Run 1A cosmics to CRV-T missed 914 mm of concrete.
(
OrientationResolver, placed asconstructExternalShieldingdoes), checked against the GDML to 0.1 mm. Rows ofinterlocking blocks become one slab each: main roof (types 2, 10, 23, 29, 30), upstream roof (4, 9), north and
south side walls (1), and the downstream endcap (27, 28) as one z-normal slab per outline strip (thick side
columns, 909 mm central wall). This fixes types 4 and 9 (modelled with the type-2 orientation: wrong footprint,
two coincident overlapping slabs), types 27-29 (overlapping the CRV-D stacks and T5; the "300" orientation was not
decoded), the side-wall z ends (200 mm short) and the overlaps between the per-type roof slabs. Run 2 concrete planes:
24 before, 18 after.
CRV sector material follows the layer stagger (
KinKalGeom/inc/CRV.hh,Mu2eKinKal/inc/KKExtrap.hh)Each CRV sector is one midplane rectangle spanning all four layers, which are staggered by 42 mm, so adjacent
sectors' rectangles overlap by 122.34 mm. A muon in that band crosses some layers of one sector and the rest of the
other: both sectors light up, so both crossings are kept, but each added a full module of material.
KKCRVSectornow carries each layer's offset from the midplane and its bar spans across the bars (one per module, from
makeCRV), andlayerFraction(pos, dir)gives the fraction of layers a straight line through the crossing meets. ACRV crossing adds that fraction of the module thickness (as the calorimeter pipe plane takes its thickness from where
it is crossed), so the two sectors together add one module, and the outer edges of a sector, where only some layers
extend, add less. A crossing inside the envelope that meets no layer is recorded without material. This changes
KKExtrap, so the PR is based on Offline#2084.KinKalGeomCheck(new,KinKalGeom/src/KinKalGeomCheck_module.cc)mu2e -c Offline/KinKalGeom/fcl/kinkalGeomCheck.fcl(default geometry) orkinkalGeomCheck_run2.fcl:share a volume (> 1 cm^3, sampled) or if two passive planes are coplanar, of the same material and thickness, with
overlapping or touching footprints. CRV sector pairs are not in the volume test (their envelopes interleave by
design); instead, lines across the shared band (normal and at 45 degrees) must not cross more than one module of
layers in total;
gdmlFile(kinkalGeomCheckG4.fclreadsmu2e_common.gdml, as written byMu2eG4/fcl/gdmldump.fclfor the CIrootOverlapstest): the fraction of points inside each element that lie in G4 volumes of matching material,whether points on each CRV layer's center plane are scintillator in G4 exactly where the layer spans say so, the
column density along straight lines from the tracker to the CRV sectors outside the DS bore (CRV material scaled by
the layer fraction, as in the extrapolation), and the G4 volumes
crossed outside every KinKal element. Report-only by default (
failOnG4Mismatch: false).A CI job needs a
Mu2e/codetoolschange (jenkins_tests/mu2e-offline-build-test/build.sh): TODO, separate PR.Validation
Geometry:
KinKalGeomCheckagainst the G4 geometry of the same buildGDML from
Mu2eG4/fcl/gdmldump.fclof this build, default (Run 1A) andgeom_run2.txtgeometries(
analysis/kkgeom_fix/run_geomcheck.sh):bands (Run 1A T1/T2; Run 2 R1/R2, R2/R3, R2/R4, R3/R5, R4/R5, R5/R6, L1/L2, L2/L3, T1/T2 ... T4/T5) the summed layer
fraction of lines across the band is 0.75 to 1 (0.75 in the 3.66 mm gaps between sectors).
the rest are the bar gaps, which are not modelled.
walls 0.97-1.00, concrete 0.94-0.99. Exceptions, unchanged by this PR: the collapsed DS coil cylinder (0.70) and
the thermal-shield end walls (0, see open questions).
Tracker-to-CRV column density outside the DS bore, mean passive material in g/cm^2 (lines from the tracker volume to
random points of each sector). G4 and "after" from
KinKalGeomCheck; "before" (main) from the Python mirror ofKinKalGeomMaker, whose rays differ, so its G4 value is given too:The other sectors (L1, L2, R4, R5, T4) agree within 4 % before and after. The remaining shortfalls toward CRV-D, U, R1
and R2 are concrete this PR does not model (open questions); C1, C2 and R3 are over by the solid CRV-C notch blocks. The CRV material itself (not in the table)
agrees within 5 % for every sector: KinKal 20-137 g/cm^2 per line against G4 20-137.
Reco (nightly off-spill cosmics, Run 1A geometry, 10,000 events, field correction on and off, against Offline#2084)
Same events, reco with this PR against Offline#2084 at
445cd49a(analysis/kkgeom_fix/run_geom_arm.sh; both ntupledwith the same EventNtuple). Truth is the matched muon's MC trajectory (
crvextrap abtrajtruth) and its CRV mid-planecrossing (
crvextrap abplanetruth); dp = |p_reco| - p_truth; changes are event-clustered.abtrajtruth)In the T1/T2 overlap band (event 1430:8276:404530, field correction off) the track crosses both sectors at one point;
each now adds 30.8 MeV/c, where Offline#2084 added 64.2 MeV/c from each. The strongback below adds 11.0 MeV/c (full
12.7 mm, 5.4 before), and the two hatch slabs 423 and 439 MeV/c.
The momentum at the CRV was biased low by about 0.7 GeV/c because cosmics reaching CRV-T missed the hatch concrete;
with it the median bias is within the (multi-GeV) spread of the cosmic momentum at the CRV. The lost strongback and
end-wall crossings are where the planes were too large (strongback 126 mm too wide, end walls to rOut2).
No reco sample with the Run 2 geometry was run: the Run 2 changes (R/L/T strongbacks, concrete) are validated by the
geometry check only.
Open questions / follow-ups
side walls in front of CRV-U and R1, south wall upstream of z 6149); MBS/IFB downstream of the DS for CRV-D.
module; the bending across 10 cm of module is neglected. Gaps between bars (0-0.2 mm) are not modelled.
crvextrap abplanetruthpins the Run 1A sector envelopes; they are unchanged by this PR.🤖 Generated with Claude Code