HPS-MC
test_run_params.py
Go to the documentation of this file.
1 import unittest
2 from hpsmc.run_params import RunParameters
3 
4 
5 class TestRunParams(unittest.TestCase):
6 
7  def test_run_params1pt1(self):
8  rp = RunParameters("1pt1")
9  self.assertEqual(rp.get("aprime_mass")[0], 15)
10  self.assertEqual(rp.get("target_thickness"), 0.0004062)
11  self.assertEqual(rp.get("beam_energy"), 1100.00)
12  self.assertEqual(rp.get("num_electrons"), 625)
13 
15  rp = RunParameters("1pt92")
16  self.assertEqual(rp.get("aprime_mass")[0], 50)
17  self.assertEqual(rp.get("target_thickness"), 0.0008)
18  self.assertEqual(rp.get("beam_energy"), 1920.00)
19  self.assertEqual(rp.get("num_electrons"), 875)
20 
22  rp = RunParameters("1pt05")
23  self.assertEqual(rp.get("aprime_mass")[0], 15)
24  self.assertEqual(rp.get("target_thickness"), 0.0004062)
25  self.assertEqual(rp.get("beam_energy"), 1056.00)
26  self.assertEqual(rp.get("num_electrons"), 625)
27 
29  rp = RunParameters("2pt2")
30  self.assertEqual(rp.get("aprime_mass")[0], 15)
31  self.assertEqual(rp.get("target_thickness"), 0.0004062)
32  self.assertEqual(rp.get("beam_energy"), 2200.00)
33  self.assertEqual(rp.get("num_electrons"), 2500)
34 
36  rp = RunParameters("2pt3")
37  self.assertEqual(rp.get("aprime_mass")[0], 15)
38  self.assertEqual(rp.get("target_thickness"), 0.0004062)
39  self.assertEqual(rp.get("beam_energy"), 2300.00)
40  self.assertEqual(rp.get("num_electrons"), 2500)
41 
43  rp = RunParameters("3pt7")
44  self.assertEqual(rp.get("aprime_mass")[0], 15)
45  self.assertEqual(rp.get("target_thickness"), 0.002)
46  self.assertEqual(rp.get("beam_energy"), 3700.00)
47  self.assertEqual(rp.get("num_electrons"), 1500)
48 
50  rp = RunParameters("3pt74")
51  self.assertEqual(rp.get("target_thickness"), 0.000875)
52  self.assertEqual(rp.get("beam_energy"), 3740.00)
53  self.assertEqual(rp.get("num_electrons"), 625)
54 
56  rp = RunParameters("3pt742")
57  self.assertEqual(rp.get("aprime_mass")[0], 50)
58  self.assertEqual(rp.get("target_thickness"), 0.002)
59  self.assertEqual(rp.get("beam_energy"), 3742.00)
60  self.assertEqual(rp.get("num_electrons"), 1500)
61 
63  rp = RunParameters("4pt4")
64  self.assertEqual(rp.get("aprime_mass")[0], 15)
65  self.assertEqual(rp.get("target_thickness"), 0.0004062)
66  self.assertEqual(rp.get("beam_energy"), 4400.00)
67  self.assertEqual(rp.get("num_electrons"), 5000)
68 
70  rp = RunParameters("4pt55")
71  self.assertEqual(rp.get("aprime_mass")[0], 75)
72  self.assertEqual(rp.get("target_thickness"), 0.002)
73  self.assertEqual(rp.get("beam_energy"), 4550.00)
74  self.assertEqual(rp.get("num_electrons"), 1500)
75 
77  rp = RunParameters("6pt6")
78  self.assertEqual(rp.get("aprime_mass")[0], 50)
79  self.assertEqual(rp.get("target_thickness"), 0.000875)
80  self.assertEqual(rp.get("beam_energy"), 6600.00)
81  self.assertEqual(rp.get("num_electrons"), 5625)
82 
83 
84 if __name__ == '__main__':
85  unittest.main()
Data with physics run parameters by beam energy.
Definition: run_params.py:1