Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / GEANT321 / cgpack / cgrifl.F
CommitLineData
fe4da5cc 1*
2* $Id$
3*
4* $Log$
5* Revision 1.1.1.1 1995/10/24 10:19:44 cernlib
6* Geant
7*
8*
9#include "geant321/pilot.h"
10*CMZ : 3.21/02 29/03/94 15.41.32 by S.Giani
11*-- Author :
12*
13 SUBROUTINE CGRIFL(TT,CG)
14*
15#include "geant321/cggpar.inc"
16#include "geant321/cgdelt.inc"
17 REAL TT(4,3),CG(*)
18#if !defined(CERNLIB_SINGLE)
19 DOUBLE PRECISION T(4,3),DET1,DET2,DET3,DETTT
20#endif
21#if defined(CERNLIB_SINGLE)
22 REAL T(4,3)
23#endif
24*-
25* TDEL = EEWOR / 10.
26 CALL CGTSTR(CG,IREP)
27 IF (IREP .LT. 0) GOTO 999
28 DO 20 J=1,3
29 DO 10 I=1,4
30 T(I,J) = TT(I,J)
31* IF (ABS(TT(I,J)) .LT. TDEL) T(I,J) = 0.
32* IF (ABS(1.-TT(I,J)) .LT. TDEL) T(I,J) = 1.
33* IF (ABS(1.+TT(I,J)) .LT. TDEL) T(I,J) =-1.
34 10 CONTINUE
35 20 CONTINUE
36*
37 DET1=T(1,1)*(T(2,2)*T(3,3)-T(2,3)*T(3,2))
38 DET2=T(1,2)*(T(2,1)*T(3,3)-T(2,3)*T(3,1))
39 DET3=T(1,3)*(T(2,1)*T(3,2)-T(3,1)*T(2,2))
40 DETTT=DET1-DET2+DET3
41 IF(DETTT.LT.0.)THEN
42* S E T I N V E R S E O R D E R O F E D G E S
43 JCG=LCGHEA
44 NFACE = CG(KCGNF)
45 DO 500 NF=1,NFACE
46 CG(JCG + KCGAA) =-CG(JCG + KCGAA)
47 CG(JCG + KCGBB) =-CG(JCG + KCGBB)
48 CG(JCG + KCGCC) =-CG(JCG + KCGCC)
49 CG(JCG + KCGDD) =-CG(JCG + KCGDD)
50 NEDGE = CG(JCG+KCGNE)
51 JCG = JCG + LCGFAC
52 DO 400 NE=1,NEDGE
53 X = CG(JCG+KCGX1)
54 Y = CG(JCG+KCGY1)
55 Z = CG(JCG+KCGZ1)
56 CG(JCG + KCGX1) = CG(JCG + KCGX2)
57 CG(JCG + KCGY1) = CG(JCG + KCGY2)
58 CG(JCG + KCGZ1) = CG(JCG + KCGZ2)
59 CG(JCG + KCGX2) = X
60 CG(JCG + KCGY2) = Y
61 CG(JCG + KCGZ2) = Z
62 JCG = JCG + LCGEDG
63 400 CONTINUE
64 500 CONTINUE
65 ENDIF
66 999 RETURN
67 END
68
69