Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / GEANT321 / ghits / gpsets.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:21:11  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.20  by  S.Giani
11 *-- Author :
12       SUBROUTINE GPSETS(IUSET,IUDET)
13 C.
14 C.    ******************************************************************
15 C.    *                                                                *
16 C.    *       Prints set and detector parameters                       *
17 C.    *                                                                *
18 C.    *        IUSET  user set identifier                              *
19 C.    *               If * prints all detectors of all sets            *
20 C.    *        IUDET  user detector identifier                         *
21 C.    *               If * prints all detectors of set IUSET           *
22 C.    *                                                                *
23 C.    *    ==>Called by : <USER>, GPRINT   ,<GXINT> GINC4              *
24 C.    *       Author    R.Brun  *********                              *
25 C.    *                                                                *
26 C.    ******************************************************************
27 C.
28 #include "geant321/gcbank.inc"
29 #include "geant321/gcunit.inc"
30       CHARACTER*4 IUSET,IUDET
31 C.
32 C.    ------------------------------------------------------------------
33 C.
34       IF(IUSET(1:1).EQ.'*')THEN
35          WRITE(CHMAIL,1000)
36          CALL GMAIL(0,0)
37       ENDIF
38       IF(JSET.LE.0)GO TO 999
39       NSET=IQ(JSET-1)
40       NS1=1
41       NS2=NSET
42       IF(IUSET(1:1).NE.'*')THEN
43          CALL GLOOK(IUSET,IQ(JSET+1),NSET,ISET)
44          IF(ISET.LE.0)GO TO 999
45          NS1=ISET
46          NS2=ISET
47       ENDIF
48 C
49 C             loop on all selected sets
50 C
51       DO 130 ISET=NS1,NS2
52       JS=LQ(JSET-ISET)
53       IF(JS.LE.0)GO TO 130
54       NDET=IQ(JS-1)
55       ND1=1
56       ND2=NDET
57       IF(IUDET(1:1).NE.'*')THEN
58          CALL GLOOK(IUDET,IQ(JS+1),NDET,IDET)
59          IF(IDET.EQ.0)GO TO 130
60          ND1=IDET
61          ND2=IDET
62       ENDIF
63 C
64 C             loop on selected detectors for this set
65 C
66       DO 120 IDET=ND1,ND2
67       JD=LQ(JS-IDET)
68       IF(JD.LE.0)GO TO 120
69       NV=IQ(JD+2)
70       NWHI=IQ(JD+7)
71       NWDI=IQ(JD+8)
72 C
73       WRITE(CHMAIL,2000)IQ(JSET+ISET),IQ(JS+IDET),NWHI,NWDI
74       CALL GMAIL(0,0)
75 C
76       IF(NV.NE.0)THEN
77          DO 10 I=1,NV
78             WRITE(CHMAIL,3000)IQ(JD+2*I+9),IQ(JD+2*I+10)
79             CALL GMAIL(0,0)
80   10     CONTINUE
81       ENDIF
82 C
83       JDH=LQ(JD-1)
84       IF(JDH.GT.0)THEN
85          NH=IQ(JD+4)
86          IF(NH.GT.0)THEN
87             DO 30 I=1,NH
88                WRITE(CHMAIL,4000)IQ(JDH+4*I-3),IQ(JDH+4*I-2),
89      +                           Q(JDH+4*I-1),Q(JDH+4*I)
90                CALL GMAIL(0,0)
91   30        CONTINUE
92          ENDIF
93       ENDIF
94 C
95       JDD=LQ(JD-2)
96       IF(JDD.GT.0)THEN
97          ND=IQ(JD+6)
98          IF(ND.GT.0)THEN
99             DO 50 I=1,ND
100                WRITE(CHMAIL,5000)IQ(JDD+2*I-1),IQ(JDD+2*I)
101                CALL GMAIL(0,0)
102   50        CONTINUE
103          ENDIF
104       ENDIF
105 C
106       JDU=LQ(JD-3)
107       IF(JDU.GT.0)THEN
108          NU=IQ(JDU-1)
109          IF(NU.GT.0)THEN
110             WRITE(CHMAIL,6000)
111             CALL GMAIL(0,0)
112             DO 60 I=1,NU,10
113                L2=I+9
114                IF(L2.GT.NU)L2=NU
115                WRITE(CHMAIL,7000)(Q(JDU+L),L=I,L2)
116                CALL GMAIL(0,0)
117   60        CONTINUE
118          ENDIF
119       ENDIF
120 C
121  120  CONTINUE
122  130  CONTINUE
123 C
124  1000 FORMAT('0',51('='),3X,'SETS AND DETECTORS',3X,50('='))
125  2000 FORMAT('   SET ',A4,'  DETECTOR ',A4,'  NWHI=',I6,'  NWDI=',I6)
126  3000 FORMAT(10X,'VOLUME ',A4,'  NBITSD=',I4)
127  4000 FORMAT(10X,'HIT ELEMENT =',A4,'  NBITSH=',I4,
128      +'  ORIG =',E12.4,'  FACT =',E12.4)
129  5000 FORMAT(10X,'DIGIT ELEMENT =',A4,'  NBITSD=',I4)
130  6000 FORMAT(10X,'USER PARAMETERS')
131  7000 FORMAT(5X,10E12.4)
132  999  RETURN
133       END