C   15/02/82 202151341  MEMBER NAME  TAGF820  (S)           FORTRAN
      SUBROUTINE TAGF82(IFLAG)
C---  TAGF82 IS AN UPDATED VERSION (1982 ONWARDS) OF TAGFLG
C---  TAGF82 CHECKS ONLY THE CONTENT OF WORD 22 IN THE LATC-BANK
C---  TAGF82 RETURNS THE SUM OF THE FOLLOWING NUMBERS VIA IFLAG:
C       0  IF NO LEAD-GLASS OF THE FORWARD DETECTOR IS HIT
C       1  IF THE LEAD-GLASS ENERGY OF THE MINUS Z-SIDE IS ABOVE
C             THRESHOLD (SMZ)
C       2  IF THE LEAD-GLASS ENERGY OF THE PLUS Z-SIDE IS ABOVE
C             THRESHOLD (SPZ)
C      10  IF THE TAGG-LATCH (SMZ.OR.SPZ) IS SET
C     100  IF THE LUMI-LATCH (SMZ.AND.SPZ) IS SET
C
C     H.WRIEDT     15.02.82     13:40
C     LAST MODIFICATION    15.02.82    13:40
C
      EXTERNAL BDLM
C
      COMMON /BCS/ IDATA(30000)
C
      DATA I2/2/,I5/5/,I6/6/,I7/7/,N3/3/
      DATA ICOUNT/0/
C
      IFLAG = 0
      ICOUNT = ICOUNT + 1
C---  FETCH LATC-POINTER
      IND = IDATA(IBLN('LATC'))
      IF (IND.EQ.0) RETURN
C---  FETCH LATC-DATA
C---  LATCH 22
      LAT = IDATA(IND+11)
C---  LUMI-BIT (#5)
      LLAT = JBIT(LAT,I5)
      IF (LLAT.EQ.1) IFLAG = 100
C---  TAGG-BITS (#2 - #4)
      LLAT = JBYT(LAT,I2,N3)
      IF (LLAT.NE.0) IFLAG = IFLAG + 10
C---  SMZ- AND SPZ-BITS
C     SMZ (#6)
      LLAT = JBIT(LAT,I6)
      IF (LLAT.EQ.1) IFLAG = IFLAG+1
C     SPZ (#7)
      LLAT = JBIT(LAT,I7)
      IF (LLAT.EQ.1) IFLAG = IFLAG+2
      RETURN
      END
