SUBROUTINE FKHPR
*-- Author : Stephen Burke
      SUBROUTINE FKHPR
*-----------------------------------------Updates 07/02/92-------                                             
**: FKHPR 30205.SB.  Remove unused FKMEAS sequence.                                                           
*-----------------------------------------Updates 24/01/92-------                                             
**: FKHPR 30205.SB.  Print histograms only if they exist.                                                     
*-----------------------------------------Updates----------------                                             
**********************************************************************                                        
*                                                                    *                                        
* Print diagnostic histograms                                        *                                        
*                                                                    *                                        
**********************************************************************                                        
                                                                        
      LOGICAL HEXIST                                                    
                                                                        
*KEEP,FKNPL.                                                                                                  
      CHARACTER*5 CKDBG                                                 
      PARAMETER (CKDBG='FKDBG')                                         
      PARAMETER (NPL=72)                                                
      LOGICAL LTRUE,LFIRST,LTRPL,LTRPLD                                 
      DOUBLE PRECISION TRUE,RTRUE,CHITRU,SPRO,CPRO,SFIL,CFIL            
     &,                SSMT,CSMT,SSMTR,CSMTR,DPRO,CBPRO,QPRO,QGAIN      
     &,                RPRO,CRPRO,RFIL,CRFIL,RSMT,CRSMT,CHIFIL,CHISMT   
*                                                                                                             
* Per-track values can go in H1WORK; note that LTRUE and LFIRST must                                          
* be set at least per event.                                                                                  
*                                                                                                             
* This is about 36k words long; the remaining common blocks are                                               
* about 3.6k in total. Some of this could be in /H1WORK/, but the                                             
* blocks would have to be reorganised.                                                                        
*                                                                                                             
      COMMON /H1WORK/                                                   
* /FKPROJ/                                                                                                    
     &                SPRO(5,NPL),CPRO(5,5,NPL)                         
* /FKFILT/                                                                                                    
     &,               SFIL(5,NPL),CFIL(5,5,NPL)                         
* /FKSMTH/                                                                                                    
     &,               SSMT(5,NPL),CSMT(5,5,NPL)                         
     &,               SSMTR(5,NPL),CSMTR(5,5,NPL)                       
* /FKINT/                                                                                                     
     &,               DPRO(5,5,NPL),CBPRO(5,5,NPL),QPRO(5,5,NPL)        
     &,               QGAIN(5,5,NPL),IAPROX,LFIRST                      
* /FKRSID/                                                                                                    
     &,               RPRO(2,NPL),CRPRO(2,2,NPL),RFIL(2,NPL)            
     &,               CRFIL(2,2,NPL),RSMT(2,NPL),CRSMT(2,2,NPL)         
     &,               CHIFIL(NPL),CHISMT(NPL)                           
* /FKTRUE/                                                                                                    
     &,               TRUE(5,NPL),RTRUE(5,NPL),CHITRU(NPL),LTRUE        
* /FKDBG/                                                                                                     
     &,               LTRPL(NPL),LTRPLD(NPL)                            
*KEEP,FFSTEE.                                                                                                 
      PARAMETER (NFT=72)                                                
      LOGICAL LRISV,LWMAP,LGRAPH,LTRUTH                                 
      REAL DSX,DSY,DSQOP,DSTTH,DSPHI,PMCUT,PCUT,CHPCUT                  
     &,    QOPMAX,THEMAX,RFTMIN,RFTMAX,CEMAX                            
      COMMON /FFSTEE/ DSX,DSY,DSQOP,DSTTH,DSPHI                         
     &,               PMCUT,IDIAG,JPLRSV,LRISV,LWMAP(NFT),JPLMAX        
     &,               IRP(NPL),JPLFT(NPL),JFTPL(NFT)                    
     &,               LUNGKS,IWKGKS,IDGKS,LUNHB,LUNGKM,IWKGKM,IDGKM     
     &,               LGRAPH,LTRUTH,IHFF,IHFK,ISRJCT,PCUT,CHPCUT        
     &,               QOPMAX,THEMAX,RFTMIN,RFTMAX,CEMAX                 
*KEEP,FKTRUE.                                                                                                 
*KEEP,FKHIST.                                                                                                 
      DIMENSION IPLANE(12)                                              
      SAVE IPLANE                                                       
      DATA IPLANE/1,12,13,24,25,36,37,48,49,60,61,72/                   
*KEEP,FKDBG.                                                                                                  
*KEND.                                                                                                        
                                                                        
**********************************************************************                                        
                                                                        
      CALL HCDIR('//PAWC/'//CKDBG,' ')                                                                 
                                                                        
      DO 100 I=101,105                                                  
         IF (HEXIST(I)) CALL HPRINT(I)                                                                 
 100  CONTINUE                                                          
                                                                        
      DO 200 I=211,255                                                  
         IF (HEXIST(I)) CALL HPRINT(I)                                                                 
 200  CONTINUE                                                          
                                                                        
      DO 300 I=301,340                                                  
         IF (HEXIST(I)) CALL HPRINT(I)                                                                 
 300  CONTINUE                                                          
                                                                        
      DO 400 I=1,12                                                     
         IPL = IPLANE(I)                                                
         IF (JFTPL(IPL).LE.0) GOTO 400                                  
         IF (HEXIST(IPL+500)) CALL HPRINT(IPL+500)                                                     
         IF (HEXIST(IPL+600)) CALL HPRINT(IPL+600)                                                     
         IF (HEXIST(IPL+700)) CALL HPRINT(IPL+700)                                                     
         IF (HEXIST(IPL+800)) CALL HPRINT(IPL+800)                                                     
         IF (HEXIST(IPL+900) .AND. HSUM(IPL+900).GT.0)                  
     &      CALL HPRINT(IPL+900)                                                                       
 400  CONTINUE                                                          
                                                                        
      CALL HCDIR('//PAWC',' ')                                                                         
                                                                        
      RETURN                                                            
      END                                                               
*