SUBROUTINE FPTHIS
*-- Author : S.J. Maxfield
      SUBROUTINE FPTHIS
**: FPTHIS 40000 SM. New monitoring/debug histos.                                                             
*-----------------------------------------------------------*                                                 
**: FPTHIS 30907 RP. Farm changes.                                                                            
*-----------------------------------------------------------*                                                 
**: FPTHIS 30907 SM. Yet mor changes to histograms.                                                           
**----------------------------------------------------------------------                                      
**: FPTHIS 30207 GB. comment lines moved inside the routine                                                   
**: FPTHIS 30205 SM. Numerous changes to histograms                                                           
**-------------------------------------------------------------                                               
*                                                                                                             
*     Book and Fill LOOK histograms for monitoring                                                            
*     Forward Tracker Pattern Recognition.                                                                    
*                                                                                                             
*     Booking and filling is controlled by word 4 in the                                                      
*     steering bank FRCS. (IDOHIS in COMMON FDIFLG)                                                           
*                                                                                                             
*--------------------------------------------------------------                                               
*                                                                                                             
*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                                                                 
*                                                                                                             
*KEEP,FDIFLG.                                                                                                 
      COMMON/LDIAG/IDIAG,IDIAG2,MAXPRT,IDOHIS,PMCUT                     
*KEEP,FPTFLG.                                                                                                 
      COMMON/FPTFLG/IPLAR, NIT, IREZ, LUNFP, NPLMAX                     
*KEND.                                                                                                        
                                                                        
      LOGICAL FIRST                                                     
      DATA FIRST /.TRUE./                                               
*------statement functions for table access--------------------------                                         
*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.                                                                                                        
*                                                                                                             
*                                                                                                             
      IF(FIRST) THEN                                                    
        FIRST = .FALSE.                                                 
                                                                        
*       Book  LOOK Histograms For Pattern recognition                                                         
*       I. AREAs 1 and 2.                                                                                     
*                                                                                                             
*                                                                                                             
        CALL SAREA('FTREC',1)                                                                          
*                                                                                                             
*       Book all the time - used in endjob stats...                                                           
        CALL BHS(   108,0,60,0.0,6.0)                                                                  
        CALL STEXT( 108,1,'Radial drifts from FRLOCO')                                                 
        CALL BHS(   109,0,60,-2.0,4.0)                                                                 
        CALL STEXT( 109,1,'Planar drifts from FPLOCO')                                                 
*                                                                                                             
        CALL BHS(   610,0,100,-1000.,6000.)                                                            
        CALL STEXT( 610,1,'Rad: raw drift times')                                                      
        CALL BHS(   612,0,100,-1000.,6000.)                                                            
        CALL STEXT( 612,1,'Pla: raw drift times')                                                      
        CALL BHS(   616,0,100,-1000.,6000.)                                                            
        CALL STEXT( 616,1,'Pla: raw drift times (2000 plus)')                                          
                                                                        
        CALL BHS(   650,0,100,1000.,3000.)                                                             
        CALL STEXT( 650,1,'Pla: avg drift times')                                                      
        CALL BHS(   651,0,100,1000.,3000.)                                                             
        CALL STEXT( 651,1,'Pla: avg drift times (0 to 500)')                                           
        CALL BHS(   652,0,100,1000.,3000.)                                                             
        CALL STEXT( 652,1,'Pla: avg drift times (500 to 2000')                                         
        CALL BHS(   653,0,100,1000.,3000.)                                                             
        CALL STEXT( 653,1,'Pla: avg drift times (2000 plus)')                                          
        CALL BHS(   654,0,100,500.,2500.)                                                              
        CALL STEXT( 654,1,'T0: FT - CT')                                                               
        CALL BHS(   655,0,100,500.,2500.)                                                              
        CALL STEXT( 655,1,'T0: FT - CT (0 to 500)')                                                    
        CALL BHS(   656,0,100,500.,2500.)                                                              
        CALL STEXT( 656,1,'T0: FT - CT (500 to 2000')                                                  
        CALL BHS(   657,0,100,500.,2500.)                                                              
        CALL STEXT( 657,1,'T0: FT - CT (2000 plus)')                                                   
        CALL BHD(   658,0,50,1000.,3000.,50,0.,2000.)                                                  
        CALL STEXT( 658,1,'T0: FT vs CT (500 to 2000)')                                                
        CALL BHD(   659,0,50,1000.,3000.,50,0.,2000.)                                                  
        CALL STEXT( 659,1,'T0: FT vs CT (2000 plus)')                                                  
