1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
---|
2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
3 | <head> |
---|
4 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8889-2"> |
---|
5 | <meta name="Generator" content="NEdit"> |
---|
6 | <meta name="Originator" content="Skowron"> |
---|
7 | <link rel="stylesheet" type="text/css" href="../ptc_general/madxdoc_ps.css"> |
---|
8 | <title>PTC_TRACKLINE</title> |
---|
9 | <style> |
---|
10 | </style> |
---|
11 | </head> |
---|
12 | <body ="" bgcolor="#ffffff"> |
---|
13 | <div style="text-align: center;"> |
---|
14 | <center> EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH |
---|
15 | <img src="http://cern.ch/madx/icons/mx7_25.gif" align="right"> |
---|
16 | <h1>PTC_TRACKLINE</h1> |
---|
17 | <h2>PERFORMS A PARTICLE TRAJECTORY TRACKING WITH ACCELERATION USING PTC</h2> |
---|
18 | </center> |
---|
19 | </div> |
---|
20 | <div class="madxdocContent"> |
---|
21 | <!-- ########################################################## --> |
---|
22 | <!-- ########################################################## --> |
---|
23 | <!-- ########################################################## --> |
---|
24 | <h3 style="margin-top: 0cm; text-align: left; text-indent: 0cm;" |
---|
25 | align="center"> <span> USER MANUAL </span> |
---|
26 | </h3> |
---|
27 | <!-- ########################################################## --> |
---|
28 | <h4>SYNOPSIS</h4> |
---|
29 | |
---|
30 | <pre><big> |
---|
31 | |
---|
32 | PTC_TRACKLINE, |
---|
33 | turns [integer, 1, 0 ] , |
---|
34 | onetable [logical, false, true ], |
---|
35 | everystep [logical, false, true], |
---|
36 | tableallsteps [logical, false, true], |
---|
37 | gcs [logical, false, true], |
---|
38 | file [string, "track", "track" ], |
---|
39 | rootntuple [logical, false, true], |
---|
40 | extension [string, "", ""]; |
---|
41 | </big></pre> |
---|
42 | |
---|
43 | <table cellpadding="2" cellspacing="2" border="0" width="100%"> |
---|
44 | <tbody> |
---|
45 | |
---|
46 | <tr> |
---|
47 | <th valign="Middle" width="150" align="Center"> Parameter Name </th> |
---|
48 | <th valign="Top" width="100" align="Center"> Type </th> |
---|
49 | <th valign="Middle" width="300" align="Center" colspan="2"> Default value </th> |
---|
50 | <th valign="Middle" align="Center"> Description </th> |
---|
51 | |
---|
52 | </tr> |
---|
53 | |
---|
54 | <tr> |
---|
55 | <th valign="Middle" align="Center"> </th> |
---|
56 | <th valign="Middle" align="Center"> </th> |
---|
57 | <th valign="Middle" align="Center" width="150" > Not present </th> |
---|
58 | <th valign="Middle" align="Center" width="150" > Present, but value not specified </th> |
---|
59 | <th valign="Middle" align="Center"> </th> |
---|
60 | |
---|
61 | </tr> |
---|
62 | |
---|
63 | <tr> |
---|
64 | <td valign="Top" align="center"> turns </td> |
---|
65 | <td valign="Top" align="Center"> integer </td> |
---|
66 | <td valign="Top" align="Center"> 1 </td> |
---|
67 | <td valign="Top" align="Center"> - </td> |
---|
68 | <td valign="Top" align="Left"> Number of turns </td> |
---|
69 | </tr> |
---|
70 | |
---|
71 | <tr> |
---|
72 | <td valign="Top" align="center"> onetable </td> |
---|
73 | <td valign="Top" align="Center"> logical </td> |
---|
74 | <td valign="Top" align="Center"> false </td> |
---|
75 | <td valign="Top" align="Center"> true </td> |
---|
76 | <td valign="Top" align="Left"> If false, tracking data are written to a single table |
---|
77 | for each track for each observation point. Table names follow |
---|
78 | the naming <i>filename</i>.obsMMMM.pNNNN, where <br> |
---|
79 | <i>filename</i> is settable prefix with <b> file </b> parameter (see below),<br> |
---|
80 | MMMM is observation point number and <br> |
---|
81 | NNNN is track number <br> |
---|
82 | <p> |
---|
83 | If true, all data are written to single table called onetable </td> |
---|
84 | </tr> |
---|
85 | |
---|
86 | <tr> |
---|
87 | <td valign="Top" align="center"> file </td> |
---|
88 | <td valign="Top" align="Center"> string </td> |
---|
89 | <td valign="Top" align="Center"> "track" </td> |
---|
90 | <td valign="Top" align="Center"> "track" </td> |
---|
91 | <td valign="Top" align="Left"> Name of file where track parameters are written, |
---|
92 | see description of onetable switch above |
---|
93 | </td> |
---|
94 | </tr> |
---|
95 | |
---|
96 | <tr> |
---|
97 | <td valign="Top" align="center"> rootntuple </td> |
---|
98 | <td valign="Top" align="Center"> logical </td> |
---|
99 | <td valign="Top" align="Center"> false </td> |
---|
100 | <td valign="Top" align="Center"> true </td> |
---|
101 | <td valign="Top" align="Left"> Stores data to ROOT file as ntuple. |
---|
102 | Accessible only if RPLOT plugin is available. |
---|
103 | i.e. only if madxp is dynamically linked |
---|
104 | and RPLOT plugin is present |
---|
105 | </td> |
---|
106 | </tr> |
---|
107 | |
---|
108 | |
---|
109 | <tr> |
---|
110 | <td valign="Top" align="center"> everystep </td> |
---|
111 | <td valign="Top" align="Center"> logical </td> |
---|
112 | <td valign="Top" align="Center"> false </td> |
---|
113 | <td valign="Top" align="Center"> true </td> |
---|
114 | <td valign="Top" align="Left"> Switches on track parameters recording every integration step. |
---|
115 | Normally tracking data are stored only at the end of each element. |
---|
116 | Everystep mode allows the user to get finer data points. |
---|
117 | It implies usage of the so called node (thin) layout. |
---|
118 | <p> |
---|
119 | Track parameters are stored for each step in thintracking_ptc.txt file. |
---|
120 | Storage of parameters in a table for each step might be very memory |
---|
121 | consuming. To switch it off use <b>tableallsteps</b> |
---|
122 | <p> |
---|
123 | Collective effects can be taken to the account only using this mode |
---|
124 | (this feature of PTC is not interfaced into MAD-X). |
---|
125 | |
---|
126 | </td> |
---|
127 | </tr> |
---|
128 | |
---|
129 | |
---|
130 | <tr> |
---|
131 | <td valign="Top" align="center"> gcs </td> |
---|
132 | <td valign="Top" align="Center"> logical </td> |
---|
133 | <td valign="Top" align="Center"> false </td> |
---|
134 | <td valign="Top" align="Center"> true </td> |
---|
135 | <td valign="Top" align="Left"> Instructs the code to store track parameters in |
---|
136 | Global Coordinate System - normally it starts at the |
---|
137 | entrance phase of the first element. |
---|
138 | </td> |
---|
139 | </tr> |
---|
140 | |
---|
141 | |
---|
142 | </tbody> |
---|
143 | </table> |
---|
144 | |
---|
145 | <!-- <font color="#ff0000"><b>Non existing.</b></font> --> |
---|
146 | |
---|
147 | |
---|
148 | <h4> Description </h4> |
---|
149 | |
---|
150 | <p>This MAD-X command performs ray tracking that takes to the account |
---|
151 | acceleration in traveling wave cavities. It must be invoked in the scope of |
---|
152 | correctly initialized <a href="../ptc_general/ptc_general.html"> PTC |
---|
153 | environment</a>, i.e. after <a href="../ptc_general/ptc_general.html"> |
---|
154 | PTC_CREATE_UNIVERSE and PTC_CREATE_LAYOUT commands </a> |
---|
155 | and before corresponding <a href="../ptc_general/ptc_general.html"> |
---|
156 | PTC_STOP </a>. |
---|
157 | All tracks that are spawned with |
---|
158 | <a href="../ptc_track/ptc_track.html"> PTC_START </a> |
---|
159 | commands beforehand PTC_TRACKLINE command is issued are tracked. Track |
---|
160 | parameters are dumped at every defined observation point |
---|
161 | (see <a href="../ptc_track/ptc_track.html"> PTC_OBSERVE command</a>). |
---|
162 | Please note that MAD-X always creates observation point at the end of a |
---|
163 | sequence. Depending on value of onetable switch, all output information |
---|
164 | is stored in one table (and also file), or in one table per track per |
---|
165 | observation point is written if the switch is false. The user must note |
---|
166 | that track parameters plotting (see <a href="../plot/plot.html"> PLOT |
---|
167 | command</a>) is only possible if onetable switch is set to false |
---|
168 | (status as for Feb. 2006). |
---|
169 | This unfortunate solution is the legacy of the regular MAD-X track |
---|
170 | command, that is designed for |
---|
171 | circular machines where the user usually tracks a few particles for |
---|
172 | many turns rather then many particles for one turn each. </p> |
---|
173 | |
---|
174 | <p>Tracks that do not fit in aperture are immediately stopped. |
---|
175 | </p> |
---|
176 | |
---|
177 | <p>Behavior of PTC calculations can be adapted with |
---|
178 | <a href="../ptc_auxiliaries/PTC_SetSwitch.html"> PTC_SETSWITCH command </a> |
---|
179 | and with appropriate switches of |
---|
180 | <a href="http://cern.ch/madx/ptc_general/ptc_general.html"> |
---|
181 | PTC_CREATE_LAYOUT command</a>. |
---|
182 | </p> |
---|
183 | |
---|
184 | <!-- ########################################################## --> |
---|
185 | <h4> Command parameters and switches </h4> |
---|
186 | <div> |
---|
187 | <dl> |
---|
188 | <dt><b> turns </b></dt> |
---|
189 | <dd> |
---|
190 | <i> integer, default value 1, no default value if value explicitly not specified </i> |
---|
191 | <p> Number of turns around sequence. If layout is not closed then its value is enforced to 1. </p> |
---|
192 | </dd> |
---|
193 | |
---|
194 | <dt><b> onetable </b></dt> |
---|
195 | <dd> |
---|
196 | <i> boolean, default value false, if value explicitly not specified then true </i> |
---|
197 | <p> If true then only one table is created and one file is written |
---|
198 | to disk. If false one file per track per observation point is written. |
---|
199 | File format is filename.obsNNNN.pMMMM, where NNNN and MMMM are numbers |
---|
200 | of observation point and track, respectively. Filename is defined by |
---|
201 | the switch described below. |
---|
202 | </p> |
---|
203 | </dd> |
---|
204 | |
---|
205 | <dt><b> file </b></dt> |
---|
206 | <dd> |
---|
207 | <i> character string, default is "track" </i> |
---|
208 | <p> name of file where track parameters are written, see description of onetable switch above. </p> |
---|
209 | </dd> |
---|
210 | </dl> |
---|
211 | </div> |
---|
212 | |
---|
213 | <!-- ############################################################ --> |
---|
214 | <!-- ############################################################ --> |
---|
215 | <!-- ############################################################ --> |
---|
216 | |
---|
217 | <h3> PROGRAMMERS MANUAL </h3> |
---|
218 | |
---|
219 | The routine PTC_TRACKLINE is implemented in file madx_ptc_trackcavs.f90 |
---|
220 | Its single parameter is the number of observation points. |
---|
221 | |
---|
222 | <p>The call sequence from MAD-X interpreter is the following <br> |
---|
223 | exec_command in madxp.c; <br> |
---|
224 | pro_ptc_trackline in madxn.c; This routine creates appropriates tables |
---|
225 | where the track parameters are stored, and after execution of the |
---|
226 | Fortran routine dumps filled table(s) to files.<br> |
---|
227 | w_ptc_trackline_ in wrap.f90; Just interface to the appropriate Fortran |
---|
228 | module <br> |
---|
229 | ptc_trackline in madx_ptc_trackline.f90 |
---|
230 | </p> |
---|
231 | |
---|
232 | <p>The key routine that enables appropriate calculation of beam and |
---|
233 | track parameters in the presence of traveling wave cavities is |
---|
234 | setcavities. </p> |
---|
235 | |
---|
236 | <p>Firstly, the ptc_trackline routine finds out which are the |
---|
237 | observation points. |
---|
238 | For this purpose array of integers observedelements is allocated. Its |
---|
239 | length is equal to the number of elements in the sequence. |
---|
240 | All elements are zero by default. If an element with an index n is an |
---|
241 | observation point |
---|
242 | then observedelements[n] is equal to 1. This solution enables fast |
---|
243 | checking if track parameters |
---|
244 | should be sent to a table after a given element. </p> |
---|
245 | |
---|
246 | <p>Further <a href="../ptc_auxiliaries/PTC_SetCavities.html">setcavities subroutine</a> |
---|
247 | is called if it was not executed yet before. </p> |
---|
248 | |
---|
249 | <p>PTC_TRACKLINE reads the track initial parameters from the table with |
---|
250 | the help of gettrack |
---|
251 | function (implemented in C in file madxn.c). For the performance |
---|
252 | reasons gettrack creates a two dimensional array and buffers there all |
---|
253 | the initial track parameters upon first call. The array is destroyed |
---|
254 | with a call of deletetrackstrarpositions function that is performed at |
---|
255 | the very end of ptc_trackline subroutine. |
---|
256 | </p> |
---|
257 | |
---|
258 | <p>Tracking itself is implemented in a doubly nested loop. |
---|
259 | The external one goes over all initiated tracks, |
---|
260 | and the internal one performs tracking of a given track element by element. |
---|
261 | The key PTC routine is called TRACK. It propagates a track described by |
---|
262 | an array of 6 real numbers, denoted as X in equations below. |
---|
263 | The important issue is that they are the canonical variables. In order |
---|
264 | to follow the standard MAD-X representation the values that are written |
---|
265 | to tables and files are scaled appropriately to the reference momentum |
---|
266 | for a given element. In the general case it changes along the line if |
---|
267 | traveling wave cavities are present. |
---|
268 | Hence, momenta xp, yp and zp are |
---|
269 | </p> |
---|
270 | |
---|
271 | <pre> |
---|
272 | zp=sqrt((1+x(5))**2 - x(2)**2 - x(4)**2) <br> |
---|
273 | xp = x(2)/zp<br> |
---|
274 | yp = x(4)/zp<br> |
---|
275 | </pre> |
---|
276 | |
---|
277 | where array x containing 6 elements is the track position in the PTC |
---|
278 | representation, i.e. x(1) is horizontal spacial coordinate, x(2) - |
---|
279 | horizontal momentum, |
---|
280 | x(3) - vertical spacial coordinate, x(4) - vertical momentum, |
---|
281 | x(5) - δp/p<sub>0</sub>c, x(6) - longitudinal coordinate |
---|
282 | (caution, the exact meaning depends on the PTC settings, see |
---|
283 | <a href="../ptc_auxiliaries/PTC_SetSwitch.html"> PTC_SETSWITCH command </a>). |
---|
284 | |
---|
285 | </div> |
---|
286 | </body> |
---|
287 | </html> |
---|