FVFIT COMMENTS
*-- Author :    Stephen Burke   07/05/92
      SUBROUTINE FVFIT
*-----------------------------------------Updates 07/09/93-------                                             
**: FVFIT 40000 SB.  No more garbage collection.                                                              
*-----------------------------------------Updates 26/07/93-------                                             
**: FVFIT  30907 RP. Farm changes.                                                                            
*-----------------------------------------Updates 02/06/93-------                                             
**: FVFIT  30907 SB. Initialise LUN at BEGJOB.                                                                
*-----------------------------------------Updates 03/05/93-------                                             
**: FVFIT  30907 SB. Print summary on ENDJOB.                                                                 
*-----------------------------------------Updates 15/10/92-------                                             
**: FVFIT  30907 SB. A bit of extra printout.                                                                 
*-----------------------------------------Updates 17/08/92-------                                             
**: FVFIT  30907 SB. Fix HBOOK error message.                                                                 
*-----------------------------------------Updates 06/05/92-------                                             
**: FVFIT  30907 SB. New deck to steer forward z-vertex fit.                                                  
*-----------------------------------------Updates----------------                                             
**********************************************************************                                        
*                                                                    *                                        
* Preliminary z-vertex determination from forward tracks.            *                                        
*                                                                    *                                        
**********************************************************************                                        
*KEEP,FVSTEE.                                                                                                 
*KEEP,FVSCAL.                                                                                                 
* Various counters                                                                                            
*KEEP,FVWBI.                                                                                                  
* Work bank indices                                                                                           
*KEND.                                                                                                        
*KEEP,BCS.                                                                                                    
*KEEP,BOSMDL.                                                                                                 
C     ------BOSMDL                                                                                            
C     ------                                                                                                  
*KEND.                                                                                                        
**********************************************************************                                        
* Make sure LUN is defined                                                                                    
* Zero work bank indices (just in case ...)                                                                   
         CALL VZERO(INFTPR,NFVWBI)                                                                     
* Initialise scalars                                                                                          
         CALL VZERO(NNEVNT,NSCAL)                                                                      
* Read parameters from text banks                                                                             
         CALL FVTEXT
* Format output banks                                                                                         
         CALL BKFMT('FTGR','2I,(3F,I)')
         CALL BKFMT('FTGX','2I,(I)')
* Book monitoring histograms                                                                                  
         CALL FVBKLK
* Book debug histograms                                                                                       
         CALL FVHBK('FVFIT')
* This shouldn't happen!                                                                                      
         CALL H1STOP                                                                                   
         CALL FVZFIT
* Make sure PAW directory is reset                                                                            
         CALL HCDIR('//PAWC',' ')                                                                      
* Clean up                                                                                                    
C         CALL WGARB(IW)                                                                                      
         IF (IW(6).GT.0) CALL HPDIR('//PAWC/FVFIT',' ')                                                
               CALL HCDIR('//PAWC/FVFIT',' ')                                                          
               CALL HRFILE(LUNHB,'FVFIT','N')                                                          
               CALL HROUT(0,ICYC,' ')                                                                  
               CALL HREND('FVFIT')                                                                     
               CALL HCDIR('//PAWC',' ')                                                                
               CALL ERRLOG(501,'W:FVFIT:  HBOOK file open failed')                                     
*