def particle_number(particle_name):
    """
    Return an integer coding the particle type
    'gamma'=0
    'proton'=1
    'electron'=2
    'muon'=3

    Parameters
    ----------
    particle_name: str

    Returns
    -------
    int
    """
    return {
        'gamma': 0,
        'proton': 1,
        'electron': 2,
        'muon': 3,
    }[particle_name]