Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Commit

Permalink
another bug: TLorentzVectorArray.from_ptetaphim and the from_p3 it de…
Browse files Browse the repository at this point in the history
…pends on
  • Loading branch information
jpivarski committed Sep 28, 2018
1 parent 9a25959 commit 94b577f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions uproot_methods/classes/TLorentzVector.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ def origin_like(cls, array):
@classmethod
def from_p3(cls, p3, t):
out = cls.__new__(cls)
out._initObjectArray(awkward.Table())
out["fX"] = p3.x
out["fY"] = p3.y
out["fZ"] = p3.z
Expand Down Expand Up @@ -577,11 +578,11 @@ def from_ptetaphi(cls, pt, eta, phi, energy):

@classmethod
def from_ptetaphim(cls, pt, eta, phi, mass):
x = pt * awkward.util.numpy.cos(phi),
y = pt * awkward.util.numpy.sin(phi),
x = pt * awkward.util.numpy.cos(phi)
y = pt * awkward.util.numpy.sin(phi)
z = pt * awkward.util.numpy.sinh(eta)
p3 = uproot_methods.classes.TVector3.TVector3Array(x, y, z)
return cls.from_p3(p3, awkward.util.numpy.sqrt(x*x + y*y + z*z + m*m*awkward.util.numpy.sign(m)))
return cls.from_p3(p3, awkward.util.numpy.sqrt(x*x + y*y + z*z + mass*mass*awkward.util.numpy.sign(mass)))

@property
def x(self):
Expand Down
2 changes: 1 addition & 1 deletion uproot_methods/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

import re

__version__ = "0.2.2"
__version__ = "0.2.3"
version = __version__
version_info = tuple(re.split(r"[-\.]", __version__))

Expand Down

0 comments on commit 94b577f

Please sign in to comment.