Remove redundant SCupdateMagnets call in applyLatticeCorrection#53
Open
thellert wants to merge 1 commit intoThorstenHellert:masterfrom
Open
Remove redundant SCupdateMagnets call in applyLatticeCorrection#53thellert wants to merge 1 commit intoThorstenHellert:masterfrom
thellert wants to merge 1 commit intoThorstenHellert:masterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
SCupdateMagnets()call at line 705 inapplyLatticeCorrection()is redundant and has been removed.Reason
SCsetMags2SetPoints()already callsSCupdateMagnets()internally for each magnet after updating setpoints. The extra call at line 705 simply recalculated identical values.For combined-function magnets with dipole compensation:
SCsetCMs2SetPoints()which modifiesSetPointB(1)and callsSCupdateMagnets()SetPointB(2)is then updated andSCupdateMagnets()is called againVerification
Regression test comparing baseline (with extra call) vs patched (without):
SetPointA/BidenticalPolynomA/BidenticalThe extra call was computationally wasteful but did not cause physics errors.