*                                                                                                             
        CALL BHS(   200,0,20, 0.,20.)                                                                  
        CALL STEXT( 200,1,'Num hits on radial segments')                                               
        CALL BHS(   201,0,20, 0.,20.)                                                                  
        CALL STEXT( 201,1,'Num hits on radial segments SM0')                                           
        CALL BHS(   202,0,20, 0.,20.)                                                                  
        CALL STEXT( 202,1,'Num hits on radial segments SM1')                                           
        CALL BHS(   203,0,20, 0.,20.)                                                                  
        CALL STEXT( 203,1,'Num hits on radial segments SM2')                                           
                                                                        
C+SELF,IF=FTTIME.                                                                                             
          CALL BHS( 224,0,100,0.0,5.0)                                                                 
          CALL STEXT( 224,1,'Total time in FTREC')                                                     
          CALL BHS( 225,0,100,0.0,5.0)                                                                 
          CALL STEXT( 225,1,'Time in FPSEG')                                                           
          CALL BHD( 226,0,40,0.0,4000.0,50,0.0,5.0)                                                    
          CALL STEXT( 226,1,'Total time vs total num hits')                                            
          CALL BHD( 227,0,40,0.0,2000.0,50,0.0,5.0)                                                    
          CALL STEXT( 227,1,'Time in FPSEG vs num pla hits')                                           
          CALL BHD( 228,0,40,0.0,2000.0,50,0.0,1.0)                                                    
          CALL STEXT( 228,1,'Time FPSEG vs num pla hits(exp)')                                         
          CALL BHD( 229,0,50,0.0,5.0,50,0.0,5.0)                                                       
          CALL STEXT( 229,1,'Total time vs time in FPSEG')                                             
          CALL BHS( 230,0,100,0.0,2000.0)                                                              
          CALL STEXT( 230,1,'Num pla hits / event')                                                    
          CALL BHS( 231,0,100,0.0,2000.0)                                                              
          CALL STEXT( 231,1,'Num rad hits / event')                                                    
          CALL BHS( 232,0,100,0.0,4000.0)                                                              
          CALL STEXT( 232,1,'Tot num hits / event')                                                    
C+SELF.                                                                                                       
                                                                        
        CALL BHS(   320,0,20, 0.,20.)                                                                  
        CALL STEXT( 320,1,'Num hits on planar segments')                                               
        CALL BHS(   321,0,20, 0.,20.)                                                                  
        CALL STEXT( 321,1,'Num hits on planar segments SM0')                                           
        CALL BHS(   322,0,20, 0.,20.)                                                                  
        CALL STEXT( 322,1,'Num hits on planar segments SM1')                                           
        CALL BHS(   323,0,20, 0.,20.)                                                                  
        CALL STEXT( 323,1,'Num hits on planar segments SM2')                                           
                                                                        
                                                                        
        IF(IDOHIS.GE.1) THEN                                            
*            Basic set if IDOHIS >=1...                                                                       
*       Histograms  101 - 106 are filled in this routine FPTHIS.                                              
          CALL BHS( 101,0,50,0.0,50.0)                                                                 
          CALL STEXT( 101,1,'Number of Pattern-recognised tracks)')                                    
*                                                                                                             
          CALL BHS( 102,0,80,-3.2, 3.2)                                                                
          CALL STEXT( 102,1,'Phi of Pattern-recognised tracks)')                                       
*                                                                                                             
          CALL BHS( 103,0,60,0.0,0.6)                                                                  
          CALL STEXT( 103,1,'Theta of Pattern-recognised tracks)')                                     
*                                                                                                             
          CALL BHS( 104,0,60,0.0,100.0)                                                                
          CALL STEXT( 104,1,'Momentum of Pattern-recognised tracks)')                                  
*                                                                                                             
          CALL BHS( 105,0,60,0.,10.0)                                                                  
          CALL STEXT( 105,1,'1/Momentum of Pattern-recognised tracks')                                 
*                                                                                                             
          CALL BHS( 106,0,50,-6.0,4.0)                                                                 
          CALL STEXT( 106,1,'LN(1/Mom) of Pattern-recognised tracks')                                  
*                                                                                                             
*                                                                                                             
          CALL BHS( 115,0,80,0.0,80.)                                                                  
          CALL STEXT( 115,1,'Radius in radials from FRLOCO')                                           
          CALL BHS( 114,0,10,-0.5,9.5)                                                                 
          CALL STEXT( 114,1,'Bad hit flag from FRLOCO')                                                
