Conditional branch instruction to jump to another part of the beamline
Parallel capable? : yes
GPU capable? : no
Back-tracking capable? : no
Counter, which is decremented by 1 for each pass. Set to negative value for unconditional branch.
Interval between branching. If non-positive, use COUNTER-based method instead.
If INTERVAL method used, offset of branch passes.
Larger values result in more output during running.
If non-zero, defaults to ELSE_TO when performing tracking for closed orbit, twiss_output, etc.
Optional name of element to which to jump when counter is non-positive.
Optional name of element to which to jump when counter is positive.
Optionally used to assign an element to a group, with a user-defined name. Group names will appear in the parameter output file in the column ElementGroup
This element is experimental and should be used with care. It may not work well with other features, e.g., orbit correction or twiss parameter output. It should work well with tracking.
Use of the BRANCH element to change the starting point in the lattice is not ideal. It is better to use the change_start command.
The element permits switching tracking between two segments of a beamline. This can be done once per run or periodically. For the former, the COUNTER parameter should be used to specify the pass number (which is zero on the first pass) on which to branch. For the latter, the INTERVAL i and (optionally) OFFSET o parameters should be used; the branch will occur when (p - o)%i == 0.
The application that inspired creation of this element is to switch from tracking using lumped elements to tracking using element-by-element methods. More specifically, imagine we want to track for 10,000 turns to reach an equilibrium, then perform a beam abort. The equilibrium state can be accurately and rapidly modeled using lumped elements, such as ILMATRIX and SREFFECTS, but the beam abort needs to be modeled using comparatively slow element-by-element tracking.
Another application is to model a periodic bypass, e.g.,
In this example, the full ring is composed of three sections, RINGA, RINGB, and RINGC. Every 100 passes, the RINGB portion is bypassed in favor of BYPASS.