Skip to content

material effects - #2081

Open
sophiemiddleton wants to merge 2 commits into
Mu2e:mainfrom
sophiemiddleton:calo_ext
Open

sophiemiddleton wants to merge 2 commits into
Mu2e:mainfrom
sophiemiddleton:calo_ext

Conversation

@sophiemiddleton

Copy link
Copy Markdown
Contributor

This pull request introduces support for modeling and tracking the calorimeter disk front panel material and embedded cooling pipes in the Mu2e simulation and reconstruction. The changes add new surface IDs for the front panel layers and pipes, implement a detailed geometric and material model for these components, and update the extrapolation and configuration logic to include them in fits and track propagation. This enables more accurate modeling of material effects for tracks passing through the calorimeter front panels.

Calorimeter front panel and cooling pipes modeling:

  • Added new surface IDs EMC_Disk_0_FrontPanel and EMC_Disk_1_FrontPanel to SurfaceIdEnum, updated the surface ID count, and registered their string names. [1] [2]
  • Introduced the CaloFrontPanelPipes class to represent the geometry and material of cooling pipes embedded in the calorimeter front panels, including methods to compute the material depth crossed by a track. [1] [2]
  • Updated KinKalGeom and KinKalGeomMaker to construct and store the front panel material layers and cooling pipes for each calorimeter disk, including detailed geometric construction and material assignment. [1] [2] [3] [4] [5] [6] [7]

Geometry and configuration enhancements:

  • Extended the calorimeter geometry configuration to include front panel material properties (material names for foam and carbon fiber).
  • Added FCL configuration options to enable extrapolation through the calorimeter front panel material and to include it in fits. [1] [2]

Extrapolation and material handling:

  • Added a uniform interface (CaloMaterialLayers) to access both fixed-thickness front panel layers and position-dependent cooling pipe material for use in extrapolation and fitting.
  • Updated the extrapolation logic to handle the new calorimeter front panel material layers and pipes in track propagation. [1] [2]

@sophiemiddleton
sophiemiddleton marked this pull request as draft October 29, 2026 19:57
@FNALbuild

Copy link
Copy Markdown
Collaborator

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

  • TrackerConditions
  • Mu2eKinKal
  • GeometryService
  • DataProducts
  • KinKalGeom

which require these tests: build.

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

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

About FNALbuild. Code review on Mu2e/Offline.

@sophiemiddleton
sophiemiddleton marked this pull request as ready for review October 29, 2026 23:54
@FNALbuild

Copy link
Copy Markdown
Collaborator

☀️ The build tests passed at f00cd50.

Test Result Details
test with ✅ Command did not list any other PRs to include
merge ✅ Merged f00cd50 at a9ddd06
build (prof) ✅ Log file. Build time: 04 min 30 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 (19) FIXME (7) in 16 files
clang-tidy ➡️ 1 errors 168 warnings
whitespace check ✅ no whitespace errors found

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

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.

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

PR Review Summary — #2081

Reviewed at head f00cd50e59f3b7cb9a85a7c10a1713ff85694c1e. First pass.

Decision

  • 🟡 comment. The geometry, the materials and the new extrapolation code check out. With the two new options turned off, the output is identical to main on all 16508 events of the nightly reco_03 input. But both options are on by default in LHDriftFit, which production on-spill reconstruction uses. With them on, about 1% of the LoopHelix fits are lost and almost every fit changes (finding 1). Please settle that before merging: either show it is an improvement, or turn the defaults off.

