Calculation of chord length in RBend wrong
Summary
When the deflection angle is negative then the chord length that is calculated in RBend is wrong. In a rectangular bend when the orientation of the face relative to the beam (E1
) is half of the deflection angle then the chord length should be equal to the length of the dipole. Instead the calculated length is as if E1
was multiplied by -1
.
Steps to reproduce
Add OPTION, LOGBENDTRAJECTORY=TRUE;
to the input file and track a bunch through a rectangular bend with ANGLE < 0
and E1 = ANGLE / 2
. Then look up the distance in the file data/<input_fname>_<bend_name>_traj.dat
between the two locations where the reference particle crosses x=0
.
What is the current bug behavior?
The current chord length is as if E1 = -ANGLE / 2
.
What is the expected correct behavior?
The chord length should be equal to L
in the description of the bend in the input file.