*                                                                                                             
*       Histograms  110 - 113 are filled in this routine FPTHIS.                                              
          CALL BHS( 110,0,60,0.0,6.0)                                                                  
          CALL STEXT( 110,1,'Drift in radials for track hits')                                         
*                                                                                                             
          CALL BHS( 111,0,80,0.0,80.)                                                                  
          CALL STEXT( 111,1,'Radius in radials for track hits')                                        
*                                                                                                             
          CALL BHD( 112,0,60,0.0,6.0,80,0.0,80.0)                                                      
          CALL STEXT( 112,1,'Radial wedge plot for track hits')                                        
                                                                        
          CALL BHS( 113,0,60,0.0,6.0)                                                                  
          CALL STEXT( 113,1,'Drift in planars for track hits')                                         
                                                                        
          IF(IREZ.GT.0) THEN                                            
*        Histograms 209, 233 -242 are filled in FPTREZ...                                                     
            CALL BHS( 209,0,40, 0.,40.)                                                                
            CALL STEXT( 209,1,'Wire number of missing radial hits')                                    
            CALL BHS( 233,0,60,-0.15,0.15)                                                             
            CALL STEXT( 233,1,'Rad seg drift residuals in SM0')                                        
            CALL BHS( 234,0,60,-0.15,0.15)                                                             
            CALL STEXT( 234,1,'Rad seg drift residuals in SM1')                                        
            CALL BHS( 235,0,60,-0.15,0.15)                                                             
            CALL STEXT( 235,1,'Rad seg drift residuals in SM2')                                        
            CALL BHS( 236,0,60,-0.15,0.15)                                                             
            CALL STEXT( 236,1,'Rad seg drift residuals in SM0+SM1+SM2')                                
                                                                        
            CALL BHS( 237,0,50,-15.0,15.0)                                                             
            CALL STEXT( 237,1,'Rad seg rad   residuals in SM0')                                        
            CALL BHS( 238,0,50,-15.0,15.0)                                                             
            CALL STEXT( 238,1,'Rad seg rad   residuals in SM1')                                        
            CALL BHS( 239,0,50,-15.0,15.0)                                                             
            CALL STEXT( 239,1,'Rad seg rad   residuals in SM2')                                        
            CALL BHS( 240,0,50,-15.0,15.0)                                                             
            CALL STEXT( 240,1,'Rad seg rad   residuals in SM0+SM1+SM2')                                
            CALL BHS( 241,0,50,0.0,10.0)                                                               
            CALL STEXT( 241,1,'Rad seg chi-squared in SM0+SM1+SM2')                                    
                                                                        
            CALL BHD( 250,0,50,0.0,80.0,50,-15.,15.)                                                   
            CALL STEXT( 250,1,'Rad seg rad res vs. Rmeas')                                             
                                                                        
            CALL BHD( 242,0,60,0.0,6.0,60,-0.15,0.15 )                                                 
            CALL STEXT( 242,1,'Rad seg res vs. drift in SM0+SM1+SM2')                                  
                                                                        
*       Histograms  243 -249 263-264  are filled in FPREZI...                                                 
            CALL BHS( 243,0,60,-0.15,0.15)                                                             
            CALL STEXT( 243,1,'Pla seg drift residuals for ORI 0')                                     
            CALL BHS( 244,0,60,-0.15,0.15)                                                             
            CALL STEXT( 244,1,'Pla seg drift residuals for ORI 1')                                     
            CALL BHS( 245,0,60,-0.15,0.15)                                                             
            CALL STEXT( 245,1,'Pla seg drift residuals for ORI 2')                                     
            CALL BHS( 246,0,60,-0.15,0.15)                                                             
            CALL STEXT( 246,1,'Pla seg drift residuals for ORI 0+1+2')                                 
            CALL BHD( 247,0,60,0.0,6.0,60,-0.15,0.15 )                                                 
            CALL STEXT( 247,1,'Pla seg res vs. drift in ORI 0+1+2')                                    
            CALL BHS( 248,0,20, 0., 20.)                                                               
            CALL STEXT( 248,1,'Num hits on planar segments')                                           
            CALL BHS( 249,0,50, 0., 1.)                                                                
            CALL STEXT( 249,1,'Prob Chisq planar segments')                                            
            CALL BHS( 263,0,40, 0.,40.)                                                                
            CALL STEXT( 263,1,'Wire number of missing planar hits')                                    
            CALL BHD( 264,0,40, 0.,40.,26,-74.1,74.1)                                                  
            CALL STEXT( 264,1,'W vs wire of missing planar hits')                                      
          ENDIF                                                         
          IF(IREZ.GE.2) THEN                                            
