This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / ggeom / gtrmul.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:20:56  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.30  by  S.Giani
11 *-- Author :
12       SUBROUTINE GTRMUL(DX1,RMAT1,DX2,IROT,DXNEW,RMATN)
13 C.
14 C.    ******************************************************************
15 C     *                                                                *
16 C     *       ROUTINE TO FORM THE TRANSFORMATION RESULTING FROM        *
17 C     *       THE APPLICATION OF FIRST THE TRANSFORMATION GIVEN        *
18 C     *       BY THE POINT DX1 AND THE MATRIX RMAT1 FOLLOWED BY        *
19 C     *       THE APPLICATION OF THE TRANSFORMATION GIVEN BY THE       *
20 C     *       POINT DX2 AND THE MATRIX IN THE GEANT ROTATION           *
21 C     *        MATRIX BANKS WITH INDEX NUMBER IROT. THE RESULTING      *
22 C     *       TRANSFORMATION IS STORED AS THE POINT DXNEW AND          *
23 C     *       MATRIX RMATN.                                            *
24 C.    *                                                                *
25 C.    *    ==>Called by : GFTRAC,GINVOL,GLVOLU,GMEDIV,GMEPOS,GSTRAC,   *
26 C.    *                   GTMEDI                                       *
27 C.    *         Author  A.McPherson  *********                         *
28 C.    *                                                                *
29 C.    ******************************************************************
30 C.
31 #include "geant321/gcbank.inc"
32       DIMENSION DX1(3),RMAT1(10),DX2(3),DXNEW(3),RMATN(10)
33 C.
34 C.    ------------------------------------------------------------------
35 C.
36       IF(RMAT1(10).EQ.0.0)THEN
37          DXNEW(1) = DX1(1) + DX2(1)
38          DXNEW(2) = DX1(2) + DX2(2)
39          DXNEW(3) = DX1(3) + DX2(3)
40          IF(IROT.EQ.0)THEN
41             DO 20 I = 1, 10, 2
42                RMATN(I) = RMAT1(I)
43                RMATN(I+1) = RMAT1(I+1)
44    20       CONTINUE
45          ELSE
46             JR=LQ(JROTM-IROT)
47             DO 30 I = 1, 9
48                RMATN(I) = Q(JR+I)
49    30       CONTINUE
50             RMATN(10)=1.
51          ENDIF
52       ELSE
53 C
54          DXTEM1 = DX2(1)*RMAT1(1) + DX2(2)*RMAT1(4) + DX2(3)*RMAT1(7)
55          DXTEM2 = DX2(1)*RMAT1(2) + DX2(2)*RMAT1(5) + DX2(3)*RMAT1(8)
56          DXTEM3 = DX2(1)*RMAT1(3) + DX2(2)*RMAT1(6) + DX2(3)*RMAT1(9)
57 C
58          IF(IROT.EQ.0)THEN
59             DO 50 I = 1, 10, 2
60                RMATN(I) = RMAT1(I)
61                RMATN(I+1) = RMAT1(I+1)
62    50       CONTINUE
63          ELSE
64             CALL GRMUL(RMAT1,IROT,RMATN)
65          ENDIF
66          DXNEW(1) = DX1(1) + DXTEM1
67          DXNEW(2) = DX1(2) + DXTEM2
68          DXNEW(3) = DX1(3) + DXTEM3
69       ENDIF
70       END