Scope understood

  • What the PR adds:
    • KinKalGeom gets the calorimeter front panels as three layers each (carbon fiber, foam, carbon fiber), the cooling pipes as centerlines, and the crystal-case inner rings.
    • These get new surface IDs 320-323.
    • KKExtrap::extrapolateCaloMaterial adds them when a fit is extrapolated to the calorimeter (ToCaloMaterial).
    • KKFit::addCaloMaterial adds the ones inside the fit range and refits (AddCaloMaterial).
    • KKShellXing::updateReference now searches the neighbouring pieces when a crossing moves.
    • MaterialsList.data gets six materials.
  • Both options are set true in Mu2eKinKal/fcl/prolog.fcl, at :395 (LHDRIFTXTRAP) and :505 (LHDriftFit).
    • KKDe, KKUe, KKDmu and KKUmu in Production/JobConfig/reco/prolog.fcl:57-84 inherit them. So recoMC/OnSpill.fcl, which runs in 18 prodtools campaign entries, picks them up.
    • OffSpill (KKCHmu) and Extracted (KKLine) keep the C++ default of false.
    • The description mentions neither the production defaults nor the KKShellXing change.

Findings

  1. 🟠 [S1] The new options are on in production on-spill reconstruction. With them, about 1% of the LoopHelix fits are lost and almost every fit changes, and the PR has no validation.
    • Evidence: the nightly reco_03 input, all 16508 events, on main (the nightly build a9ddd063) and on this PR merged onto it. The track counts are:
fit main this PR
KKDe 16486 16362
KKUe 16303 16146
KKDmu 16316 16109
KKUmu 16043 15934
  • Of the 16252 matched KKDe tracks, 16134 change, and 2514 change their active hit count.
  • For conversion-like KKDe tracks (95-110 MeV at TT_Front, fit consistency above 1e-3, at least 20 hits; 10769 on main), the change in momentum at TT_Front is small: median 0.007 MeV, 99th percentile 0.34 MeV. 34 tracks move by more than 1 MeV, and 1 is lost.
  • Most of the lost tracks are poor fits: 101 of the 125 lost KKDe tracks have fewer than 20 hits. But good fits are lost too.
  • Example: event 1430:1065:1269, a 54 MeV KKDe track with 27 hits before extension.
    • On main: After extending the fit : goodFit = 1, fitcon = 0.9054, nHits = 30, 1 calo-hits.
    • At this head: the three disk-0 front panel layers are added (at 766.2 to 766.5 ns), then goodFit = 0, fitcon = 0.0000, and the track is not saved.
  • The refit is the cause. KKTrack::addFitMaterialXings calls extend with the full fit configuration (KKTrack.hh:334), which replays the whole extension schedule. In the printout, meta-iterations 13 to 21 follow the original 12. That replay is where hits change state and fits fail.
  • The replay also costs CPU. The four LoopHelix fits take 112.8 ms per event against 81.5 ms on main, and KKDe alone goes from 20.6 to 31.6 ms.
  • Control: with AddCaloMaterial and ToCaloMaterial set to false on the four fits, every KalSeed collection, with all its intersections, is identical to main in all 16508 events. So all of the change comes from these two options.
  • Suggested fix, any of these:
    • Set both defaults to false until validated, with momentum resolution and efficiency against MC truth on conversion electrons and on a background sample.
    • Or add the panel material in the same extension step that adds the CaloHit, rather than in a second full extension.
  • Either way, please say in the description that production output changes.
  1. ⚪ [S3] The pipe and ring layout is a second copy of the G4 construction.
    • KinKalGeomMaker::makeCaloPipes reproduces caloBuildFrontPlate in constructDiskCalorimeter.cc, including its 0.9975 angle factor, the 2 mm shortening and the - 0.1 manifold margin (KinKalGeomMaker.cc:199, :211, :215).
    • If the G4 layout changes, KinKal goes out of step without any error.
    • A description of the pipes kept once, in DiskCalorimeter, and used by both would avoid that. This does not gate.
  2. ⚪ [S3] Small items.
    • The front panel material names come straight from the geometry file and must exist in MaterialsList.data.
      • geom_common_trackerVST.txt:373-374 sets them to "G4_AIR", which is not there. MatDBInfo::findDetMaterial then throws Cannot find requested material G4_AIR at the first crossing.
      • The only user, Production/Processing/vstdata_epilog.fcl, runs line fits with the options off, so nothing fails today.
    • Regrown fits do not get the in-fit material (the TODO at KKFit.hh:418), while the regrow configurations use LHDRIFTXTRAP and so add it in the extrapolation. RefRegrow.fcl is in no campaign.
    • DiskCalorimeterMaker.cc:117 gives innerCFRingMaterial a default of "CarbonFiber". G4 reads the same key with no default, and both calorimeter geometry files set it, so the default can go.

