Skip to content

recalibrate KinKal brehmsstralung cutoff - #2168

Open
edcallaghan wants to merge 1 commit into
Mu2e:mainfrom
edcallaghan:synchronize_radiative_cutoff
Open

edcallaghan wants to merge 1 commit into
Mu2e:mainfrom
edcallaghan:synchronize_radiative_cutoff

Conversation

@edcallaghan

Copy link
Copy Markdown
Contributor

KinKal PR #236 fixed a typo in the calculation of the mean radiative energy loss of electrons via bremsstrahlung, which invalidates the calibrated cutoff to the photoemission spectrum used. The automated PR review suggested an updated cutoff to restore the effect of the previous calibration, which I checked and provide here with higher precision.

@FNALbuild

Copy link
Copy Markdown
Collaborator

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

  • 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 fa6b952: build (Build queue - API unavailable)

About FNALbuild. Code review on Mu2e/Offline.

@FNALbuild

Copy link
Copy Markdown
Collaborator

☀️ The build tests passed at fa6b952.

Test Result Details
test with ✅ Command did not list any other PRs to include
merge ✅ Merged fa6b952 at d29cb22
build (prof) ✅ Log file. Build time: 04 min 41 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. Return Code 1.
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 fa6b952 after being merged into the base branch at d29cb22.

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 Ed! Note this PR needs to wait for the KinKal PR to be merged and built.

@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 — #2168

Reviewed at head fa6b952643a304083482cfd5497cc35cefe38035. First pass.

Decision

  • 🔴 request changes, only to hold the merge. The new value is right: with KFTrack/KinKal#236's corrected formula it gives exactly the mean radiative loss that 0.03 gave before. But Offline cannot use #236 yet. Merged today, this line would triple the modelled loss for every electron and positron fit. brownd1978 already noted that this PR has to wait. I will approve once the envset on main, or this PR, brings in a KinKal release that contains #236.

Scope understood

  • One line: ElectronBrehmsFraction in KinKalGeom/fcl/prolog.fcl:18 goes from 0.03 to 0.09277414. This is the bremsstrahlung cutoff ymax that KinKal's DetMaterial uses for the mean and variance of the radiative energy loss.

Findings

  1. 🟠 [S1] With the KinKal that Offline builds against today, this triples the modelled mean radiative loss.
    • Evidence:
      • KinKal#236 divides the mean loss per radiation length by 3 (MatEnv/DetMaterial.cc:83). It merged into KinKal main at 23:38 UTC on 17 November as 906c4ce4. It is in no tag yet: v3.9.2...906c4ce4 is 3 commits ahead.
      • Offline main now uses envset p111 (Offline#2111 merged at 21:48 UTC today). p111 sets KINKAL_VERSION="v03_09_02", so it does not have #236. No later envset exists yet; the Muse envset directory ends at p111.
      • With the old formula, the mean loss per radiation length is 4y − 2y² + y³. At y = 0.03 that is 0.1182 E. At y = 0.09277414 it is 0.3547 E, exactly 3.0 times more.
    • Impact: every electron and positron fit, in reco and in extrapolation, would model 3 times the calibrated radiative loss. In my KinKal#236 review, a change of 0.0788 E per radiation length in this mean moved the tracker-front momentum by −46 keV/c and the tracker back by +44 keV/c. This change is +0.2365 E, three times larger in the other direction. Scaling from that, I estimate about +140 keV/c at the tracker front and −130 keV/c at the back. I did not run this case.
    • Suggested fix: put the envset bump to a KinKal release with #236 into this PR, so that the formula and the cutoff change in one merge. Otherwise, hold this PR until such an envset is on main. A line in the description would help whoever merges.

Checked, no action needed

  • 🟢 The value. With #236's formula, the mean loss is (4y − 2y² + y³)/3. Solving (4y − 2y² + y³)/3 = 0.118227, the old mean at y = 0.03, gives y = 0.0927741431. The PR's 0.09277414 matches it to 8 digits, and it reproduces the old mean to 3 parts in 10⁸. That is the "restore the effect of the previous calibration" the description promises, for the mean.
  • 🟢 This is the only place the value is set. In Offline the parameter is read with no C++ default (KinKalGeom/inc/KKMaterial.hh:42). A GitHub code search finds no ElectronBrehmsFraction in Production, mu2e-trig-config or EventNtuple.
  • 🟢 FNALbuild passed at this head at 00:39 UTC on 18 November (merged on d29cb22c). That run was on p110, before #2111 moved main to p111.

Validation check

  • Build/tests run: no new build. The arithmetic above, and the measured effect from my KinKal#236 review (Offline 8628ceb7 with KinKal v3.9.1, with and without #236; recoMC on 4,000 CeMLeadingLog mix events).
  • Sourced numbers: the new cutoff, checked against #236's formula above. The old 0.03 comes from Offline#1900 ("retuned to center the reconstructed track momentum at the tracker front").
  • Config contract check: pass. Same key, same type.
  • Cross-repo consistency: needs follow-up (finding 1).

Residual risk

  • The variance is not restored, and it is not meant to be. At y = 0.0928 the radiative variance is 9.2 times the old one, which is the fix #236 is after. No one has measured what that does to the fit: momentum centring at the tracker front, pulls and fit consistency. The mean is restored exactly, so the centring should come back close to today's. The larger variance changes how the fit weights each material crossing, though, so "close" is an expectation, not a measurement.

Author follow-ups

  1. Bring in the KinKal release with #236 in the same merge as this change, or hold the PR until it is on main (finding 1).
  2. Once that release is built, compare recoMC before and after on a CE sample: the TT_Front residual, the momentum pull and the fit consistency. The variance increase is the part no one has measured yet.

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