Skip to content

Commit

Permalink
Add lines for co ref after creating the collider
Browse files Browse the repository at this point in the history
  • Loading branch information
giadarol committed Jan 6, 2025
1 parent 6b58309 commit 0d81ac0
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions xmask/lhc/build_madx_and_xsuite_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,22 @@ def build_xsuite_collider(

lines_to_track[sequence_name] = line

lines = {}
lines.update(lines_to_track)
lines.update(lines_co_ref)

if 'lhcb1' in lines_to_track:
lines['lhcb1_co_ref'].particle_ref = lines['lhcb1'].particle_ref.copy()
lines_co_ref['lhcb1_co_ref'].particle_ref = (
lines_to_track['lhcb1'].particle_ref.copy())
if 'lhcb2' in lines_to_track:
lines['lhcb2_co_ref'].particle_ref = lines['lhcb2'].particle_ref.copy()
lines_co_ref['lhcb2_co_ref'].particle_ref = (
lines_to_track['lhcb2'].particle_ref.copy())

collider = xt.Environment(lines=lines)
collider = xt.Environment(lines=lines_to_track)

if 'lhcb1' in lines_to_track:
collider.import_line(line=lines_co_ref['lhcb1_co_ref'],
line_name='lhcb1_co_ref')
define_octupole_current_knobs(line=collider.lhcb1, beamn=1)
if 'lhcb2' in lines_to_track:
collider.import_line(line=lines_co_ref['lhcb2_co_ref'],
line_name='lhcb2_co_ref')
define_octupole_current_knobs(line=collider.lhcb2, beamn=2)

add_correction_term_to_dipole_correctors(collider)
Expand Down

0 comments on commit 0d81ac0

Please sign in to comment.