data

import ampform.data

Data containers for working with four-momenta.

class DataSet(data: Mapping[str, Union[int, float, complex, str, bytes, generic, Sequence[Union[int, float, complex, str, bytes, generic]], Sequence[Sequence[Any]], ArrayLike]], dtype: Union[dtype, None, type, DTypeLike, str, Tuple[Any, int], Tuple[Any, Union[SupportsIndex, Sequence[SupportsIndex]]], List[Any], DTypeLike, Tuple[Any, Any]] = None)[source]

Bases: collections.abc.Mapping

A mapping of variable names to their ScalarSequence.

The keys of DataSet represent variable names in a HelicityModel, while its values are inserted in their place.

__getitem__(i: str)ScalarSequence[source]
append(other: Mapping[str, Union[int, float, complex, str, bytes, generic, Sequence[Union[int, float, complex, str, bytes, generic]], Sequence[Sequence[Any]], ArrayLike]])None[source]
items()ItemsView[source]
keys()KeysView[source]
property n_events
select_events(selection: Union[int, slice])DataSet[source]
to_pandas(_: Union[dtype, None, type, DTypeLike, str, Tuple[Any, int], Tuple[Any, Union[SupportsIndex, Sequence[SupportsIndex]]], List[Any], DTypeLike, Tuple[Any, Any]] = None)Dict[str, ndarray][source]

Converter for the data argument of pandas.DataFrame.

values()ValuesView[source]
class EventCollection(data: Mapping[int, Union[int, float, complex, str, bytes, generic, Sequence[Union[int, float, complex, str, bytes, generic]], Sequence[Sequence[Any]], ArrayLike]])[source]

Bases: collections.abc.Mapping

A mapping of state IDs to their FourMomentumSequence data samples.

An EventCollection has to be converted to DataSet so that it can be used to evaluate a HelicityModel.

__getitem__(i: int)FourMomentumSequence[source]
append(other: Mapping[int, Union[int, float, complex, str, bytes, generic, Sequence[Union[int, float, complex, str, bytes, generic]], Sequence[Sequence[Any]], ArrayLike]])None[source]
items()ItemsView[source]
keys()KeysView[source]
property n_events
select_events(selection: Union[int, slice])EventCollection[source]
sum(indices: Iterable[int])FourMomentumSequence[source]
to_pandas(_: Union[dtype, None, type, DTypeLike, str, Tuple[Any, int], Tuple[Any, Union[SupportsIndex, Sequence[SupportsIndex]]], List[Any], DTypeLike, Tuple[Any, Any]] = None)Dict[Tuple[int, str], ndarray][source]

Converter for the data argument of pandas.DataFrame.

The resulting DataFrame has multi-columns (see MultiIndex / advanced indexing) where the first column layer represents the state IDs and the second column layer represents each of the four-momentum entries (\(E, p_x, p_y, p_z\)).

values()ValuesView[source]
class FourMomentumSequence(data: Union[int, float, complex, str, bytes, generic, Sequence[Union[int, float, complex, str, bytes, generic]], Sequence[Sequence[Any]], ArrayLike])[source]

Bases: numpy.lib.mixins.NDArrayOperatorsMixin, collections.abc.Sequence

Container for a numpy.array of four-momentum tuples.

The input data has to be of shape (N, 4) and the order of the items has to be \((E, p)\) (energy first).

__getitem__(i: Union[Tuple[Union[int, slice], Union[int, slice]], int, slice])ndarray[source]
property energy
mass()ScalarSequence[source]
mass_squared(dtype: Union[dtype, None, type, DTypeLike, str, Tuple[Any, int], Tuple[Any, Union[SupportsIndex, Sequence[SupportsIndex]]], List[Any], DTypeLike, Tuple[Any, Any]] = None)ScalarSequence[source]
p_norm()ScalarSequence[source]

Norm of three_momentum.

p_squared()ScalarSequence[source]

Squared norm of three_momentum.

property p_x
property p_y
property p_z
phi()ScalarSequence[source]
theta()ScalarSequence[source]
property three_momentum
class MatrixSequence(data: Union[int, float, complex, str, bytes, generic, Sequence[Union[int, float, complex, str, bytes, generic]], Sequence[Sequence[Any]], ArrayLike])[source]

Bases: numpy.lib.mixins.NDArrayOperatorsMixin, collections.abc.Sequence

Safe data container for a sequence of 4x4-matrices.

__getitem__(i: Union[int, slice])ndarray[source]
dot(vector: FourMomentumSequence)FourMomentumSequence[source]
class ScalarSequence(data: Union[int, float, complex, str, bytes, generic, Sequence[Union[int, float, complex, str, bytes, generic]], Sequence[Sequence[Any]], ArrayLike], dtype: Union[dtype, None, type, DTypeLike, str, Tuple[Any, int], Tuple[Any, Union[SupportsIndex, Sequence[SupportsIndex]]], List[Any], DTypeLike, Tuple[Any, Any]] = None)[source]

Bases: numpy.lib.mixins.NDArrayOperatorsMixin, collections.abc.Sequence

numpy.array data container of rank 1.

__getitem__(i: Union[int, slice])ndarray[source]
class ThreeMomentum(data: Union[int, float, complex, str, bytes, generic, Sequence[Union[int, float, complex, str, bytes, generic]], Sequence[Sequence[Any]], ArrayLike], dtype: Union[dtype, None, type, DTypeLike, str, Tuple[Any, int], Tuple[Any, Union[SupportsIndex, Sequence[SupportsIndex]]], List[Any], DTypeLike, Tuple[Any, Any]] = None)[source]

Bases: numpy.lib.mixins.NDArrayOperatorsMixin, collections.abc.Sequence

__getitem__(i: Union[Tuple[Union[int, slice], Union[int, slice]], int, slice])ndarray[source]