Skip to content

Commit

Permalink
fix: remove bad accessors for cylindrical pt/eta/phi vectors
Browse files Browse the repository at this point in the history
lgray authored Aug 19, 2024
1 parent 4cc6b25 commit d53680c
Showing 1 changed file with 0 additions and 160 deletions.
160 changes: 0 additions & 160 deletions src/coffea/nanoevents/methods/vector.py
Original file line number Diff line number Diff line change
@@ -513,90 +513,6 @@ class PtEtaPhiMLorentzVector(LorentzVector):
Some additional properties are overridden for performance
"""

@property
def E(self):
"""Alias for `t`"""
return self.t

@property
def pt(self):
"""Alias for `r`"""
return self["pt"]

@property
def eta(self):
r"""Pseudorapidity
:math:`-\ln\tan(\theta/2) = \text{arcsinh}(z/r)`
"""
return self["eta"]

@property
def phi(self):
r"""Azimuthal angle relative to X axis in XY plane
:math:`\text{arctan2}(y, x)`
"""
return self["phi"]

@property
def mass(self):
r"""Invariant mass (+, -, -, -)
:math:`\sqrt{t^2-x^2-y^2-z^2}`
"""
return self["mass"]

@property
def rho(self):
r"""Distance from origin in 3D
:math:`\sqrt{x^2+y^2+z^2} = \sqrt{r^2+z^2}`
"""
return self.pt * numpy.cosh(self.eta)

@property
def theta(self):
r"""Inclination angle from XY plane
:math:`\text{arctan2}(r, z) = 2\text{arctan}(e^{-\eta})`
"""
return 2 * numpy.arctan(numpy.exp(-self.eta))

@property
def r(self):
r"""Distance from origin in XY plane
:math:`\sqrt{x^2+y^2} = \rho \sin(\theta)`
"""
return self.pt

@property
def z(self):
r"""Cartesian z value
:math:`\rho \cos(\theta) = r \sinh(\eta)`
"""
return self.pt * numpy.sinh(self.eta)

@property
def t(self):
r"""Cartesian time component
:math:`\sqrt{\rho^2+m^2}`
"""
return numpy.hypot(self.rho, self.mass)

@property
def rho2(self):
"""Squared `rho`"""
return self.rho * self.rho

@property
def mass2(self):
"""Squared `mass`"""
return self.mass * self.mass

@awkward.mixin_class_method(numpy.multiply, {numbers.Number})
def multiply(self, other):
"""Multiply this vector by a scalar elementwise using `x`, `y`, `z`, and `t` components
@@ -644,82 +560,6 @@ class PtEtaPhiELorentzVector(LorentzVector):
Some additional properties are overridden for performance
"""

@property
def E(self):
"""Alias for `t`"""
return self.t

@property
def pt(self):
"""Alias for `r`"""
return self["pt"]

@property
def eta(self):
r"""Pseudorapidity
:math:`-\ln\tan(\theta/2) = \text{arcsinh}(z/r)`
"""
return self["eta"]

@property
def phi(self):
r"""Azimuthal angle relative to X axis in XY plane
:math:`\text{arctan2}(y, x)`
"""
return self["phi"]

@property
def energy(self):
"""Alias for `t`"""
return self["energy"]

@property
def t(self):
r"""Cartesian time component
:math:`\sqrt{\rho^2+m^2}`
"""
return self["energy"]

@property
def rho(self):
r"""Distance from origin in 3D
:math:`\sqrt{x^2+y^2+z^2} = \sqrt{r^2+z^2}`
"""
return self.pt * numpy.cosh(self.eta)

@property
def theta(self):
r"""Inclination angle from XY plane
:math:`\text{arctan2}(r, z) = 2\text{arctan}(e^{-\eta})`
"""
return 2 * numpy.arctan(numpy.exp(-self.eta))

@property
def r(self):
r"""Distance from origin in XY plane
:math:`\sqrt{x^2+y^2} = \rho \sin(\theta)`
"""
return self.pt

@property
def z(self):
r"""Cartesian z value
:math:`r \sinh(\eta)`
"""
return self.pt * numpy.sinh(self.eta)

@property
def rho2(self):
"""Squared `rho`"""
return self.rho * self.rho

@awkward.mixin_class_method(numpy.multiply, {numbers.Number})
def multiply(self, other):
"""Multiply this vector by a scalar elementwise using `x`, `y`, `z`, and `t` components

0 comments on commit d53680c

Please sign in to comment.