*
* $Id: dumpme.F,v 1.1.1.1 1996/03/22 16:42:46 mclareni Exp $
*
* $Log: dumpme.F,v $
* Revision 1.1.1.1  1996/03/22 16:42:46  mclareni
* Phtools
*
*
      SUBROUTINE DUMPME
C--  CALLED FROM -     TRANCH      (MAY BE CALLED FROM USER)
C--  PURPOSE -   DUMPS ALL THE QUANTITIES RELATIVE TO  THE CURRENT EVENT
      COMMON / / NDIMEN,BINS(100)
      COMMON/UTIL/PLACE(150),WEIGHT(150),NP,TECM,AMASS(18),PCM(5,18),WT
      COMMON/UTIL2/FM(18),FM2(18),D2(18)
     +/BEAM  / PRM       ,TARGM    ,PBM      ,ETA      ,GAM      ,DPBM
     +/CONTRL/ NEVTOT    ,TLIMIT   ,TLIM2    ,NDUMP    ,IEVENT
     +        ,DAT1      ,DAT2     ,IPAGE
     +/HISTR / NHIST     ,NGRP     ,NHDIM    ,LTITLE   ,LOCP(150)
     +/TAPES / NTPNCH   ,NTPBIN   ,KONSOL
      COMMON / FDUMP / D(10,5)
      DIMENSION IBINS(10)
      EQUIVALENCE (BINS(1),IBINS(1))
      DATA IHAVE,IUND,IOVF,INON/0,4HUNDR,4HOVER,4HNONE/
      IHAVE = IHAVE + 1
      IF(IHAVE - 100) 40,30,999
   30 WRITE(6,5010)IHAVE
   40 CONTINUE
      WRITE(6,5000)IEVENT
      WRITE(6,5011)PRM,TARGM,PBM,TECM
      WRITE(6,5001)
      DO  50  I= 1, NP
   50 WRITE(6,5002)I,AMASS(I),(PCM(J,I),J=1,5),FM(I),D2(I)
      WRITE(6,5003)
      DO  100  I= 1, NHIST
      K = LOCP(I)
      IF(K.EQ.0) GOTO 100
      WGHT = WT * WEIGHT(I)
      IF(PLACE(I).EQ.0.) GOTO 75
      KB = IUCHAN(PLACE(I), BINS(K+1), BINS(K+2), BINS(K+3))
      IF(KB.EQ.0) GOTO 77
      IF(KB.GT.IBINS(K+3)) GOTO 79
      GOTO 95
   75 KB = INON
      GOTO 85
   77 KB = IUND
      GOTO 85
   79 KB = IOVF
   85 WRITE(6,5044)I,PLACE(I),KB,WEIGHT(I),WGHT
      GOTO 100
   95 WRITE(6,5004)I,PLACE(I),KB,WEIGHT(I),WGHT
  100 CONTINUE
      DO  200  J2= 1, 5
      JB = 6-J2
      DO  190  J= 1, 10
      IF(D(J,JB)) 250,190,250
  190 CONTINUE
  200 CONTINUE
      WRITE(6,5006)
      GO  TO  999
  250 CONTINUE
      WRITE(6,5007)
      DO  300  J= 1, JB
      WRITE(6,5008)(D(JD,J),JD=1,10)
  300 CONTINUE
      IF(JB.LT.5) WRITE(6,5009)
  999 RETURN
 5000 FORMAT('0',/,'0DUMP OF EVENT NUMBER',I5,/1X,26('*'))
 5001 FORMAT('0PARTICLE',3X,'MASS',10X,'PX',10X,'PY',10X,'PZ',
     +10X,'E ',10X,'P ',10X,'EFF.MASS',3X,'DELTA SQ.')
 5002 FORMAT(I7,6F12.5, 4X,2F12.5)
 5003 FORMAT('0',11X,'PLACE',5X,'CONTENTS',8X,'BIN NO.',9X,'WEIGHT' ,
     + 7X,'WEIGHT*WT')
 5004 FORMAT(I15,E16.5,I12,2X,2E16.5)
 5044 FORMAT(I15,E16.5,8X,A6,2E16.5)
 5006 FORMAT('0',10X,'ALL FDUMP LOCATIONS CONTAIN ZERO'//)
 5007 FORMAT('0','FDUMP  1',10X,'2',11X,'3',11X,'4',11X,'5',11X,
     +  '6',11X,'7',11X,'8',11X,'9',10X,'10')
 5008 FORMAT(10E12.5)
 5009 FORMAT(11X,'ALL OTHERS CONTAIN ZERO'//)
 5010 FORMAT('0'/'0DUMP LIMIT EXCEEDED.',I10,' EVENTS DUMPED'///)
 5011 FORMAT(/10X,'BEAM MASS=',F9.5,',  TARGET MASS=',F9.5,
     + ',   BEAM MOM.=',F9.5,',  CMS ENERGY=',F10.5)
      END