*       Histograms  116- 119 are filled in FPTREZ...                                                          
            CALL BHS( 116,0,50,-5.0,5.0)                                                               
            CALL STEXT( 116,1,'R0 res/150mic of nearest hits')                                         
*                                                                                                             
            CALL BHS( 117,0,50,-5.0,5.0)                                                               
            CALL STEXT( 117,1,'R1 res/150mic of nearest hits')                                         
*                                                                                                             
            CALL BHS( 118,0,50,-5.0,5.0)                                                               
            CALL STEXT( 118,1,'R2 res/150mic of nearest hits')                                         
*                                                                                                             
            CALL BHS( 119,0,50,-5.0,5.0)                                                               
            CALL STEXT( 119,1,'R012 res/150mic of nearest hits')                                       
*                                                                                                             
*       Histograms  120- 123 are filled in FPLPK1...                                                          
            CALL BHS( 120,0,50,-10.0,10.0)                                                             
            CALL STEXT( 120,1,'P0 res/150mic of nearest hits')                                         
            CALL BHS( 121,0,50,-10.0,10.0)                                                             
            CALL STEXT( 121,1,'P1 res/150mic of nearest hits')                                         
            CALL BHS( 122,0,50,-10.0,10.0)                                                             
            CALL STEXT( 122,1,'P2 res/150mic of nearest hits')                                         
            CALL BHS( 123,0,50,-10.0,10.0)                                                             
            CALL STEXT( 123,1,'P012 res/150mic of nearest hits')                                       
          ENDIF                                                         
                                                                        
        ENDIF                                                           
*            ...IDOHIS > 1                                                                                    
                                                                        
        IF(IDOHIS.GE.2) THEN                                            
                                                                        
