SUBROUTINE FQBOOK
*-- Author :    Girish D. Patel   07/12/93
      SUBROUTINE FQBOOK
************************************************************************                                      
* HBOOKing of histograms for PLANAR and RADIAL monitoring              *                                      
************************************************************************                                      
                                                                        
*KEEP,FMOBIN.                                                                                                 
      PARAMETER( NBINR=40 )                                             
*KEEP,FMOHIS.                                                                                                 
      INTEGER IHS(28)                                                   
      COMMON/FMOHIS/ IHS                                                
*KEEP,FMOTOT.                                                                                                 
      PARAMETER(LENST=66)                                               
      COMMON/FMOTOT/ ISTSUM(LENST)                                      
*KEEP,FMORUN.                                                                                                 
      LOGICAL PLANAR,RADIAL                                             
      COMMON /FMORUN/  NRUN,NRUN0,NRUN1,MAXEV,PLANAR,RADIAL             
*KEEP,FMOLUN.                                                                                                 
      COMMON/FMOLUN/ LUNH, LUNS, LMES                                   
*KEND.                                                                                                        
                                                                        
*Set aside SGI area for forward tracker monotoring                                                            
         CALL SAREA('FTDSGI',0)                                                                        
         IHX = 19500                                                    
                                                                        
* book some histograms                                                                                        
      IF(PLANAR) THEN                                                   
                                                                        
                                                                        
* book packed histograms for SGI                                                                              
                                                                        
      IHS(1) = IHX + 1                                           !SGI   
            CALL BHD(IHX + 1,0,32,-0.5,31.5,36,0.5,36.5)         !SGI                                  
          CALL STEXT(IHX + 1 ,4,'FT Planar')                     !SGI                                  
          CALL STEXT(IHX + 1 ,1,'Cell No vs Wire Plane')         !SGI                                  
                                                                        
                                                                        
      IHS(2) = IHX + 2                                           !SGI   
          CALL   BHS(IHX + 2,0,50,-0.5,49.5)                     !SGI                                  
          CALL STEXT(IHX + 2 ,4,'FT Planar')                     !SGI                                  
          CALL STEXT(IHX + 2 ,1,'Hit Multiplicity/Cell')         !SGI                                  
                                                                        
                                                                        
      IHS(3) = IHX + 3                                           !SGI   
          CALL   BHS(IHX + 3,0,100,0.,2000.)                     !SGI                                  
          CALL STEXT(IHX + 3 ,4,'FT Planar')                     !SGI                                  
          CALL STEXT(IHX + 3 ,1,'Raw D-Time ALL Hits')           !SGI                                  
                                                                        
      IHS(4) = IHX + 4                                           !SGI   
          CALL   BHD(IHX + 4,0,100,0.,1000.,4,0.,4.)             !SGI                                  
          CALL STEXT(IHX + 4 ,4,'FT Planar')                     !SGI                                  
          CALL STEXT(IHX + 4 ,1,'Inter-Hit Time, ALL + per SM')  !SGI                                  
                                                                        
      IHS(5) = IHX + 5                                           !SGI   
          CALL   BHD(IHX + 5,0,32,0.,1600.,30,4.,10.)            !SGI                                  
          CALL STEXT(IHX + 5 ,4,'FT Planar')                     !SGI                                  
          CALL STEXT(IHX + 5 ,1,'Ln(Q) vs T, ALL Hits')          !SGI                                  
                                                                        
      IHS(6) = IHX + 6                                           !SGI   
          CALL   BHD(IHX + 6,0,30,4.,10.  ,5,0.,5.)              !SGI                                  
          CALL STEXT(IHX + 6 ,4,'FT Planar')                     !SGI                                  
          CALL STEXT(IHX + 6 ,1,'Ln(Q) ALL Hits + per wire')     !SGI                                  
                                                                        
      IHS(7) = IHX + 7                                           !SGI   
          CALL   BHD(IHX + 7,0,30,4.,10.,4,0.,4.)                !SGI                                  
          CALL STEXT(IHX + 7 ,4,'FT Planar')                     !SGI                                  
          CALL STEXT(IHX +7,1,'Ln(Q) for Cluster hits + per SM') !SGI                                  
                                                                        
      IHS(8) = IHX + 8                                           !SGI   
          CALL   BHD(IHX + 8,0,34,-51.,51.,39,0.,39.)            !SGI                                  
          CALL STEXT(IHX + 8 ,4,'FT Planar')                     !SGI                                  
          CALL STEXT(IHX + 8 ,1,'+/-2S/V All+SM+Layer')          !SGI                                  
                                                                        
      IHS(9) = IHX + 9                                           !SGI   
          CALL  BHDW(IHX + 9,0,40,800.,1200.,13,0.,13.)          !SGI                                  
          CALL STEXT(IHX + 9 ,4,'FT Planar')                     !SGI                                  
          CALL STEXT(IHX + 9 ,1,'Raw D-Time DOS/Back')           !SGI                                  
                                                                        
      IHS(10)= IHX + 10                                          !SGI   
          CALL   BHDW(IHX + 10,0,40,80.,280.,13,0.,13.)          !SGI                                  
          CALL STEXT(IHX + 10 ,4,'FT Planar')                    !SGI                                  
          CALL STEXT(IHX + 10 ,1,'Raw D-Time DOS/Front')         !SGI                                  
                                                                        
      IHS(27) = IHX + 27                                                
          CALL BHS(IHX + 27,0,100,200.,1000.)                                                          
          CALL STEXT(IHX + 27 ,4,'FT Planar')                                                          
          CALL STEXT(IHX + 27 ,1,'Planar: Mean Drift/event')                                           
                                                                        
      ENDIF                                                             
                                                                        
                                                                        
                                                                        
      IF(RADIAL) THEN                                                   
                                                                        
                                                                        
