1 | Option, warn,info,echo; |
---|
2 | Title, "LHC 6.503 with errors and two beam orbit correction using MADX"; |
---|
3 | |
---|
4 | // CALL IN SELECTION, SEQUENCE and OPTICS FILES; |
---|
5 | Option, -echo,-warn,-info; |
---|
6 | |
---|
7 | call, file = "../share/LHC/LHCRing/V6.503/V6.5.seq"; |
---|
8 | call, file = "../share/LHC/LHCRing/V6.503/V6.5.coll.str"; |
---|
9 | |
---|
10 | option,warn,echo; |
---|
11 | |
---|
12 | Beam, particle=proton, sequence=lhcb1, energy=7000.0, NPART=1.05E11, sige=4.5e-4; |
---|
13 | Beam, particle=proton, sequence=lhcb2, energy=7000.0, NPART=1.05E11, sige=4.5e-4, bv=-1; |
---|
14 | ! the 'bv' parameter indicates that beam2 rotates counter-clockwise |
---|
15 | |
---|
16 | // Removing classes of correctors |
---|
17 | select, flag=seqedit, clear; |
---|
18 | select, flag=seqedit, class=MU; |
---|
19 | select, flag=seqedit, class=MKI; |
---|
20 | select, flag=seqedit, class=MKI__192; |
---|
21 | select, flag=seqedit, class=MKI__193; |
---|
22 | select, flag=seqedit, class=MKA; |
---|
23 | select, flag=seqedit, class=MKD; |
---|
24 | select, flag=seqedit, class=MKQ; |
---|
25 | select, flag=seqedit, class=MKQA; |
---|
26 | select, flag=seqedit, class=MSDA; |
---|
27 | select, flag=seqedit, class=MSDB; |
---|
28 | select, flag=seqedit, class=MSDB2; |
---|
29 | select, flag=seqedit, class=MSDC; |
---|
30 | select, flag=seqedit, class=MSIA; |
---|
31 | select, flag=seqedit, class=MSIB; |
---|
32 | select, flag=seqedit, class=MCBV; |
---|
33 | select, flag=seqedit, class=MCBH; |
---|
34 | select, flag=seqedit, class=MCBCA; |
---|
35 | select, flag=seqedit, class=MCBCB; |
---|
36 | select, flag=seqedit, class=MCBCC; |
---|
37 | select, flag=seqedit, class=MCBCD; |
---|
38 | select, flag=seqedit, class=MCBCH; |
---|
39 | select, flag=seqedit, class=MCBCV; |
---|
40 | select, flag=seqedit, class=MCBYA; |
---|
41 | select, flag=seqedit, class=MCBYB; |
---|
42 | select, flag=seqedit, class=MCBYH; |
---|
43 | select, flag=seqedit, class=MCBYV; |
---|
44 | select, flag=seqedit, class=MCBWH; |
---|
45 | select, flag=seqedit, class=MCBWV; |
---|
46 | seqedit, sequence=lhcb1; |
---|
47 | remove, element=selected; |
---|
48 | seqedit, sequence=lhcb2; |
---|
49 | remove, element=selected; |
---|
50 | endedit; |
---|
51 | |
---|
52 | select, flag=seqedit, clear; |
---|
53 | select, flag=seqedit, class=MBXWH; |
---|
54 | select, flag=seqedit, class=MBXWS; |
---|
55 | select, flag=seqedit, class=MBXWT; |
---|
56 | select, flag=seqedit, class=MBAW; |
---|
57 | select, flag=seqedit, class=MBLW; |
---|
58 | select, flag=seqedit, class=MBWMD; |
---|
59 | seqedit, sequence=lhcb1; |
---|
60 | remove, element=selected; |
---|
61 | seqedit, sequence=lhcb1; |
---|
62 | remove, element=selected; |
---|
63 | seqedit, sequence=lhcb2; |
---|
64 | remove, element=selected; |
---|
65 | seqedit, sequence=lhcb2; |
---|
66 | remove, element=selected; |
---|
67 | endedit; |
---|
68 | |
---|
69 | // assign alignment errors in ring 1 and ring 2 at Q1 |
---|
70 | Use, period=lhcb2; |
---|
71 | Select, flag=ERROR, clear; |
---|
72 | Select, flag=ERROR, range=MQXA.1L1; |
---|
73 | ealign, dy:=0.100e-3, dx:=0.070e-3; |
---|
74 | Select, flag=ERROR, clear; |
---|
75 | Select, flag=ERROR, range=MQXA.1R5; |
---|
76 | ealign, dy:=0.050e-3, dx:=0.035e-3; |
---|
77 | Use, period=lhcb1; |
---|
78 | Select, flag=ERROR, clear; |
---|
79 | Select, flag=ERROR, range=MQXA.1L1; |
---|
80 | ealign, dy:=0.100e-3, dx:=0.070e-3; |
---|
81 | Select, flag=ERROR, clear; |
---|
82 | Select, flag=ERROR, range=MQXA.1R5; |
---|
83 | ealign, dy:=0.050e-3, dx:=0.035e-3; |
---|
84 | |
---|
85 | // enable only MCBX at Q1 |
---|
86 | USEKICK,CLASS=mcbx, status=OFF; |
---|
87 | USEKICK,CLASS=mcbxv, status=OFF; |
---|
88 | USEKICK,CLASS=mcbxh, status=OFF; |
---|
89 | USEKICK,CLASS=mcbxa, status=OFF; |
---|
90 | USEKICK,class=mbxws, status=OFF; |
---|
91 | USEKICK,class=mbxwt, status=OFF; |
---|
92 | USEKICK,class=mbaw, status=OFF; |
---|
93 | USEKICK,class=mbwmd, status=OFF; |
---|
94 | !USEKICK,RANGE=mcbx.3l1, status=ON; |
---|
95 | !USEKICK,RANGE=mcbx.3r1, status=ON; |
---|
96 | !USEKICK,RANGE=mcbx.3l5, status=ON; |
---|
97 | !USEKICK,RANGE=mcbx.3r5, status=ON; |
---|
98 | !USEKICK,RANGE=mcbx.2l1, status=ON; |
---|
99 | !USEKICK,RANGE=mcbx.2r1, status=ON; |
---|
100 | !USEKICK,RANGE=mcbx.2l5, status=ON; |
---|
101 | !USEKICK,RANGE=mcbx.2r5, status=ON; |
---|
102 | !USEKICK,RANGE=mcbx.1l1, status=ON; |
---|
103 | !USEKICK,RANGE=mcbx.1r1, status=ON; |
---|
104 | !USEKICK,RANGE=mcbx.1l5, status=ON; |
---|
105 | !USEKICK,RANGE=mcbx.1r5, status=ON; |
---|
106 | USEKICK,RANGE=mcbxv.3l1, status=ON; |
---|
107 | USEKICK,RANGE=mcbxv.3r1, status=ON; |
---|
108 | USEKICK,RANGE=mcbxv.2l1, status=ON; |
---|
109 | USEKICK,RANGE=mcbxv.2r1, status=ON; |
---|
110 | USEKICK,RANGE=mcbxv.1l1, status=ON; |
---|
111 | USEKICK,RANGE=mcbxv.1r1, status=ON; |
---|
112 | USEKICK,RANGE=mcbxv.3l5, status=ON; |
---|
113 | USEKICK,RANGE=mcbxv.2l5, status=ON; |
---|
114 | USEKICK,RANGE=mcbxv.1l5, status=ON; |
---|
115 | USEKICK,RANGE=mcbxv.1r5, status=ON; |
---|
116 | USEKICK,RANGE=mcbxh.3l1, status=ON; |
---|
117 | USEKICK,RANGE=mcbxh.3r1, status=ON; |
---|
118 | USEKICK,RANGE=mcbxh.2l1, status=ON; |
---|
119 | USEKICK,RANGE=mcbxh.2r1, status=ON; |
---|
120 | USEKICK,RANGE=mcbxh.1l1, status=ON; |
---|
121 | USEKICK,RANGE=mcbxh.1r1, status=ON; |
---|
122 | USEKICK,RANGE=mcbxh.3l5, status=ON; |
---|
123 | USEKICK,RANGE=mcbxh.2l5, status=ON; |
---|
124 | USEKICK,RANGE=mcbxh.1l5, status=ON; |
---|
125 | USEKICK,RANGE=mcbxh.1r5, status=ON; |
---|
126 | |
---|
127 | // calculate TWISS table for correction, beam 1 |
---|
128 | on_x1 = 0.0; |
---|
129 | on_x2 = 0.0; |
---|
130 | on_x5 = 0.0; |
---|
131 | on_x8 = 0.0; |
---|
132 | on_sep1 = 0.0; |
---|
133 | on_sep2 = 0.0; |
---|
134 | on_sep5 = 0.0; |
---|
135 | on_sep8 = 0.0; |
---|
136 | on_alice = 0.0; |
---|
137 | on_lhcb = 0.0; |
---|
138 | select, flag=twiss, clear; |
---|
139 | select, flag=twiss, column=name,s,x,px,y,py,betx,bety,alfx,alfy; |
---|
140 | TWISS,table=twb1,sequence=lhcb1; |
---|
141 | !plot,table=twb1,title="Orbit ..L1..before",vmin=-0.005,vmax=0.005,noline=true,haxis=s,vaxis=x; |
---|
142 | |
---|
143 | coption,print=1; |
---|
144 | !CORRECT, FLAG=ring, |
---|
145 | ! MODE=micado,cond=0,NCORR= 1,ERROR=1E-6,PLANE=y, |
---|
146 | ! mlist='my1.tab',clist='cy1.tab', RESOUT=1,corzero=1; |
---|
147 | |
---|
148 | USEKICK,RANGE=mcbxv.1l5, status=ON; |
---|
149 | |
---|
150 | // calculate TWISS table for correction, beam 2 |
---|
151 | on_x1 = 0.0; |
---|
152 | on_x2 = 0.0; |
---|
153 | on_x5 = 0.0; |
---|
154 | on_x8 = 0.0; |
---|
155 | on_sep1 = 0.0; |
---|
156 | on_sep2 = 0.0; |
---|
157 | on_sep5 = 0.0; |
---|
158 | on_sep8 = 0.0; |
---|
159 | on_alice = 0.0; |
---|
160 | on_lhcb = 0.0; |
---|
161 | select, flag=twiss, clear; |
---|
162 | select, flag=twiss, column=name,s,x,px,y,py,betx,bety,alfx,alfy; |
---|
163 | TWISS,table=twb2,sequence=lhcb2; |
---|
164 | !plot,table=twb2,title="Orbit ..L2..before",vmin=-0.005,vmax=0.005,noline=true,haxis=s,vaxis=x; |
---|
165 | |
---|
166 | CORRECT, FLAG=ring, |
---|
167 | tworing,beam1tab=twb1,beam2tab=twb2, |
---|
168 | MODE=micado,cond=0,NCORR= 4,ERROR=1E-6,PLANE=x, |
---|
169 | mlist='mx12.tab',clist='cx12.tab', RESOUT=1,corzero=1; |
---|
170 | |
---|
171 | select, flag=twiss, clear; |
---|
172 | select, flag=twiss, column=name,s,x,px,y,py,betx,bety,alfx,alfy; |
---|
173 | TWISS,sequence=lhcb1; |
---|
174 | !plot,title="Orbit ..L1..after",vmin=-0.005,vmax=0.005,noline=true,haxis=s,vaxis=x; |
---|
175 | |
---|
176 | select, flag=twiss, clear; |
---|
177 | select, flag=twiss, column=name,s,x,px,y,py,betx,bety,alfx,alfy; |
---|
178 | TWISS,sequence=lhcb2; |
---|
179 | !plot,title="Orbit ..L2..after",vmin=-0.005,vmax=0.005,noline=true,haxis=s,vaxis=x; |
---|
180 | |
---|