C   14/12/83 401111710  MEMBER NAME  USER     (JADEGS)      FORTRAN
C
C-----------------------------------------------------------------------
      SUBROUTINE USER(INDEX)
C-----------------------------------------------------------------------
C
C   AUTHOR:   L. O'NEILL   ?/??/78 :  USER ROUTINE CALLED BY SUPERV
C
C        MOD: C. BOWDERY  14/12/83 :  TO IMPROVE THE COMMENTING
C   LAST MOD: C. BOWDERY   9/01/84 :  TO REMOVE EXCESS CODE
C
C        USER ROUTINE FOR CUTS AND INTERACTIVE DECISION MAKING.
C
C-----------------------------------------------------------------------
C
C        INDEX IS PASSED FROM SUPERV TO INDICATE WHICH LEVEL HAS BEEN
C        COMPLETED. THE MEANING OF THE VALUES IS EXPLAINED BELOW.
C
C        INDEX=0   INITIAL CALL, BEFORE FIRST EVENT READ.
C              1   CALLED AT THE BEGINNING OF EACH NEW RUN.
C              2   CALLED IMMEDIATELY AFTER EVENT IS READ INTO CDATA.
C              3   LEAD GLASS ENERGIES HAVE BEEN COMPUTED.
C              4   FAST Z VERTEX RECONSTRUCTION HAS BEEN DONE.
C              5   INNER DETECTOR PATTERN RECOGNITION HAS BEEN RUN.
C              6   ENERGIES CLUSTERS IN THE LEAD GLASS HAVE BEEN FOUND.
C              7   TRACKS AND CLUSTERS HAVE BEEN ASSOCIATED.
C              8   UNUSED
C              9   MUON ANALYSIS HAS BEEN DONE
C             10   UNUSED
C
C            100   END OF JOB CALL
C
C   ON RETURN, IF INDEX =  1 : THE SUPERVISOR WILL DROP CURRENT EVENT
C                              AND READ THE NEXT ONE.
C                         11 : EVENT WILL BE WRITTEN OUT AND NEW EVENT
C                              WILL BE READ
C                         12 : JOB WILL BE TERMINATED NORMALLY
C
C   OTHERWISE THE SUPERVISOR WILL GO TO THE LEVEL GIVEN BY "INDEX" ON
C   RETURN FROM "USER". THUS, TO CONTINUE WITH THE ANALYSIS, THIS
C   ROUTINE MUST INCREMENT "INDEX" BEFORE PASSING CONTROL BACK.
C
C-----------------------------------------------------------------------
C
      IMPLICIT INTEGER*2 (H)
C
#include "cgraph.for"
#include "cdata.for"
C
C
C------------------  C O D E  ------------------------------------------
C
C        CHECK WHETHER CALL AT END OF JOB
C
      IF(INDEX.EQ.100) GOTO 1100
C
      GO TO (1001,1002,1003,1004,1005,1006,1007,1008,1009,1010),INDEX
C---
C---     INDEX=0 INITIALIZATION.
C---
C
      INDEX=INDEX+1
      RETURN
C
 1001 CONTINUE
      INDEX=INDEX+1
      RETURN
C
 1002 CONTINUE
      INDEX=INDEX+1
      RETURN
C
 1003 CONTINUE
      INDEX=INDEX+1
      RETURN
C
 1004 CONTINUE
      INDEX=INDEX+1
      RETURN
C
 1005 CONTINUE
      INDEX=INDEX+1
      RETURN
C
 1006 CONTINUE
      INDEX=INDEX+1
      RETURN
C
 1007 CONTINUE
      INDEX=INDEX+1
      RETURN
C
 1008 CONTINUE
      INDEX=INDEX+1
      RETURN
C
 1009 CONTINUE
      INDEX=INDEX+1
      RETURN
C
 1010 CONTINUE
      INDEX=INDEX+1
      RETURN
C---     END OF JOB: FINAL CALCULATIONS + PRINTOUT
 1100 CONTINUE
      CALL BSTA
      RETURN
C---
C---     RETURNS FOR STEERING ANALYSIS TO DESIRED NEXT STEP.
C---     'GO TO 1' MEANS REJECT EVENT AND GO TO NEXT EVENT.
C---
    1 CONTINUE
      INDEX=1
      RETURN
    2 CONTINUE
      INDEX=2
      RETURN
    3 CONTINUE
      INDEX=3
      RETURN
    4 CONTINUE
      INDEX=4
      RETURN
    5 CONTINUE
      INDEX=5
      RETURN
    6 CONTINUE
      INDEX=6
      RETURN
    7 CONTINUE
      INDEX=7
      RETURN
    8 CONTINUE
      INDEX=8
      RETURN
    9 CONTINUE
      INDEX=9
      RETURN
   10 CONTINUE
      INDEX=10
      RETURN
      END
