Skip to content

Conversation

@thellert
Copy link

@thellert thellert commented Jan 2, 2026

Summary

The SCupdateMagnets() call at line 705 in applyLatticeCorrection() is redundant and has been removed.

Reason

SCsetMags2SetPoints() already calls SCupdateMagnets() internally for each magnet after updating setpoints. The extra call at line 705 simply recalculated identical values.

For combined-function magnets with dipole compensation:

  1. Dipole compensation is applied via SCsetCMs2SetPoints() which modifies SetPointB(1) and calls SCupdateMagnets()
  2. SetPointB(2) is then updated and SCupdateMagnets() is called again
  3. The extra call at line 705 recalculated identical values (no setpoints changed)

Verification

Regression test comparing baseline (with extra call) vs patched (without):

  • ✓ All SetPointA/B identical
  • ✓ All PolynomA/B identical
  • ✓ Closed orbits identical (RMS diff = 0)
  • ✓ Tunes identical

The extra call was computationally wasteful but did not cause physics errors.

The SCupdateMagnets() call at line 705 was redundant because
SCsetMags2SetPoints() already calls SCupdateMagnets() internally
for each magnet after updating setpoints.

For combined-function magnets with dipole compensation:
- Dipole compensation is applied via SCsetCMs2SetPoints() which
  modifies SetPointB(1) and calls SCupdateMagnets()
- SetPointB(2) is then updated and SCupdateMagnets() is called again
- The extra call at line 705 recalculated identical values

Verified by regression test comparing baseline (with extra call) vs
patched (without): all SetPointA/B, PolynomA/B, orbits, and tunes
are identical.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant