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

Commit

Permalink
finalize TVector/TLorentzVector names
Browse files Browse the repository at this point in the history
  • Loading branch information
jpivarski committed Sep 20, 2018
1 parent 4091e51 commit 8554ae3
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 111 deletions.
6 changes: 3 additions & 3 deletions tests/test_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_vector2_array(self):
self.assertEqual(a.tolist(), [TVector2(0, 0), TVector2(0, 1), TVector2(0, 2), TVector2(0, 3), TVector2(0, 4), TVector2(0, 5), TVector2(0, 6), TVector2(0, 7), TVector2(0, 8), TVector2(0, 9)])
self.assertEqual(a[5], TVector2(0, 5))
self.assertEqual(a.y.tolist(), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
self.assertEqual(a.mag2().tolist(), [0.0, 1.0, 4.0, 9.0, 16.0, 25.0, 36.0, 49.0, 64.0, 81.0])
self.assertEqual(a.mag2.tolist(), [0.0, 1.0, 4.0, 9.0, 16.0, 25.0, 36.0, 49.0, 64.0, 81.0])
self.assertEqual((a + TVector2(1000, 2000))[5], TVector2(1000, 2005))
self.assertEqual((a + TVector2(1000, 2000) == TVector2Array(numpy.full(10, 1000), numpy.arange(2000, 2010))).tolist(), [True, True, True, True, True, True, True, True, True, True])
self.assertEqual((a**2).tolist(), [0.0, 1.0, 4.0, 9.0, 16.0, 25.0, 36.0, 49.0, 64.0, 81.0])
Expand Down Expand Up @@ -110,7 +110,7 @@ def test_vector3_array(self):
self.assertEqual(a.tolist(), [TVector3(0, 0, 0), TVector3(0, 1, 0), TVector3(0, 2, 0), TVector3(0, 3, 0), TVector3(0, 4, 0), TVector3(0, 5, 0), TVector3(0, 6, 0), TVector3(0, 7, 0), TVector3(0, 8, 0), TVector3(0, 9, 0)])
self.assertEqual(a[5], TVector3(0, 5, 0))
self.assertEqual(a.y.tolist(), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
self.assertEqual(a.mag2().tolist(), [0.0, 1.0, 4.0, 9.0, 16.0, 25.0, 36.0, 49.0, 64.0, 81.0])
self.assertEqual(a.mag2.tolist(), [0.0, 1.0, 4.0, 9.0, 16.0, 25.0, 36.0, 49.0, 64.0, 81.0])
self.assertEqual((a + TVector3(1000, 2000, 0))[5], TVector3(1000, 2005, 0))
self.assertEqual((a + TVector3(1000, 2000, 0) == TVector3Array(numpy.full(10, 1000), numpy.arange(2000, 2010), numpy.zeros(10))).tolist(), [True, True, True, True, True, True, True, True, True, True])
self.assertEqual((a**2).tolist(), [0.0, 1.0, 4.0, 9.0, 16.0, 25.0, 36.0, 49.0, 64.0, 81.0])
Expand Down Expand Up @@ -154,7 +154,7 @@ def test_lorentzvector_array(self):
self.assertEqual(a.tolist(), [TLorentzVector(0, 0, 0, 0), TLorentzVector(0, 1, 0, 0), TLorentzVector(0, 2, 0, 0), TLorentzVector(0, 3, 0, 0), TLorentzVector(0, 4, 0, 0), TLorentzVector(0, 5, 0, 0), TLorentzVector(0, 6, 0, 0), TLorentzVector(0, 7, 0, 0), TLorentzVector(0, 8, 0, 0), TLorentzVector(0, 9, 0, 0)])
self.assertEqual(a[5], TLorentzVector(0, 5, 0, 0))
self.assertEqual(a.y.tolist(), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
self.assertEqual(a.mag2().tolist(), [0.0, -1.0, -4.0, -9.0, -16.0, -25.0, -36.0, -49.0, -64.0, -81.0])
self.assertEqual(a.mag2.tolist(), [0.0, -1.0, -4.0, -9.0, -16.0, -25.0, -36.0, -49.0, -64.0, -81.0])
self.assertEqual((a + TLorentzVector(1000, 2000, 0, 0))[5], TLorentzVector(1000, 2005, 0, 0))
self.assertEqual((a + TLorentzVector(1000, 2000, 0, 0) == TLorentzVectorArray(numpy.full(10, 1000), numpy.arange(2000, 2010), numpy.zeros(10), numpy.zeros(10))).tolist(), [True, True, True, True, True, True, True, True, True, True])
self.assertEqual((a**2).tolist(), [0.0, -1.0, -4.0, -9.0, -16.0, -25.0, -36.0, -49.0, -64.0, -81.0])
Expand Down
Loading

0 comments on commit 8554ae3

Please sign in to comment.