-
Notifications
You must be signed in to change notification settings - Fork 2
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
Documentation #30
Comments
I have a question about using this. I am using the CorsikaParticleFile and I don't understand the particle_description parameter. They don't seem to correspond with particle IDs I know. For reference, I want to look at all the muons from an event. |
Hi @mathewpotts The It's a composite value of the particle id and other information:
So to get the particle id, you need to compute: particle_description // 1000 |
The scikit-hep
https://github.com/scikit-hep/particle Small example: import numpy as np
from corsikaio import CorsikaParticleFile
from particle import Corsika7ID, Particle
MUON_IDS = [
# get corsika 7 id from the particle name
Corsika7ID.from_pdgid(Particle.from_name("mu-").pdgid),
Corsika7ID.from_pdgid(Particle.from_name("mu+").pdgid),
]
with CorsikaParticleFile("./DAT000006") as f:
for e in f:
particle_ids = e.particles["particle_description"].astype(int) // 1000
# boolean mask for all muons
muons = np.isin(particle_ids, MUON_IDS)
# count them
ids, counts = np.unique(particle_ids[muons], return_counts=True)
for cid, count in zip(ids, counts):
# create particle from the corsika 7 id
p = Particle.from_pdgid(Corsika7ID(cid).to_pdgid())
print(p, count) |
The only docs we have its the README and features like that introduced by #21 are not easy to understand if you are not an experienced developer.
What if we strat proper documentation like in other CTA projects like ctapipe/protopipe?
The text was updated successfully, but these errors were encountered: