FPLKPR COMMENTS
*-- Author :   I.O.Skillicorn
      SUBROUTINE FPLKPR(ISMP,IDM )
**: FPLKPR 30907 RP. Farm changes.                                                                            
**----------------------------------------------------------------------                                      
**     ROUTINE TO JOIN ADJACENT RADIAL AND PLANAR MODULES                                                     
*     AS FPLKRP1 BUT FIND BEST RADIAL FOR SELECTED PLANAR                                                     
*                                                                                                             
*     12/8/96  add d(phi)/dz cut                                                                              
*                                                                                                             
*                                                                                                             
*KEEP,FRDIMS.                                                                                                 
*KEEP,FH1WORK.                                                                                                
*    Planar geometry                                                                                          
*                                                                                                             
*    Radial geometry                                                                                          
*                                                                                                             
*    Radial data...                                                                                           
*                                                                                                             
*    Planar Data                                                                                              
*                                                                                                             
*    Pointers into DIGI bank for IOS labelled hits                                                            
*                                                                                                             
*    Track segment data                                                                                       
*                                                                                                             
*    Fit data                                                                                                 
*                                                                                                             
*                                                                                                             
*KEEP,FPTVTX.                                                                                                 
**the common/VERTEX/ becomes /VERTVV/ (in analogy to /VERTFF/) on the                                         
** 17/6/91, since it is in conflict with the VERTEX module (g.bernardi)                                       
** (note that all these common names should start by F in this deck...)                                       
*KEEP,FRH3FT.                                                                                                 
*     Common for RETRAC results (SJM)                                                                         
*KEEP,FPPRAM.                                                                                                 
C                                                                                                             
C---  MAXSEG is maximum number of segments per supermodule                                                    
C---  MAXCON is maximum number of amibiguous segments associatable with                                       
C---         one segment                                                                                      
C---  LIMSTO is maximum number of 2 cluster planes intersections to be                                        
C---         stored per supermodule                                                                           
C---  MSEGLM is maximum number of clusters that can be found before                                           
C---         connectivity considered                                                                          
C---  MAXCLU is maximum number of clusters that can be found after                                            
C---         forming non-connected set    MUST BE 50 IF RUN WITH OLD RCW                                      
C---         (cluster = 3/4 digits found in a straight line in one                                            
C---          4-wire orientation)                                                                             
C                                                                                                             
C---                                                                                                          
*KEEP,FPLSEG.                                                                                                 
C---                                                                                                          
C---                                                                                                          
*KEEP,FPTFLG.                                                                                                 
*KEEP,FPTPAR.                                                                                                 
*KEEP,FDIFLG.                                                                                                 
*KEND.                                                                                                        
*     Common for track parameter errors...                                                                    
*     Common for segment numbers...                                                                           
*     Local arrays...                                                                                         
*        note millimetres                                                                                     
C                                                                                                             
C---   LOOP OVER SUPERMODULES - FOR RADIALS                                                                   
C                                                                                                             
C      ISMP- PLANAR MODULE                                                                                    
C      ISM - RADIAL MODULE                                                                                    
C                                                                                                             
C                                                                                                             
C---  search only unused segments                                                                             
C                                                                                                             
C                                                                                                             
C---  search only the disconnected set                                                                        
C                                                                                                             
C                                                                                                             
C---  Extract planar segment and covariance matrix                                                            
C                                                                                                             
C     STR LINES THROUGH PLANARS IN PHI-Z  R-Z                                                                 
C     DISTANCES IN MM HERE FOR RCWH                                                                           
C---                                                                                                          
C---                                                                                                          
C---                                                                                                          
C     NOTE MM  THRUOUT                                                                                        
C                                                                                                             
*     R AND PHI FOR PLANAR SEGMENT AT POSITION OF RADIAL                                                      
C                                                                                                             
C                                                                                                             
C---  RR AND PHI CALCULATED FOR THIS Z AS FOUND     BY RADIALS                                                
C                                                                                                             
*     Believe the radial segment prediction in the 'drift' direction                                          
*     only. More-or-less ignore rad radius...                                                                 
      CALL SHS(1631,0,DR   )                                                                           
C                                                                                                             
C---  END OF LOOP OVER RADIAL  SEGMENTS FOR SUPERMODULE                                                       
C                                                                                                             
C                                                                                                             
C      GET  DISTANCE OF RADIAL POINTS FROM PREDICTION*******                                                  
C     FOLLOWING HISTOGRAM SHOWS DATA SPREAD TO 1 CMS                                                          
c     CALL SHS(1632,0,DIFF)                                                                            
      CALL FTLFT(XX,YY,LL,0,AT,BT,EE)
      CALL SHS(1633,0,AT)                                                                              
      CALL SHS(1636,0,AT)                                                                              
*     if(dphi1.ne.dphi)write(*,*)' fplkpr ',dphi,dphi1                                                        
      CALL SHS(1635,0,dphi)                                                                            
      CALL SHS(1632,0,DIFF)                                                                            
C     CHECK SLOPE OF SEGMENT : HISTGRAM SUGGESTS 0.1                                                          
C     END ADDITION *****************************************                                                  
      CALL SHS(1630,0,DRMIN)                                                                           
C     LINK FLAG ISMP =PLANAR MODULE 2,3 . IP POINTS TO PLANAR SEGMENT                                         
C     ISGR IS RADIAL SEGMENT IN MODULE ISMP-1                                                                 
C     ISGR ZERO'D IN FTADD                                                                                    
CIOS     PRINT 2000,ISM,ISMP,ISMIN,IP                                                                         
CIOS     CALL SHD(212,0,DRMIN,DRM)                                                                            
C                                                                                                             
C---  End of loop over supermodules                                                                           
C                                                                                                             
C     PRINT 1000,(IRP(II,K),II=1,36)                                                                          
*