Add support for RapidSim names#756
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #756 +/- ##
==========================================
- Coverage 97.89% 97.30% -0.60%
==========================================
Files 31 35 +4
Lines 2619 2667 +48
==========================================
+ Hits 2564 2595 +31
- Misses 55 72 +17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
To improve the coverage, I should add a test that mocks |
|
Hello @admorris, I will look at this next week ... One immediate reaction is indeed why RapidSim uses non PDG/EvtGen standard names in the 2020s!? It's more complication for absolute zero gain. The obvious question is whether it would not be simpler in the end to sort the issue at source? In the end they must be using names as labels, right, so should be rather easy? Have you checked this with the authors? I am not saying I am opposing to having another submodule as we already have for LHCb. Just asking for the record. Thanks. |
|
Hi Eduardo That's a fair suggestion. I just had a go at converting RapidSim's There are a lot of open PRs and issues in RapidSim which suggest it's not being actively maintained. But I'm sure Greig and Dan are still contactable. |
|
Hi. I checked briefly your data file and all 4 misses are for wrongly assigned PDGIDs from RapidSim authors. I could find the correct replacements in https://github.com/scikit-hep/particle/blob/main/src/particle/data/conversions.csv. I don't know how you and LHCb would like to proceed, but that seems like the main point here, else I am happy to merge this as-is if that helps with support for LHCb. I see many LHCb analysts still using RapidSim, hence it is useful and should be maintained. If the authors are not active anymore, could the package be taken over by LHCb somehow? I see it is effectively dead, since the last release is from 2019 and the latest merge from 2 years ago - https://github.com/gcowan/RapidSim! |
| """ | ||
| lines: list[str] = ["PDGID,STR\n"] | ||
| with dat_file.open(encoding="utf-8") as f: | ||
| next(f) # skip header line |
There was a problem hiding this comment.
There is now an extra line to skip given my added comment, right?
eduardo-rodrigues
left a comment
There was a problem hiding this comment.
This looks great and I only made a couple of trivial suggestions.
Another suggestion would be to add somewhere in the docs the link to RapidSim, probably in admin/dump_pdgid_to_rapidsim.py but also in the functions to and from?
I let you decide if you update the docs for this new functionality here or in a follow-up PR.
Last thing: did you then decide what to do overall, I mean given the exchange above? Even if some work is going to be done to revive and modernise RapidSim, it may still take a while before that's available. If helpful we can move on merging and releasing this asap. Just let me know.
Thank you again for the great and clear enhancement.
|
Hi @admorris, I saw that RapidSim got moved to the LHCb organisation. Let me know your decision on this work. |
|
I had a quick chat with Michal K a few weeks ago about it, and I think we agreed it's better not to break backwards compatibility with the names, but also that it should be easier for the user to provide their own particle table. At the moment you need to copy the whole config directory and override the parts you need. The PDG ID bugs should be fixed though IMO. I am undecided on how that impacts whether this PR is needed. Someone who wants to use Particle is probably proactive enough to provide their own particle table to RapidSim (of course we could ship one with it and make it a flag). |
|
OK, then we leave this open and see. Maybe you can chat to 1-2 usual suspects and see what their take is? I agree that at least the PDG ID bugs ought to be fixed. Thanks. |
Co-authored-by: Eduardo Rodrigues <eduardo.rodrigues@cern.ch>
|
Hi. I know this is in standby. Just to say, FYI, there's been in the past days a great enhancement that simplifies conversions enormously, making them better designed, see #780. |
I added support for the RapidSim particle-naming convention (oh how I wish they just used EvtGen names!)
It largely follows the same strategy as the LHCb names, but with the important difference of loading from
$RAPIDSIM_ROOT/config/particles.datif present, which is nice if you're usingparticlein e.g. a conda environment withrapidsiminstalled.