-
Notifications
You must be signed in to change notification settings - Fork 69
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
Possible fix for wrong secondary masses of photons and neutrinos #484
Possible fix for wrong secondary masses of photons and neutrinos #484
Conversation
… lines for non-nuclei
…nuclei as suggested by Lukas and Julien
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.
The solution looks good to me.
I have only smaller style comments.
And maybe we should include a test in the testCore
part explicitly checking the secondary mass.
CHANGELOG.md
Outdated
|
||
### New features: | ||
|
||
### Interface changes: | ||
* Added new backwards-compatible function particleMass that returns particle mass also for non-nuclei |
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.
Add this to new features, as the old interface stays the same.
There is no change in behaviour for the old functions, which are available for the user.
@param id id of the particle following the PDG numbering scheme | ||
@returns The mass of a the particle | ||
*/ | ||
double particleMass(int id); |
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.
add whiteline between the function definition and the comment for the next function.
src/ParticleMass.cpp
Outdated
if (isNucleus(id)) | ||
return nuclearMass(id); | ||
if (abs(id) == 11) | ||
m = mass_electron; |
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.
why is it here not a direct return statement. This would reduce the code amount.
Looks good to me. Let's wait for more comments otherwise I will merge in the next days. |
Thank you very much for your feedback! |
…ing new test for the particleMass() function
Dear all,
with this PR we try to fix #483. @lukasmerten, @JulienDoerner and me discussed it and introduced a new function particleMass(int id) in ParticleMass.cpp to fix the bug by calling it in setId(int newId) in ParticleState.cpp. It gives all particles other than nuclei or electrons/positrons a zero rest-mass and could possibly be extended for other particles when needed.