Transform3d Broken

Issue #54 resolved
Laurie Nevay created an issue

Since the new beamline implementation (or when rotation axes were added), the transform3d does not behave as expected for phi and psi rotations.

Edit the attached example - the transform3d instance at the end of the components file.

Screen Shot 2015-07-22 at 14.38.22.png

Comments (2)

  1. Laurie Nevay reporter

    Fixed with commits 4d336f6 (transform3d) and 98fe260 (general placement).

    Rotation matrices were calculated for ACTIVE transforms but used as passive transforms. This meant, they were always wrong in the new beam line implementation - although the positions were calculated correctly.

    This went unnoticed as there was a -1x flip in the horizontal global x coordinate - done so as assumed definition of +ve angle corresponds to -ve x deflection (madx & accelerator convention) and as we only ever really bend in the horizontal, this worked just fine - only when we deviated from rotation about global z or bending in the global xz plane would we notice - ie any interesting transform3d.

    Solved by automatically creating a transform 3d out of the placement vector and rotation matrix in when the BDSBeamlineElement instance is created (in its constructor). Using the exact same rotation matrix and position but as a transform makes it an active placement rather than a passive one and hence correct.

  2. Laurie Nevay reporter

    Vertical bends achieved with a transform3d at the beginning of the line and then normal sbends.

    Screen Shot 2015-07-29 at 20.07.41.png

  3. Log in to comment