cta-observatory / ctapipe

Low-level data processing pipeline software for CTAO or similar arrays of Imaging Atmospheric Cherenkov Telescopes
https://ctapipe.readthedocs.org
BSD 3-Clause "New" or "Revised" License
63 stars 267 forks source link

Switch to PDGID numbering scheme for particles #2230

Open maxnoe opened 1 year ago

maxnoe commented 1 year ago

We should move from the sim_telarray specific particle numbering scheme to one well-defined and widely used.

The PDGID numbering scheme will be used by CORSIKA 8 and is also proposed in the draft of the common data models document for CTA.

kosack commented 1 year ago

This should also be synced with gammasim-tools if they don't already do this (I have not checked, but I posted a message on Slack)

maxnoe commented 1 year ago

What kind of sync do you expect to be necessary? I would expect that the simtel output will still contain simtel numbers but that we convert those in the SimTelEventSource.

kosack commented 1 year ago

I mean they also have a mapping from an internal representation to the corsika numbering, so we consider using the same so we don't end up with configuration mismatches, or confusing monitoring data.

They responded they only use CORSIKA7 numbering, and I notice they have a mapping to particle name as well

Basically if the standard is to use PDGIDs, we should recommend we do that everywhere, as later many things may be linked to this identifier/metadata.

orelgueta commented 1 year ago

Yes we only use name which are translated to CORSIKA 7 numbers. I guess we will have to keep both numbering schemes in gammasim-tools and translate as necessary when running the simulation. However, as Max said, at the output you will probably have to do the translation as well.

kosack commented 1 year ago

Would be nice to have a shared set of functions that does the mappings to/from various conventions

maxnoe commented 1 year ago

https://github.com/scikit-hep/particle/

Also supports CORSIKA 7 (was added recently by a Dortmund master student)

orelgueta commented 2 days ago

@GernotMaier implemented a small class to accept either PDG ID or CORSIKA 7 ID in simtools. You might find it useful (or at least it would be nice to use the same class if possible).

https://github.com/gammasim/simtools/blob/main/simtools/corsika/primary_particle.py