diff --git a/madx/lib/beta_beat.macros.madx b/madx/lib/beta_beat.macros.madx index 3937a4b4..90de97f0 100644 --- a/madx/lib/beta_beat.macros.madx +++ b/madx/lib/beta_beat.macros.madx @@ -8,7 +8,7 @@ select_monitors(): macro = { select, flag=twiss, clear; select, flag=twiss, pattern="^BPM.*B[12]$", column=name, s, betx, alfx, bety, alfy, - mux, muy, dx, dy, dpx, dpy, x, y, + mux, muy, dx, dy, dpx, dpy, x, y, px, py, k1l, k1sl, k2l, k3l, k4l, wx, wy, phix, phiy, dmux, dmuy, keyword, dbx, dby, r11, r12, r21, r22; @@ -21,7 +21,7 @@ select_monitors(): macro = { select_elements(): macro = { select, flag=twiss, clear; select, flag=twiss, class=monitor, column=name, s, betx, alfx, bety, alfy, - mux, muy, dx, dy, dpx, dpy, x, y, + mux, muy, dx, dy, dpx, dpy, x, y, px, py, k1l, k1sl, k2l, k3l, k4l, wx, wy, phix, phiy, dmux, dmuy, keyword, dbx, dby, r11, r12, r21, r22; @@ -40,6 +40,16 @@ select_elements(): macro = { select, flag=twiss, class=drift; } +/* +* Selects the LHC IPs only and only important columns. +*/ +select_lhc_ips_few_columns(): macro = { + select, flag=twiss, clear; + select, flag=twiss, pattern = "^IP[1-8]$", column=name, s, x, y, px, py, + betx, alfx, bety, alfy, + mux, muy, dx, dy, dpx, dpy; +} + /* * Simple twiss file output with only monitors. @@ -67,6 +77,18 @@ do_twiss_elements(use_sequence, output_file, dpp): macro = { }; +/* +* Simple twiss file output with only the LHC IPs and few important columns. +* @param sequence: name of the sequence to use. +* @param output_file: path to the file to write, it has to be input in "" to +* preserve upper case characters. +* @param dpp: delta p / p to use in the twiss command. +*/ +do_twiss_lhc_ips_few_columns(use_sequence, output_file, dpp): macro = { + exec, select_lhc_ips_few_columns(); + twiss, chrom, sequence=use_sequence, deltap=dpp, file=output_file; +}; + /* * Transform the coupling given in R-matrix in MAD-X to f terms. diff --git a/model/accelerators/lhc/best_knowledge.madx b/model/accelerators/lhc/best_knowledge.madx index 1f56dec2..d9d3aa8d 100644 --- a/model/accelerators/lhc/best_knowledge.madx +++ b/model/accelerators/lhc/best_knowledge.madx @@ -30,3 +30,7 @@ call, file = "%(PATH)s/extracted_mqts.str"; exec, do_twiss_monitors(LHCB%(NUM_BEAM)i, "%(PATH)s/twiss_best_knowledge.dat", %(DPP)s); exec, do_twiss_elements(LHCB%(NUM_BEAM)i, "%(PATH)s/twiss_elements_best_knowledge.dat", %(DPP)s); + +! check the values at the IPs, to see that knob extraction worked. +exec, do_twiss_lhc_ips_few_columns(LHCB%(NUM_BEAM)i, "%(PATH)s/twiss_ips_best_knowledge.dat", %(DPP)s); +system, "cat %(PATH)s/twiss_ips_best_knowledge.dat"; diff --git a/model/accelerators/lhc/nominal.madx b/model/accelerators/lhc/nominal.madx index 66b2dc1b..d8418ce4 100644 --- a/model/accelerators/lhc/nominal.madx +++ b/model/accelerators/lhc/nominal.madx @@ -31,3 +31,7 @@ if(%(USE_ACD)s == 1){ }else if(%(USE_ADT)s == 1){ exec, twiss_adt(%(QX)s, %(QY)s, %(QDX)s, %(QDY)s, %(NUM_BEAM)i, "%(PATH)s/twiss_adt.dat", %(DPP)s); } + +! check the values at the IPs, to see that knob extraction worked. +exec, do_twiss_lhc_ips_few_columns(LHCB%(NUM_BEAM)i, "%(PATH)s/twiss_ips.dat", %(DPP)s); +system, "cat %(PATH)s/twiss_ips.dat";