-
Notifications
You must be signed in to change notification settings - Fork 24
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
from_nucleus_info and from_name inconsitency #620
Comments
Same for a neutron btw.:
|
Hi @maxnoe. Thank you for stress-testing the package :-). So, the reason for these 2, and only 2, exceptions (well, double to accout for their antiparticles), is what @HDembinski replied to you at #263 (comment). Basically, protons and neutrons can be "seen" as both particles and nuclei, hence the exceptions of non-unique PDG IDs for them. I think there is no way out, as otherwise one would need to remove all nuclei info. But you are totally right that, for the sake of argument, the "particle proton" and the "nucleus proton", with different PDG IDs, should compare to equal. And a fix will resolve this issue by construction since the round-trip works, as it should, for all other particles. Would you be interested in making a contribution for the fix? That would be cool. |
Yes, sure, happy to make a PR. Could you maybe roughly point me into the right general direction? for the comparison part, I guess overloading |
Brilliant 👍 ! Yep. Unfortunately the PR will not be tiny because one needs to overload the various comparison operators for Particle. I don't think one should change the PDGID class comparison methods because the PDGIDs are different, albeit refering to the same particle. A little test will be great as well to keep coverage high. |
I.e. this does not round-trip, which is very surprising:
The text was updated successfully, but these errors were encountered: