This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / ghits / gfndig.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:21:09  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 GFNDIG (IUSET, IUDET, NDIGI)
13 C.
14 C.    ******************************************************************
15 C.    *                                                                *
16 C.    *    SUBR. GFNDIG (IUSET, IUDET, NDIGI*)                         *
17 C.    *                                                                *
18 C.    *   Returns the number of digits belonging to the detector IUDET *
19 C.    *   of set IUSET                                                 *
20 C.    *                                                                *
21 C.    *   IUSET    User set identifier                                 *
22 C.    *   IUDET    User detector identifier (name of the corresponding *
23 C.    *            sensivitive volume)                                 *
24 C.    *   NDIGI    returns the total number of digits                  *
25 C.    *                                                                *
26 C.    *   Called by : <USER>                                           *
27 C.    *   Author    : S.Banerjee                                       *
28 C.    *                                                                *
29 C.    ******************************************************************
30 C.
31 #include "geant321/gcbank.inc"
32       CHARACTER*4     IUSET, IUDET
33 C.
34 C.    ------------------------------------------------------------------
35 *
36 * *** Find if selected set, detector exists
37 *
38       NDIGI = 0
39       IF (JDIGI.LE.0)   GO TO 999
40       NSET  = IQ(JSET-1)
41       CALL GLOOK (IUSET, IQ(JSET+1), NSET, ISET)
42       IF (ISET.LE.0)    GO TO 999
43 *
44       JS    = LQ(JSET-ISET)
45       JDI   = LQ(JDIGI-ISET)
46       IF (JS.LE.0)      GO TO 999
47       IF (JDI.LE.0)     GO TO 999
48       NDET  = IQ(JS-1)
49       CALL GLOOK (IUDET, IQ(JS+1), NDET, IDET)
50       IF (IDET.LE.0)    GO TO 999
51 *
52       JDID  = LQ(JDI-IDET)
53       IF (JDID.LE.0)    GO TO 999
54       ILAST = IQ(JDI+IDET)
55 *
56       IF (ILAST.NE.0) NDIGI = IQ(JDID+ILAST)
57 *                                                             END GFNDIG
58   999 END