pidp_tools.formatting module

This module contains some miscellaneous formatting functions.

pidp_tools.formatting.format_labels(particle)[source]

Formats a particle label from a plain string to a LaTeX string.

Parameters

particle : str

The particle label to be converted into a LaTeX string.

Returns

str

The LaTeX formatted label, or the original label if not a valid particle type.

pidp_tools.formatting.from_pdg(ptype)[source]

Finds the string label of the particle based on a Particle Data Group (PDG) number.

Parameters

ptype : int

A PDG number corresponding to a particle in the following list: [“Photon”,”KLong”,”Neutron”,”Proton”,”K+”,”Pi+”,”AntiMuon”,”Positron”,”AntiProton”,”K-“,”Pi-“,”Muon”,”Electron”,”No ID”]

Returns

str

A string of the name of the particle that corresponds to the provided pdg number.