LorentzVector
- class coffea.nanoevents.methods.vector.LorentzVector[source]
Bases:
ThreeVectorA 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,yandzcompontents divided bytas aThreeVectorAlias for
tPseudorapidity
Invariant mass (+, -, -, -)
Squared
massThe
x,yandzcompontents as aThreeVectorMethods Summary
absolute()Magnitude of this Lorentz vector
add(other)Add two vectors together elementwise using
x,y,z, andtcomponentsboost(other)Apply a Lorentz boost given by the
ThreeVectorotherand return itdelta_r(other)Distance between two Lorentz vectors in (eta,phi) plane
delta_r2(other)Squared
delta_rmetric_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, andtcomponentsnearest(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, andtcomponentssum([axis])Sum an array of vectors elementwise using
x,y,z, andtcomponentsAttributes Documentation
- boostvec
The
x,yandzcompontents divided bytas aThreeVectorThis 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,yandzcompontents as aThreeVector
Methods Documentation
- boost(other)[source]
Apply a Lorentz boost given by the
ThreeVectorotherand 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
selfwith a new axis with shape ofotherappended at the specified axis depths.- Parameters:
other (awkward.Array) – Another array with same shape in all but
axisaxis (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, andtcomponents
- nearest(other, axis=1, metric=<function LorentzVector.<lambda>>, return_metric=False, threshold=None)[source]
Return nearest object to this one
Finds item in
othersatisfyingmin(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
axisaxis (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 > thresholdwill be masked from the result