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

Data structure containing four-momentum of particle list.

New in version 0.1.0.

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

Changed in version 0.2.3: Added x, y, z, and energy attributes.

Changed in version 0.2.11: Added mass_t attribute.

Parameters:
data : ndarray[float64] or sequence of length-4 tuples of floats

Data representing the four-momentum of each particle in the point cloud. Given as either a (n, 4)-dimensional numpy array, or structured array, with field names ('x', 'y', 'z', 'e').

dtype[source]

numpy data type that data is exposed with.

Type:

dtype

Public members

classmethod from_spherical_uniform(size: int, ...) MomentumArray[source]

Returns a MomentumArray whose elements are sampled from uniform distributions of energy and 3-momentum.

__repr__() str[source]

Return repr(self).

property data : ndarray[Any, dtype[void]][source]

Structured array containing ('x', 'y', 'z', 'e') components of four momenta, \(p_\mu\).

__iter__() Iterator[MomentumElement][source]

Iterator exposing contained data as Python native.

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

Numpy array representation of the data.

__getitem__(key) MomentumArray[source]
__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.

copy() MomentumArray[source]

Copies the underlying data into a new MomentumArray instance.

property x : ndarray[Any, dtype[float64]][source]

x component of momentum, \(p_x\).

property y : ndarray[Any, dtype[float64]][source]

y component of momentum, \(p_y\).

property z : ndarray[Any, dtype[float64]][source]

z component of momentum, \(p_z\).

property energy : ndarray[Any, dtype[float64]][source]

Energy component of momentum, \(E\).

property pt : ndarray[Any, dtype[float64]][source]

Transverse component of particle momenta, \(p_T\).

property eta : ndarray[Any, dtype[float64]][source]

Pseudorapidity component of particle momenta, \(\eta\).

property rapidity : ndarray[Any, dtype[float64]][source]

Rapidity component of the particle momenta, \(y\).

property phi : ndarray[Any, dtype[float64]][source]

Azimuth component of particle momenta, \(\phi\).

property theta : ndarray[Any, dtype[float64]][source]

Spherical angle from the beam axis, \(\theta\).

property mass : ndarray[Any, dtype[float64]][source]

Mass of the particles, \(m\).

property mass_t : ndarray[Any, dtype[float64]][source]

Transverse component of particle mass, \(m_T\).

shift_rapidity(shift) MomentumArray[source]

Performs a Lorentz boost to a new frame, with a rapidity increased by shift.

shift_eta(shift, ...) MomentumArray[source]

Performs a Lorentz boost to a new frame, with a pseudorapidity increased by shift.

shift_phi(shift) MomentumArray[source]

Performs an azimuthal rotation about the longitudinal axis, by adding an angle of shift to all elements.

delta_R(other: MomentumArray, ...) ndarray[Any, dtype[float64]][source]

Calculates the Euclidean inter-particle distances, \(\Delta R_{ij}\), in the \(\eta-\phi\) plane between this set of particles and a provided other set. Produces a mxn matrix, where m is number of particles in this MomentumArray, and n is the number of particles in other.

serialize() tuple[MomentumElement, ...][source]

Provides a serialized version of the underlying data.

__setattr__(name, val)[source]

Method generated by attrs for class MomentumArray.

MomentumArray(...)[source]

Method generated by attrs for class MomentumArray.

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().

MomentumArray = <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