Coordinates

Different systems of coordinates are considered here which will be used, at least unconsciously. It is preferable to consciously have precise definitions to be referred to when useful.

This concerns the various parts of the detector namely the primary beam, the secondary beam and the two arms downstream of the magnet. For completeness one must consider the various inclinations of the measurement direction. For example calculations on track candidates in the planes with vertical wires of the left arm are done in a different system from that one corresponding to horizontal wires in the same arm. The explicit distinction between these systems is necessary if one wants to work with a common logical structure, such as "index_1 means X which in turn corresponds to the direction of measurement".

The systems of coordinates are formally represented by C={O,X,Y,Z}, an origin (a 3 coordinates vector) and 3 directions of axes —chosen right-handed in the order X,Y,Z. The detectors are essentially made of planes for which one considers the following axes (unit vectors): N (Normal) a normal to the plane, L (Longitudinal) along the wires or the scintillator slabs and T (Transversal) the 3rd axis along which one makes measurements. Practically the system (T,L,N) —chosen right-handed in this order— will be one of the systems of coordinates defined later with the implicit identity of (X,Y,Z) and (T,L,N). There is a basic system of coordinates (Csh=Secondary horizontal or "Secondary" in short) with respect to which the other systems are defined using Euler-style angles [a,b,c] : a around X, then b around the new Y, then c around the new-new Z.

Notice the unconventional X then Y then Z (instead of, for example, Z,Y,Z). This is used explicitly to easily differentiate parallel planes with different directions of measurement. Angles are quoted in degrees. Under the name "Euler" in the detector file the different ways one can combine successive rotations are referenced. The one mentioned above is named in this file "XYZ" and referenced later through the code 1. The first 2 angles reflect in a natural way the angles 5.7 and 19 degrees respectively. The last angle of the triplet is used to orient the transverse axis (T) along the direction of measurement. A further parameter (equal to +1 or —1) is used to indicate if the direction of "increasing" measurement is along T or —T.

Systems of coordinates

For convenience, the origin of ALL systems is placed at the mid-point of the magnet. Precisely, this point is the intersection of the mid-plane of the magnet with a straight line going through the center of the target (in its ideal position) and making an angle of 5.7 degrees upwards from the beamline. Evidently, "mid-plane", "target" and "beamline" are ideal concepts, approximated from survey measurements. An origin of coordinates is however explicitly associated to each system (and set to {0,0,0}), but, so far, transformations from one system into another use implicitly the coincidence of the origins.
Primary
[a,b,c] = [5.7, 0, 0]
Yp is vertical
Zp is horizontal, projection of the mean primary beam in the horizontal plane
Xp = [Yp cross Zp]
Secondary (Secondary horizontal)
[a,b,c] = [0, 0, 0]
Secondary vertical
[a,b,c] = [0, 0, -90]
Secondary inclined
[a,b,c] = [0, 0, 11.3]
Right horizontal
[a,b,c] = [0, -19, 0]
Right vertical
[a,b,c] = [0, -19, -90]
Left horizontal
[a,b,c] = [0, 19, 0]
Left vertical
[a,b,c] = [0, 19, -90]
SecondaryU (inclined MSGC)
[a,b,c] = [0, 0, -85]
SecondaryT (inclined MSGC)
[a,b,c] = [0, 0, 5]
RightPrShH
[a,b,c] = [5.7, -19, 1.852]
LeftPrShH
[a,b,c] = [5.7, 19, -1.852]
RightMuonH
[a,b,c] = [5.7, -31.5, 2.982]
LeftMuonH
[a,b,c] = [5.7, 31.5, -2.982]

Planes

Triplets of Euler angles [a, b, c] represent the detector planes in the detector file defining each a triplet of unit vectors (T,L,N) as explained above. For convenience reasons one of the 14 systems of axes listed above is associated to each plane to be used as a first order approximation, i.e. the [a,b,c] triplet of the system of coordinates will be used. For precise (final) calculations one will resort to the [a,b,c] triplet of the detector plane. There will be inevitably slight differences between these two triplets when precise alignment adjustments will be made. In addition to these angles the position of a plane in space is defined by a point (X,Y,Z) defined in the coordinates system associated to the plane.

There are two utility subroutines, RotVectorFrom and RotVectorTo, that allow to transform a vector from one system to the Secondary system or the reverse respectively.

Rotation matrix

The transformation between the coordinates Ms in the Secondary system and M in a system deduced from the former by Euler rotation angles [a,b,c] about "X then Y then Z" corresponds to a rotation matrix (no translation because a common origin is imposed to all systems). Let Ms and M be represented by column vectors, then a (unitary) rotation matrix R may represent the rotation.

Ms = R*M

where R is:

    | cos(c)*cos(b)                                     -cos(b)*sin(c)                 sin(b) |
R = | cos(a)*sin(c)+cos(c)*sin(b)*sin(a)   cos(c)*cos(a)-sin(c)*sin(b)*sin(a)  -cos(b)*sin(a) |
    |-cos(c)*cos(a)*sin(b)+sin(c)*sin(a)   cos(c)*sin(a)+sin(c)*sin(b)*cos(a)   cos(b)*cos(a) |



The inverse relation, M = R-1 *Ms, involves the inverse matrix R-1 which equals as usual the transposed matrix R-1 = RT