1 | !Example file showing the usage of PTC_SETSWITCH command |
---|
2 | !that sets the internal state (i.e switches) of PTC |
---|
3 | ! |
---|
4 | !Piotr Skowronski (CERN) |
---|
5 | ! |
---|
6 | ! examples/ptc_madx_interface/intstate/intstate.ptc.madx |
---|
7 | ! |
---|
8 | option,-echo; |
---|
9 | option,-info; |
---|
10 | |
---|
11 | LQL := 0.220; ! length of QL |
---|
12 | LQS := 0.124; ! length of QS |
---|
13 | CAVLENGTH := 2.4; |
---|
14 | QL : QUADRUPOLE, L=LQL; ! QL quadrupole |
---|
15 | QS : QUADRUPOLE, L=LQS; ! QS quadrupole |
---|
16 | |
---|
17 | !****** define the regular linac cell (Daniel)... |
---|
18 | |
---|
19 | TCAV : TWCAVITY, L=CAVLENGTH, VOLT=14.0d0, LAG=-30.d0/360., FREQ=3000.; |
---|
20 | |
---|
21 | ds_ql : drift, l=0.25; ! short drift between quads in Daniels design |
---|
22 | ds_trip : drift, l=(3.34-CAVLENGTH)/2.; ! long drift between quads in Daniels design |
---|
23 | cell_mrk : marker; |
---|
24 | cell_q1 : marker; |
---|
25 | cell_q3 : marker; |
---|
26 | beforecav : marker; |
---|
27 | bc : marker; |
---|
28 | aftercav : marker; |
---|
29 | k_ls1 := -1.53125*.56/LQL; ! weaker foc. |
---|
30 | k_ls2 := 1.53125/LQL; ! weaker foc. |
---|
31 | quad_l1 : quadrupole, l=LQL, k1=k_ls1; |
---|
32 | quad_l2 : quadrupole, l=LQL/2, k1=k_ls2; |
---|
33 | LDLS :=(LQL-LQS)/2.; ! half L difference of QL and QS |
---|
34 | dls : DRIFT, L=LDLS; ! 0.048 m |
---|
35 | |
---|
36 | ctfcell : line=( quad_l2,ds_ql,quad_l1,cell_q1,ds_trip ,cell_mrk, |
---|
37 | beforecav, |
---|
38 | TCAV, |
---|
39 | aftercav, |
---|
40 | ds_trip,cell_q3,quad_l1,ds_ql,quad_l2); |
---|
41 | |
---|
42 | ctf : line=(1*ctfcell); |
---|
43 | |
---|
44 | ! calculate Twiss parameters for regular cell structure |
---|
45 | beam, PARTICLE=ELECTRON, ENERGY=0.02d0; |
---|
46 | |
---|
47 | USE, period=ctf; |
---|
48 | |
---|
49 | |
---|
50 | ptc_create_universe; |
---|
51 | ptc_create_layout, model=1, method=6, nst=100, exact=false, closed_layout=false; |
---|
52 | |
---|
53 | |
---|
54 | ptc_start, x=0.001, px=0.0003, y=-0.002, py=0, pt=0.0, t=0.0015; |
---|
55 | |
---|
56 | |
---|
57 | print, text="############################################"; |
---|
58 | print, text="############################################"; |
---|
59 | print, text="## Tracking with default settings ##"; |
---|
60 | print, text="############################################"; |
---|
61 | print, text="############################################"; |
---|
62 | |
---|
63 | ptc_setswitch, debuglevel = 0, maxacceleration=true, exact_mis=true, time=true, totalpath=true, fringe=true; |
---|
64 | ptc_trackline,everystep, ffile=1; |
---|
65 | |
---|
66 | |
---|
67 | !print, text="############################################"; |
---|
68 | !print, text="############################################"; |
---|
69 | !print, text="## Extensive Debug information printout ##"; |
---|
70 | !print, text="############################################"; |
---|
71 | !print, text="############################################"; |
---|
72 | ! |
---|
73 | !ptc_setswitch, debuglevel = 10, maxacceleration=true, exact_mis=true, time=true, totalpath=true; |
---|
74 | !ptc_trackline; |
---|
75 | !!____________________________________________________________________________________________________________ |
---|
76 | ! |
---|
77 | !print, text="############################################"; |
---|
78 | !print, text="############################################"; |
---|
79 | !print, text="## TOTALPATH==FALSE ##"; |
---|
80 | !print, text="## T is given with respect to ref. part. ##"; |
---|
81 | !print, text="############################################"; |
---|
82 | !print, text="############################################"; |
---|
83 | ! |
---|
84 | !ptc_setswitch, debuglevel = 3, maxacceleration=true, exact_mis=true, time=true, totalpath=false; |
---|
85 | !ptc_trackline; |
---|
86 | !!____________________________________________________________________________________________________________ |
---|
87 | ! |
---|
88 | ! |
---|
89 | !print, text="############################################"; |
---|
90 | !print, text="############################################"; |
---|
91 | !print, text="## TIME==FALSE ##"; |
---|
92 | !print, text="##It is assumed that particle moves with c##"; |
---|
93 | !print, text="############################################"; |
---|
94 | !print, text="############################################"; |
---|
95 | ! |
---|
96 | !ptc_setswitch, debuglevel = 3, maxacceleration=true, exact_mis=true, time=false, totalpath=true; |
---|
97 | !ptc_trackline; |
---|
98 | !!____________________________________________________________________________________________________________ |
---|
99 | |
---|
100 | |
---|
101 | ptc_track_end; |
---|
102 | |
---|
103 | |
---|
104 | |
---|
105 | ptc_end; |
---|
106 | stop; |
---|
107 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
108 | ! SSSSS TTTTT OOO PPP |
---|
109 | ! S T O O P P |
---|
110 | ! SSSSS T O O PPP |
---|
111 | ! S T O O P |
---|
112 | ! SSSSS T OOO P |
---|
113 | ! |
---|