5 Fiducialization in elegant
In some tracking codes, there is a “fiducial particle” that is tracked along with the beam. This particle
follows the ideal trajectory or orbit, with the ideal momentum, and at the ideal phase. There is no fiducial
particle in elegant. Instead, fiducialization is typically based on statistical properties of the bunch. This
can be performed on a bunch-by-bunch basis, or for the first bunch seen in a run. The latter method must
be used if one wants to look at the effects of changing phase, voltage, or magnets relative to some nominal
configuration.
Internally, elegant fiducializes each element in the beamline. Fiducializing an element means
determining the reference momentum and arrival time (or phase) for that element. If the reference
momentum does not change along a beamline and no time-dependent elements are involved, then
fiducialization is irrelevant. All elements are fiducialized at the central momentum defined in
run_setup.
A number of commands have parameters for controlling fiducialization:
- The always_change_p0 parameter of run_setup causes elegant to re-establish the central
momentum after each element when fiducializing. This may be more convenient than setting
the CHANGE_P0 parameter on the elements themselves. However, it can have unexpected
consequences, such as changing the central momentum to match changes in beam momentum
due to synchrotron radiation.
- run_control has four parameters that affect fiducialization, which come into play when multi-step
runs are made. Typically, these are runs that involve variation of elements, addition of errors, or
loading of multiple sets of parameters.
- reset_rf_for_each_step — If nonzero, the rf phases are re-established for each beam
tracked. If this is 1 (the default), the time reference is discarded after each bunch is
tracked. This means that bunch-to-bunch phasing errors due to time-of-flight differences
would be lost.
- first_is_fiducial — The first bunch seen is taken to establish the fiducial phases
and momentum profile. If one is simulating, for example, successive beams in a fixed
accelerator, this should be set to 1. Otherwise, the momentum reference is discarded
after each bunch is tracked. N.B.: as of version 27.0.1, setting first_is_fiducial=1
does not imply always_change_p0=1. You must set this separately, or use the CHANGE_P0
parameter on various elements (e.g., RFCA) to further specify how to set the fiducial
momentum profile.
- restrict_fiducialization — If nonzero, then momentum profile fiducialization occurs
only after elements that are known to possibily change the momentum. It would not
occur, for example, after a scraper that changes the average beam momentum by
removing a low-momentum tail. This is a convenience that, essentially, allows modifying
the impact of setting always_change_p0=1.
- n_passes_fiducial — If positive, sets the number passes used for fiducial tracking to
be different from the n_passes value. For ring fiducialization, should probably always
be set to 1.
- The bunched_beam command has a first_is_fiducial parameter that is convenient for use with
the first_is_fiducial mode established by run_control. If nonzero, this parameter causes
elegant to generate a first bunch with only one particle. This is very useful if one wants to track
with many particles but doesn’t want to waste time fidicializing with a many-particle
bunch.
Here are some examples that may be helpful.
- Scanning a phase error in a linac with a bunch compressor: The scan is performed using the
vary_element command. For this to work properly, it is necessary to fidcualize the system
with zero phase error. Hence, one must use the enumeration feature of vary_element to
provide an input file with the phase errors and the file must be sorted so that the row
with zero phase error is first. Further, one must set reset_rf_for_each_step = 0 and
first_is_fiducial = 1 in run_control, and CHANGE_P0=1 on all rf cavity elements. (See
the bunchComp/phaseSweep and bunchComp/dtSweep examples.)
- Scanning the voltage of a linac to simulate different operating energy choices at the
compressor: In this case, one scans the linac voltage, but wants to fiducialize the system
for each voltage. (It’s a change in design, not an error or perturbation.) One again uses
vary_element, but nothing special needs to be done about the order of the voltage values. One
must set reset_rf_for_each_step = 1 and first_is_fiducial = 0 in in run_control,
and CHANGE_P0=1 on all rf cavity elements. (See the bunchComp/energySweep example.)
- Simulation of phase and voltage jitter: In this case, one uses the error_element command
to impart errors to the PHASE and VOLT parameters of rf cavity elements. However, the
first beam through the system must not see any errors. This is accomplished by setting
no_errors_for_first_step=1 in error_control. One can also (optionally) use a 1-particle
beam for fiducialization by setting first_is_fiducial=1 in bunched_beam. In addition, one
must set reset_rf_for_each_step = 0 and first_is_fiducial = 1 in run_control, and
CHANGE_P0=1 on all rf cavity elements. (See the bunchCompJitter/jitter example.)