Skip to content

Implement bethemean energy loss option. Enable optional per-material …#222

Merged
brownd1978 merged 2 commits into
KFTrack:mainfrom
RobMina:detmaterial-unrestricted-mean
Jul 17, 2026
Merged

Implement bethemean energy loss option. Enable optional per-material …#222
brownd1978 merged 2 commits into
KFTrack:mainfrom
RobMina:detmaterial-unrestricted-mean

Conversation

@RobMina

@RobMina RobMina commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

…energy loss configuration (defaults to the global config setting).

For issue #221

…energy loss configuration (defaults to the global config setting).

@brownd1978 brownd1978 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Rob this looks great! I just have 1 quibble about an error printout.

Comment thread MatEnv/MatMaterialList.cc Outdated
} else if (key == "bethemean") {
matObj->setElossMode(2);
} else {
ErrMsg(warning) << "MatMaterialList: unrecognized trailing token '" << token

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to throw here instead. ErrMsg is a deprecated legacy class (I'll add an issue).

@brownd1978

Copy link
Copy Markdown
Contributor

Rob, could you please paste in the output from MatEnv_unit? It gets suppressed in the automatic tests, but in this case it would be good to have this as part of the record.

@RobMina

RobMina commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Rob, could you please paste in the output from MatEnv_unit? It gets suppressed in the automatic tests, but in this case it would be good to have this as part of the record.

Here's the output:
Test for particle muon mass 105.66
Searching for material CONCRETE_MARS
project KINKAL_SOURCE_DIR source /exp/mu2e/app/users/ram2aq/kinkal_eloss_pr/KinKal dir /MatEnv/
Found DetMaterial CONCRETE_MARS

==== per-material ionization energy loss (issue #221) ====
global default eloss mode (dmconf): moyalmean
requested material 'CONCRETE_MARS' resolved eloss mode: bethemean
CONCRETE_MARS (tagged bethemean) -> elossMode() = bethemean
Target (untagged Al) -> elossMode() = moyalmean (== global default, proving the fallback)

thick concrete slab 447 mm, particle muon (mass 105.66 MeV) -- energy loss in MeV (more negative = larger loss):
p[MeV/c] MPV moyalmean bethemean dispatched
100 -346.4820 -368.2093 -284.6438 -284.6438
300 -193.9603 -205.4999 -182.9124 -182.9124
1000 -184.0133 -194.3941 -193.3215 -193.3215
3000 -185.8915 -196.1704 -211.6355 -211.6355
10000 -186.3533 -196.6206 -228.2388 -228.2388
30000 -186.3333 -196.5996 -240.5503 -240.5503

@brownd1978

Copy link
Copy Markdown
Contributor

Thanks for adding the printout Rob. Do you understand why bethemean energy loss is less than moyalmean at low momentum? Is this perhaps related to the AI review of Mu2e/Offline#1868 ? "It omits the shell correction (shellCorrection) that KinKal's own ionizationEnergyLossMPV includes. For the low-bg2 regime that matters; for the ~100 MeV electrons/muons here it's small, but the ratio f is then not a clean "same physics minus the restriction," so the comment "same density-effect KinKal uses" is only half-true."

@RobMina

RobMina commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

The MPV scales with eloss_xi, whereas the bethemean scales with Tmax. So for this thick target, the MPV (and thus the moyalmean) end up larger than the bethemean for low-energy muons. If you take the difference bethemean - MPV, the dominant term is ln(Tmax/eloss_xi), and Tmax is small at low momentum, whereas eloss_xi is large for a thick absorber. The implicit assumption in the moyalmean calculation in particular is that there is a very long Landau tail of high-energy-loss events, which is only true when Tmax >> eloss_xi (so not for low-momentum muons traversing a thick slab of concrete).

The new implementation of bethemean in KinKal includes the shell correction (https://github.com/RobMina/KinKal/blob/068fba7f2ff9d025f00702d793a91b21da50ba6a/MatEnv/DetMaterial.cc#L167),
so the AI comment is a red herring.

@brownd1978

brownd1978 commented Jul 16, 2026 via email

Copy link
Copy Markdown
Contributor

@brownd1978
brownd1978 merged commit 2011f34 into KFTrack:main Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants