SUBROUTINE FMSLCT
*-- Author :    Girish D. Patel
      SUBROUTINE FMSLCT(EVT0,EVZV,IRET)
*======================================================================                                       
*     OUTPUT: EVT0   CJC EVENT T0       ( = 1000.0 IF NOT FOUND)                                              
*             EVZV   CJC EVENT Z-VERTEX ( = 1000.0 IF NOT FOUND)                                              
*             IRET   RETURN FLAG: 0 - OK OR NO CJC INFO FOR REJECTION                                         
*                                 1 - CJC REJECT ON T0                                                        
*                                 2 - CJC REJECT ON Z-VERTEX                                                  
*                                 3 - CJC REJECT ON T0 & Z-VERTEX                                             
*======================================================================                                       
*KEEP,BOSMDL.                                                                                                 
C     ------BOSMDL                                                                                            
      LOGICAL       BEGJOB,ENDRUN,BEGRUN,REVENT,ENDJOB,OTHDAT           
      COMMON/BOSMDL/BEGJOB,ENDRUN,BEGRUN,REVENT,ENDJOB,OTHDAT,          
     +              LCCRUN,NCCRUN,NEVENT,                               
     +              IHA,IBS,IDB,IDATEL,LUP,ISN,JSN                      
      SAVE  /BOSMDL/                                                    
C     ------                                                                                                  
*KEEP,BCS.                                                                                                    
      INTEGER      NHROW,NHCOL,NHLEN                                    
      PARAMETER   (NHROW = 2, NHCOL = 1, NHLEN=2)                       
      INTEGER      NBOSIW                                               
      PARAMETER   (NBOSIW=1000000)                                      
      INTEGER      IW(NBOSIW)                                           
      REAL         RW(NBOSIW)                                           
      COMMON /BCS/ IW                                                   
      EQUIVALENCE (RW(1),IW(1))                                         
      SAVE   /BCS/                                                      
*KEND.                                                                                                        
      LOGICAL FIRST                                                     
      DIMENSION INFO20(20)                                              
*KEEP,STFUNCT.                                                                                                
*     index of element before row number IROW                                                                 
      INDR(IND,IROW)=IND+2+IW(IND+1)*(IROW-1)                           
*     index of L'th element  of row number IROW                                                               
      INDCR(IND,L,IROW)=INDR(IND,IROW) + L                              
*     L'th integer element of the IROW'th row of bank with index IND                                          
      IBTAB(IND,L,IROW)=IW(INDCR(IND,L,IROW))                           
*     L'th real element of the IROW'th row of bank with index IND                                             
      RBTAB(IND,L,IROW)=RW(INDCR(IND,L,IROW))                           
*KEND.                                                                                                        
      DATA FIRST/.TRUE./                                                
*                                                                                                             
      IF(FIRST) THEN                                                    
        FIRST = .FALSE.                                                 
        IQCJCC = NAMIND('CJCC')                                         
        IQCJKV = NAMIND('CJKV')                                         
      ENDIF                                                             
*                                                                                                             
      INCJCC = IW(IQCJCC)                                               
      INCJKV = IW(IQCJKV)                                               
*                                                                                                             
      EVT0 = 1000.0                                                     
      IF(INCJCC.NE.0) THEN                                              
        IF(IW(INCJCC+2).NE.0) EVT0 = RBTAB(INCJCC,2,1)                  
      ENDIF                                                             
*                                                                                                             
      EVZV = 1000.0                                                     
      IF(INCJKV.NE.0) THEN                                              
        NVERT = IW(INCJKV+2)                                            
        IF(NVERT.GT.0) THEN                                             
          DO IV = 1 , NVERT                                             
            IVTYP = IBTAB(INCJKV,9,IV)                                  
            IF(IVTYP.EQ.1) THEN                                         
              EVZV = RBTAB(INCJKV,3,IV)                                 
            ENDIF                                                       
          ENDDO                                                         
        ENDIF                                                           
      ENDIF                                                             
                                                                        
      IRET = 0                                                          
      IERR = 0                                                          
                                                                        
      CALL H1MOR1('T_0 ','CJTREC',NCCRUN,CJCT0,VARI,INFO20,IERR)                                       
                                                                        
      IF (EVT0.NE.1000.0 .AND. CJCT0.GT.0.) THEN                        
         DT0 = ABS(EVT0 - CJCT0)                                        
         IF (DT0.GT.50.) IRET = IRET + 1                                
      ENDIF                                                             
                                                                        
      INBEAZ = IABS(MDB('BEAZ'))                                        
      ZNOM = 0.                                                         
      IF (INBEAZ.GT.0) ZNOM = RW(INBEAZ +2 +2)                          
                                                                        
      IF(EVZV.LT.ZNOM-100.0) IRET = IRET + 2                            
                                                                        
      RETURN                                                            
      END                                                               
*