-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Energy loss function #1323
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1323 +/- ##
=======================================
Coverage 49.81% 49.81%
=======================================
Files 420 421 +1
Lines 23874 23876 +2
Branches 10835 10836 +1
=======================================
+ Hits 11894 11895 +1
Misses 4366 4366
- Partials 7614 7615 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Looking at eq. 33.5 and 33.11 this seems indeed like an inconsistency to me. @asalzburger can you have a look at this? Of course this changes the output of everything we run that runs the fast sim. |
Hi @beomki-yeo - great catch, I assigned that to me & will cross-check the details. |
OK. BTW I still see the inconsistency in energy loss function (from both Bethe and Landau) compared to the value in the figures of the same reference. I thought the discrepancies are from the approximated mean excitation energy, but it seems not the main reason apparently (the approximation is not that bad). I will provide the details later when I have time but do you guys have any idea what the reason could be |
Re your update: this is indeed very interesting. If we're now sort of mitigating literature errors, I guess we should thoroughly document the actual equations being used. Do you think it makes sense to have this as a page on the documentation, which references the source publications, but also lists explicitly the combined equations being used now? (in a future PR) |
I am not sure if we need a dedicated place in the documentation, since mostly everything is explained in this PR. I am afraid, that we might just mirror GH to the docs and lose some information (e.g. the discussions). |
If we want to track the documentation in this PR we should at least link it in the code since git history is a bit loose after a following change IMO but it would not hurt to have an MD documenting the formulas used in the code and referencing where they come from. the code can then point to this doc |
I agree with @andiwand. What I was suggesting was to have a document which explicitly writes out the equations as they are implemented after this PR, rather than having something like // like eq 33.5 from Ref 1 but with epsilon from eq 35.22 and adjusted m to account for ... because I think that will make it much harder to get up to speed on what's happening. |
this seems to have some impact on #1385 (comment) do you think we can get this in in the near future? @beomki-yeo @paulgessinger it looks like some reference tests are failing because the output changed. but otherwise the fix is complete? |
The fix is not complete yet. I still need to modify the density correction effect. |
This issue/PR has been automatically marked as stale because it has not had recent activity. The stale label will be removed if any interaction occurs. |
Here are the key changes:
After the updates, Integration test of Let me also ping @niermann999 as she might be interested in synchronizing detray and Acts material. |
📊 Physics performance monitoring for 7bc345bFull report VertexingSeedingCKFAmbiguity resolutionTruth tracking (Kalman Filter)Truth tracking (GSF) |
Hmm truth tracking test fails :/... @paulgessinger Is there any possibility that physmon uses data simulated from the reference commit? |
I saw - let's discuss this tomorrow, I have an idea how to validate this. |
simulation is done on the fly but we compare to reference. so I guess a failure is expected if we fix something in the energy loss? |
"compare to reference" means "compare to the data simulated from reference commit"? If that is the case, the shift in qoverp pull value distribution can be explained. If not, I made a stupid mistake in the PR |
yes - the reference is just an output generated by a previous run of physmon with a commit from the main branch. so if you change the physics this will reflected in your physmon run and will fail the comparison if we are happy with the new results you can copy the new output files from the CI and put the into the reference folder before merging. that way we make sure nobody accidentally breaks things again |
3d9df0e
to
5e2d677
Compare
lets hope not 🤔 it would be pions in that case right? |
I think it was not electron; Yeah Pions or muons I guess |
the // calculate the most probable value of the Landau distribution
double mpv = m_mpvScale * xi / (beta * beta) *
(std::log(m * eta2 * kaz / (iPot * iPot)) + 0.2 -
beta * beta - delta); //
// 12.325); |
TBH, I didn't look into other terms seriously; I will crosscheck - but why do you think it is not aligned? |
I the equation you posted there is only |
Nah the equation I posted is in the form of |
haha I fell for the same trick twice - thanks 😄 lets bring this PR one more time into the round table on tuesday and then merge it |
Of course |
4b7f52a
to
89a2962
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andiwand has ironed that out anyway - again, @beomki-yeo great work!
One pending discussion to be resolved, then we can merge that in. |
I also need to update the CI reference and root hash tag - I will do that promptly |
b7c8c54
to
3627292
Compare
3627292
to
e86202f
Compare
It is good to go now |
…Bethe-Function
This PR fixes the Bethe energy loss function in
Interactions.cpp
Acts::computeEnergyLossBethe
andActs::computeEnergyLossLandau
is implemented from equation 33.5 and 33.11 of Review in Particle PhysicsAnd their first term is computed with
computeEpsilon
function, following the notation of equation 33.11:Problem is that the epsilon term of equation 33.5 for Bethe function doesnt have the
0.5f
termEq. 33.5
Eq. 33.11
If we are going to use the same epsilon term, we need to multiply 2 in the next term of Bethe energy loss function
After the change, the output of
Acts::computeEnergyLossBethe
gets consistent with Figure 33.2 of the reference.Update July 18th
Looks like there is a literature error in Landau energy loss function (eq. 33.11).
It used the mass term of the incident particle (
m
), but I guess it should be the mass of electron (m_e
) as equation 33.5.I need a cross-check from someone who can access Straggling in thin silicon detectors, which I cannot (Update: It is confirmed that it should be the rest mass of electron)
Finally, to get a consistent result of energy loss function, we need to fix the
computeDeltaHalf
term as well.But this is already mentioned in the comment which says: "Should we use RPP2018 eq. 33.7 instead w/ tabulated constants?"
Yeah it does make big difference between 33.6 (valid for very high energy particles) and 33.7.
I am not going to include delatHalf term correction in this PR, but it is included in acts-project/detray#282
After fixing codes (including the deltaHalf term), the Bethe energy loss function matches to the value in (PDG)
In the following figure, Bethe energy loss (dE/dx) in Silicon is compared for Acts main, this PR, acts-project/detray#282, and PDG value. The value from this PR is not accurate yet due to the incorrect deltaHalf term
For the most probable energy loss from Landau equation under the same condition of Figure 33.7 of Review in Particle Physics
, detray#282 got 0.526 MeV, which is very close to the value in the figure.
This PR got 0.739 MeV due to the incorrect delatHalf term