Skip to content

Run the offSpill CentralHelix fit with BField correction - #583

Merged
brownd1978 merged 1 commit into
Mu2e:mainfrom
RobMina:nightly-offspill-bfcorr
Oct 19, 2026
Merged

brownd1978 merged 1 commit into
Mu2e:mainfrom
RobMina:nightly-offspill-bfcorr

Conversation

@RobMina

@RobMina RobMina commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Now that Mu2e/Offline#2021 is merged, it is possible to fit & extrapolate CentralHelix cosmic muon tracks with B field correction enabled. This PR enables this setting and the relevant config parameters in the nightly validation.

When merged, this will cause a one-time val histogram comparison failure.

@FNALbuild

Copy link
Copy Markdown
Collaborator

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

  • Validation

which require these tests: build.

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

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

About FNALbuild. Code review on Mu2e/Offline.

@FNALbuild

Copy link
Copy Markdown
Collaborator

☀️ The build tests passed at 2bca2e6.

Test Result Details
test with ✅ Command did not list any other PRs to include
merge ✅ Merged 2bca2e6 at 0d1c370
build (prof) ✅ Log file. Build time: 04 min 28 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.
FIXME, TODO ✅ TODO (0) FIXME (0) in 0 files
clang-tidy ✅ 0 errors 0 warnings

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

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

Reviewed at head 2bca2e6ce0808a7cf884b40d09ffd0156bc3e486. first pass

Decision

  • 🟢 approve. The settings resolve where intended and pass Offline's config checks. One comment, about the field-file switch reaching every KinKal fit in the job, is worth a line in the PR before the nightly reference is reset.

Scope understood

  • Nightly validation only. Validation/offSpill.fcl turns on BFieldCorrection for the KKCHmu fit and extension, sets the two KinKal stability settings from Offline#2021 (MinDomainTimeStep 0.03 ns, DomainMargin 0), and switches the job to bfgeom_v01_minfield.txt, which is v01 plus bfield.minUsableField = 1e-6 T.
  • No production config changes. The prodtools campaign files name JobConfig/recoMC/OffSpill.fcl, never Validation/offSpill.fcl.

Findings

  1. 🟡 [S2] The field-file switch is job-wide, so the "one-time comparison failure" may include the LoopHelix fits, not only KKCHmu.
    • Evidence: services.GeometryService.bFieldFile feeds BFieldConfig::minUsableField (GeometryService/src/BFieldConfigMaker.cc:50 at Offline main f122c5b3). Every KKBField passes it to KinKal::BFieldMap: CentralHelixFit_module.cc:254, LoopHelixFit_module.cc:257, RegrowLoopHelix_module.cc:216 and KinematicLineFit_module.cc:237. The dump of this job has KKDe, KKDmu, KKUe, KKUmu, RegrowLH and KKLine beside KKCHmu, and all four LoopHelix fits already run with BFieldCorrection: true. With minUsableField > 0, BFieldMap::protecting() is true. An unusable field sample then hands off to free-particle continuation instead of failing the fit (Fit/Track.hh return bfield_.protecting() paths in #224). The new comment describes the settings as "run the CentralHelix fit ... with BField correction", and the PR body attributes the expected failure to that.
    • Impact: offSpill is the nightly job that validates the LoopHelix fits on cosmics, as its own header says. If those histograms move too, the reference reset would absorb a LoopHelix change that nobody named. If they do not move, saying so costs one sentence.
    • Suggested fix: state in the PR which histogram sets changed in your test, LoopHelix included. If you would rather keep the LoopHelix fits on the stock map, that needs a per-module setting, which does not exist today. The PR as written is a reasonable choice. It just needs to be said.

Verified

  • 🟢 Every key exists and lands where intended. fhicl-dump of Validation/offSpill.fcl at this head, against Offline main f122c5b3, gives rc 0. Diffed against Production main, the only changes are BFieldCorrection, DomainMargin and MinDomainTimeStep in KKCHmu.FitSettings and KKCHmu.ExtensionSettings, plus bFieldFile. All three keys are in Mu2eKinKal::KinKalConfig (KKFitSettings.hh:36,39,40). DomainMargin is an OptionalAtom, so setting 0 confines the domains and passes the >= 0 check (KKFitSettings.cc:29).
  • 🟢 Offline's guard is satisfied. KKExtrap::checkConfig throws when bfcorr is on and MinDomainTimeStep exceeds ExtrapolationSettings.MaxDtStep. KKCHmu has MaxDtStep: 1, and 0.03 is well under it.
  • 🟢 The values have a source. 0.03 ns, margin 0 and 1e-6 T are the settings validated on 98k Run-2 cosmic events in Offline#2021 and KinKal#224, and both are merged. This PR is the first consumer of bfgeom_v01_minfield.txt, which answers the "no consumer" note from my #2021 review for that file. bfgeom_v01_minfield0p3.txt is still unused.
  • 🟢 No conflict with #582. Both PRs edit Validation/offSpill.fcl. The merged tree is clean, and its dump carries both changes with nothing else.

Validation check

  • Build/tests run: FNALbuild passed at this head. No buildtest job runs Validation/offSpill.fcl; cosmicOffSpill is the digitize step. Locally I ran fhicl-dump at main, at this head and merged with #582 (claude-scratch/pr583_582_review/fcldump.sh). No art job was run. The inputs are on tape over xrootd, and I have no valid token, so the "only CentralHelix moves" question is not checked.
  • Config contract check: pass.
  • Cross-repo consistency: pass. Offline#2021 is merged, and the field file and keys are on Offline main.

Residual risk

  • Validation only; no campaign uses this file.
  • Per #2021, bfcorr loses about 9% of CentralHelix tracks. The KKCHmu histograms will shift by design.

Author follow-ups

  1. Say whether the LoopHelix histograms in offSpill also change (finding 1).

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

Can you look at the OffSpill nightly validation plots to make sure this behaves as expected?

@brownd1978
brownd1978 merged commit efebc0a into Mu2e:main Oct 19, 2026
14 checks passed
@RobMina

RobMina commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Checking the nightly val plots: https://mu2e-exp.fnal.gov/computing/ops/val/valJob2/nightly/2026_10/20/offSpill/result.html

These results seem reasonable to me. The nightly val plots don't show residuals vs truth, but those were presented in eg. https://mu2e-docdb.fnal.gov/cgi-bin/sso/ShowDocument?docid=57496 and are much better with B field correction than without.

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