This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / gdraw / gdpart.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:20:23  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.26  by  S.Giani
11 *-- Author :
12       SUBROUTINE GDPART(IT,ISEL,SIZE)
13 C.
14 C.    ******************************************************************
15 C.    *                                                                *
16 C.    *       Draws attributes of particle generating track IT         *
17 C.    *       (for which space points have been stored in banks JXYZ). *
18 C.    *       IT=0 means all tracks.                                   *
19 C.    *                                                                *
20 C.    *       If ISEL=xxxxxx1   then draw track number;                *
21 C.    *       if ISEL=xxxxx1x   then draw particle name.               *
22 C.    *                                                                *
23 C.    *       SIZE is character size used.                             *
24 C.    *                                                                *
25 C.    *    ==>Called by : <USER>, <GXINT>                              *
26 C.    *       Author : P.Zanarini   *********                          *
27 C.    *                                                                *
28 C.    ******************************************************************
29 C.
30 #include "geant321/gcbank.inc"
31 #include "geant321/gcdraw.inc"
32       CHARACTER*4 IPTAB(100),IPTAB1(100),IPTAB2(100)
33       CHARACTER*5 CHPART
34       CHARACTER*12 CHTEXT
35       SAVE IPTAB,IPTAB1,IPTAB2
36 C
37       DATA IPTAB /'<[G$','<E>[','<E>[','<[N$','<[M>','<[M>','<[P>',
38      +            '<[P>','<[P>','K?L&','K[^+','K[^-','<N$ ','<P$ ',
39      +            '<-P$','K?<S','<[C$','[L$ ','[S^+','[S^0','[S^-',
40      +            '[X^0','[X^-','[W^-','<-N$','<->[','<->[','<->[',
41      +            '<->[','<->[','<->[','<->[','<[T>','<[T>','D[^+',
42      +            'D[^-','D[^0','<->D','F[^+','F[^-','[L]?','W[^+',
43      +            'W[^-','Z[^0','D$  ','T$  ','<[A$','G$  ',
44      +                52*'"4$ '/
45       DATA IPTAB1/'    ','^+$ ','^-$ ','    ','^+$ ','^-$ ','^0$ ',
46      +            '^+$ ','^-$ ','[^0$','$   ','$   ','    ','    ',
47      +            '    ','>&[^','    ','    ','$   ','$   ','$   ',
48      +            '$   ','$   ','$   ','    ','L$  ','S^-$','S^0$',
49      +            'S^+$','X^0$','X^+$','W^+$','^+$ ','^-$ ','$   ',
50      +            '$   ','$   ','[^0$','$   ','$   ','C&[^','$   ',
51      +            '$   ','$   ','    ','    ','    ','    ',
52      +                52*'    '/
53       DATA IPTAB2/'    ','    ','    ','    ','    ','    ','    ',
54      +            '    ','    ','L   ','    ','    ','    ','    ',
55      +            '    ','0$  ','    ','    ','    ','    ','    ',
56      +            '    ','    ','    ','    ','    ','    ','    ',
57      +            '    ','    ','    ','    ','    ','    ','    ',
58      +            '    ','    ','    ','    ','    ','+$  ','    ',
59      +            '    ','    ','    ','    ','    ','    ',
60      +                52*'    '/
61 C.
62 C.    ------------------------------------------------------------------
63 C.
64 #if defined(CERNLIB_DEBUG)
65       IF (IT.LT.0) THEN
66          IPART=0
67          DO 10 IV=19,1,-2
68             DO 10 IU=1,19,2
69                IPART=IPART+1
70                CHTEXT=IPTAB(IPART)//IPTAB1(IPART)//IPTAB2(IPART)
71                U=IU
72                V=IV
73                CALL GDRAWT(U,V,CHTEXT,SIZE,0.,1,0)
74    10    CONTINUE
75       ENDIF
76 #endif
77 C
78       CALL UCTOH('OFF ',IOFF,4,4)
79       CALL UCTOH('$   ',IDOL,4,4)
80 C
81 C            Set IOBJ to TRACK
82 C
83       IOBJ=2
84 C
85       ISEL1=ISEL/10
86       ISEL1=ISEL1-ISEL1/2*2
87       ISEL0=ISEL/1
88       ISEL0=ISEL0-ISEL0/2*2
89 C
90       IF(JXYZ.LE.0)GO TO 30
91       NXYZ=IQ(JXYZ-2)
92       N1  =1
93       N2  =NXYZ
94       IF(IT.NE.0)N1=IT
95       IF(IT.NE.0)N2=IT
96       IF(N1.LE.0)GO TO 30
97       IF(N2.GT.NXYZ)GO TO 30
98 C
99       DO 20 I=N1,N2
100 C
101          JX=LQ(JXYZ-I)
102          IF(JX.LE.0)GO TO 20
103          IPOINT=JX+3
104          IF(IPOINT.GT.JX+IQ(JX-1))GO TO 20
105          NPOINT=Q(IPOINT)
106          IF(NPOINT.LE.0)GO TO 20
107          IPART=Q(IPOINT+1)
108 C
109 C            Is THRZ option set on (R-Z projection)
110 C            and the cut lateral (vertical or horizontal) ?
111 C
112          IF (ITHRZ.NE.IOFF) THEN
113             IF (ICUT.EQ.1.OR.ICUT.EQ.2) ITR3D=-I
114          ELSE
115             ITR3D=0
116          ENDIF
117 C
118          CALL GDFR3D(Q(IPOINT+3*NPOINT-1),1,U0,V0)
119 C
120          IF (ISEL0.NE.0) THEN
121 C
122 C             Draw track number I
123 C
124             WRITE (CHPART,'(I4,''$'')') I
125             U=U0-0.5*SIZE
126             V=V0-1.5*SIZE
127             CALL GDRAWT(U,V,CHPART,SIZE,0.,1,0)
128          ENDIF
129 C
130          IF (ISEL1.NE.0) THEN
131 C
132 C             Draw particle name IPTAB...(IPART)
133 C
134             CHTEXT=IPTAB(IPART)//IPTAB1(IPART)//IPTAB2(IPART)
135             U=U0-0.5*SIZE
136             V=V0+0.5*SIZE
137             CALL GDRAWT(U,V,CHTEXT,SIZE,0.,1,0)
138          ENDIF
139 C
140    20 CONTINUE
141 C
142    30 CONTINUE
143 C
144 C             Reset ITR3D to 'standard projection'
145 C
146       ITR3D=0
147       IOBJ=0
148 C
149       END