*       Histograms 215 - 223 filled in FPLPKS.                                                                
                                                                        
          CALL BHS( 210,0,100,0.,50.)                                                                  
          CALL STEXT( 210,1,'Min DrPhi accepted r-p match')                                            
          CALL BHS( 211,0,100,0.,50.)                                                                  
          CALL STEXT( 211,1,'Dr for    accepted r-p match')                                            
          CALL BHD( 212,0,100,0.,50.,100, 0.,50.)                                                      
          CALL STEXT( 212,1,'Dr vs DrPhi accepted r-p match')                                          
                                                                        
          CALL BHS( 215,0,100,0.,100.)                                                                 
          CALL STEXT( 215,1,'Min DrPhi Pla-rad match mm IT=1')                                         
          CALL BHS( 216,0,100,0.,100.)                                                                 
          CALL STEXT( 216,1,'Min DrPhi Pla-rad match mm IT=2')                                         
          CALL BHS( 217,0,100,0.,100.)                                                                 
          CALL STEXT( 217,1,'Min DrPhi Pla-rad match mm IT=3')                                         
                                                                        
          CALL BHS( 218,0,100,0.,100.)                                                                 
          CALL STEXT( 218,1,'Dr for min Pla-rad match mm IT=1')                                        
          CALL BHS( 219,0,100,0.,100.)                                                                 
          CALL STEXT( 219,1,'Dr for min Pla-rad match mm IT=2')                                        
          CALL BHS( 220,0,100,0.,100.)                                                                 
          CALL STEXT( 220,1,'Dr for min Pla-rad match mm IT=3')                                        
                                                                        
          CALL BHS( 204,0,60, 0.,60.)                                                                  
          CALL STEXT( 204,1,'Num radial segments in SM0')                                              
          CALL BHS( 205,0,60, 0.,60.)                                                                  
          CALL STEXT( 205,1,'Num radial segments in SM1')                                              
          CALL BHS( 206,0,60, 0.,60.)                                                                  
          CALL STEXT( 206,1,'Num radial segments in SM2')                                              
          CALL BHS( 207,0,60, 0.,150.)                                                                 
          CALL STEXT( 207,1,'Num radial segments in SM0+1+2')                                          
          CALL BHS( 260,0,50,0.0,1.0)                                                                  
          CALL STEXT( 260,1,'Frac radial hits attached to segments')                                   
                                                                        
          CALL BHS( 221,0,60,0.,60.)                                                                   
          CALL STEXT( 221,1,'Num planar segments in Mod 0 ')                                           
          CALL BHS( 222,0,60,0.,60.)                                                                   
          CALL STEXT( 222,1,'Num planar segments in Mod 1 ')                                           
          CALL BHS( 223,0,60,0.,60.)                                                                   
          CALL STEXT( 223,1,'Num planar segments in Mod 2 ')                                           
          CALL BHS( 261,0,60,0.,60.)                                                                   
          CALL STEXT( 261,1,'Num planar segments in Mod 0+1+2 ')                                       
                                                                        
          CALL BHS( 262,0,50,0.0,1.0)                                                                  
          CALL STEXT( 262,1,'Frac planar hits attached to segments')                                   
                                                                        
          CALL BHS( 251, 0,100,0.0,10000.)                                                             
          CALL BHS( 251, 1,100,0.0,10000.)                                                             
          CALL BHS( 251, 2,100,0.0,10000.)                                                             
          CALL BHS( 251, 3,100,0.0,10000.)                                                             
          CALL BHS( 251, 4,100,0.0,10000.)                                                             
          CALL BHS( 251, 5,100,0.0,10000.)                                                             
          CALL BHS( 251, 6,100,0.0,10000.)                                                             
          CALL BHS( 251, 7,100,0.0,10000.)                                                             
          CALL BHS( 251, 8,100,0.0,10000.)                                                             
          CALL BHS( 251, 9,100,0.0,10000.)                                                             
          CALL BHS( 251,10,100,0.0,10000.)                                                             
          CALL BHS( 251,11,100,0.0,10000.)                                                             
          CALL BHS( 251,12,100,0.0,10000.)                                                             
          CALL STEXT( 251,1,'Chg sum hits on rad segments')                                            
          CALL BHD( 252,0,100,0.0,10000.,15,0.,15.)                                                    
          CALL STEXT( 252,1,'Radial Chg vs wire number')                                               
                                                                        
          CALL BHS( 253,0,100,0.0,10000.)                                                              
          CALL STEXT( 253,1,'Chg hits on pla segments - outer')                                        
          CALL BHD( 254,0,100,0.0,10000.,15,0.,15.)                                                    
          CALL STEXT( 254,1,'Planar Chg vs wire number - outer')                                       
          CALL BHS( 255,0,100,0.0,10000.)                                                              
          CALL STEXT( 255,1,'Chg hits on pla segments - inner')                                        
          CALL BHD( 256,0,100,0.0,10000.,15,0.,15.)                                                    
          CALL STEXT( 256,1,'Planar Chg vs wire number - inner')                                       
                                                                        
          CALL BHS( 257,0,100,0.0,10000.)                                                              
          CALL STEXT( 257,1,'Chg sum hits in radials')                                                 
                                                                        
                                                                        
          CALL BHS( 300,0,50,-20.,20.)                                                                 
          CALL STEXT( 300,1,'Rrad-Rpred all')                                                          
          CALL BHD( 301,0, 80,10.0,90.0,50,-20.,20.)                                                   
          CALL STEXT( 301,1,'Rrad-Rpred  vs. Rpred all')                                               
          CALL BHD( 302,0,80, 10., 90., 80, 10., 90.0)                                                 
          CALL STEXT( 302,1,'Rrad vs. Rpred all')                                                      
                                                                        
          CALL BHS( 303,0,50,-20.,20.)                                                                 
          CALL STEXT( 303,1,'Rrad-Rpred  long projection')                                             
          CALL BHD( 304,0, 80,10.0,90.0,50,-20.,20.)                                                   
          CALL STEXT( 304,1,'Rrad-Rpred  vs. Rpred long projection')                                   
          CALL BHD( 305,0,80, 10., 90., 80, 10., 90.0)                                                 
          CALL STEXT( 305,1,'Rrad vs. Rpred long projection')                                          
                                                                        
          CALL BHS( 306,0,50,-20.,20.)                                                                 
          CALL STEXT( 306,1,'Rrad-Rpred  shrt projection')                                             
          CALL BHD( 307,0, 80,10.0,90.0,50,-20.,20.)                                                   
          CALL STEXT( 307,1,'Rrad-Rpred  vs. Rpred shrt projection')                                   
          CALL BHD( 308,0,80, 10., 90., 80, 10., 90.0)                                                 
          CALL STEXT( 308,1,'Rrad vs. Rpred shrt projection')                                          
                                                                        
          CALL BHS( 310,0,50,-10.,10.)                                                                 
          CALL STEXT( 310,1,'Del drift   all')                                                         
          CALL BHD( 311,0,80,-10., 10.,80, -10.,10.)                                                   
          CALL STEXT( 311,1,'Drad v Dpred al')                                                         
                                                                        
          CALL BHS( 312,0,50,-10.,10.)                                                                 
          CALL STEXT( 312,1,'Drad - Dpred long projection')                                            
          CALL BHD( 313,0,80,-10., 10.,80,-10.,10.)                                                    
          CALL STEXT( 313,1,'Drad v Dpred long projection')                                            
                                                                        
          CALL BHS( 314,0,50,-10.,10.)                                                                 
          CALL STEXT( 314,1,'Drad - Dpred shrt projection')                                            
          CALL BHD( 315,0,80,-10., 10.,80, -10.,10.)                                                   
          CALL STEXT( 315,1,'Drad v Dpred shrt projection')                                            
                                                                        
          CALL BHS( 316,0,50,-10.,10.)                                                                 
          CALL STEXT( 316,1,'Drad - Dpred all: Dpred < 0')                                             
          CALL BHS( 317,0,50,-10.,10.)                                                                 
          CALL STEXT( 317,1,'Drad - Dpred all: Dpred > 0')                                             
        ENDIF                                                           
