Settle on Rotation Definition in Detector files
Status Quo
Currently, two rotation schemes are supported:
-
XYZ: the default definition, representing an extrinsic rotation around the global axis. First rotation around global X, then global Y, then global Z. This scheme is nice to work with since extrinsic rotations are a bit easier to digest than proper Euler rotations, but the order of rotations X->Y->Z is very uncommon.
-
ZXZ: a Euler rotation (also dubbed the 313 notation or x-notation) with intrinsic rotations, first around the global Z axis, then around the X' axis, and finally around the new Z'' axis. It's a very common notation but is harder to wrap your head around especially when trying to rotate around both X and Y axes.
New Features
This MR suggest to add a third rotation scheme, namely
-
ZYX: this is an extrinsic rotation (also as Roll-Pitch-Yaw or 321 Euler notation (?)). This means, the following configuration
orientation_type = "zyx" orientation = 45deg 10deg 12deg
would translate into the rotation of 45deg around the global
Z
axis, followed by a 10deg rotation around the globalY
axis, and finally a rotation of 12deg around the globalX
axis. -
The angles in the configuration file should be provided in the order in which they are applied.
Open Discussions
The following items are not implemented yet but should be discussed and settled before merging:
-
There is a ROOT issue with the RotationZYX
class, which is documented as intrinsic rotation, but actually implements an extrinsic rotation as discussed in the JIRA ticket: https://sft.its.cern.ch/jira/browse/ROOT-9084 - we should try to get some answer there before we use this class. -
Should we make the new ZYX rotation the default choice? -
With our new configuration parser, it is possible to read 2D matrices from configuration files. With this, it would be possible to also allow the specification of a 3D rotation matrix, where orientation_type = "matrix" orientation = [a, b, c], [d, e, f], [g, h, i]
translate into the following rotation matrix
\mathcal{M}
:\mathcal{M} = \begin{pmatrix} a & b & c \\ d & e & f \\ g & h & i \end{pmatrix}
As @msmk has pointed out in !88 (merged) providing a full rotation matrix does not enforce orthogonality and two vectors would be enough.
-
The user manual should provide a bit more guidance on this issue as this always takes the longest to get right when preparing geometry files.