Skip to content

switched on calo materials - #2103

Merged
brownd1978 merged 2 commits into
Mu2e:mainfrom
sophiemiddleton:calo_ext
Nov 8, 2026
Merged

brownd1978 merged 2 commits into
Mu2e:mainfrom
sophiemiddleton:calo_ext

Conversation

@sophiemiddleton

Copy link
Copy Markdown
Contributor

No description provided.

@FNALbuild

Copy link
Copy Markdown
Collaborator

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

  • Mu2eKinKal

which require these tests: build.

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

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

About FNALbuild. Code review on Mu2e/Offline.

@FNALbuild

Copy link
Copy Markdown
Collaborator

☀️ The build tests passed at 5d97add.

Test Result Details
test with ✅ Command did not list any other PRs to include
merge ✅ Merged 5d97add at b24d416
build (prof) ✅ Log file. Build time: 15 min 18 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 (0) FIXME (0) in 0 files
clang-tidy ✅ 0 errors 0 warnings
whitespace check ✅ no whitespace errors found

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

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 — #2103

Reviewed at head 2d9366033e4f64cb1be1f04e0ffda5fe0d883eaf. First pass.

Decision

  • 🟡 comment only. This line turns on the calorimeter material in every production LoopHelix fit (KKDe, KKUe, KKDmu, KKUmu), but the PR has no description and no validation. The comment it deletes said the option stays "off until validated against MC truth". My own run on the nightly reco_03 sample shows a small effect: the core momentum resolution of KKDe against truth narrows by about 1%, and the same few converged fits are lost as in my #2081 review (finding 2). I would approve once the description says what changes and links the resolution and efficiency plots from today's meeting. FNALbuild passed at the first commit 5d97addb, which differs from this head only in the comment; mu2e/buildtest has not run at this head.

Scope understood

  • Mu2eKinKal/fcl/prolog.fcl:505 sets AddCaloMaterial : true in Mu2eKinKal.LHDriftFit.KKFitSettings and drops the comment. The second commit only removes the comment. Merging with main b24d4163 (git merge-tree) gives main plus this one line.
  • With the option on, KKFit::extendTrack calls addCaloMaterial once the extended fit is usable (KKFit.hh:407). That adds the calorimeter front-panel layers and the crystal-case inner rings crossed between the last straw hit and the end of the fit, then refits once at the final temperature with no hit updaters (KKTrack.hh:335-347). ToCaloMaterial (prolog.fcl:395), which adds the same material beyond the end of the fit during extrapolation (KKExtrap.hh:151), stays false.
  • Which jobs change. I ran fhicl-dump on 23 Production, PassN and Validation configurations, with main's prolog and with the PR's. The only difference anywhere is AddCaloMaterial, on KKDe, KKUe, KKDmu, KKUmu and Production's RegrowLH table.
    • The four fits run in recoMC/OnSpill, OffSpill (LHPath), both Retrigger configurations, reco/OnSpill, and the validation jobs reco.fcl, offSpill.fcl, ceSimReco.fcl and nightly reco_03.
    • Unchanged: the trigger, KKCHmu, KKLine, the regrow jobs and PassN Combined_Pass1. mu2e-trig-config builds its fits from Mu2eKinKal.KKFIT, and the C++ default is false (KKFitSettings.hh:76). The dumps of Validation/trigger.fcl and digitize/OnSpill.fcl are identical. The regrow jobs use Offline's RegrowLH, built from KKFIT. Combined_Pass1 runs only KKLine on its paths.
    • Production's own RegrowLH (JobConfig/reco/prolog.fcl:123-138) inherits true through @table::Mu2eKinKal.producers.KKDe.KKFitSettings, but no job puts it on a path.

Findings

  1. 🟠 [S1] A production reconstruction default changes with no description and no validation.

    • Evidence: the description is empty. The title says "calo materials", but only one of the two options changes. The deleted comment made the change conditional on validation against MC truth. On #2081 the author offered to show resolution and efficiency plots at the Wednesday meeting (issuecomment-6581229006), and nothing has been posted on either PR. brownd1978 noted there that calorimeter material "requires a different workflow", because the calorimeter hit comes after the material (issuecomment-6582318164). This PR does not say whether that was settled.

    • Impact: 91% of KKDe tracks and 65% of KKDmu tracks now carry calorimeter material in the fit, and most of their fitted values move slightly (table below). Anyone who sees these shifts in validation will need the reason, and this PR does not give one.

    • Suggested fix. Best practice reminder: please add a meaningful PR description including intent, scope, and validation evidence. In particular:

      • why only AddCaloMaterial is turned on;
      • the expected effect on resolution and efficiency, with a link to the meeting plots (DocDB or Indico).

      That clears this finding.

  2. 🟡 [S2] Carried over from #2081: some converged fits are dropped as ParamsDiverged after the material refit.

    • Evidence: on reco_03, KKDe loses 9 tracks, 3 of them conversion-like (1430:1612:4983, 1430:1652:1372, 1430:967:4391). KKDmu loses 68, 9 of them in the conversion-like window. These are exactly the track counts I measured on #2081 with both options on, so ToCaloMaterial plays no part.
    • I reran 1430:1652:1372 at this head with KKDe printing. The fit converges with probability 0.957. Three disk-0 front-panel layers and two disk-1 inner-ring crossings are added, and then Fit Status ParamsDiverged Meta-iteration 13 iteration 0 Chisq value 45.2518 nDOF 63 prob 0.955355 makes the fit fail (goodFit = 0). With main's prolog the same event ends with goodFit = 1, fitcon = 0.9567.
    • Impact: the rate is small, 3 of 10,769 conversion-like KKDe tracks. But each lost fit had converged with a high probability.
    • Suggested fix: find why a single refit iteration trips the divergence test on a converged fit. Until then, the description should say that this loss is known and accepted.
  3. ⚪ [S3] The deleted comment also said what the parameter does. Please keep "add the calorimeter front panel material crossed within the fit range" and drop only the caveat. prolog.fcl:395 still says ToCaloMaterial stays "off until validated against MC truth"; the description could say whether that is still the plan.