* book packed histograms for farm                                                                             
      IHS(11)= IHX + 11                                          !SGI   
          CALL    BHD(IHX + 11,0,48,-0.5,47.5,36,0.5,36.5)       !SGI                                  
          CALL STEXT(IHX + 11 ,4,'FT Radial')                    !SGI                                  
          CALL STEXT(IHX + 11 ,1,'Wedge Pair*2+- vs Wire Plane') !SGI                                  
                                                                        
                                                                        
      IHS(12)= IHX + 12                                          !SGI   
          CALL    BHS(IHX + 12,0,30,-0.5,29.5)                   !SGI                                  
          CALL STEXT(IHX + 12 ,4,'FT Radial')                    !SGI                                  
          CALL STEXT(IHX + 12 ,1,'Hit Multiplicity/Cell')        !SGI                                  
                                                                        
      IHS(13)= IHX + 13                                          !SGI   
          CALL   BHS(IHX + 13,0,100,0.,2000.)                    !SGI                                  
          CALL STEXT(IHX + 13 ,4,'FT Radial')                    !SGI                                  
          CALL STEXT(IHX + 13 ,1,'Raw D-Time ALL Hits')          !SGI                                  
                                                                        
*      IHS(14)= IHX + 14                                          !SGI                                        
*          CALL   BHS(IHX + 14,0,80, -80.,80.)                    !SGI                                        
*          CALL STEXT(IHX + 14 ,4,'FT Radial')                    !SGI                                        
*          CALL STEXT(IHX + 14 ,1,'Radius  ALL Hits')             !SGI                                        
                                                                        
      IHS(15)= IHX + 15                                          !SGI   
          CALL   BHS(IHX + 15,0,80,0.,80.)                       !SGI                                  
          CALL STEXT(IHX + 15 ,4,'FT Radial')                    !SGI                                  
          CALL STEXT(IHX + 15 ,1,'ABS(Radius)  ALL Hits')        !SGI                                  
                                                                        
*      IHS(16)= IHX + 16                                          !SGI                                        
*          CALL   BHD(IHX + 16,0,50,0.,2500.,40,0.,80.)           !SGI                                        
*          CALL STEXT(IHX + 16 ,4,'FT Radial')                    !SGI                                        
*          CALL STEXT(IHX + 16 ,1,'Drift T vs Radius, ALL Hits')  !SGI                                        
                                                                        
*     IHS(17)= IHX + 17                                          !SGI                                         
*         CALL   BHD(IHX + 17,0,60,0.,300.,40,0.,80.)            !SGI                                         
*         CALL STEXT(IHX + 17 ,4,'FT Radial')                    !SGI                                         
*         CALL STEXT(IHX + 17 ,1,'D-T vs R, Front edge+All Hits')!SGI                                         
*          GMAX = FLOAT(NBINR)                                                                                
*      IHS(17)= IHX + 17                                          !SGI                                        
*          CALL  BHDW(IHX + 17,0,27,300.,1920.,NBINR,0.,GMAX)     !SGI                                        
*          CALL STEXT(IHX + 17 ,4,'FT Radial')                    !SGI                                        
*          CALL STEXT(IHX + 17 ,1,'RawD-Time DOS/Back +   ')      !SGI                                        
                                                                        
