C   22/02/82 206220917  MEMBER NAME  OMUANA   (JADEMUS)     FORTRAN
C   17/02/82 202171432  MEMBER NAME  ERMUANA  (S)           FORTRAN
C   20/10/81 202041534  MEMBER NAME  MUANA    (JADEMUS)     FORTRAN
C   19/10/81 110191748  MEMBER NAME  MUANA    (JADEMUS1)    FORTRAN
C   18/05/79 005130909  MEMBER NAME  MUANA    (JADEMUS)     FORTRAN
C
C LAST CHANGE 09.15 22/06/82 HUGH MCCANN - FOR J.O. COSMIC REJECTION.
C      CHANGE 13.30 22/02/82 HUGH MCCANN - FOR IMPROVED ERROR OUTPUT.
C      CHANGE 15.30 04/02/82 HUGH MCCANN - NOW CALLS MUCUTS.
C      CHANGE 15.15 05/11/81 HUGH MCCANN - CORRECT BUG , IMP INT*2!!
C      CHANGE 17.46 19/10/81 CHRIS BOWDERY- INSERT MACRO CMUBCS
C      CHANGE 12.30 19/10/81 HUGH MCCANN  - INSERT COMMON CMUIEV.
C      CHANGE 09.12 13/05/80 JOHN ALLISON --COMMENT OUT CALL MUANAJ.
C      CHANGE 16.00 02/05/80 HUGH MCCANN ---COMMENT OUT CALL MUANAL.
C      CHANGE 10.56 18/05/79 JOHN ALLISON.
C
      SUBROUTINE MUANA(IJOIN)
      IMPLICIT INTEGER*2 (H)
C
C  COMMONS.
      COMMON /CMUPRN/MUPRIN,MUHPR
      COMMON /CMUIEV/IEV,NEV,IRD,KRUN,KREC,
     *ISECS,IMINS,IHOURS,IDAY,IMONTH,IYEAR
#include "cmubcs.for"
C
C  INITIALISE HEADER PRINT CONTROL FLAG FOR THIS EVENT( USED IN MUERRY).
      MUHPR=0
C
C  COUNT THE EVENTS.
      IEV=IEV+1
C
C  EXTRACT EVENT INFORMATION FROM THE HEADER BANK.
      IPHEAD=IDATA(IBLN('HEAD'))
      ISECS = HDATA(2*IPHEAD+3)
      IMINS = HDATA(2*IPHEAD+4)
      IHOURS= HDATA(2*IPHEAD+5)
      IDAY  = HDATA(2*IPHEAD+6)
      IMONTH= HDATA(2*IPHEAD+7)
      IYEAR = HDATA(2*IPHEAD+8)
      KRUN  = HDATA(2*IPHEAD+10)
      KREC  = HDATA(2*IPHEAD+11)
C
C-----------------------------------------------------------------------
C
C STANDARD MUON ANALYSIS PROCEDURE.
C
C IJOIN=0 SUPPRESSES CALLS TO ROUTINES WHICH USE BANKS OTHER THAN MUON
C         BANKS.
C
C-----------------------------------------------------------------------
C
C CONVERT MUON SIGNALS TO COORDINATES.
      CALL MUANAC
C
C FOLLOW EACH INNER DETECTOR TRACK OUT (PHILOSOPHY 2).  AT THE MOMENT
C    MUANAF AND MUANAL ARE COMPLETELY INDEPENDENT.
      IF(IJOIN.NE.0)CALL MUANAF
CCCCC IF(IJOIN.NE.0)CALL MUCUTS CCCCCCCCCCCCCCCCCCC     J.O. CHANGE  .
C
C ****** FROM 18/03/80 , ONLY WANT PHIL2 RUN IN STANDARD MU ANALYSIS.
C        THIS WILL BE DONE IF 'IJOIN' IS GREATER THAN ZERO .
C        THEREFORE , RETURN HERE.
C
      RETURN
C
C FIND MUON LINES - PHILOSOPHY 1 MUON PATTERN RECOGNITION.
C     CALL MUANAL
C
C ATTEMPT TO JOIN MUON CLUSTERS WITH INNER DETECTOR TRACKS AND WITH LEAD
C   GLASS CLUSTERS.  ALSO CORRELATE RESULTS OF PHILOSPHY 1 AND 2.
C     IF(IJOIN.NE.0)CALL MUANAJ
C
C-----------------------------------------------------------------------
C
C     RETURN
      END
