22.05.2014 Views

CERN Program Library Long Writeup W5013 - CERNLIB ...

CERN Program Library Long Writeup W5013 - CERNLIB ...

CERN Program Library Long Writeup W5013 - CERNLIB ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Geant 3.16 GEANT User’s Guide GEOM200<br />

Origin : R.Brun, F.Carena Submitted: 01.06.83<br />

Revision : Revised: 14.12.93<br />

Documentation :<br />

Rotation matrices<br />

The relative position of a volume inside its mother is expressed in GEANT by a translation vector and a<br />

rotation matrix which are arguments of the routines GSPOS and GSPOSP. The rotation matrix expresses the<br />

transformation from the Mother Reference System to the Daughter Reference System.<br />

A rotation matrix is described to GEANT by giving the polar and azimuthal angles of the axes of the DRS<br />

(x ′ ,y ′ ,z ′ ) in the MRS via the routine GSROTM.<br />

CALL GSROTM<br />

(IROT,THETA1,PHI1,THETA2,PHI2,THETA3,PHI3)<br />

IROT (INTEGER) number of the rotation matrix;<br />

THETA1 (REAL) polar angle for axis x ′ ;<br />

PHI1 (REAL) azimuthal angle for axis x ′ ;<br />

THETA2 (REAL) polar angle for axis y ′ ;<br />

THI2 (REAL) azimuthal angle for axis y ′ ;<br />

THETA3 (REAL) polar angle for axis z ′ ;<br />

PHI3 (REAL) azimuthal angle for axis z ′ .<br />

Stores rotation matrix IROT in the data structure JROTM. If the matrix is not orthonormal, it will be corrected<br />

by setting y ′ ⊥ x ′ and then z ′ = x ′ × y ′ . A warning message is printed in this case.<br />

Note: the angles THETA and PHI must be given in degrees.<br />

Examples of use<br />

The unit matrix is defined in the following way:<br />

x ′ ‖ x<br />

y ′ ‖ y<br />

z ′ ‖ z<br />

⎫ ⎧<br />

⎪⎬ ⎪⎨<br />

⇒<br />

⎪⎭ ⎪⎩<br />

θ 1 = 90 ◦ ; φ 1 = 0 ◦<br />

θ 2 = 90 ◦ ; φ 2 = 90 ◦<br />

θ 3 = 0 ◦ ; φ 3 = 0 ◦<br />

This is just an example. There is in fact no need to define a unit rotation matrix. Giving the value 0 to the<br />

rotation matrix number in the call to GSPOS and GSPOSP is equivalent to a positioning without rotation and<br />

it improves tracking performance.<br />

The result of a 90 ◦ counterclockwise rotation around z, followed by a 90 ◦ counterclockwise rotation around<br />

the new x is a cyclic shift of the axes: x → z ′ ,y→ x ′ ,z→ y ′ . This is expressed by the following rotation<br />

matrix:<br />

x ′ ‖ y<br />

y ′ ‖ z<br />

z ′ ‖ x<br />

⎫ ⎧<br />

⎪⎬ ⎪⎨<br />

⇒<br />

⎪⎭ ⎪⎩<br />

θ 1 = 90 ◦ ; φ 1 = 90 ◦<br />

θ 2 = 0 ◦ ; φ 2 = 0 ◦<br />

θ 3 = 90 ◦ ; φ 3 = 0 ◦<br />

Sometimes the rotation matrix is known or it can be constructed. In this case the arguments to the routine<br />

GSROTM can be calculated with the help of the routine GFANG in the following way:<br />

133 GEOM200 – 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!