CORSIKA Particles

Use this for particle identification for particles in CORSIKA

Particle codes as specified in CORSIKA user manual, Table 4.

This relates to the Description in Particles as:

particle id x 1000 + hadron generation x 10 + no. of observation level

So to find e+/e-:

from sapphire.corsika import particles

particle.id = 2
if particles.name(particle.id) in ['positron', 'electron']:
    pass

particle.id = 1206
if particle.id > 200:
    print('atom: %s' % particles.ATOMIC_NUMBER[particle.id % 100])
sapphire.corsika.particles.name(particle_id)

Get the name for a CORSIKA particle code

Parameters:particle_id – code for the particle
Returns:name of the particle. In case of atoms the weight is added to the name.
sapphire.corsika.particles.particle_id(name)

Get the CORSIKA particle code for a partice name

Parameters:name – name of the particle/atom, for atoms the mass (neutrons + protons) can be appended to the name.
Returns:CORSIKA code for the particle. For atoms the code is: A x 100 + Z