SUBROUTINE FTDPAT
*-- Author : S.J. Maxfield
      SUBROUTINE FTDPAT
**: FTDPAT 30907 RP. Farm changes.                                                                            
**----------------------------------------------------------------------                                      
***********************************************************                                                   
*                                                         *                                                   
*     Do Pattern recognition in FTD. Link segments.       *                                                   
*                                                         *                                                   
***********************************************************                                                   
*                                                                                                             
      COMMON/FEVSAT/IEVSAT                                              
      IEVSAT = 0                                                        
                                                                        
*     Make radial-radial links and pick up planar segments.                                                   
      CALL FRAPKR
*                                                                                                             
*     Set area for histograms...                                                                              
      CALL SAREA('FTREC',2)                                                                            
*                                                                                                             
*     Make planar-planar links and pick up radial segments.                                                   
      CALL FPLPKP
*                                                                                                             
*     Merge track lists. Release radial segments not used by planars.                                         
      CALL FTMERG
*                                                                                                             
*     Make planar-radial links                                                                                
      CALL FTPRLK
*                                                                                                             
*     Pick up planar segments from connected set                                                              
      CALL FPCXTD
*                                                                                                             
*     Pick up unused planar segments (connected and unconnected)                                              
      CALL FPSPC
*     Pick up unused radial segments.                                                                         
      CALL FSINGR
*                                                                                                             
*     Drift velocity determination by projection from planars.                                                
*     Do BEFORE radial segments are used to improve track!                                                    
*                                                                                                             
      CALL SAREA('FPOKE', 0)                                                                           
      CALL FPOKER
      CALL SAREA('FTREC', 2)                                                                           
*                                                                                                             
*     Improve track parameters with radial segments...                                                        
      CALL FPRFIT
                                                                        
*     Output results...                                                                                       
      CALL FPATUT
*                                                                                                             
      IF(IEVSAT .NE. 0) THEN                                            
       CALL ERRLOG(120,'W:FTDPAT: Pattern recognition saturated')                                      
      ENDIF                                                             
*                                                                                                             
*     Reset area for histograms...                                                                            
      CALL SAREA('FTREC',1)                                                                            
*                                                                                                             
      RETURN                                                            
      END                                                               
*