[430] | 1 | #include "mad_def.h" |
---|
| 2 | #include "mad_gcst.h" |
---|
| 3 | |
---|
| 4 | /* Temporary file: global constants |
---|
| 5 | these constants will be split over their respective modules... |
---|
| 6 | and should be const pointers to constant values... |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | // madx version and date from makefile |
---|
| 10 | |
---|
| 11 | #define mkstr(a) mkstr_(a) |
---|
| 12 | #define mkstr_(a) #a |
---|
| 13 | |
---|
| 14 | const char *version_name = "MAD-X " mkstr(_VERSION); |
---|
| 15 | const char *version_arch = sizeof(void*) == 4 ? "32" : sizeof(void*) == 8 ? "64" : "??"; |
---|
| 16 | const char *version_ostype = mkstr(_VERSION_OSTYPE); |
---|
| 17 | const char *version_date_mod = "Code Modification Date: " mkstr(_VERSION_DATE); |
---|
| 18 | const char *version_type_dev = "DEBUG Version - use at own risk!"; |
---|
| 19 | const char *version_type_pro = " Production Version "; |
---|
| 20 | |
---|
| 21 | #undef mkstr |
---|
| 22 | #undef mkstr_ |
---|
| 23 | |
---|
| 24 | // madx constants |
---|
| 25 | |
---|
| 26 | char* const functs[] = {"dummyfunction", "abs", "sqrt", "exp", "log", "log10", |
---|
| 27 | "sin", "cos", "tan", "asin", "acos", |
---|
| 28 | "atan", "sinh", "cosh", "tanh", "ranf", |
---|
| 29 | "gauss", "tgauss", "table", "exist", "floor","ceil","round","frac", |
---|
| 30 | ""}; /* keep "" ! */ |
---|
| 31 | |
---|
| 32 | const char op_string[] = "-+*/^"; |
---|
| 33 | char file_string[] = "file"; /* to avoid local in routine alias */ |
---|
| 34 | char vrai[] = "true"; /* to avoid local in routine alias */ |
---|
| 35 | char faux[] = "false"; /* to avoid local in routine alias */ |
---|
| 36 | const int n_match = 17; /* # of match token lists in cmd_match_base */ |
---|
| 37 | const int s_match[] = /* position of first token of command below */ |
---|
| 38 | {0, 1, 4, 8, 13, 17, 22, 25, 29, 32, 36, 39, 43, 45, 48, 50, 52, 56}; |
---|
| 39 | |
---|
| 40 | const int t_match[] = /* order in which the commands are matched */ |
---|
| 41 | {0, 1, 16, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; |
---|
| 42 | const char* cmd_match_base[] = |
---|
| 43 | { /* 0 */ "@cmd", |
---|
| 44 | /* 1 */ "@name", ":", "@cmd", |
---|
| 45 | /* 2 */ "int", "const", "@name", "=", |
---|
| 46 | /* 3 */ "int", "const", "@name", ":", "=", |
---|
| 47 | /* 4 */ "real", "const", "@name", "=", |
---|
| 48 | /* 5 */ "real", "const", "@name", ":", "=", |
---|
| 49 | /* 6 */ "int", "@name", "=", |
---|
| 50 | /* 7 */ "int", "@name", ":", "=", |
---|
| 51 | /* 8 */ "real", "@name", "=", |
---|
| 52 | /* 9 */ "real", "@name", ":", "=", |
---|
| 53 | /* 10 */ "const", "@name", "=", |
---|
| 54 | /* 11 */ "const", "@name", ":", "=", |
---|
| 55 | /* 12 */ "@name", "=", |
---|
| 56 | /* 13 */ "@name", ":", "=", |
---|
| 57 | /* 14 */ "@name", ":", |
---|
| 58 | /* 15 */ "@name", "@name", |
---|
| 59 | /* 16 */ "shared", "@name", ":", "@cmd"}; |
---|
| 60 | |
---|
| 61 | /* aperture types and # of parameters, needed for twiss table */ |
---|
| 62 | |
---|
| 63 | char* aperture_types[] = |
---|
| 64 | { |
---|
| 65 | "circle", "ellipse", "rectangle", "lhcscreen", |
---|
| 66 | "marguerite", "rectellipse", "racetrack", |
---|
| 67 | " " /* blank terminates */ |
---|
| 68 | }; |
---|
| 69 | |
---|
| 70 | /*added 4, 3 and "racetrack" here */ |
---|
| 71 | |
---|
| 72 | int aperture_npar[] = |
---|
| 73 | { |
---|
| 74 | 1, 2, 2, 3, |
---|
| 75 | 2, 4, 3 |
---|
| 76 | }; |
---|
| 77 | |
---|
| 78 | /* table descriptors: type 1 = int, type 2 = double, type 3 = string; |
---|
| 79 | internally, however, int are stored as double */ |
---|
| 80 | |
---|
| 81 | int ap_table_types[] = |
---|
| 82 | { |
---|
| 83 | 3, 2, 2, 2, 3, |
---|
| 84 | 2, 2, 2, 2, |
---|
| 85 | 2, 2, 2, |
---|
| 86 | 2, 2, 2, 2, 2, 2, 2, |
---|
| 87 | 2, 2, 2 |
---|
| 88 | }; |
---|
| 89 | |
---|
| 90 | char* ap_table_cols[] = |
---|
| 91 | { |
---|
| 92 | "name", "n1", "n1x_m", "n1y_m", "apertype", |
---|
| 93 | "aper_1", "aper_2", "aper_3", "aper_4", |
---|
| 94 | "rtol", "xtol", "ytol", |
---|
| 95 | "s", "betx", "bety", "dx", "dy", "x", "y", |
---|
| 96 | "on_ap", "on_elem", "spec", |
---|
| 97 | " " /* blank terminates */ |
---|
| 98 | }; |
---|
| 99 | |
---|
| 100 | int survey_table_types[] = |
---|
| 101 | { |
---|
| 102 | 3, 2, 2, 2, 2, |
---|
| 103 | 2, 2, 2, 2, 2, 2, |
---|
| 104 | 1, 1, 2, |
---|
| 105 | /*== dealt with the new property v_pos as for mech_sep */ |
---|
| 106 | 2 |
---|
| 107 | /*==*/ |
---|
| 108 | }; |
---|
| 109 | |
---|
| 110 | char* survey_table_cols[] = |
---|
| 111 | { |
---|
| 112 | "name", "s", "l", "angle", "x", |
---|
| 113 | "y", "z", "theta", "phi", "psi", "globaltilt", |
---|
| 114 | "slot_id", "assembly_id", "mech_sep", |
---|
| 115 | /*== dealt with the new property v_pos as for mech_sep */ |
---|
| 116 | "v_pos", |
---|
| 117 | /*==*/ |
---|
| 118 | " " /* blank terminates */ |
---|
| 119 | }; |
---|
| 120 | |
---|
| 121 | int efield_table_types[] = |
---|
| 122 | { |
---|
| 123 | 3, 2, 2, 2, 2, |
---|
| 124 | 2, 2, 2, 2, 2, |
---|
| 125 | 2, 2, 2, 2, 2, |
---|
| 126 | 2, 2, 2, 2, 2, |
---|
| 127 | 2, 2, 2, 2, 2, |
---|
| 128 | 2, 2, 2, 2, 2, |
---|
| 129 | 2, 2, 2, 2, 2, |
---|
| 130 | 2, 2, 2, 2, 2, |
---|
| 131 | 2, 2, 2, 2, 2, |
---|
| 132 | 2, 2, 2, 2, 2, |
---|
| 133 | 2, 2, 2, 2, 2, |
---|
| 134 | 2, 2, |
---|
| 135 | /* AL: RF-multipolar error */ |
---|
| 136 | 2, 2, 2, |
---|
| 137 | 2, 2, 2, 2, 2, 2, |
---|
| 138 | 2, 2, 2, 2, 2, 2, |
---|
| 139 | 2, 2, 2, 2, 2, 2, |
---|
| 140 | 2, 2, 2, 2, 2, 2, |
---|
| 141 | 2, 2, 2, 2, 2, 2, |
---|
| 142 | 2, 2, 2, 2, 2, 2, |
---|
| 143 | 2, 2, 2, 2, 2, 2 |
---|
| 144 | }; |
---|
| 145 | |
---|
| 146 | char* efield_table_cols[] = |
---|
| 147 | { |
---|
| 148 | "name", |
---|
| 149 | "k0l", "k0sl", "k1l", "k1sl", |
---|
| 150 | "k2l", "k2sl", "k3l", "k3sl", "k4l", |
---|
| 151 | "k4sl", "k5l", "k5sl", "k6l", "k6sl", |
---|
| 152 | "k7l", "k7sl", "k8l", "k8sl", "k9l", |
---|
| 153 | "k9sl", "k10l", "k10sl", "k11l", "k11sl", |
---|
| 154 | "k12l", "k12sl", "k13l", "k13sl", "k14l", |
---|
| 155 | "k14sl", "k15l", "k15sl", "k16l", "k16sl", |
---|
| 156 | "k17l", "k17sl", "k18l", "k18sl", "k19l", |
---|
| 157 | "k19sl", "k20l", "k20sl", |
---|
| 158 | "dx", "dy", "ds", "dphi", "dtheta", |
---|
| 159 | "dpsi", "mrex", "mrey", "mredx", "mredy", |
---|
| 160 | "arex", "arey", "mscalx", "mscaly", |
---|
| 161 | /* AL: RF-multipolar errors */ |
---|
| 162 | "rfm_freq", "rfm_harmon", "rfm_lag", |
---|
| 163 | "p0l", "p0sl", "p1l", "p1sl", |
---|
| 164 | "p2l", "p2sl", "p3l", "p3sl", "p4l", |
---|
| 165 | "p4sl", "p5l", "p5sl", "p6l", "p6sl", |
---|
| 166 | "p7l", "p7sl", "p8l", "p8sl", "p9l", |
---|
| 167 | "p9sl", "p10l", "p10sl", "p11l", "p11sl", |
---|
| 168 | "p12l", "p12sl", "p13l", "p13sl", "p14l", |
---|
| 169 | "p14sl", "p15l", "p15sl", "p16l", "p16sl", |
---|
| 170 | "p17l", "p17sl", "p18l", "p18sl", "p19l", |
---|
| 171 | "p19sl", "p20l", "p20sl", |
---|
| 172 | " " /* blank terminates */ |
---|
| 173 | }; |
---|
| 174 | |
---|
| 175 | |
---|
| 176 | char* sxf_table_names[] = |
---|
| 177 | { |
---|
| 178 | "l","angle", "k0","k0s","k1","k1s", |
---|
| 179 | "e1","e2","k2","k2s","h1", |
---|
| 180 | "h2","hgap","fint","k3","k3s", |
---|
| 181 | "lrad","knl","ksl","ks","volt", |
---|
| 182 | "lag","harmon","betrf","pg", |
---|
| 183 | "shunt","tfill","eloss","ex","ey", |
---|
| 184 | "hkick","vkick","xsize","ysize","sigx", |
---|
| 185 | "sigy","xma","yma","charge", |
---|
| 186 | " " /* blank terminates */ |
---|
| 187 | }; |
---|
| 188 | |
---|
| 189 | int twiss_opt_end = 33; /* last column filled by twiss module */ |
---|
| 190 | int twiss_mult_end = 78; /* last multipole column filled |
---|
| 191 | by complete_twiss_table */ |
---|
| 192 | int twiss_fill_end = 97; /* last standard column filled |
---|
| 193 | by complete_twiss_table */ |
---|
| 194 | /*== increased twiss_fill_end from 96 to 97 to accomodate for v_pos */ |
---|
| 195 | |
---|
| 196 | /* warning: modify routine complete_twiss_table in case of changes */ |
---|
| 197 | int twiss_table_types[] = |
---|
| 198 | { |
---|
| 199 | 3, 3, 2, 2, 2, |
---|
| 200 | 2, 2, 2, 2, 2, |
---|
| 201 | 2, 2, 2, 2, 2, |
---|
| 202 | 2, 2, 2, 2, 2, |
---|
| 203 | 2, 2, 2, 2, 2, |
---|
| 204 | 2, 2, 2, 2, 2, |
---|
| 205 | 2, 2, 2, 2, 2, |
---|
| 206 | 2, 2, 2, 2, 2, |
---|
| 207 | 2, 2, 2, 2, 2, |
---|
| 208 | 2, 2, 2, 2, 2, |
---|
| 209 | 2, 2, 2, 2, 2, |
---|
| 210 | 2, 2, 2, 2, 2, |
---|
| 211 | 2, 2, 2, 2, |
---|
| 212 | 2, 2, 2, 2, |
---|
| 213 | 2, 2, 2, 2, |
---|
| 214 | 2, 2, 2, 2, |
---|
| 215 | 2, 2, 2, 2, |
---|
| 216 | 2, 2, 2, 2, 2, |
---|
| 217 | 2, 2, 2, 2, |
---|
| 218 | 2, 2, 2, 2, |
---|
| 219 | 1, 1, 2, |
---|
| 220 | 2, /* v_pos */ |
---|
| 221 | 2, 3, |
---|
| 222 | 2, 2, 2, 2, 2, 2, |
---|
| 223 | 2, 2, 2, 2, 2, 2, |
---|
| 224 | 2, 2, 2, 2, 2, 2, |
---|
| 225 | 2, 2, 2, 2, 2, 2, |
---|
| 226 | 2, 2, 2, 2, 2, 2, |
---|
| 227 | 2, 2, 2, 2, 2, 2, |
---|
| 228 | 2, 2, 2, 2, 2, |
---|
| 229 | 2, 2, 2, |
---|
| 230 | 2, 2, 2, |
---|
| 231 | 2, 2, 2, |
---|
| 232 | 2, 2, 2, |
---|
| 233 | 2, 2, 2, |
---|
| 234 | 2, 2, 2, |
---|
| 235 | 2, 2, 2, |
---|
| 236 | 2, 2, 2, |
---|
| 237 | 2, 2, 2, |
---|
| 238 | /* delta_p dependency terms */ |
---|
| 239 | 2,2,2, /* beta11p, beta12p, beta13p */ |
---|
| 240 | 2,2,2, /* beta21p, beta22p, beta23p */ |
---|
| 241 | 2,2,2, /* beta31p, beta32p, beta33p */ |
---|
| 242 | 2,2,2, /* alfa11p, alfa12p, alfa13p */ |
---|
| 243 | 2,2,2, /* alfa21p, alfa22p, alfa23p */ |
---|
| 244 | 2,2,2, /* alfa31p, alfa32p, alfa33p */ |
---|
| 245 | 2,2,2, /* gama11p, gama12p, gama13p */ |
---|
| 246 | 2,2,2, /* gama21p, gama22p, gama23p */ |
---|
| 247 | 2,2,2, /* gama31p, gama32p, gama33p */ |
---|
| 248 | /* end of delta_p dependency terms */ |
---|
| 249 | 2, 2, 2, 2, |
---|
| 250 | /* derivatives of dispersion w.r.t. delta_p */ |
---|
| 251 | 2, 2, 2, 2, |
---|
| 252 | 2, 2, 2, 2, /* second order derivatives */ |
---|
| 253 | 2, 2, 2, 2, /* third order derivatives */ |
---|
| 254 | /* end of dispersion derivatives w.r.t. delta_p */ |
---|
| 255 | 2, 2, 2, /* mu1, mu2, mu3 */ |
---|
| 256 | 2, 2, 2, 2, 2, 2, |
---|
| 257 | 2, 2, 2, 2, 2, 2, |
---|
| 258 | 2, 2, 2, 2, 2, 2, |
---|
| 259 | 2, 2, 2, 2, 2, 2, |
---|
| 260 | 2, 2, 2, 2, 2, 2, |
---|
| 261 | 2, 2, 2, 2, 2, 2, |
---|
| 262 | 2 |
---|
| 263 | }; |
---|
| 264 | |
---|
| 265 | char* twiss_table_cols[] = |
---|
| 266 | { |
---|
| 267 | "name", "keyword", "s", "betx", "alfx", |
---|
| 268 | "mux", "bety", "alfy", "muy", "x", |
---|
| 269 | "px", "y", "py", "t", "pt", |
---|
| 270 | "dx", "dpx", "dy", "dpy", "wx", |
---|
| 271 | "phix", "dmux", "wy", "phiy", "dmuy", |
---|
| 272 | "ddx", "ddpx", "ddy", "ddpy", "r11", |
---|
| 273 | "r12", "r21", "r22", "energy", "l", |
---|
| 274 | "angle", "k0l", "k0sl", "k1l", "k1sl", |
---|
| 275 | "k2l", "k2sl", "k3l", "k3sl", "k4l", |
---|
| 276 | "k4sl", "k5l", "k5sl", "k6l", "k6sl", |
---|
| 277 | "k7l", "k7sl", "k8l", "k8sl", "k9l", |
---|
| 278 | "k9sl", "k10l", "k10sl", "k11l", "k11sl", |
---|
| 279 | "k12l", "k12sl", "k13l", "k13sl", |
---|
| 280 | "k14l", "k14sl", "k15l", "k15sl", |
---|
| 281 | "k16l", "k16sl", "k17l", "k17sl", |
---|
| 282 | "k18l", "k18sl", "k19l", "k19sl", |
---|
| 283 | "k20l", "k20sl", "ksi", "hkick", |
---|
| 284 | "vkick", "tilt", "e1", "e2", "h1", |
---|
| 285 | "h2", "hgap", "fint", "fintx", |
---|
| 286 | "volt", "lag", "freq", "harmon", |
---|
| 287 | "slot_id","assembly_id","mech_sep", |
---|
| 288 | /*== dealt with the new property v_pos as for mech_sep */ |
---|
| 289 | "v_pos", |
---|
| 290 | /*==*/ |
---|
| 291 | "lrad","parent", |
---|
| 292 | "re11", "re12", "re13", "re14", "re15", "re16", |
---|
| 293 | "re21", "re22", "re23", "re24", "re25", "re26", |
---|
| 294 | "re31", "re32", "re33", "re34", "re35", "re36", |
---|
| 295 | "re41", "re42", "re43", "re44", "re45", "re46", |
---|
| 296 | "re51", "re52", "re53", "re54", "re55", "re56", |
---|
| 297 | "re61", "re62", "re63", "re64", "re65", "re66", |
---|
| 298 | "kmax", "kmin", "calib", "polarity", "alfa", |
---|
| 299 | "beta11", "beta12", "beta13", |
---|
| 300 | "beta21", "beta22", "beta23", |
---|
| 301 | "beta31", "beta32", "beta33", |
---|
| 302 | "alfa11", "alfa12", "alfa13", |
---|
| 303 | "alfa21", "alfa22", "alfa23", |
---|
| 304 | "alfa31", "alfa32", "alfa33", |
---|
| 305 | "gama11", "gama12", "gama13", |
---|
| 306 | "gama21", "gama22", "gama23", |
---|
| 307 | "gama31", "gama32", "gama33", |
---|
| 308 | /* delta_p dependency: derivatives of the above Twiss parameters */ |
---|
| 309 | "beta11p","beta12p","beta13p", |
---|
| 310 | "beta21p","beta22p","beta23p", |
---|
| 311 | "beta31p","beta32p","beta33p", |
---|
| 312 | "alfa11p", "alfa12p","alfa13p", |
---|
| 313 | "alfa21p", "alfa22p","alfa23p", |
---|
| 314 | "alfa31p", "alfa32p","alfa33p", |
---|
| 315 | "gama11p", "gama12p","gama13p", |
---|
| 316 | "gama21p", "gama22p","gama23p", |
---|
| 317 | "gama31p", "gama32p","gama33p", |
---|
| 318 | /* end of delta_p dependency */ |
---|
| 319 | "disp1", "disp2", "disp3","disp4", |
---|
| 320 | /* derivatives of dispersion w.r.t. delta_p */ |
---|
| 321 | "disp1p", "disp2p", "disp3p", "disp4p", |
---|
| 322 | "disp1p2", "disp2p2", "disp3p2", "disp4p2", /* second order derivatives */ |
---|
| 323 | "disp1p3", "disp2p3", "disp3p3", "disp4p3", /* third order derivatives */ |
---|
| 324 | /* end of dispersion derivatives w.r.t. delta_p */ |
---|
| 325 | "mu1", "mu2", "mu3", |
---|
| 326 | "eign11", "eign12", "eign13", "eign14", "eign15", "eign16", |
---|
| 327 | "eign21", "eign22", "eign23", "eign24", "eign25", "eign26", |
---|
| 328 | "eign31", "eign32", "eign33", "eign34", "eign35", "eign36", |
---|
| 329 | "eign41", "eign42", "eign43", "eign44", "eign45", "eign46", |
---|
| 330 | "eign51", "eign52", "eign53", "eign54", "eign55", "eign56", |
---|
| 331 | "eign61", "eign62", "eign63", "eign64", "eign65", "eign66", |
---|
| 332 | "n1", |
---|
| 333 | " " /* blank terminates */ |
---|
| 334 | }; |
---|
| 335 | |
---|
| 336 | int twiss_sector_table_types[] = { |
---|
| 337 | 3, 2, |
---|
| 338 | 2, 2, 2, 2, 2, 2, |
---|
| 339 | /* 36 elements for the R-matrix */ |
---|
| 340 | 2, 2, 2, 2, 2, 2, |
---|
| 341 | 2, 2, 2, 2, 2, 2, |
---|
| 342 | 2, 2, 2, 2, 2, 2, |
---|
| 343 | 2, 2, 2, 2, 2, 2, |
---|
| 344 | 2, 2, 2, 2, 2, 2, |
---|
| 345 | 2, 2, 2, 2, 2, 2, |
---|
| 346 | /* 216 elements for the T-matrix */ |
---|
| 347 | 2, 2, 2, 2, 2, 2, |
---|
| 348 | 2, 2, 2, 2, 2, 2, |
---|
| 349 | 2, 2, 2, 2, 2, 2, |
---|
| 350 | 2, 2, 2, 2, 2, 2, |
---|
| 351 | 2, 2, 2, 2, 2, 2, |
---|
| 352 | 2, 2, 2, 2, 2, 2, |
---|
| 353 | 2, 2, 2, 2, 2, 2, |
---|
| 354 | 2, 2, 2, 2, 2, 2, |
---|
| 355 | 2, 2, 2, 2, 2, 2, |
---|
| 356 | 2, 2, 2, 2, 2, 2, |
---|
| 357 | 2, 2, 2, 2, 2, 2, |
---|
| 358 | 2, 2, 2, 2, 2, 2, |
---|
| 359 | 2, 2, 2, 2, 2, 2, |
---|
| 360 | 2, 2, 2, 2, 2, 2, |
---|
| 361 | 2, 2, 2, 2, 2, 2, |
---|
| 362 | 2, 2, 2, 2, 2, 2, |
---|
| 363 | 2, 2, 2, 2, 2, 2, |
---|
| 364 | 2, 2, 2, 2, 2, 2, |
---|
| 365 | 2, 2, 2, 2, 2, 2, |
---|
| 366 | 2, 2, 2, 2, 2, 2, |
---|
| 367 | 2, 2, 2, 2, 2, 2, |
---|
| 368 | 2, 2, 2, 2, 2, 2, |
---|
| 369 | 2, 2, 2, 2, 2, 2, |
---|
| 370 | 2, 2, 2, 2, 2, 2, |
---|
| 371 | 2, 2, 2, 2, 2, 2, |
---|
| 372 | 2, 2, 2, 2, 2, 2, |
---|
| 373 | 2, 2, 2, 2, 2, 2, |
---|
| 374 | 2, 2, 2, 2, 2, 2, |
---|
| 375 | 2, 2, 2, 2, 2, 2, |
---|
| 376 | 2, 2, 2, 2, 2, 2, |
---|
| 377 | 2, 2, 2, 2, 2, 2, |
---|
| 378 | 2, 2, 2, 2, 2, 2, |
---|
| 379 | 2, 2, 2, 2, 2, 2, |
---|
| 380 | 2, 2, 2, 2, 2, 2, |
---|
| 381 | 2, 2, 2, 2, 2, 2, |
---|
| 382 | 2, 2, 2, 2, 2, 2 |
---|
| 383 | }; |
---|
| 384 | |
---|
| 385 | char* twiss_sector_table_cols[] = { |
---|
| 386 | "name", "pos", |
---|
| 387 | "k1", "k2", "k3", "k4", "k5", "k6", |
---|
| 388 | "r11", "r21", "r31", "r41", "r51", "r61", |
---|
| 389 | "r12", "r22", "r32", "r42", "r52", "r62", |
---|
| 390 | "r13", "r23", "r33", "r43", "r53", "r63", |
---|
| 391 | "r14", "r24", "r34", "r44", "r54", "r64", |
---|
| 392 | "r15", "r25", "r35", "r45", "r55", "r65", |
---|
| 393 | "r16", "r26", "r36", "r46", "r56", "r66", |
---|
| 394 | "t111", "t211", "t311", "t411", "t511", "t611", |
---|
| 395 | "t121", "t221", "t321", "t421", "t521", "t621", |
---|
| 396 | "t131", "t231", "t331", "t431", "t531", "t631", |
---|
| 397 | "t141", "t241", "t341", "t441", "t541", "t641", |
---|
| 398 | "t151", "t251", "t351", "t451", "t551", "t651", |
---|
| 399 | "t161", "t261", "t361", "t461", "t561", "t661", |
---|
| 400 | "t112", "t212", "t312", "t412", "t512", "t612", |
---|
| 401 | "t122", "t222", "t322", "t422", "t522", "t622", |
---|
| 402 | "t132", "t232", "t332", "t432", "t532", "t632", |
---|
| 403 | "t142", "t242", "t342", "t442", "t542", "t642", |
---|
| 404 | "t152", "t252", "t352", "t452", "t552", "t652", |
---|
| 405 | "t162", "t262", "t362", "t462", "t562", "t662", |
---|
| 406 | "t113", "t213", "t313", "t413", "t513", "t613", |
---|
| 407 | "t123", "t223", "t323", "t423", "t523", "t623", |
---|
| 408 | "t133", "t233", "t333", "t433", "t533", "t633", |
---|
| 409 | "t143", "t243", "t343", "t443", "t543", "t643", |
---|
| 410 | "t153", "t253", "t353", "t453", "t553", "t653", |
---|
| 411 | "t163", "t263", "t363", "t463", "t563", "t663", |
---|
| 412 | "t114", "t214", "t314", "t414", "t514", "t614", |
---|
| 413 | "t124", "t224", "t324", "t424", "t524", "t624", |
---|
| 414 | "t134", "t234", "t334", "t434", "t534", "t634", |
---|
| 415 | "t144", "t244", "t344", "t444", "t544", "t644", |
---|
| 416 | "t154", "t254", "t354", "t454", "t554", "t654", |
---|
| 417 | "t164", "t264", "t364", "t464", "t564", "t664", |
---|
| 418 | "t115", "t215", "t315", "t415", "t515", "t615", |
---|
| 419 | "t125", "t225", "t325", "t425", "t525", "t625", |
---|
| 420 | "t135", "t235", "t335", "t435", "t535", "t635", |
---|
| 421 | "t145", "t245", "t345", "t445", "t545", "t645", |
---|
| 422 | "t155", "t255", "t355", "t455", "t555", "t655", |
---|
| 423 | "t165", "t265", "t365", "t465", "t565", "t665", |
---|
| 424 | "t116", "t216", "t316", "t416", "t516", "t616", |
---|
| 425 | "t126", "t226", "t326", "t426", "t526", "t626", |
---|
| 426 | "t136", "t236", "t336", "t436", "t536", "t636", |
---|
| 427 | "t146", "t246", "t346", "t446", "t546", "t646", |
---|
| 428 | "t156", "t256", "t356", "t456", "t556", "t656", |
---|
| 429 | "t166", "t266", "t366", "t466", "t566", "t666", |
---|
| 430 | " " /* blank terminates */ |
---|
| 431 | }; |
---|
| 432 | |
---|
| 433 | |
---|
| 434 | int ptc_twiss_summary_table_types[] = |
---|
| 435 | { |
---|
| 436 | 2, 2, 2, 2, 2, 2, 2, |
---|
| 437 | 2, 2, 2, 2, 2, |
---|
| 438 | 2, 2, 2, 2, |
---|
| 439 | 2, |
---|
| 440 | 2,2,2, |
---|
| 441 | 2,2,2, |
---|
| 442 | 2,2,2,2, |
---|
| 443 | 2,2,2,2 |
---|
| 444 | }; |
---|
| 445 | char* ptc_twiss_summary_table_cols[] = { |
---|
| 446 | "length", "alpha_c", "alpha_c_p", "alpha_c_p2", "alpha_c_p3", "eta_c", "gamma_tr", |
---|
| 447 | "q1", "q2", "dq1", "dq2", "qs", |
---|
| 448 | "beta_x_min","beta_x_max","beta_y_min","beta_y_max", |
---|
| 449 | "deltap", |
---|
| 450 | "orbit_x","orbit_px","orbit_y", |
---|
| 451 | "orbit_py","orbit_pt","orbit_-cT", |
---|
| 452 | "xcorms","ycorms","pxcorms","pycorms", |
---|
| 453 | "xcomax","ycomax","pxcomax","pycomax", |
---|
| 454 | " " /* blank terminates */ |
---|
| 455 | }; |
---|
| 456 | |
---|
| 457 | int ibs_table_types[] = |
---|
| 458 | { |
---|
| 459 | 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 |
---|
| 460 | }; |
---|
| 461 | |
---|
| 462 | char* ibs_table_cols[] = |
---|
| 463 | { |
---|
| 464 | "name", "s", "dels", "tli", "txi", "tyi", "betx","alfx","dx","dpx", "bety","alfy","dy","dpy", |
---|
| 465 | " " /* blank terminates */ |
---|
| 466 | }; |
---|
| 467 | |
---|
| 468 | int map_tab_types[]= |
---|
| 469 | { |
---|
| 470 | 2,1,1,1,1,1,1,1,1,1 |
---|
| 471 | }; |
---|
| 472 | |
---|
| 473 | char* map_tab_cols[]= |
---|
| 474 | { |
---|
| 475 | "coef","n_vector","nv","order","nx","nxp","ny","nyp","ndeltap","nt", |
---|
| 476 | " " /* blank terminates */ |
---|
| 477 | }; |
---|
| 478 | |
---|
| 479 | int normal_res_types[] = |
---|
| 480 | { |
---|
| 481 | 3, 1, 1, 1, 1, 2 |
---|
| 482 | }; |
---|
| 483 | |
---|
| 484 | char* normal_res_cols[] = |
---|
| 485 | { |
---|
| 486 | "name", "order1", "order2", "order3", "order4", "value", |
---|
| 487 | " " /* blank terminates */ |
---|
| 488 | }; |
---|
| 489 | |
---|
| 490 | int sodd_detune_5_types[] = |
---|
| 491 | { |
---|
| 492 | 1, 1, 2, 1, 1 |
---|
| 493 | }; |
---|
| 494 | |
---|
| 495 | char* sodd_detune_5_cols[] = |
---|
| 496 | { |
---|
| 497 | "multipoleorder", "plane", "detuning", "h_inv_order", "v_inv_order", |
---|
| 498 | " " /* blank terminates */ |
---|
| 499 | }; |
---|
| 500 | |
---|
| 501 | int sodd_distort1_8_types[] = |
---|
| 502 | { |
---|
| 503 | 2, 2, 2, 2, 2, 2, 2, 2 |
---|
| 504 | }; |
---|
| 505 | |
---|
| 506 | char* sodd_distort1_8_cols[] = |
---|
| 507 | { |
---|
| 508 | "multipoleorder", "cosine", "sine", "amplitude", "j", "k", "l", "m", |
---|
| 509 | " " /* blank terminates */ |
---|
| 510 | }; |
---|
| 511 | |
---|
| 512 | int sodd_distort1_11_types[] = |
---|
| 513 | { |
---|
| 514 | 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1 |
---|
| 515 | }; |
---|
| 516 | |
---|
| 517 | char* sodd_distort1_11_cols[] = |
---|
| 518 | { |
---|
| 519 | "multipoleorder", "location", "resonance", "position[m]", "cosine", "sine", "amplitude", "j", "k", "l", "m", |
---|
| 520 | " " /* blank terminates */ |
---|
| 521 | }; |
---|
| 522 | |
---|
| 523 | int sodd_distort2_9_types[] = |
---|
| 524 | { |
---|
| 525 | 1, 1, 2, 2, 2, 1, 1, 1, 1 |
---|
| 526 | }; |
---|
| 527 | |
---|
| 528 | char* sodd_distort2_9_cols[] = |
---|
| 529 | { |
---|
| 530 | "multipoleorder1", "multipoleorder2", "cosine", "sine", "amplitude", "j", "k", "l", "m", |
---|
| 531 | " " /* blank terminates */ |
---|
| 532 | }; |
---|
| 533 | |
---|
| 534 | int touschek_table_types[] = |
---|
| 535 | { |
---|
| 536 | 3, 2, 2, 2, 2 |
---|
| 537 | }; |
---|
| 538 | |
---|
| 539 | char* touschek_table_cols[] = |
---|
| 540 | { |
---|
| 541 | "name", "s", "tli", "tliw", "tlitot", |
---|
| 542 | " " /* blank terminates */ |
---|
| 543 | }; |
---|
| 544 | |
---|
| 545 | int mon_table_types[] = |
---|
| 546 | { |
---|
| 547 | 3, 2, 2, 2, 2 |
---|
| 548 | }; |
---|
| 549 | |
---|
| 550 | char* mon_table_cols[] = |
---|
| 551 | { |
---|
| 552 | "name", "x.old", "y.old", "x", "y", |
---|
| 553 | " " /* blank terminates */ |
---|
| 554 | }; |
---|
| 555 | |
---|
| 556 | int corr_table_types[] = |
---|
| 557 | { |
---|
| 558 | 3, 2, 2, 2, 2 |
---|
| 559 | }; |
---|
| 560 | |
---|
| 561 | char* corr_table_cols[] = |
---|
| 562 | { |
---|
| 563 | "name", "px.old", "py.old", "px.correction", "py.correction", |
---|
| 564 | " " /* blank terminates */ |
---|
| 565 | }; |
---|
| 566 | |
---|
| 567 | int orbit_table_types[] = |
---|
| 568 | { |
---|
| 569 | 3, 2, 2, 1, |
---|
| 570 | }; |
---|
| 571 | |
---|
| 572 | char* orbit_table_cols[] = |
---|
| 573 | { |
---|
| 574 | "name", "x", "y", "status", |
---|
| 575 | " " /* blank terminates */ |
---|
| 576 | }; |
---|
| 577 | |
---|
| 578 | int special_comm_cnt[] = |
---|
| 579 | { |
---|
| 580 | 3, 5, 7, 6, 5, 4, |
---|
| 581 | 0 |
---|
| 582 | }; |
---|
| 583 | |
---|
| 584 | char* special_comm_desc[] = /* ">?" = skip from start including char. at ? */ |
---|
| 585 | { |
---|
| 586 | "if(", "else{", "elseif(", "while(", ">:macro", ">:line", |
---|
| 587 | " " /* blank terminates , line must remain last */ |
---|
| 588 | }; |
---|
| 589 | |
---|
| 590 | int summ_table_types[] = |
---|
| 591 | { |
---|
| 592 | 2, 2, 2, 2, 2, |
---|
| 593 | 2, 2, 2, 2, 2, |
---|
| 594 | 2, 2, 2, 2, 2, |
---|
| 595 | 2, 2, 2, 2, 2, |
---|
| 596 | 2, 2, 2, 2, |
---|
| 597 | }; |
---|
| 598 | |
---|
| 599 | char* summ_table_cols[] = |
---|
| 600 | { |
---|
| 601 | "length", "orbit5", "alfa", "gammatr", "q1", |
---|
| 602 | "dq1", "betxmax", "dxmax", "dxrms", "xcomax", |
---|
| 603 | "xcorms", "q2", "dq2", "betymax", "dymax", |
---|
| 604 | "dyrms", "ycomax", "ycorms", "deltap", |
---|
| 605 | "synch_1","synch_2","synch_3","synch_4","synch_5", |
---|
| 606 | " " /* blank terminates */ |
---|
| 607 | }; |
---|
| 608 | |
---|
| 609 | int trackone_table_types[] = |
---|
| 610 | { |
---|
| 611 | 1, 1, 2, 2, 2, 2, 2, 2, 2, 2 |
---|
| 612 | }; |
---|
| 613 | |
---|
| 614 | char* trackone_table_cols[] = |
---|
| 615 | { |
---|
| 616 | "number", "turn", "x", "px", "y", "py", "t", "pt", "s", "e", |
---|
| 617 | " " /* blank terminates */ |
---|
| 618 | }; |
---|
| 619 | |
---|
| 620 | int track_table_types[] = |
---|
| 621 | { |
---|
| 622 | 1, 1, 2, 2, 2, 2, 2, 2, 2, 2 |
---|
| 623 | }; |
---|
| 624 | |
---|
| 625 | char* track_table_cols[] = |
---|
| 626 | { |
---|
| 627 | "number", "turn", "x", "px", "y", "py", "t", "pt", "s", "e", |
---|
| 628 | " " /* blank terminates */ |
---|
| 629 | }; |
---|
| 630 | int track_table_cols_len = sizeof track_table_cols / sizeof track_table_cols[0]; |
---|
| 631 | |
---|
| 632 | int tracksumm_table_types[] = |
---|
| 633 | { |
---|
| 634 | 1, 1, 2, 2, 2, 2, 2, 2, 2, 2 |
---|
| 635 | }; |
---|
| 636 | |
---|
| 637 | char* tracksumm_table_cols[] = |
---|
| 638 | { |
---|
| 639 | "number", "turn", "x", "px", "y", "py", "t", "pt", "s", "e", |
---|
| 640 | " " /* blank terminates */ |
---|
| 641 | }; |
---|
| 642 | |
---|
| 643 | |
---|
| 644 | int ptcnodetrack_table_types[] = |
---|
| 645 | { 1, 3, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2 }; |
---|
| 646 | |
---|
| 647 | char* ptcnodetrack_table_cols[] = |
---|
| 648 | {"number", "name", "elnumber","trnumber" , "turn","s_slice", "s", "x", "px", "y", "py", "t", "pt", "s", |
---|
| 649 | " " /* blank terminates */ |
---|
| 650 | }; |
---|
| 651 | |
---|
| 652 | |
---|
| 653 | int trackloss_table_types[] = |
---|
| 654 | { |
---|
| 655 | 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3 |
---|
| 656 | }; |
---|
| 657 | |
---|
| 658 | char* trackloss_table_cols[] = |
---|
| 659 | { |
---|
| 660 | "number", "turn", "x", "px", "y", "py", "t", "pt", "s", "e", "element", |
---|
| 661 | " " /* blank terminates */ |
---|
| 662 | }; |
---|
| 663 | |
---|
| 664 | int dynap_table_types[] = |
---|
| 665 | { |
---|
| 666 | 2,2,2,2,2, |
---|
| 667 | 2,2,2,2,2, |
---|
| 668 | 2,2,2,2,2 |
---|
| 669 | }; |
---|
| 670 | |
---|
| 671 | char* dynap_table_cols[] = |
---|
| 672 | { |
---|
| 673 | "dynapfrac", "dktrturns", "xend", "pxend", "yend", |
---|
| 674 | "pyend", "tend", "wxmin", "wxmax", "wymin", "wymax", |
---|
| 675 | "wxymin", "wxymax", "smear", "yapunov", |
---|
| 676 | " " /* blank terminates */ |
---|
| 677 | }; |
---|
| 678 | |
---|
| 679 | int dynaptune_table_types[] = |
---|
| 680 | { |
---|
| 681 | 2,2,2,2,2 |
---|
| 682 | }; |
---|
| 683 | |
---|
| 684 | char* dynaptune_table_cols[] = |
---|
| 685 | { |
---|
| 686 | "x", "y", "tunx", "tuny", "dtune", |
---|
| 687 | " " /* blank terminates */ |
---|
| 688 | }; |
---|
| 689 | |
---|
| 690 | /* Definition of "select_ptc_normal" parameters for "ptc_normal" */ |
---|
| 691 | char names[PTC_NAMES_L][5]= |
---|
| 692 | { |
---|
| 693 | "dx","dpx","dy","dpy","q1","q2","dq1","dq2","anhx","anhy","haml","gnfu","eign" |
---|
| 694 | }; |
---|
| 695 | |
---|
| 696 | char atm[3][4] = |
---|
| 697 | { |
---|
| 698 | "hmon","vmon","moni" |
---|
| 699 | }; |
---|
| 700 | |
---|
| 701 | char atc[3][4] = |
---|
| 702 | { |
---|
| 703 | "hkic","vkic","kick" |
---|
| 704 | }; |
---|
| 705 | |
---|
| 706 | char* atc_type = 0; |
---|
| 707 | int atc_flag = 0; |
---|
| 708 | |
---|
| 709 | char* atm_type = 0; |
---|
| 710 | int atm_flag = 0; |
---|
| 711 | |
---|