*     IHS(18)= IHX + 18                                          !SGI                                         
*         CALL   BHD(IHX + 18,0,40,300.,1900.,40,0.,80.)         !SGI                                         
*         CALL STEXT(IHX + 18 ,4,'FT Radial')                    !SGI                                         
*         CALL STEXT(IHX + 18 ,1,'D-T vs R, Back edge+All Hits') !SGI                                         
*         GMAX = FLOAT(NBINR)                                                                                 
*     IHS(18)= IHX + 18                                          !SGI                                         
*         CALL  BHDW(IHX + 18,0,27,300.,1920.,NBINR,0.,GMAX)     !SGI                                         
*         CALL STEXT(IHX + 18 ,4,'FT Radial')                    !SGI                                         
*         CALL STEXT(IHX + 18 ,1,'RawD-Time DOS/Back -   ')      !SGI                                         
                                                                        
      IHS(19)= IHX + 19                                          !SGI   
          CALL   BHD(IHX + 19,0,100,0.,1000.,4,0.,4.)            !SGI                                  
          CALL STEXT(IHX + 19 ,4,'FT Radial')                    !SGI                                  
          CALL STEXT(IHX + 19 ,1,'Inter-Hit Time all + SM')      !SGI                                  
                                                                        
      IHS(20)= IHX + 20                                          !SGI   
          CALL   BHD(IHX + 20,0,50,0.,2500.,30,4.,10.)           !SGI                                  
          CALL STEXT(IHX + 20 ,4,'FT Radial')                    !SGI                                  
          CALL STEXT(IHX + 20 ,1,'Ln(Q) vs T, ALL Hits')         !SGI                                  
                                                                        
      IHS(21)= IHX + 21                                          !SGI   
          CALL   BHD(IHX + 21,0,30,4.,10.  ,13,0.,13.)           !SGI                                  
          CALL STEXT(IHX + 21 ,4,'FT Radial')                    !SGI                                  
          CALL STEXT(IHX + 21 ,1,'Ln(Q) ALL Hits and per wire')  !SGI                                  
                                                                        
      IHS(22)= IHX + 22                                          !SGI   
          CALL   BHD(IHX + 22,0,50,0.,5000.,4,0.,4.)             !SGI                                  
          CALL STEXT(IHX + 22 ,4,'FT Radial')                    !SGI                                  
          CALL STEXT(IHX + 22 ,1,'Q for Cluster hits + SM')      !SGI                                  
                                                                        
      IHS(23)= IHX + 23                                          !SGI   
          CALL   BHD(IHX + 23,0,34,-51.,51.,39,0.,39.)           !SGI                                  
          CALL STEXT(IHX + 23 ,4,'FT Radial')                    !SGI                                  
          CALL STEXT(IHX + 23 ,1,'+/- 2S/V All + SM + Layer')    !SGI                                  
                                                                        
      IHS(24)= IHX + 24                                          !SGI   
          CALL  BHSW(IHX + 24,0,60,80.,380.)                     !SGI                                  
          CALL STEXT(IHX + 24 ,4,'FT Radial')                    !SGI                                  
          CALL STEXT(IHX + 24 ,1,'Raw D-Time DOS/Front R<80')    !SGI                                  
                                                                        
          GMAX = FLOAT(NBINR)                                           
      IHS(25)= IHX + 25                                          !SGI   
          CALL  BHDW(IHX + 25,0,24,300.,1740.,NBINR,0.,GMAX)     !SGI                                  
          CALL STEXT(IHX + 25 ,4,'FT Radial')                    !SGI                                  
          CALL STEXT(IHX + 25 ,1,'RawD-Time DOS/Back Rbin')      !SGI                                  
                                                                        
      IHS(28) = IHX + 28                                                
          CALL BHS(IHX + 28,0,100,200.,1000.)                                                          
          CALL STEXT(IHX + 28 ,4,'FT Radial')                                                          
          CALL STEXT(IHX + 28 ,1,'Radial: Mean Drift/event')                                           
                                                                        
      ENDIF                                                             
                                                                        
      GMIN = 0.5                                                        
      GMAX = FLOAT(LENST) + 0.5                                         
                                                                        
      IHS(26)= IHX + 26                                          !SGI   
          CALL  BHSW(IHX + 26,0,LENST,GMIN,GMAX)                 !SGI                                  
          CALL STEXT(IHX + 26,4,'FTD Monitoring')                !SGI                                  
          CALL STEXT(IHX + 26,1,'Run Statistics')                !SGI                                  
                                                                        
      RETURN                                                            
      END                                                               
*