SUBROUTINE FPFPUX
*-- Author : S.J. Maxfield
      SUBROUTINE FPFPUX
*-----------------------------------------------------------*                                                 
*     Print output banks from Forward Pattern recognition   *                                                 
*     in readable form.                                     *                                                 
*-----------------------------------------------------------*                                                 
*KEEP,BCS.                                                                                                    
      INTEGER      NHROW,NHCOL,NHLEN                                    
      PARAMETER   (NHROW = 2, NHCOL = 1, NHLEN=2)                       
      INTEGER      NBOSIW                                               
      PARAMETER   (NBOSIW=1000000)                                      
      INTEGER      IW(NBOSIW)                                           
      REAL         RW(NBOSIW)                                           
      COMMON /BCS/ IW                                                   
      EQUIVALENCE (RW(1),IW(1))                                         
      SAVE   /BCS/                                                      
*KEEP,BOSMDL.                                                                                                 
C     ------BOSMDL                                                                                            
      LOGICAL       BEGJOB,ENDRUN,BEGRUN,REVENT,ENDJOB,OTHDAT           
      COMMON/BOSMDL/BEGJOB,ENDRUN,BEGRUN,REVENT,ENDJOB,OTHDAT,          
     +              LCCRUN,NCCRUN,NEVENT,                               
     +              IHA,IBS,IDB,IDATEL,LUP,ISN,JSN                      
      SAVE  /BOSMDL/                                                    
C     ------                                                                                                  
*KEEP,H1EVDT.                                                                                                 
      COMMON /H1EVDT/ KEVENT,IDATA,MONTE,LCONF                          
      INTEGER KEVENT,IDATA,LCONF                                        
      LOGICAL MONTE                                                     
*                                                                                                             
*  IDATA  type of information (HEAD bank word 6) :                                                            
*                                                                                                             
*                       0 - real data H1                                                                      
*                       1 - MC data H1SIM                                                                     
*                       2 - real data CERN tests                                                              
*                       3 - MC data ARCET                                                                     
*                                                                                                             
*  MONTE = .TRUE.   if IDATA=1                                                                                
*  KEVENT = event processed counter for H1REC                                                                 
*                                                                                                             
*KEND.                                                                                                        
      COMMON /FPFRWW/ INDFPD                                            
*KEEP,STFUNCT.                                                                                                
*     index of element before row number IROW                                                                 
      INDR(IND,IROW)=IND+2+IW(IND+1)*(IROW-1)                           
*     index of L'th element  of row number IROW                                                               
      INDCR(IND,L,IROW)=INDR(IND,IROW) + L                              
*     L'th integer element of the IROW'th row of bank with index IND                                          
      IBTAB(IND,L,IROW)=IW(INDCR(IND,L,IROW))                           
*     L'th real element of the IROW'th row of bank with index IND                                             
      RBTAB(IND,L,IROW)=RW(INDCR(IND,L,IROW))                           
*KEND.                                                                                                        
      NBN  = 0                                                          
      IND  = NLINK('FPUX',NBN)
      IF (IND .EQ. 0) THEN                                              
        WRITE(6,*) ' FPFPUX>> FPUX Bank not found in event ',NEVENT     
        RETURN                                                          
      ENDIF                                                             
      INDFPD=0                                                          
      CALL BKTOW(IW,'FPUX',NBN,IW,INDFPD,*900)
      NROW = IW(INDFPD+2)                                               
      WRITE(6,'('' '')')                                                
      WRITE(6,'(/,10X,'' ------  FPUX BANK:  Event'',I10,               
     +          3X,I4,'' hits -------'')')                              
     +      NEVENT,NROW                                                 
      WRITE(6,  '(''    Hit   Next    Sgn'',                            
     +    ''    '',''   Hit   Next    Sgn'',                            
     +    ''    '',''   Hit   Next    Sgn'')')                          
      MROW = NROW/3                                                     
      KMORE= NROW-3*MROW                                                
      J2   = MROW                                                       
      IF(KMORE.NE.0) J2 = J2 + 1                                        
      J3   = MROW*2 + KMORE                                             
      IF(MROW.GT.0) THEN                                                
      DO 6 J= 1,MROW                                                    
        WRITE(6,'( 3(1X,I6),3X,3(1X,I6),3X,3(1X,I6) )')                 
     +       J   ,(IBTAB(INDFPD,K,J   ), K=1,2),                        
     +       J+J2,(IBTAB(INDFPD,K,J+J2), K=1,2),                        
     +       J+J3,(IBTAB(INDFPD,K,J+J3), K=1,2)                         
 6    CONTINUE                                                          
      ENDIF                                                             
      IF(KMORE.EQ.1) THEN                                               
        J= MROW + 1                                                     
        WRITE(6,'( 3(1X,I6) )')                                         
     +       J   ,(IBTAB(INDFPD,K,J   ), K=1,2)                         
      ENDIF                                                             
      IF(KMORE.EQ.2) THEN                                               
        J= MROW + 1                                                     
        WRITE(6,'(3(1X,I6),3X,3(1X,I6))')                               
     +       J   ,(IBTAB(INDFPD,K,J   ), K=1,2),                        
     +       J+J2,(IBTAB(INDFPD,K,J+J2), K=1,2)                         
      ENDIF                                                             
      CALL WDROP(IW,INDFPD)                                                                            
      RETURN                                                            
*     Error condition...                                                                                      
 900  CONTINUE                                                          
      WRITE(6,*) ' FPFPUX >> Error in Work Bank Creation'               
      RETURN                                                            
      END                                                               
*