Checked, no action needed

  • 🟢 Effect on all 16,508 events of Production/Validation/nightly/reco_03.fcl, read in place. Both runs used the same p110 build, once with main's prolog and once with the PR's. Every KalSeed collection was printed. All 12 jobs exited with status 0. Every trigger KalSeed collection is identical.

    Fit tracks, main / PR lost / gained conversion-like, main / PR tracks with calorimeter material
    KKDe 16,486 / 16,478 9 / 1 10,769 / 10,742 14,928
    KKUe 16,303 / 16,294 12 / 3 743 / 731 7,125
    KKDmu 16,316 / 16,249 68 / 1 8,542 / 8,505 10,529
    KKUmu 16,043 / 16,033 12 / 2 720 / 709 6,012
    • Conversion-like here means 95-110 MeV/c at TT_Front, fit consistency above 1e-3 and at least 20 active hits, as in #2081.
    • The 27 fewer conversion-like KKDe tracks are the 3 lost fits, plus 53 tracks that drop below the fit-consistency cut, minus 29 that rise above it.
    • On KKDe, 14,927 of the 16,477 matched tracks change.
    • Momentum at t0: changes on 13,421 tracks, with a median change of 0.006 MeV/c. 64 tracks change by more than 1 MeV/c, all with few hits or a fit consistency near 0.
    • Conversion-like KKDe: the momentum at TT_Front shifts by −0.011 MeV/c on average, and by at most 1.76 MeV/c.
    • t0: changes on 3,176 tracks, 15 of them by more than 1 ns (at most 3.2 ns).
    • The last column comes from a third run with SaveMaterialXings : true on the four fits. Its fit results are identical to the PR run.
  • 🟢 Against MC truth. This is a cross-check, not a substitute for the author's validation.

    • Method: I ran EventNtuple main (6da9b4f) on both outputs and compared the KKDe momentum at TT_Front with the true momentum of the matched particle at the tracker front.
    • Sample: the 10,000 events with exactly one conversion-like KKDe track in both runs.
    • The half-width of the central 68% goes from 0.1791 to 0.1767 MeV/c.
    • The median goes from −0.0163 to −0.0228 MeV/c.
    • Tails: 234 tracks are low by more than 1 MeV/c in main and 236 with the PR; 28 are high by more than 1 MeV/c in main and 22 with the PR.
    • Events with a conversion-like KKDe track matched to a 95-110 MeV/c true particle go from 10,857 to 10,847.
  • 🟢 FNALbuild build 3553 at 5d97addb passed every row, including ceSimReco, which runs these fits with the option on, plus trigger and check_cmake. 5d97addb and the head differ only in the comment. GitHub reports the PR as mergeable. No other open Offline PR touches Mu2eKinKal/fcl.

Validation check

  • Build/tests run: yes.
    • No new build was needed, since the PR changes only fcl. I used my p110 build from the #2100 review: Offline 7bccd295, which is main 5629b9f2 plus p110, with Production 94a4d81f and mu2e-trig-config 5999ffa2. Since then, main has added only #2090 (CosmicTrack).
    • The PR's prolog went first in FHICL_FILE_PATH, and it is byte-identical to the git merge-tree result.
    • Jobs: 18 reco_03 chunks, 12 EventNtuple jobs, two single-event reruns, and fhicl-dump of 23 configurations. All exited with status 0.
  • Config contract check: pass. AddCaloMaterial is an existing fhicl::Atom<bool>.
  • Cross-repo consistency: pass. No Production, mu2e-trig-config, PassN, EventNtuple, DQM, RefAna or EventDisplay fcl sets AddCaloMaterial.

Residual risk

  • Only one sample was checked: CeMLeadingLogMix1BB, on spill.
  • Not checked:
    • off-spill cosmics through OffSpill's LHPath;
    • real data;
    • the CPU cost. With both options on, I measured 85.9 against 81.6 ms per event for the four fits on #2081.

Author follow-ups

  1. Add a description, with the plots, as in finding 1.
  2. Say whether the ParamsDiverged losses are accepted for now or will be followed up (finding 2).
  3. Optional: keep the parameter description in the comment (finding 3).

@oksuzian

oksuzian commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

@FNALbuild run build test

@FNALbuild

Copy link
Copy Markdown
Collaborator

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

@FNALbuild

Copy link
Copy Markdown
Collaborator

☀️ The build tests passed at 2d93660.

Test Result Details
test with ✅ Command did not list any other PRs to include
merge ✅ Merged 2d93660 at b24d416
build (prof) ✅ Log file. Build time: 09 min 10 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 (0) FIXME (0) in 0 files
clang-tidy ✅ 0 errors 0 warnings
whitespace check ✅ no whitespace errors found

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

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.

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

Thanks.

@brownd1978
brownd1978 merged commit df52caa into Mu2e:main Nov 8, 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.

5 participants