EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH

PTC_SetCavities

f90 routine that adjusts cavities and sets appropriate reference momenta for a layout containing traveling wave cavities

PROGRAMMERS MANUAL

CAUTION For the time being cavities MUST not be placed one after another, and at least a marker must be inserted between two neighboring accelerating structures. Otherwise, program will stop with the error message.

Description

This routine sets up the properties of a layout and traveling wave cavities. The main goal is to update reference beam energy for the elements that follow a traveling wave cavity. It traces the synchronous particle, i.e. one that has all its parameters set to zero at the beginning of the layout under study. At the point it arrives to a cavity, the parameters of the latter one are adjusted according to the switches defined by the user. There are 2 cases

  1. Leaves all parameters untouched
  2. Phase of cavity is adjusted so it gives the maximum acceleration Afterwards to the calculated phase the lag is added. This setting is acquired using set_switch command, setting maxaccel parameter to true.
Afterwards, the synchronous particle is tracked through traveling wave cavity and its energy gain is known. This energy becomes the reference one for all the elements downstream of the cavity. The particle is tracked further to the next cavity, for which the procedure described above is repeated.

Parameters of the cavities are dumped to the file named twcavsettings.txt.

At the end patches at the ends of the cavities are set, so the parameters after them are calculated taking to the account reference energy increase.

The exact program behavior depends on the PTC switches settings.

Please note that in PTC phase velocity of a cavities wave is always equal to speed of light. Hence, if PTC internal state TIME is TRUE, what is the most correct setting, then voltage seen by a particle is varying along the structure. If TIME is FALSE, track is assumed to fly with speed of light and in such case a particle moves together with the wave front.