class graphicle.data.PdgArray(graphicle.base.ArrayBase)[source]

Returns data structure containing PDG integer codes for particle data.

New in version 0.1.0.

Changed in version 0.2.0: Added internal numpy interfaces for greater interoperability.

Changed in version 0.4.1: name property now gives unicode array. latex property added.

Parameters:
data : sequence[int]

The PDG codes for each particle in the point cloud.

name[source]

String representation of particle names.

Type:

ndarray[unicode]

charge[source]

Charge for each particle in elementary units.

Type:

ndarray[float64]

mass[source]

Mass for each particle in GeV.

Type:

ndarray[float64]

mass_bounds[source]

Mass upper and lower bounds for each particle in GeV. Structured array with fields ('masslower', 'massupper').

Type:

ndarray[void]

quarks[source]

String representation of quark composition for each particle.

Type:

ndarray[object]

width[source]

Width for each particle in GeV.

Type:

ndarray[float64]

width_bounds[source]

Width upper and lower bounds for each particle in GeV. Structured array with fields ('widthlower', 'widthupper').

Type:

ndarray[void]

isospin[source]

Isospin for each particle.

Type:

ndarray[float64]

g_parity[source]

G-parity for each particle.

Type:

ndarray[float64]

space_parity[source]

Spatial parity for each particle.

Type:

ndarray[float64]

charge_parity[source]

Charge parity for each particle.

Type:

ndarray[float64]

latex[source]

LaTeX compatible representation of particle names.

Type:

list[str]

mask()[source]

Returns MaskArray to blacklist or whitelist PDGs from event.

copy()[source]

Provides a deepcopy of the data.

Public members

classmethod from_name(names: str | Iterable[str]) PdgArray[source]

Instantiates PdgArray using string representations of particle names, instead of integer valued PDG codes.

__repr__() str[source]

Return repr(self).

__iter__() Iterator[int][source]

Iterator exposing contained data as Python native.

__array__() ndarray[Any, dtype[int32]][source]

Numpy array representation of the data.

__bool__() bool[source]

Truthy returns False if no elements, True otherwise.

__eq__(other: ArrayBase | ndarray[Any, dtype[Any]]) MaskArray[source]

Equality comparison.

__ne__(other: ArrayBase | ndarray[Any, dtype[Any]]) MaskArray[source]

Non equality comparison.

__getitem__(key) PdgArray[source]
property data : ndarray[Any, dtype[int32]][source]
copy() PdgArray[source]

Copies the underlying data into a new PdgArray instance.

mask(target, ...) MaskArray[source]

Provide a mask over particle evaluated against the passed target pdg codes. May be used to select or filter out particles with given pdg.

property name : ndarray[Any, dtype[str_]][source]
property latex : ndarray[Any, dtype[str_]][source]
property charge : ndarray[Any, dtype[float64]][source]
property mass : ndarray[Any, dtype[float64]][source]
property mass_bounds : ndarray[Any, dtype[void]][source]
property quarks : ndarray[Any, dtype[str_]][source]
property width : ndarray[Any, dtype[float64]][source]
property width_bounds : ndarray[Any, dtype[void]][source]
property isospin : ndarray[Any, dtype[float64]][source]
property g_parity : ndarray[Any, dtype[float64]][source]
property space_parity : ndarray[Any, dtype[float64]][source]
property charge_parity : ndarray[Any, dtype[float64]][source]
serialize() tuple[int, ...][source]

Provides a serialized version of the underlying data.

__setattr__(name, val)[source]

Method generated by attrs for class PdgArray.

PdgArray(...)[source]

Method generated by attrs for class PdgArray.

dtype : dtype[source]
index(value, ...) integer -- return first index of value.[source]

Raises ValueError if the value is not present.

count(value) integer -- return number of occurrences of value[source]
classmethod __subclasshook__(C)[source]

Abstract classes can override this to customize issubclass().

PdgArray = <bound method GenericAlias of <class 'collections.abc.Iterable'>>[source]
__lt__(other)[source]

Return self<value.

__le__(other)[source]

Return self<=value.

__gt__(other)[source]

Return self>value.

__ge__(other)[source]

Return self>=value.

__or__(other)[source]

Return self|value.

__ror__(other)[source]

Return value|self.


Last update: Jun 27, 2025