PTC_EPLACEMENT, range = [s, none], x = [r, 0], y = [r, 0], z = [r, 0], phi = [r, 0], theta = [r, 0], onlyposition = [l, false, true] , onlyorientation = [l, false, true] , autoplacedownstream = [l, true, true] , refframe = [s, gcs] ;
Specifies name of the element to be moved.
Coordinate of the front face of the magnet.
polar (in xz plane, around z axis) and azimuthal (around x axis) angles, respectively.
Defines the coordinate system with respect to which coordinates and angles are specified. Possible values are:
If true, only translation are performed and orientation of the element is not changed.
If true, only rotations are performed and position of the element is not changed.
if true all the elements downstream are placed at default positions in respect to the moved element, if false the rest of the layout stays untouched.
If true, survey of all the line is performed after element placement at new position and orientation. It is implemented mainly for the software debugging purposes. If patching was performed correctly, the global survey should not change anything.
The command is implemented pro_ptc_eplacement function in madxn.c and by subroutine ptc_eplacement() in madx_ptc_eplacement.f90.
Sopecified range is resolved with help of get_range command. Number of the element in the current sequence is resolved and passed as the parameter to the fortran routine. It allows to resolve uniquely the corresponding element in the PTC layout.
TRANSLATE_Fibre and ROTATE_Fibre routines of ptc are employed to place and orient an element in space. These commands adds rotation and translation from the current position. Hence, if the specified reference frame is other then "current", the element firstly needs to be placed at the center of the reference frame and then it is moved about the user specified coordinates.
After element placement at new position and orientation patch needs to be recomputed. If autoplacedownstream is false then patch to the next element is also recomputed. Otherwise, the layout is surveyed from the next element on, what places all the elements downstream with default position with respect to the moved element.
At the end all the layout is surveyed, if surveyall flag is true, what normally should always take place.