Ejemplo n.º 1
0
 def test_N_host(self):
     h_event1 = host_events_1(10)
     h_event2 = host_events_2(10)
     h_event3 = host_events_3(10)
     h_event4 = host_events_4(10)
     h_event5 = host_events_5(10)
     h_event6 = host_events_6(10)
     h_event7 = host_events_7(10)
     h_event8 = host_events_8(10)
     h_event9 = host_events_9(10)
     h_event10 = host_events_10(10)
     self.assertIsInstance(h_event1, host_events_1,
                           'Failure: Not an instance of host_events_1')
     self.assertIsInstance(h_event2, host_events_2,
                           'Failure: Not an instance of host_events_2')
     self.assertIsInstance(h_event3, host_events_3,
                           'Failure: Not an instance of host_events_3')
     self.assertIsInstance(h_event4, host_events_4,
                           'Failure: Not an instance of host_events_4')
     self.assertIsInstance(h_event5, host_events_5,
                           'Failure: Not an instance of host_events_5')
     self.assertIsInstance(h_event6, host_events_6,
                           'Failure: Not an instance of host_events_6')
     self.assertIsInstance(h_event7, host_events_7,
                           'Failure: Not an instance of host_events_7')
     self.assertIsInstance(h_event8, host_events_8,
                           'Failure: Not an instance of host_events_8')
     self.assertIsInstance(h_event9, host_events_9,
                           'Failure: Not an instance of host_events_9')
     self.assertIsInstance(h_event10, host_events_10,
                           'Failure: Not an instance of host_events_10')
Ejemplo n.º 2
0
 def test_assign_host(self):
     h_event = host_events_10(100)
     h_event.setWeight(10, 10.838597782598)
     h_event_2 = host_events_10()
     h_event_2.assign(h_event)
     self.check_equals(h_event, h_event_2)
Ejemplo n.º 3
0
 def test_setWeight(self):
     h_event = host_events_10(100)
     h_event.setWeight(10, 10.838597782598)
     self.assertAlmostEqual(h_event.getWeight(10), 10.838597782598)
Ejemplo n.º 4
0
 def test_copy_constructor_from_device(self):
     d_event = device_events_10(100)
     h_event = host_events_10(d_event)
     self.assertIsInstance(h_event, host_events_10,
                           'Failure: Not an instance of host_events_10')
     self.check_equals(d_event, h_event)
Ejemplo n.º 5
0
 def test_copy_constructor_from_host(self):
     h_event = host_events_10(100)
     h_event_2 = host_events_10(h_event)
     self.assertIsInstance(h_event_2, host_events_10,
                           'Failure: Not an instance of host_events_10')
     self.check_equals(h_event, h_event_2)
Ejemplo n.º 6
0
 def test_default_constructor(self):
     h_event = host_events_10()
     self.assertIsInstance(h_event, host_events_10,
                           'Failure: Not an instance of host_events_10')
Ejemplo n.º 7
0
 def test_argument_constructor(self):
     h_event = host_events_10(100)
     self.assertIsInstance(h_event, host_events_10,
                           'Failure: Not an instance of host_events_10')
     self.assertEqual(h_event.GetNEvents(), 100)
Ejemplo n.º 8
0
 def test_size(self):
     h_event = host_events_10(100)
     h_event.resize(1000)
     self.assertEqual(h_event.GetNEvents(), 1000)
Ejemplo n.º 9
0
 def test_assign_host(self):
     d_event = device_events_10(100)
     d_event.setWeight(10, 10.838597782598)
     h_event = host_events_10()
     d_event.assign(h_event)
     self.check_equals(d_event, h_event)
Ejemplo n.º 10
0
 def test_setFlag(self):
     h_event = host_events_10(100)
     h_event.setFlag(1, True)
     self.assertAlmostEqual(h_event.getFlag(1), True)
Ejemplo n.º 11
0
 def test_Daughters(self):
     h_event = host_events_10(100)
     for d in h_event.Daughters(3):
         self.assertAlmostEqual(d, (0.0, 0.0, 0.0, 0.0))
Ejemplo n.º 12
0
 def test_weights(self):
     h_event = host_events_10(100)
     for i in range(100):
         h_event.setWeight(i, 9.876123456745)
     for weight in h_event.Weights():
         self.assertAlmostEqual(weight, 9.876123456745)
Ejemplo n.º 13
0
 def test_flags(self):
     h_event = host_events_10(100)
     for flag in h_event.Flags():
         self.assertEqual(flag, False)
Ejemplo n.º 14
0
 def test_get_max_weight(self):
     h_event = host_events_10(100)
     h_event.SetMaxWeight(10.838597782598)
     self.assertAlmostEqual(h_event.GetMaxWeight(), 10.838597782598)