C   03/05/80 109091220  MEMBER NAME  TOFCHK   (JADEGS)      FORTRAN
      SUBROUTINE TOFCHK(TDIF,TSUM,NRUN)
      IMPLICIT INTEGER*2 (H)
      COMMON/SMPTOF/MTOF,TTOF(42),NTOF,HTOF(42)
      TDIF = 0.
      TSUM = 0.
      CALL TOFSMP(NRUN)
      IF(NTOF.LE.0) GO TO 5123
      NRS = 0
      DO 32 JK = 1,21
      IF(HTOF(JK).EQ.0.OR.ABS(TTOF(JK)).EQ.0.) GO TO 32
      IF(TTOF(JK).EQ.-20.) GO TO 32
      TOF1 = TTOF(JK)
      JK1 = JK + 18
      NRT = 0
      TOF2 = 0.
      DO 33 IBT = 1,5
      JK2 = JK1 + IBT
      IF(JK2.GT.42) JK2 = 42
      IF(HTOF(JK2).EQ.0.OR.ABS(TTOF(JK2)).EQ.0.) GO TO 33
      IF(TTOF(JK2).EQ.-20.) GO TO 33
      NRT = NRT + 1
      TOF2 = TOF2 + TTOF(JK2)
33    CONTINUE
      IF(NRT.EQ.0) GO TO 32
      TOF2 = TOF2/NRT
      NRS = NRS + 1
      TDIF = TDIF + TOF1 - TOF2
      TSUM = TSUM + TOF1 + TOF2
   32 CONTINUE
      IF(NRS.EQ.0) GO TO 5123
      TDIF = - TDIF / NRS
      TSUM = TSUM / NRS
5123  RETURN
      END
