コード例 #1
0
ファイル: test_evt.py プロジェクト: leriomaggio/km3pipe
class TestTrackFit(TestCase):

    def setUp(self):
        data = (1, 2, 3, 4, 0, 0, 1, 8, 9, 10, 11, 12, 13, 14)
        self.track_fit = TrackFit(data, zed_correction=0)

    def test_trackfit_init(self):
        track_fit = self.track_fit
        self.assertEqual(1, track_fit.id)
        self.assertListEqual([2, 3, 4], list(track_fit.pos))
        self.assertListEqual([0, 0, 1], list(track_fit.dir))
        self.assertEqual(8, track_fit.E)
        self.assertEqual(9, track_fit.time)
        self.assertEqual(10, track_fit.speed)
        self.assertEqual(11, track_fit.ts)
        self.assertEqual(12, track_fit.te)
        self.assertEqual(13, track_fit.con1)
        self.assertEqual(14, track_fit.con2)

    def test_trackfit_repr(self):
        repr_str = ("Track:\n id: 1\n pos: [2 3 4]\n dir: (0.0, 0.0, 1.0)\n "
                    "energy: 8 GeV\n time: 9 ns\n speed: 10 [m/ns]\n"
                    " ts: 11 [ns]\n te: 12 [ns]\n con1: 13\n con2: 14\n")
        self.assertEqual(repr_str, self.track_fit.__repr__())
コード例 #2
0
ファイル: test_evt.py プロジェクト: leriomaggio/km3pipe
 def setUp(self):
     data = (1, 2, 3, 4, 0, 0, 1, 8, 9, 10, 11, 12, 13, 14)
     self.track_fit = TrackFit(data, zed_correction=0)