C   27/06/79 C9073101   MEMBER NAME  LUMONS   (JADEGAMS)    FORTRAN
      SUBROUTINE LUMONS(ICOMB,ITRK)
C---  DETERMINE WHETHER TRACK HITS LUMONITORS
C
C     H.WRIEDT     27.6.79      04:10
C     LAST MODIFICATION       30.7.79       20:10
C
      IMPLICIT INTEGER*2 (H)
C
      COMMON /CWORK/ IWORK1(601),CLSPRP(13,51)
      DIMENSION HCLSPR(26,51)
      EQUIVALENCE (HCLSPR(1,1),CLSPRP(1,1))
C
      COMMON /CGGDMS/ X0,ZECAP(4),ZECAPX(4),THECPX(2),
     &                ECXLST(46),ECYLST(46),
     &                XANL(8),XANU(8),YANL(8),YANU(8),
     &                XBNL(8),XBNU(8),YBNL(8),YBNU(8)
C
      DIMENSION XA(3),XB(3)
C
      DATA PIHALF/1.57079632/, PI/3.14159264/
C
      COMMON /CGGVRN/ NVRSN(20)
      DATA NVCODE/279073020/
C
      NVRSN(16) = NVCODE
      ICOMB = 0
      IF (HCLSPR(2,ITRK).EQ.+1) GOTO 5
C---  Z-COORDINATES OF A- AND B-COUNTERS ON -Z-SIDE (PRELIMINARY!)
      XA(3) = -4135.
      XB(3) = -4235.
      IDIR = 0
      GOTO 10
C---  Z-COORDINATES OF A- AND B-COUNTERS ON +Z-SIDE (PRELIMINARY!)
    5 XA(3) = 4135.
      XB(3) = 4235.
      IDIR = 4
C
C---  CALCULATE PHI- AND SIN(THETA)-VALUE OF TRACKS
   10 DX = CLSPRP(11,ITRK)
      DY = CLSPRP(12,ITRK)
      DZ = CLSPRP(13,ITRK)
C
      IF (DY.NE.0.) GOTO 15
      PHI = SIGN(PIHALF,DX)
      GOTO 16
   15 PHI = ATAN(DX/DY)
      IF (DY.LT.0.) PHI = PI - PHI
C
   16 STHETA = SIN(ARCOS(DZ))
C---  COMPUTE X- AND Y-COORDINATES IN A-COUNTER PLANE (EACH IN MM)
C     AND ROTATE THEM BY 45 DEGREES
      CALL RCOORD(XA,PHI,STHETA)
      XR = XA(1)
      YR = XA(2)
C
C---  WHICH COUNTER HAS BEEN HIT?
      K = 0
        DO 20 II = 1,4
        I = II + IDIR
        IF (XR.GT.XANL(I).AND.XR.LT.XANU(I).AND.YR.GT.YANL(I).AND.YR
     &      .LT.YANU(I)) K = I
        IF (K.GT.0) GOTO 21
   20   CONTINUE
      GOTO 25
   21 ICOMB = 2**(16-K)
C---  COMPUTE X- AND Y-COORDINATES IN B-COUNTER PLANE (EACH IN MM)
C     AND ROTATE THEM BY 45 DEGREES
   25 CALL RCOORD(XB,PHI,STHETA)
      XR = XB(1)
      YR = XB(2)
C---  WHICH COUNTER HAS BEEN HIT?
      K = 0
        DO 30 II = 1,4
        I = II + IDIR
        IF (XR.GT.XBNL(I).AND.XR.LT.XBNU(I).AND.YR.GT.YBNL(I).AND.YR
     &      .LT.YBNU(I)) K = I
        IF (K.GT.0) GOTO 31
   30   CONTINUE
      RETURN
   31 ICOMB = ICOMB + 2**(8-K)
      RETURN
      END
