vector.backends.awkward_constructors module#
- vector.backends.awkward_constructors.Array(*args: Any, **kwargs: Any) Any #
Constructs an Awkward Array of vectors, whose type is determined by the fields of the record array (which may be nested within lists or other non-record structures).
All allowed signatures for
ak.Array
can be used in this function.The array must contain records with the following combinations of field names:
(2D)
x
,y
(2D)
rho
,phi
(3D)
x
,y
,z
(3D)
x
,y
,theta
(3D)
x
,y
,eta
(3D)
rho
,phi
,z
(3D)
rho
,phi
,theta
(3D)
rho
,phi
,eta
(4D)
x
,y
,z
,t
(4D)
x
,y
,z
,tau`
(4D)
x
,y
,theta
,t`
(4D)
x
,y
,theta
,tau`
(4D)
x
,y
,eta
,t`
(4D)
x
,y
,eta
,tau`
(4D)
rho
,phi
,z
,t`
(4D)
rho
,phi
,z
,tau`
(4D)
rho
,phi
,theta
,t`
(4D)
rho
,phi
,theta
,tau`
(4D)
rho
,phi
,eta
,t`
(4D)
rho
,phi
,eta
,tau`
in which
px
may be substituted forx
py
may be substituted fory
pt
may be substituted forrho
pz
may be substituted forz
E
may be substituted fort
e
may be substituted fort
energy
may be substituted fort
M
may be substituted fortau
m
may be substituted fortau
mass
may be substituted fortau
to make the vector a momentum vector.
No constraints are placed on the types of the vector fields, though if they are not numbers, mathematical operations will fail. Usually, you want them to be integers or floating-point numbers.
- vector.backends.awkward_constructors._check_names(projectable: Any, fieldnames: list[str]) tuple[bool, int, list[str], Any] #
- vector.backends.awkward_constructors._is_type_safe(array_type: Any) bool #
- vector.backends.awkward_constructors._recname(is_momentum: bool, dimension: int) str #
- vector.backends.awkward_constructors.zip(arrays: dict[str, Any], depth_limit: int | None = None) Any #
Constructs an Awkward Array of vectors, whose type is determined by the fields of the record array (which may be nested within lists or other non-record structures).
This function accepts a subset of
ak.zip
’s arguments.- Parameters:
arrays (dict of str to array-like) – Arrays, lists, etc. to zip together. Unlike
ak.zip
, this must be a dict with string keys to determine the coordinate system of the arrays; it may not be a tuple.depth_limit (None or int) – If None, attempt to fully broadcast the
array
to all levels. If an int, limit the number of dimensions that get broadcasted. The minimum value is1
, for no broadcasting.
The array must contain records with the following combinations of field names:
(2D)
x
,y
(2D)
rho
,phi
(3D)
x
,y
,z
(3D)
x
,y
,theta
(3D)
x
,y
,eta
(3D)
rho
,phi
,z
(3D)
rho
,phi
,theta
(3D)
rho
,phi
,eta
(4D)
x
,y
,z
,t
(4D)
x
,y
,z
,tau`
(4D)
x
,y
,theta
,t`
(4D)
x
,y
,theta
,tau`
(4D)
x
,y
,eta
,t`
(4D)
x
,y
,eta
,tau`
(4D)
rho
,phi
,z
,t`
(4D)
rho
,phi
,z
,tau`
(4D)
rho
,phi
,theta
,t`
(4D)
rho
,phi
,theta
,tau`
(4D)
rho
,phi
,eta
,t`
(4D)
rho
,phi
,eta
,tau`
in which
px
may be substituted forx
py
may be substituted fory
pt
may be substituted forrho
pz
may be substituted forz
E
may be substituted fort
e
may be substituted fort
energy
may be substituted fort
M
may be substituted fortau
m
may be substituted fortau
mass
may be substituted fortau
to make the vector a momentum vector.