Chromaticity studies on SFT injection
During Parallel MD 2025-08-22 we performed chromaticity measurement of an SFT type cycle with 14 GeV injection. It was found during earlier MDs that the beam becomes unstable when the dipole cycle of the preceeding MD1 precycle was kept at idle current (= no dipole precycle), even after manually correcting the main dipole field. The beam was made stable by reducing horizontal chromaticity SPSBEAM/QPH in LSA by 0.1, which suggested that a wrong chromaticity made the beam unstable. The only difference between the two cycle instances was the lack of dipole precycle, suggesting that a remanent sextupolar () component of the main dipole field could explain the discrepancy.
For the chromaticity measurements we set up a SHiP cycle with Tirsi in a parallel MD, with the beam going to the dump at the ramp. In either cases with and without MD1 we correct the beam manually by centering the orbit and adjusting horizontal tune to get a good separation between the two planes. In either cases the small momentum ramp at the SFT injection (normally there to counter eddy current decay), was flattened.
Without the MD1 we perform measurements in in steps of , and taking 3 measurements at each step, taking about 20 minutes for the entire measurement. With the MD1 use in steps of due to significant beam losses with .
During postprocessing we apply clustering and more intelligent peak selection to choose the tunes in each plane due to strong coupling between the two planes, and removing erraneous datapoints from the tune evolution. The algorithm is described in Analysis scripts.
During the MD we use the following values in LSA: QPH = 0.6003, QPV = -0.7258.
Results
With an MD1
The supercycle during the measurement with MD1 is the following:

Looking at the tune evolution over injection plateau, we see many missing points in the evolution, but see the overall trend of the tunes. We see a decay in the horizontal tune due to beam losses over the measurement, which is less significant in the vertical plane.

The average measured chromaticity over the full window (C200-C1100) is seen below. In the horizontal plane we see strong nonlinearities, which are not present in the vertical plane, which is mainly linear. In the horizontal plane we see a slightly negative (normalized) chromaticity at , and more negative in the vertical plane . In both planes the values make sense being negative because the SFT beam is below transition at injection.

When not averaging over the whole injection we can extract the chromaticity evolution over time. The averages match with the above within an error margin. The chromaticity does not seem to evolve over the injection in neither planes, as expected.

We also extract the higher order chromaticities from the 3rd order fit above:
~*~*~*~*~*~*~*~*~*~*~*~*
Linear chroma H: -2.399 ± 0.715, normalized: -0.090 ± 0.027
Linear chroma V: -7.059 ± 0.567, normalized: -0.266 ± 0.021
~*~*~*~*~*~*~*~*~*~*~*~*
Second order chroma H [1e3]: 0.812 ± 0.362
Second order chroma V [1e3]: 0.093 ± 0.275
~*~*~*~*~*~*~*~*~*~*~*~*
Third order chroma H [1e6]: -0.052 ± 0.661
Third order chroma V [1e6]: 0.373 ± 0.508
Without MD1
The supercycle during the measurement without MD1 is the following:

We apply the same clustering and filtering to extract the tunes, and we see a simiilar tune decay in both planes.

The measured chromaticity in the vertical plane changes from , so a , whereas the in the horizontal plane , with a total change . Surprisingly, we see that the chromaticity in the H plane becomes positive, which explains why the beam becomes unstable and is lost within a few hundred turns. In general small positive chromaticity can still yield a stable beam at low intensities, which suggests why during some measurements the beam was lost when intensity was increased from a few to .
The evolution of chromaticity over the measurement window stays rather constant over time, around the in the horizontal plane, and we don’t see any signficant drift, suggesting that the sextupolar field error is not caused by Eddy current decay in the SPS main dipoles.

~*~*~*~*~*~*~*~*~*~*~*~*
Linear chroma H: 4.069 ± 0.436, normalized: 0.153 ± 0.016
Linear chroma V: -11.166 ± 0.432, normalized: -0.420 ± 0.016
~*~*~*~*~*~*~*~*~*~*~*~*
Second order chroma H [1e3]: 2.269 ± 0.251
Second order chroma V [1e3]: -0.943 ± 0.229
~*~*~*~*~*~*~*~*~*~*~*~*
Third order chroma H [1e6]: -1.210 ± 0.301
Third order chroma V [1e6]: 0.811 ± 0.295
~*~*~*~*~*~*~*~*~*~*~*~*
QPH in LSA: 0.6003
QPV in LSA: -0.7258
Analysis scripts
Tirsi (Prebibaj) provided scripts to retreive information from NXCALS and postprocess to extract tunes and compute chromaticity.
However the original script computed only very few tunes (N=10), and chose the first tune. As the tunes in our MD were coupled, a more intelligent way was developed to determine which tune is which, and when to discard a wrongly detected tune.
This algorithm separates H/V tunes in the presence of strong coupling where peaks appear in both planes’ spectra. The implementation uses a two-phase approach: comprehensive data extraction followed by prior-informed assignment assignment, and prioritizes conservative assignment over forced decisions
-
Time chunking and NAFF analysis: Process beam data in 24ms windows using
chunk_size = 24from BBQ measurements. Apply NAFF withN = 100peaks (increased from typical N=20) to capture weak tune peaks in either plane that might be missed with lower peak counts. -
Expanded frequency collection: Use limits [0.54, 0.66] for both planes instead of the standard H [0.58, 0.645] and V [0.54, 0.63] ranges. This expansion captures coupled H peaks appearing in the V spectrum, preventing premature filtering of valid signals during the extraction phase.
-
Raw data preservation: Store all detected frequencies and amplitudes without making assignment decisions. This preserves complete spectral information for the clustering analysis and avoids early loss of coupled signals.
-
Independent plane clustering: Apply K-means clustering (k=2) separately to each plane’s frequencies using
cluster_single_plane(). The clustering is initialized at min/max frequencies to encourage separation and handles cases where all peaks group into a single cluster. -
Cluster consolidation: Merge clusters closer than
min_cluster_separation = 0.002tune units usingmerge_close_clusters(). -
Informed cluster selection: Use
select_cluster_for_plane()to assign clusters based on a priori knowledge. The H plane selects the higher frequency cluster while the V plane selects the lower frequency cluster, since we have set up the beam so that QH > QV. -
Amplitude-weighted extraction: Within each selected cluster, choose the frequency with highest amplitude using
get_best_tune_from_cluster(). -
Temporal continuity validation: Apply
check_temporal_continuity()withmax_tune_change = 0.008to reject tune changes in case the wrong peak was chosen.
References
@Tommasini - 1233948 @carlaStudiesNewOptics2018
Attachments
Transclude of 01A_load_chroma_data_NXCALS-1.ipynb
Transclude of 01B_load_chroma_data_NXCALS-1.ipynb
Transclude of 02A_compute_chroma_withoutMomentumRamp_flatMD1.ipynb
Transclude of 02B_compute_chroma_withoutMomentumRamp_MD1.ipynb
Transclude of magnetic-cycle.ipynb
Transclude of nxcals_helpers.py