@@ -53,6 +53,19 @@ local ref_cfg = object "ref" {
53
53
}
54
54
55
55
56
+ local default_plot_cfg = {
57
+ series = {
58
+ "'${test_type}' == 'edir'",
59
+ "'${test_type}' == 'chg'",
60
+ "'${test_type}' == 'backtrack'",
61
+ },
62
+ legend = {
63
+ y1 = "Reverse edir",
64
+ y2 = "Reverse charge",
65
+ y3 = "Backtrack",
66
+ },
67
+ }
68
+
56
69
-- The actual test functions --------------------------------------------------o
57
70
local function testQUAD() -- Test the body (~2 min)
58
71
local cfg = ref_cfg "quad" {
@@ -70,22 +83,10 @@ local function testQUAD() -- Test the body (~2 min)
70
83
alist = tblcat(ref_cfg.alist, {"k1", "k1s"}),
71
84
72
85
plot_info = {
73
- title = "Quadrupole NG v NG Maps",
74
- series = {
75
- "'${test_type}' == 'edir'",
76
- "'${test_type}' == 'chg'",
77
- "'${test_type}' == 'backtrack'",
78
- "'${test_type}' == 'rotate_1'",
79
- "'${test_type}' == 'rotate_2'",
80
- },
81
- legend = {
82
- y1 = "Reverse edir",
83
- y2 = "Reverse charge",
84
- y3 = "Backtrack",
85
- y4 = "Rotate by pi/4",
86
- y5 = "Rotate by -pi/4",
87
- },
86
+ title = "Quadrupole NG v NG Maps",
88
87
filename = "quad-ngvng.png",
88
+ series = default_plot_cfg.series,
89
+ legend = default_plot_cfg.legend,
89
90
}
90
91
}
91
92
local equiv = object "quad" {
@@ -117,18 +118,10 @@ local function testSBEND() -- Test the body (~2 min)
117
118
alist = tblcat(ref_cfg.alist, {"angle_div"}),
118
119
119
120
plot_info = {
120
- title = "SBend NG v NG Maps",
121
- series = {
122
- "'${test_type}' == 'edir'",
123
- "'${test_type}' == 'chg'",
124
- "'${test_type}' == 'backtrack'",
125
- },
126
- legend = {
127
- y1 = "Reverse edir",
128
- y2 = "Reverse charge",
129
- y3 = "Backtrack",
130
- },
121
+ title = "SBend NG v NG Maps",
131
122
filename = "sbend-ngvng.png",
123
+ series = default_plot_cfg.series,
124
+ legend = default_plot_cfg.legend,
132
125
}
133
126
}
134
127
run_test(cfg, {alist = {}})
@@ -138,7 +131,8 @@ local function testRBEND() -- Test the body (~2 min)
138
131
local cfg = ref_cfg "rbend" {
139
132
elm = [[rbend 'rbend' {
140
133
at=0.75, l=1.5, k0=${bdir}*math.pi/${angle_div}, angle=${tdir}*math.pi/${angle_div}*1.5, fringe=0,
141
- e1 = ${edir}*${e1}*math.pi/${angle_div}*1.5, e2 = ${edir}*${e2}*math.pi/${angle_div}*1.5
134
+ e1 = ${tdir}*${e1}*math.pi/${angle_div}*1.5, e2 = ${tdir}*${e2}*math.pi/${angle_div}*1.5,
135
+ true_rbend = ${true_rbend},
142
136
}]],
143
137
model = {1, 2},
144
138
method = 2..6..2,
@@ -148,23 +142,45 @@ local function testRBEND() -- Test the body (~2 min)
148
142
tol = 2000,
149
143
150
144
angle_div = {50, 100, 200, 500, 1000},
145
+ true_rbend = {false, true},
151
146
e1 = {-0.15, 0, 0.2},
152
147
e2 = {-0.2, 0, 0.15},
153
- alist = tblcat(ref_cfg.alist, {"angle_div", "e1", "e2"}),
148
+ alist = tblcat(ref_cfg.alist, {"true_rbend", " angle_div", "e1", "e2"}),
154
149
155
150
plot_info = {
156
- title = "RBend NG v NG Maps",
157
- series = {
158
- "'${test_type}' == 'edir'",
159
- "'${test_type}' == 'chg'",
160
- "'${test_type}' == 'backtrack'",
161
- },
162
- legend = {
163
- y1 = "Reverse edir",
164
- y2 = "Reverse charge",
165
- y3 = "Backtrack",
166
- },
151
+ title = "RBend NG v NG Maps",
167
152
filename = "rbend-ngvng.png",
153
+ series = default_plot_cfg.series,
154
+ legend = default_plot_cfg.legend,
155
+ } }
156
+ run_test(cfg, {alist = {}})
157
+ end
158
+
159
+ local function testRBENDPARALLEL()
160
+ local cfg = ref_cfg "rbend_parallel" {
161
+ elm = [[rbend 'rbend' { true_rbend = true,
162
+ at=0.75, l=1.5, k0=${bdir}*math.pi/${angle_div}, angle=${tdir}*math.pi/${angle_div}*1.5, fringe=0,
163
+ e1 = ${e1} and ${tdir}*${e1}*math.pi/${angle_div}*1.5, e2 = ${e2} and ${tdir}*${e2}*math.pi/${angle_div}*1.5
164
+ }]],
165
+
166
+ model = {1, 2},
167
+ method = 2..6..2,
168
+ nslice = 1..3,
169
+ energy = {1, 6500}, -- {1, 450, 6500}
170
+
171
+ tol = 2000,
172
+
173
+ angle_div = {50, 100, 200, 500, 1000},
174
+ patch_first = {false, true},
175
+ e1 = \s -> s.cur_cfg.patch_first and {false} or {-0.15, 0, 0.2},
176
+ e2 = \s -> s.cur_cfg.patch_first and {-0.2, 0, 0.15} or {false},
177
+ alist = tblcat(ref_cfg.alist, {"patch_first", "angle_div", "e1", "e2"}),
178
+
179
+ plot_info = {
180
+ title = "True Parallel RBend NG v NG Maps",
181
+ filename = "true-parallel-rbend-ngvng.png",
182
+ series = default_plot_cfg.series,
183
+ legend = default_plot_cfg.legend,
168
184
}
169
185
}
170
186
run_test(cfg, {alist = {}})
213
229
testQUAD()
214
230
testSBEND()
215
231
testRBEND()
216
- -- testRFMULTIPOLE()
232
+ testRBENDPARALLEL()
233
+ -- testRFMULTIPOLE()
0 commit comments