]> git.uio.no Git - u/mrichter/AliRoot.git/blob - GEANT321/geocad/gtrdse.F
Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / GEANT321 / geocad / gtrdse.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1999/05/18 15:55:17  fca
6 * AliRoot sources
7 *
8 * Revision 1.1.1.1  1995/10/24 10:20:47  cernlib
9 * Geant
10 *
11 *
12 #include "geant321/pilot.h"
13 *CMZ :  3.21/02 29/03/94  15.41.32  by  S.Giani
14 *-- Author :
15       SUBROUTINE GTRDSE(PAR,ISHAPE)
16 C-
17 C----------------------------------------------------------
18 C-  Calculates the coordinates of the corner points of a GEANT  shape
19 C-  from the shape parameters.   The end faces are generated by drawing
20 C-  connected polylines between the corner points at each Z-end of the shape.
21 C-  A ruled solid is then defined between the 2 faces, and written out in SET.
22 C----------------------------------------------------------
23 C
24 #include "geant321/gcsetf.inc"
25  
26 C
27       DIMENSION PAR(100)
28       REAL P1X,P1Y,P1Z,P2X,P2Y,P2Z,P3X,P3Y,P3Z,P4X,P4Y,P4Z
29       REAL P5X,P5Y,P5Z,P6X,P6Y,P6Z,P7X,P7Y,P7Z,P8X,P8Y,P8Z
30 C
31 C
32 C----------------------------------------------------------------------
33 C             TRD1&2
34 C
35  
36       DX1=PAR(1)
37       DX2=PAR(2)
38       DY1=PAR(3)
39       IF (ISHAPE .EQ. 2) THEN
40          DY2=DY1
41          DZ= PAR(4)
42       ELSE
43          DY2=PAR(4)
44          DZ=PAR(5)
45       ENDIF
46 C       FACE parameters:
47 C       FACE 1:
48       P1X= -DX1
49       P1Y= -DY1
50       P1Z= -DZ
51 C
52       P2X= DX1
53       P2Y= -DY1
54       P2Z= -DZ
55 C
56       P3X= DX1
57       P3Y= DY1
58       P3Z= -DZ
59 C
60       P4X= -DX1
61       P4Y= DY1
62       P4Z= -DZ
63 C       Next FACE:
64       P5X= -DX2
65       P5Y= -DY2
66       P5Z= DZ
67 C
68       P6X= DX2
69       P6Y= -DY2
70       P6Z= DZ
71 C
72       P7X= DX2
73       P7Y= DY2
74       P7Z= DZ
75 C
76       P8X= -DX2
77       P8Y= DY2
78       P8Z= DZ
79 C       DESCRIBED BY 2 FACES represented by polylines
80 C       connected by the 4 corners of the shape.
81 C *WRITE SET@103,F1,:5,2#3,3,2,P1X,P1Y,P1Z,P2X,P2Y,P2Z,P3X,P3Y,P3Z,P4X,P4Y,P4Z
82 C *WRITE SET@103,F2,:5,2#3,3,2,P5X,P5Y,P5Z,P6X,P6Y,P6Z,P7X,P7Y,P7Z,P8X,P8Y,P8Z
83 C *WRITE SET @100,N,:5,2,:9,'MATNAM'#145,!F1,!F2,
84 C-------------------------------------------------------------------
85 C
86       WRITE(BLKSTR,10000)N1,P1X,P1Y,P1Z,P2X,P2Y,P2Z, P3X,P3Y,P3Z,P4X,
87      +P4Y,P4Z
88       CALL GJWRIT
89       N1=N1+1
90       WRITE(BLKSTR,10000)N1,P5X,P5Y,P5Z,P6X,P6Y,P6Z, P7X,P7Y,P7Z,P8X,
91      +P8Y,P8Z
92       CALL GJWRIT
93       N1=N1+1
94       WRITE(BLKSTR,10100)N1,N1-2,N1-1
95       CALL GJWRIT
96 C
97 10000   FORMAT('@103,',I10,',:5,2#3,3,2,',G14.7,',',G14.7,','
98      +  ,G14.7,',',G14.7,',',G14.7,',',G14.7,',',G14.7,','
99      +  ,G14.7,',',G14.7,',',G14.7,',',G14.7,',',G14.7)
100 10100   FORMAT('@100,',I10,',:5,2#145,!',I10,',!',I10)
101 C
102       END