Checked, no action needed

  • 🟢 The surface IDs are append-only.
    • The new values are 320-323, after EMC_Disk_1_Back (317), so no existing value moves.
    • SurfaceId is stored as the enum integer through EnumToStringSparse, so older files read the same.
    • nSurfaceIds is used only in the static_assert (SurfaceId.cc:95).
    • EventNtuple stores sid as an integer, with no calorimeter-specific list.
  • 🟢 Every new TimeRange is built from a time inside the range.
    • extrapolateCaloMaterial: tstart is clamped into the fit range (KKExtrap.hh:491) and later set from intersection times (:515). extrapolateCaloSupport (:572) does the same.
    • caloSupportXings (CaloMaterialLayers.hh:64, :74) starts from good() intersections, and good() requires the intersection to be in range.
    • KKFit::addCaloMaterial orders its ends (KKFit.hh:440). KKShellXing uses ±1 ns (:90).
    • The calorimeter material is added after the DS and CRV material passes and before the material-free disk extension (KKExtrap.hh:151). That is the order #2059 needed.
  • 🟢 The materials match G4's own definitions (ConstructMaterials.cc:1266-1295, :1372-1378):
    • CarbonFiber_resin: C5H5O2 at 1.1 g/cm³.
    • CarbonFiber: 46% fiber at 1.422 g/cm³. G4 computes the same weighted density.
    • AluminumHoneycomb: 0.03 g/cm³.
    • CaloPipeAl and CaloRingAl: G4_Al, as calorimeter.pipeMaterial and the aluminium rings use.
  • 🟢 The layer positions match G4.
    • The case front is frontFaceCenter - crystalCapZLength, because the crystal origin sits one cap length behind the case front (DiskCalorimeterMaker.cc:215). G4 places the front plate directly upstream of the case.
    • The 3 / 21.75 / 3 mm layers and the pipe plane, one pipe radius into the foam, follow caloBuildFrontPlate (ZposPipe).
  • 🟢 With the options off, the KKShellXing change and the new geometry leave every output unchanged (the control in finding 1).
  • 🟢 No crash. All 16508 reco_03 events run at this head with its defaults, and so do 200 ceSimReco events.

Validation check

  • Build: Offline main a9ddd063 merged with this head, with Production 94a4d81f and mu2e-trig-config 2b90c646, p109. These are the same three commits as the nightly build.
    • The merge is clean. The branch is based on #2059's head (0fd28482), and the merge keeps #2076's clamp.
    • Exit status 0, no warnings. FNALbuild passed at this head.
  • Production/Validation/nightly/reco_03.fcl on its two dig inputs, read in place, all 16508 events, with every KalSeed collection printed per event (PrintModule verbose 2: fit summary and all intersections). It was run three ways: main, this PR, and this PR with the two options off.
  • Production/Validation/ceSimReco.fcl, 200 events (baseSeed 8), main against this PR:
    • 84 of 85 KKDe tracks change.
    • The change in momentum at TT_Front has a median of 0.012 MeV and a maximum of 1.29 MeV.
    • No track is lost.
  • With KKDe printout on, over 100 events, front panel material was added about 290 times and inner-ring material 21 times. A second pass was needed 4 times.
  • Not checked:
    • Momentum resolution against MC truth.
    • The cooling-pipe wall depth (wallDepth) against G4, beyond reading the code.

Author follow-ups

  1. Settle finding 1. Either turn the defaults off until validated, or show resolution and efficiency against MC truth, and avoid the second full extension that loses fits.
  2. Say in the description that production output changes, and mention the KKShellXing change.

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