forked from lhcopt/lhcmask
-
Notifications
You must be signed in to change notification settings - Fork 0
/
submodule_05d_matching.madx
51 lines (43 loc) · 1.37 KB
/
submodule_05d_matching.madx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
print, text="";
print, text="";
print, text=" --- Submodule 5d: matching";
print, text=" --------------------------";
print, text="";
print, text="";
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
! matching of orbit, tune and chromaticity
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if(par_match_with_bb==1) {ON_BB_CHARGE:=1;}; ! W/o head-on Q and Q' are matched with bb
!Rematch the Xscheme towards specified separation and Xange in IP1/2/5/8
call, file="tools/rematchCOIP.madx";
!Rematch the CO in the arc for dispersion correction
if(on_disp<>0) {call, file="tools/rematchCOarc.madx";};
if(mylhcbeam==1){
kqtf=kqtf.b1;kqtd=kqtd.b1;kqtf.b1:=kqtf;kqtd.b1:=kqtd;
ksf=ksf.b1;ksd=ksd.b1;ksf.b1:=ksf;ksd.b1:=ksd;
};
if(mylhcbeam>1){
kqtf=kqtf.b2;kqtd=kqtd.b2;kqtf.b2:=kqtf;kqtd.b2:=kqtd;
ksf=ksf.b2;ksd=ksd.b2;ksf.b2:=ksf;ksd.b2:=ksd;
};
match;
global, q1=qx0, q2=qy0;
vary, name=kqtf, step=1.0E-7 ;
vary, name=kqtd, step=1.0E-7 ;
lmdif, calls=100, tolerance=1.0E-21;
endmatch;
match,chrom;
global, dq1=qprime, dq2=qprime;
vary, name=ksf;
vary, name=ksd;
lmdif, calls=100, tolerance=1.0E-21;
endmatch;
match,chrom;
global, dq1=qprime, dq2=qprime;
global, q1=qx0, q2=qy0;
vary, name=ksf;
vary, name=ksd;
vary, name=kqtf, step=1.0E-7 ;
vary, name=kqtd, step=1.0E-7 ;
lmdif, calls=500, tolerance=1.0E-21;
endmatch;