LorentzVector
- class coffea.nanoevents.methods.vector.LorentzVector[source]
Bases:
ThreeVector
A cartesian Lorentz vector
A heavy emphasis towards a momentum vector interpretation is assumed. (+, -, -, -) metric This mixin class requires the parent class to provide items
x
,y
,z
, andt
.Attributes Summary
The
x
,y
andz
compontents divided byt
as aThreeVector
Alias for
t
Pseudorapidity
Invariant mass (+, -, -, -)
Squared
mass
The
x
,y
andz
compontents as aThreeVector
Methods Summary
absolute
()Magnitude of this Lorentz vector
add
(other)Add two vectors together elementwise using
x
,y
,z
, andt
componentsboost
(other)Apply a Lorentz boost given by the
ThreeVector
other
and return itdelta_r
(other)Distance between two Lorentz vectors in (eta,phi) plane
delta_r2
(other)Squared
delta_r
metric_table
(other[, axis, metric, ...])Return a list of a metric evaluated between this object and another.
multiply
(other)Multiply this vector by a scalar elementwise using
x
,y
,z
, andt
componentsnearest
(other[, axis, metric, ...])Return nearest object to this one
negative
()Returns the negative of the vector
subtract
(other)Subtract a vector from another elementwise using
x
,y
,z
, andt
componentssum
([axis])Sum an array of vectors elementwise using
x
,y
,z
, andt
componentsAttributes Documentation
- boostvec
The
x
,y
andz
compontents divided byt
as aThreeVector
This can be used for boosting. For cases where
|t| <= rho
, this returns the unit vector.
- eta
Pseudorapidity
\(-\ln[\tan(\theta/2)] = \text{arcsinh}(z/r)\)
- mass
Invariant mass (+, -, -, -)
\(\sqrt{t^2-x^2-y^2-z^2}\)
- pvec
The
x
,y
andz
compontents as aThreeVector
Methods Documentation
- boost(other)[source]
Apply a Lorentz boost given by the
ThreeVector
other
and return itNote that this follows the convention that, for example in order to boost a vector into its own rest frame, one needs to use the negative of its
boostvec
- delta_r(other)[source]
Distance between two Lorentz vectors in (eta,phi) plane
\(\sqrt{\Delta\eta^2 + \Delta\phi^2}\)
- metric_table(other, axis=1, metric=<function LorentzVector.<lambda>>, return_combinations=False)[source]
Return a list of a metric evaluated between this object and another.
The two arrays should be broadcast-compatible on all axes other than the specified axis, which will be used to form a cartesian product. If axis=None, broadcast arrays directly. The return shape will be that of
self
with a new axis with shape ofother
appended at the specified axis depths.- Parameters:
other (awkward.Array) – Another array with same shape in all but
axis
axis (int, optional) – The axis to form the cartesian product (default 1). If None, the metric is directly evaluated on the input arrays (i.e. they should broadcast)
metric (callable) – A function of two arguments, returning a scalar. The default metric is
delta_r
.return_combinations (bool) – If True return the combinations of inputs as well as an unzipped tuple
- multiply(other)[source]
Multiply this vector by a scalar elementwise using
x
,y
,z
, andt
components
- nearest(other, axis=1, metric=<function LorentzVector.<lambda>>, return_metric=False, threshold=None)[source]
Return nearest object to this one
Finds item in
other
satisfyingmin(metric(self, other))
. The two arrays should be broadcast-compatible on all axes other than the specified axis, which will be used to form a cartesian product. If axis=None, broadcast arrays directly. The return shape will be that ofself
.- Parameters:
other (awkward.Array) – Another array with same shape in all but
axis
axis (int, optional) – The axis to form the cartesian product (default 1). If None, the metric is directly evaluated on the input arrays (i.e. they should broadcast)
metric (callable) – A function of two arguments, returning a scalar. The default metric is
delta_r
.return_metric (bool, optional) – If true, return both the closest object and its metric (default false)
threshold (Number, optional) – If set, any objects with
metric > threshold
will be masked from the result