Page 1 of 1

Questions Regarding SHIFT_IN_FIELD_MAP and Transfer Matrix Extraction in TraceWin

Posted: Mon 26 Oct 2026 02:42
by shliu
Dear Didier,
I hope you are doing well.
I am using TraceWin for beam dynamics simulations and have encountered some questions regarding the `SHIFT_IN_FIELD_MAP` command and transfer matrix extraction. I would appreciate your help in clarifying these issues.
In my lattice file, some diagnostic elements are positioned inside magnetic field maps using the `SHIFT_IN_FIELD_MAP` command.
The following is a relevant section of my actual TraceWin lattice file:
;name MEBT_SLIT3
DIAG_SIZE 210
DIAG_PHASE 211
SHIFT_IN_FIELD_MAP 360
;name MEBT_BPM5
DIAG_POSITION 212 0 0 0.5
MATCH_FAM_GRAD 12 0
SUPERPOSE_MAP 0 0 0 0 0 0
;name MEBT_Q11
adjust 1003 5 1 0 180
FIELD_MAP 70 400 0 15.001 23.6771 0 0 0 MEBT_Q1 0
SUPERPOSE_MAP 160 0 0 0 0 0
MATCH_FAM_GRAD 12 0
;name MEBT_Q12
adjust 1003 5 2 -180 0
FIELD_MAP 70 400 0 15.001 -66.1659 0 0 0 MEBT_Q2 0
In this configuration, diagnostic No. 212 corresponds to element No. 46 (BPM05), and its position is defined using `SHIFT_IN_FIELD_MAP 360`.
However, when checking the simulation outputs, I noticed a discrepancy between the longitudinal positions reported by different TraceWin outputs:
In the `RAR.diag1` file, diagnostic No. 211 (element No. 45) is located at **2.84050 m**.
In the `RAR.diag1` file, diagnostic No. 212 (element No. 46) is located at **3.24084 m**.
In the TraceWin Data/Lattice interface, the position displayed for element No. 46 appears to be approximately 2.84050 m, which differs from the position reported in `RAR.diag1`.
The distance between diagnostics No. 211 and No. 212 reported in `RAR.diag1` is approximately 400.34 mm, while the specified `SHIFT_IN_FIELD_MAP` value for diagnostic No. 212 is 360 mm.
I am not sure how these different position values should be interpreted, or whether this discrepancy is related to the combined use of `SHIFT_IN_FIELD_MAP` and `SUPERPOSE_MAP`.
I also obtained the transfer matrix from element No. 1 to element No. 46 using:
`Charts → Transfer Matrix → From 1 to 46`
Since element No. 46 is associated with the `SHIFT_IN_FIELD_MAP` command, I am unsure whether the extracted transfer matrix corresponds to the position displayed in the lattice or to the actual shifted diagnostic position.
I would greatly appreciate your clarification on the following points:
(1)When `SHIFT_IN_FIELD_MAP` is used, does the transfer matrix extracted through `Charts → Transfer Matrix → From 1 to 46` correspond to the original lattice position of element No. 46, or to its shifted diagnostic position inside the field map?
(2) Why does the longitudinal position reported in `RAR.diag1` differ from that displayed in the Data/Lattice interface? Is this expected behavior?
(3) What is the recommended method for obtaining the transfer matrix corresponding exactly to the actual diagnostic position (3.24084 m) reported in `RAR.diag1`?
(4) If I temporarily disable `SHIFT_IN_FIELD_MAP`, will this only change the diagnostic position, or could it also affect the beam transport calculations?
I have attached several screenshots showing the relevant lattice configuration, `RAR.diag1` output, element positions, and the extracted transfer matrix.
Thank you very much for your time and assistance. I look forward to your reply.
Best regards