source: PSPA/madxPSPA/tests/test-track-11/test-track-11.madx @ 430

Last change on this file since 430 was 430, checked in by touze, 11 years ago

import madx-5.01.00

File size: 9.6 KB
Line 
1! S. Fartoukh March 2012
2! General Sample job with or w/o beam-beam and with errors in collision for SLHCV3.1b
3!
4!---|----1----|----2----|----3----|----4----|----5----|----6----|----7----|---8;
5Option,  -warn,-info, -echo;
6
7
8!---------------------------------------------------------------;
9!           CALL IN SELECTION, MACRO's, SEQUENCE, BEAM, NRJ and OPTICS FILES;
10!---------------------------------------------------------------;
11call,file="macro.madx";        !Call some macro facilities
12
13!Call sequence V6.503 with finite length for the TAN
14REAL CONST l.TAN   = 3.7  ;REAL CONST l.TANAL = l.TAN;
15REAL CONST l.TANAR = l.TAN;REAL CONST l.TANC  = l.TAN;
16REAL CONST l.TCT   = 1.0;REAL CONST l.TCTH  = l.TCT;REAL CONST l.TCTVA = l.TCT;
17call,file="../share/LHC/LHCRing/V6.503/V6.5.seq";
18
19!Install new triplet, D1 & corrector package
20call,file="slhc_sequence.madx";
21
22
23
24!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
25!                 RF multipoles installation
26!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
27
28exec,crab_remove(A);
29exec,crab_remove(B);
30exec,crab_remove(C);
31
32
33call, file="crab_install_all.madx";
34
35on_crab1 := 1;
36on_crab5 := 1;
37
38!Cycling w.r.t. to IP3 (mandatory to find closed orbit in collision in the presence of errors)
39seqedit,sequence=lhcb1;flatten;cycle,start=IP3;endedit;
40
41!Thin lens
42exec,myslice;
43
44!********************************************
45
46 mylhcbeam:=1 ;// LHC beam 1 (clockwise)
47
48!NRJ:= 450.0  ; // injection
49 NRJ:= 7000.0 ; // collision
50
51!General switch to select collision (0/1)
52ON_COLLISION:=0;
53!General switch to install bb lens (0/1)
54ON_BB_SWITCH:=0;
55
56 gamma_rel      := NRJ/pmass;
57 emittance_norm := 3.75e-6;
58 epsx:=emittance_norm /gamma_rel;
59 epsy:=emittance_norm /gamma_rel;
60
61!********************************************
62
63tsplit= 2.0;   !new tune split
64qx00  = 62.0;  !integer h tune
65qy00  = 60.0;  !integer v tune
66
67
68if (NRJ<4999.9999)
69{
70!Inj. optics in thin lens
71call,file="../share/LHC/LHCRing/SLHCV3.1b/opt_5500_5500thin.madx";  ! beta* [m]=5.5/10/5.5/10 in IR1/2/5/8
72qx0 = 62.28;   qy0 = 60.31;  qprime = 2.0;
73Beam,particle=proton,sequence=lhcb1,energy=NRJ,sigt=0.130,bv= 1,
74                     NPART=1.15E11,sige=4.5e-4,ex=epsx,ey=epsy;
75};
76
77if (NRJ>5000.0000)
78{
79call,file="../share/LHC/LHCRing/SLHCV3.1b/opt_0150_0150thin.madx";  ! beta*=15cm in IR1/5, beta*=10 m in IR2/8
80qx0 = 62.31;   qy0 = 60.32;  qprime = 2.0;
81ON_QPP     :=0;  ! Correction of residual Q'' by MO's
82ON_DISP    :=1;  ! Correction of spurious dispersion
83Beam,particle=proton,sequence=lhcb1,energy=NRJ,sigt=0.075,bv= 1,
84                     NPART=1.15E11,sige=1.1e-4,ex=epsx,ey=epsy;
85};
86
87
88
89
90!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++;
91!                        Sequence & Beam selection
92!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++;
93
94if(mylhcbeam==1) {use,  sequence=lhcb1;};
95
96!!!!!!!!!!!!NO LONGER ANY "USE" AFTER THIS POINT
97
98!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++;
99!               Prepare nominal twiss tables
100!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++;
101
102
103! Record actual Xschemes
104
105 on0_x1=on_x1; on0_sep1=on_sep1;
106 on0_x2=on_x2; on0_sep2=on_sep2; on0_alice=on_alice;
107 on0_x5=on_x5; on0_sep5=on_sep5;
108 on0_x8=on_x8; on0_sep8=on_sep8; on0_lhcb =on_lhcb;
109
110! Switch off Xschemes
111
112 on_x1:=0; on_sep1:=0;
113 on_x2:=0; on_sep2:=0; on_alice:=0;
114 on_x5:=0; on_sep5:=0;
115 on_x8:=0; on_sep8:=0; on_lhcb :=0;
116 twiss, table=nominal;   // used by orbit correction
117 beta.ip1=table(twiss,IP1,betx);value,beta.ip1;
118
119! print nominal optics parameter at the MB, MQS and MSS for
120! b2, b3, b4, b5, a2 and a3 correction
121 select, flag=twiss, clear;
122 select, flag=twiss,pattern=MB\.   ,class=multipole,column=name,k0L,k1L,betx,bety,dx,mux,muy;
123 select, flag=twiss,pattern=MQT\.14,class=multipole,column=name,k0L,k1L,betx,bety,dx,mux,muy;
124 select, flag=twiss,pattern=MQT\.15,class=multipole,column=name,k0L,k1L,betx,bety,dx,mux,muy;
125 select, flag=twiss,pattern=MQT\.16,class=multipole,column=name,k0L,k1L,betx,bety,dx,mux,muy;
126 select, flag=twiss,pattern=MQT\.17,class=multipole,column=name,k0L,k1L,betx,bety,dx,mux,muy;
127 select, flag=twiss,pattern=MQT\.18,class=multipole,column=name,k0L,k1L,betx,bety,dx,mux,muy;
128 select, flag=twiss,pattern=MQT\.19,class=multipole,column=name,k0L,k1L,betx,bety,dx,mux,muy;
129 select, flag=twiss,pattern=MQT\.20,class=multipole,column=name,k0L,k1L,betx,bety,dx,mux,muy;
130 select, flag=twiss,pattern=MQT\.21,class=multipole,column=name,k0L,k1L,betx,bety,dx,mux,muy;
131 select, flag=twiss,class=MQS                      ,column=name,k0L,k1L,betx,bety,dx,mux,muy;
132 select, flag=twiss,class=MSS                      ,column=name,k0L,k1L,betx,bety,dx,mux,muy;
133 twiss;
134
135! print nominal optics parameter at the D1, MQX and triplet corrector
136! for triplet correction
137 select, flag=twiss, clear;
138 select, flag=twiss, pattern=MQX  , class=multipole, column=name,betx,bety,x,y;
139 select, flag=twiss, pattern=MBX  , class=multipole, column=name,betx,bety,x,y;
140 select, flag=twiss, pattern=MBRC , class=multipole, column=name,betx,bety,x,y;
141 select, flag=twiss, pattern=MBRD , class=multipole, column=name,betx,bety,x,y;
142 select, flag=twiss, pattern=MQSX                  , column=name,betx,bety,x,y;
143 select, flag=twiss, pattern=MCSX                  , column=name,betx,bety,x,y;
144 select, flag=twiss, pattern=MCTX                  , column=name,betx,bety,x,y;
145 select, flag=twiss, pattern=MCOSX                 , column=name,betx,bety,x,y;
146 select, flag=twiss, pattern=MCOX                  , column=name,betx,bety,x,y;
147 select, flag=twiss, pattern=MCSSX                 , column=name,betx,bety,x,y;
148 select, flag=twiss, pattern=MCDX                  , column=name,betx,bety,x,y;
149 select, flag=twiss, pattern=MCDSX                 , column=name,betx,bety,x,y;
150 select, flag=twiss, pattern=MCTSX                 , column=name,betx,bety,x,y;
151 twiss;
152
153
154
155!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
156!                Switch ON/OFF some multipole
157!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
158
159!exec, ON_ALL_MULT;
160ON_LSF:=1;             ! to be set to 0 if run is performed on BOINC.
161
162 ON_A1s =  0 ; ON_A1r =  0 ; ON_B1s =  0 ; ON_B1r =  0;
163 ON_A2s =  1 ; ON_A2r =  1 ; ON_B2s =  1 ; ON_B2r =  1;
164 ON_A3s =  1 ; ON_A3r =  1 ; ON_B3s =  1 ; ON_B3r =  1;
165 ON_A4s =  1 ; ON_A4r =  1 ; ON_B4s =  1 ; ON_B4r =  1;
166 ON_A5s =  1 ; ON_A5r =  1 ; ON_B5s =  1 ; ON_B5r =  1;
167 ON_A6s =  1 ; ON_A6r =  1 ; ON_B6s =  1 ; ON_B6r =  1;
168 ON_A7s =  1 ; ON_A7r =  1 ; ON_B7s =  1 ; ON_B7r =  1;
169 ON_A8s =  1 ; ON_A8r =  1 ; ON_B8s =  1 ; ON_B8r =  1;
170 ON_A9s =  1 ; ON_A9r =  1 ; ON_B9s =  1 ; ON_B9r =  1;
171 ON_A10s =  1; ON_A10r =  1; ON_B10s =  1; ON_B10r =  1;
172 ON_A11s =  1; ON_A11r =  1; ON_B11s =  1; ON_B11r =  1;
173 ON_A12s =  ON_LSF; ON_A12r = ON_LSF; ON_B12s = ON_LSF; ON_B12r =  ON_LSF;
174 ON_A13s =  ON_LSF; ON_A13r = ON_LSF; ON_B13s = ON_LSF; ON_B13r =  ON_LSF;
175 ON_A14s =  ON_LSF; ON_A14r = ON_LSF; ON_B14s = ON_LSF; ON_B14r =  ON_LSF;
176 ON_A15s =  ON_LSF; ON_A15r = ON_LSF; ON_B15s = ON_LSF; ON_B15r =  ON_LSF;
177
178
179!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
180!     correct orbit distortion resulting from MB magnets
181!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
182if((ON_A1S)^2+(ON_A1r)^2+(ON_B1S)^2+(ON_B1r)^2 >0)
183{
184  exec,   initial_micado(4);
185  exec,   initial_micado(4);
186};
187
188!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
189!           apply field errors to all other magnets
190!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
191
192! New IT/D1/D2/Q4/Q5
193myseed=1;
194
195
196!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
197!    final orbit correction before applying crossing scheme
198!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
199if((ON_A1S)^2+(ON_A1r)^2+(ON_B1S)^2+(ON_B1r)^2 >0)
200{ exec, final_micado(0.004); };
201
202
203! end of orbit correction, now switch ON crossing scheme
204 on_x1=on0_x1; on_sep1=on0_sep1;
205 on_x2=on0_x2; on_sep2=on0_sep2; on_alice=on0_alice;
206 on_x5=on0_x5; on_sep5=on0_sep5;
207 on_x8=on0_x8; on_sep8=on0_sep8; on_lhcb =on0_lhcb;
208 on_disp=on0_disp;
209
210value,on_x1,on_x2,on_x5,on_x8,on_sep1,on_sep2,on_sep5,on_sep8,on_alice,on_lhcb,on_disp;
211
212
213!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
214!                 matching of orbit, tune and chromaticity
215!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
216if(ON_COLLISION==0) {ON_BB_CHARGE:=1;};    ! W/o head-on Q and Q' are matched with bb
217
218!Rematch the Xscheme towards specified separation and Xange in IP1/2/5/8
219call,file="../share/LHC/LHCRing/SLHCV3.1b/toolkit/rematchCOIP.madx";
220!Rematch the CO in the arc for dispersion correction
221if(ON_DISP<>0) {call,file="../share/LHC/LHCRing/SLHCV3.1b/toolkit/rematchCOarc.madx";};
222
223if(mylhcbeam==1)
224{kqtf=kqtf.b1;kqtd=kqtd.b1;kqtf.b1:=kqtf;kqtd.b1:=kqtd;
225 ksf=ksf.b1;ksd=ksd.b1;ksf.b1:=ksf;ksd.b1:=ksd;};
226
227if(mylhcbeam>1)
228{kqtf=kqtf.b2;kqtd=kqtd.b2;kqtf.b2:=kqtf;kqtd.b2:=kqtd;
229 ksf=ksf.b2;ksd=ksd.b2;ksf.b2:=ksf;ksd.b2:=ksd;};
230 
231!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
232!                 final twiss before tracking
233!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
234
235ON_BB_CHARGE:=1;
236
237b2:=114./abrho/3.;
238b3:=1260.*2./abrho/3.;
239b4:=1760.*6./abrho/3.;
240
241
242    on_crab1 := 1;
243    on_crab5 := 1;
244
245!/*
246if (NRJ<4999.9999) {VRF400:=8. ;LAGRF400.B1=0.5;LAGRF400.B2=0.;};
247if (NRJ>5000.0000) {VRF400:=16.;LAGRF400.B1=0.5;LAGRF400.B2=0.;};
248twiss;
249!emit;
250 value, table(summ,q1);
251 value, table(summ,q2);
252 value, table(summ,dq1);
253 value, table(summ,dq2);
254
255!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
256!                 YIL inserted tracking
257!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
258
259use, sequence= lhcb1;
260track, dump;
261  start;
262  run,   turns= 400, ffile=20;
263endtrack;
264
265stop;
Note: See TracBrowser for help on using the repository browser.