FRSOUT COMMENTS
*-- Author :    Stephen J. Maxfield   30/03/92
      SUBROUTINE FRSOUT
**: FRSOUT 30907 RP. Farm changes.                                                                            
**----------------------------------------------------------------------                                      
**: FRSOUT 30907 SM. Fix histogram handling.                                                                  
**: FRSOUT 30907 SM. New routine for monitoring.                                                              
**----------------------------------------------------------------------                                      
*------------------------------------------------------------------*                                          
*  OUTPUT RESULTS OF RADIAL PATTERN RECOGNITION                    *                                          
*                                                                  *                                          
*------------------------------------------------------------------*                                          
*                                                                  *                                          
*  OUTPUT:     FRSG,0     radial segments                          *                                          
*  =====                                                           *                                          
*------------------------------------------------------------------*                                          
*      FORMAT OF BANKS FROM FORWARD TRACK RECONSTRUCTION           *                                          
*                                                                  *                                          
*      FRSG    TABLE  FMT =        (7F,15I)                        *                                          
*      ====                                                        *                                          
*                                                                  *                                          
*  1  X         F        x    )                                    *                                          
*  2  Y         F        y    )  at beginning of sm                *                                          
*  3  Z         F        z    )                                    *                                          
*  4  X         F        x    )                                    *                                          
*  5  Y         F        y    )  at end       of sm                *                                          
*  6  Z         F        z    )                                    *                                          
*                                                                  *                                          
*  7  CHSQ      F        Chisq of segment                          *                                          
*  8  ISM       I        Supermodule number                        *                                          
*  9   -        I        Not used                                  *                                          
*  10 INEXT     I        Pointer to next segment on track          *                                          
*  11 IDIG      I             ) Row numbers in FRRE bank(0if none) *                                          
*  ...                        ) SIGNED!                            *                                          
*  22                         )                                    *                                          
*                                                                  *                                          
********************************************************************                                          
*KEEP,BCS.                                                                                                    
*KEEP,BOSMDL.                                                                                                 
C     ------BOSMDL                                                                                            
C     ------                                                                                                  
*KEEP,FRDIMS.                                                                                                 
*KEEP,H1EVDT.                                                                                                 
*                                                                                                             
*  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,FH1WORK.                                                                                                
*    Planar geometry                                                                                          
*                                                                                                             
*    Radial geometry                                                                                          
*                                                                                                             
*    Radial data...                                                                                           
*                                                                                                             
*    Planar Data                                                                                              
*                                                                                                             
*    Pointers into DIGI bank for IOS labelled hits                                                            
*                                                                                                             
*    Track segment data                                                                                       
*                                                                                                             
*    Fit data                                                                                                 
*                                                                                                             
*                                                                                                             
*KEEP,FRH3FT.                                                                                                 
*     Common for RETRAC results (SJM)                                                                         
*KEEP,FDIFLG.                                                                                                 
*KEND.                                                                                                        
*  Bank formatting data...                                                                                    
*  Local arrays...                                                                                            
*KEEP,STFUNCT.                                                                                                
*     index of element before row number IROW                                                                 
*     index of L'th element  of row number IROW                                                               
*     L'th integer element of the IROW'th row of bank with index IND                                          
*     L'th real element of the IROW'th row of bank with index IND                                             
*KEND.                                                                                                        
*------------------------BEGIN ROUTINE-------------------------------                                         
*       Format output banks...                                                                                
        CALL BKFMT('FRSG','2I,(7F,15I)')
*  Loop over supermodules...                                                                                  
*  Loop over segments...                                                                                      
*       Get FRRE row numbers of hits in this segment...                                                       
*       First and last wire planes...                                                                         
*       Write(6,'(3I10)') IOSP, ISP, IAR(10+IWIR)                                                             
           CALL SHS(200,     0, FLOAT(IHITS))                                                          
           CALL SHS(200+ISM, 0, FLOAT(IHITS))                                                          
*       z at beginning and end of this segment...                                                             
*       convert R-z Phi-z to x,y at beginning and end...                                                      
*       Write(6,'(5F10.3, 2I10)') (BAR(JJ), JJ=1,5), IAR(6), IAR(7)                                           
*   Close banks...                                                                                            
*       make empty banks                                                                                      
        IFRSG = NBANK('FRSG',NBNN,2)
      CALL BLIST(IW,'R+','FRSG')                                                                       
*