* ...........IDOHIS GE 2.                                                                                     
                                                                        
                                                                        
*------------------------------------------------------                                                       
*       Book More  Histograms...                                                                              
                                                                        
*       Now book additional histograms in area 2:-                                                            
        CALL SAREA('FTREC',2)                                                                          
*       This set previously booked locally in FPLPKP...                                                       
        CALL STEXT(500,4,' CHI LINK 123 ALL')                                                          
        CALL BHS(500,0,50,0.0,10.0)                                                                    
        CALL STEXT(501,4,' CHI LINK 123')                                                              
        CALL BHS(501,0,50,0.0,10.0)                                                                    
        CALL STEXT(510,4,' CHI LINK 12 PHI')                                                           
        CALL BHS(510,0,50,0.0,10.0)                                                                    
        CALL STEXT(511,4,' CHI LINK 12 STR LINE XZ YZ')                                                
        CALL BHS(511,0,50,0.0,10.0)                                                                    
        CALL STEXT(520,4,' CHI LINK 23')                                                               
        CALL BHS(520,0,50,0.0,10.0)                                                                    
        CALL STEXT(530,4,' CHI LINK 13')                                                               
        CALL BHS(530,0,50,0.0,10.0)                                                                    
                                                                        
        CALL STEXT(550,4,' # LINKS 123,12,23,13 TOT ')                                                 
        CALL BHS(550,0,50,0.0,50.0)                                                                    
        CALL STEXT(560,4,' # PLANAR TRACKS/EVENT           ')                                          
        CALL BHS(560,0,50,0.0,50.0)                                                                    
                                                                        
        CALL STEXT(571,4,' CHI DRIFT  LINK 123 ALL')                                                   
        CALL BHS(571,0,50,0.0,50.0)                                                                    
        CALL STEXT(572,4,' CHI DRIFT  LINK 12 ALL')                                                    
        CALL BHS(572,0,50,0.0,50.0)                                                                    
        CALL STEXT(573,4,' CHI DRIFT  LINK 23 ALL')                                                    
        CALL BHS(573,0,50,0.0,50.0)                                                                    
        CALL STEXT(574,4,' CHI DRIFT  LINK 13 ALL')                                                    
        CALL BHS(574,0,50,0.0,50.0)                                                                    
                                                                        
        CALL STEXT(575,4,' CHI DRIFT  LINK 123 SEL')                                                   
        CALL BHS(575,0,50,0.0, 1.0)                                                                    
        CALL STEXT(576,4,' CHI DRIFT  LINK 12 SEL')                                                    
        CALL BHS(576,0,50,0.0, 1.0)                                                                    
        CALL STEXT(577,4,' CHI DRIFT  LINK 23 SEL')                                                    
        CALL BHS(577,0,50,0.0, 1.0)                                                                    
        CALL STEXT(578,4,' CHI DRIFT  LINK 13 SEL')                                                    
        CALL BHS(578,0,50,0.0, 1.0)                                                                    
                                                                        
        CALL STEXT(901,4,' PLANAR (X**2+Y**2)  COMP 12  2 MOD    ')                                    
        CALL BHS(901,0,50,0.0,100.0)                                                                   
        CALL STEXT(902,4,' PLANAR (X**2+Y**2)  COMP 23  2 MOD    ')                                    
        CALL BHS(902,0,50,0.0,100.0)                                                                   
        CALL STEXT(903,4,' PLANAR (X**2+Y**2)  COMP 13  2 MOD    ')                                    
        CALL BHS(903,0,50,0.0,100.0)                                                                   
        CALL STEXT(904,4,' PLANAR (X**2+Y**2)  COMP 12  3MOD JOIN')                                    
        CALL BHS(904,0,50,0.0,100.0)                                                                   
        CALL STEXT(905,4,' PLANAR (X**2+Y**2)  COMP 23  3MOD JOIN')                                    
        CALL BHS(905,0,50,0.0,100.0)                                                                   
        CALL STEXT(907,4,' dx  12   3 MOD ')                                                           
        CALL BHS(907,0,50,-15.,15.)                                                                    
        CALL STEXT(908,4,' dy  12   3 MOD ')                                                           
        CALL BHS(908,0,50,-20.,20.)                                                                    
        CALL STEXT(911,4,' PLANAR SQRT(X**2+Y**2)  COMP 12  2 MOD    ')                                
        CALL BHS(911,0,50,0.0,50.0)                                                                    
        CALL STEXT(912,4,' PLANAR SQRT(X**2+Y**2)  COMP 23  2 MOD    ')                                
        CALL BHS(912,0,50,0.0,50.0)                                                                    
        CALL STEXT(913,4,' PLANAR SQRT(X**2+Y**2)  COMP 13  2 MOD    ')                                
        CALL BHS(913,0,50,0.0,50.0)                                                                    
        CALL STEXT(921,4,' PLANAR R1-R2            COMP 12  MID PROJ ')                                
        CALL BHS(921,0,50,0.0,100.0)                                                                   
        CALL STEXT(922,4,' PLANAR R3-R2            COMP 23  MID PROJ ')                                
        CALL BHS(922,0,50,0.0,100.0)                                                                   
        CALL STEXT(923,4,' PLANAR R3-R1            COMP 13  MID PROJ ')                                
        CALL BHS(923,0,50,0.0,100.0)                                                                   
                                                                        
        CALL STEXT(699,4,' P->R LINK MEAS-PRED DRIFT SLOPE ')                                          
        CALL BHS(699,0,50,-0.5,0.5)                                                                    
        CALL STEXT(700,4,' PLANAR->RADIAL LINK  DRPHI MIN            ')                                
        CALL BHS(700,0,50,.0,2.0)                                                                      
        CALL STEXT(701,4,' PLANAR->RADIAL LINK  DR MIN               ')                                
        CALL BHS(701,0,50,.0,50.0)                                                                     
        CALL STEXT(702,4,' PLANAR->RADIAL LINK  DRI PRED-MEAS M0     ')                                
        CALL BHS(702,0,50,-1.0,1.0)                                                                    
        CALL STEXT(703,4,' PLANAR->RADIAL LINK  DRI PRED-MEAS M1     ')                                
        CALL BHS(703,0,50,-1.0,1.0)                                                                    
        CALL STEXT(704,4,' PLANAR->RADIAL LINK  DRI PRED-MEAS M2     ')                                
        CALL BHS(704,0,50,-1.0,1.0)                                                                    
        CALL STEXT(705,4,' PLANAR->RADIAL LINK  DRI P-M M0 MIN       ')                                
        CALL BHS(705,0,50,-1.0,1.0)                                                                    
        CALL STEXT(706,4,' PLANAR->RADIAL LINK  DRI P-M M1 MIN       ')                                
        CALL BHS(706,0,50,-1.0,1.0)                                                                    
        CALL STEXT(707,4,' PLANAR->RADIAL LINK  DRI P-M M2 MIN       ')                                
        CALL BHS(707,0,50,-1.0,1.0)                                                                    
        CALL STEXT(708,4,' PL->RAD  LINK  SLOPE DRIFT RESIDUALS')                                      
        CALL BHS(708,0,50,-0.5,0.5)                                                                    
        CALL STEXT(710,4,' RAD EFCNCY FRM PLANAR PROJ. EXPECTED/OBS ' )                                
        CALL BHS(710,0,50,0.,50.0)                                                                     
                                                                        
        CALL STEXT(721,4,' # PLANAR SEGMENTS SM 0 ' )                                                  
        CALL BHS(721,0,50,0.,50.0)                                                                     
        CALL STEXT(722,4,' # PLANAR SEGMENTS SM 1 ' )                                                  
        CALL BHS(722,0,50,0.,50.0)                                                                     
        CALL STEXT(723,4,' # PLANAR SEGMENTS SM 2 ' )                                                  
        CALL BHS(723,0,50,0.,50.0)                                                                     
        CALL STEXT(731,4,' # RADIAL SEGMENTS SM 0 ' )                                                  
        CALL BHS(731,0,50,0.,50.0)                                                                     
        CALL STEXT(732,4,' # RADIAL SEGMENTS SM 1 ' )                                                  
        CALL BHS(732,0,50,0.,50.0)                                                                     
        CALL STEXT(733,4,' # RADIAL SEGMENTS SM 2 ' )                                                  
        CALL BHS(733,0,50,0.,50.0)                                                                     
                                                                        
        CALL STEXT(751,4,' P->R LINK  V-FACTOR FIT M1 SEG  ')                                          
        CALL BHS(751,0,50,.0,2.0)                                                                      
        CALL STEXT(752,4,' P->R LINK  V-FACTOR FIT M2 SEG  ')                                          
        CALL BHS(752,0,50,.0,2.0)                                                                      
        CALL STEXT(753,4,' P->R LINK  V-FACTOR FIT M3 SEG  ')                                          
        CALL BHS(753,0,50,.0,2.0)                                                                      
        CALL STEXT(761,4,' P->R LINK  V-FACTOR FIT M1M2 TRK  ')                                        
        CALL BHS(761,0,50,.0,2.0)                                                                      
        CALL STEXT(762,4,' P->R LINK  TZ M1M2 TRK          ')                                          
        CALL BHS(762,0,50,-1.0,1.0)                                                                    
                                                                        
        CALL STEXT(764,4,' # HITS PLANAR LINE SEGMENT      ')                                          
        CALL BHS(764,0,50,.0,25.)                                                                      
        CALL STEXT(765,4,' # PLANAR SEGMENTS/MODULE        ')                                          
        CALL BHS(765,0,50,.0,25.)                                                                      
        CALL STEXT(766,4,' PLANAR LINKS 123 12 23 13  USED 1 2 3     ')                                
        CALL BHS(766,0,50,.0,25.)                                                                      
