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

Commit

Permalink
fix special case of handling TLorentzVector -> TVector3 with non-jagg…
Browse files Browse the repository at this point in the history
…ed arrays
  • Loading branch information
jpivarski committed Sep 27, 2018
1 parent 7258071 commit 9a25959
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions uproot_methods/classes/TLorentzVector.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ def _initObjectArray(self, table):
def p3(self):
out = self.empty_like(generator=lambda row: uproot_methods.classes.TVector3.TVector3(row["fX"], row["fY"], row["fZ"]))
if isinstance(self, awkward.JaggedArray):
out.__class__ = type("JaggedArray", (awkward.JaggedArray, uproot_methods.classes.TVector3.ArrayMethods), {})
out.__class__ = type("JaggedArrayMethods", (awkward.JaggedArray, uproot_methods.classes.TVector3.ArrayMethods), {})
else:
out.__class__ = uproot_methods.classes.TVector3.ArrayMethods
out.__class__ = type("ObjectArrayMethods", (awkward.ObjectArray, uproot_methods.classes.TVector3.ArrayMethods), {})
out["fX"] = self.x
out["fY"] = self.y
out["fZ"] = self.z
Expand Down Expand Up @@ -216,9 +216,9 @@ def unit(self):
def boostp3(self):
out = self.empty_like(generator=lambda row: uproot_methods.classes.TVector3.TVector3(row["fX"], row["fY"], row["fZ"]))
if isinstance(self, awkward.JaggedArray):
out.__class__ = type("JaggedArray", (awkward.JaggedArray, uproot_methods.classes.TVector3.ArrayMethods), {})
out.__class__ = type("JaggedArrayMethods", (awkward.JaggedArray, uproot_methods.classes.TVector3.ArrayMethods), {})
else:
out.__class__ = uproot_methods.classes.TVector3.ArrayMethods
out.__class__ = type("ObjectArrayMethods", (awkward.ObjectArray, uproot_methods.classes.TVector3.ArrayMethods), {})
out["fX"] = self.x / self.t
out["fY"] = self.y / self.t
out["fZ"] = self.z / self.t
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.1"
__version__ = "0.2.2"
version = __version__
version_info = tuple(re.split(r"[-\.]", __version__))

Expand Down

0 comments on commit 9a25959

Please sign in to comment.