*       End FPLPKP set.                                                                                       
                                                                        
*       This set previously booked in FTMERG...                                                               
        CALL STEXT(711,4,' #P,#R-Ver,#R-Unver,#R-Shr,#R,#singR,#totR')                                 
        CALL BHS(711,0,50,0.,25.)                                                                      
        CALL STEXT(712,4,' #PR LINKS;21,32,11,22,33,TOT,RADS/PL SEG')                                  
        CALL BHS(712,0,50,0.,25.)                                                                      
        CALL STEXT(713,4,' P VER BY RAD;R-P COMMON R,COMMON P    ')                                    
        CALL BHS(713,0,50,0.,25.)                                                                      
        CALL STEXT(714,4,' SINGLE SEGS  R ; P    UNUSED/TOTAL    ')                                    
        CALL BHS(714,0,50,0.,25.)                                                                      
        CALL STEXT(715,4,'#R1-R2 TRACKS;#P2,P3 FND . PL EFFICIENCY')                                   
        CALL BHS(715,0,50,0.,25.)                                                                      
        CALL STEXT(716,4,' #P1P2P3,P1P2,P2P3,P1P3  TOTS  TOT   ')                                      
        CALL BHS(716,0,50,0.,25.)                                                                      
                                                                        
        CALL STEXT(1630,4,' DRPHI R-P SEL MM ')                                                        
        CALL BHS(1630,0,50,0.,20.)                                                                     
        CALL STEXT(1631,4,' DR    R-P SEL MM')                                                         
        CALL BHS(1631,0,50,0.,250.)                                                                    
        CALL STEXT(1632,4,' EXPT-MEAS DRIFT ')                                                         
        CALL BHS(1632,0,50,-5.0,5.0)                                                                   
        CALL STEXT(1633,4,' SLOPE OF RESID  ')                                                         
        CALL BHS(1633,0,50,-0.5,0.5)                                                                   
        CALL STEXT(1634,4,' EXPT-MEAS LINE SEG. CENTRE ')                                              
        CALL BHS(1634,0,50,-5.0,5.0)                                                                   
*       End FTMERG set.                                                                                       
*                                                                                                             
        CALL SAREA('FTREC',1)                                                                          
*                                                                                                             
      ENDIF                                                             
*                                                                                                             
*-----------------------------------------------------------------                                            
*                                                                                                             
      RETURN                                                            
      END                                                               
*