C   09/09/83 309090115  MEMBER NAME  E#EVSLCT (FORT)        FORTRAN
c **********************************************************************
c *                                                                    *
c *  EVent Selection subroutine PACKAGE by T.TAKAHASHI                 *
c *                      version 1     (1983.4.12)                     *
c *                      version 2     (1983.9  8)                     *
c *                      version 2.2   (1983.10.5)                     *
c *			 version 2.3   (1983.10.11) at LBL delete      *
c *                      version 2.3   (1984.10.11)      ERRTRA        *
c *                      version 2.4   (1984.10.25) add EVScum         *
c *                      version 2.5   (1984.10.31) Call evsiz         *
c *				 internally ( in EVSdef )	       *
c *                      version 2.6   (1984.11.1 ) add EVSout_def     *
c *					to allow output specified key  *
c *				        add EVSCLR_ALL		       *
c *                      version 2.7   (1984.12.13) mod EVScum         *
c *         initialize          : EVSiz                                *
c *         flag  definition    : EVSdef(key)                          *
c *         normarize   key  def: EVSNRK(key1,key2) norm. key1 by key2 *
c *         normarize  const def: EVSNRN(key1,val ) norm. key1 by val  *
c *         flag  set           : EVSset(key)                          *
c *                             : EVSval(key,logic)                    *
c *         flag  clear         : EVSclr(key)                          *
c *	    flag  clear all	: EVSclr_all
c *         flag  check         : EVS(key)    .true. if flag is set    *
c *                             : EVSall()    .true. if all of flag set*
c *         flag  accumurate    : accumulate if flag is set            *
c *                                --EVSacm                            *
c *	    flag accumurate by key : EVScum(key)		       *
c *         output results of event selection : EVSout(lun)            *
c *	    get accumurated EVS number : EVSnum( key ,num)             *
c *         internal routines   : EVSkey : search key and return index *
c *                             : E$out1 :
c **********************************************************************
c *                                                                    *
c * EVS MANUAL ( this manual is wriiten by Taku for KMU analysis )     *
c * To handle event selections.                                        *
c * Each event selection has its own name within 32 characters.        *
c * The value of the selection can be set, reset, or refered by        *
c * its name from any routines.                                        *
c *   1 First, declare the name of event selection.                    *
c *     call EVSDEF( name )                                            *
c *     will define the name ( charcter string within 32 chars ).      *
c *   2 There are three ways to set the value of event selection.      *
c *   2.1 EVSSET( name )                                               *
c *       call EVSSET( name )                                          *
c *       will set the value of the specified event selection to       *
c *       .TRUE. .                                                     *
c *   2.2 EVSCLR( name )                                               *
c *       call EVSCLR( name )                                          *
c *       will set the value of the name to .FALSE. ;                  *
c *       in other word, 'clear'.                                      *
c *   2.3 EVSVAL( name, logic )                                        *
c *       call EVSVAL( name, logic )                                   *
c *       will set the value of the event selection to the value       *
c *       given by 'logic'. 'logic' is a logical expression, as        *
c *       .TRUE., .FALSE., logical variable, or logical                *
c *       combination of logical variables.                            *
c *   3 In order to get the value of the event selection, use          *
c *     logical function EVS.                                          *
c *     EVS( name ) returns the value of the specified event           *
c *     selection. For example, you can use EVS as ...                 *
c *     if( EVS( 'ALL_CHAMBERS_HIT' ) ) then                           *
c *       ......                                                       *
c *     or                                                             *
c *     call EVSVAL( 'PC1V_IS_OK', ( MULT(1).GT.0 ) )                  *
c *     call EVSVAL( 'PC1H_IS_OK', ( MULT(2).GT.0 ) )                  *
c *     call EVSVAL( 'PC1_IS_OK',                                      *
c *    &             ( EVS('PC1V_IS_OK') .and. EVS('PC1H_IS_OK') ) )   *
c *     ...                                                            *
c *     and so on.                                                     *
c *                                                                    *
c *     Do not forget to declare the function EVS as logical ;         *
c *     put the next statement in a declaration part in each routine   *
c *     which uses EVS.                                                *
c *       logical EVS            " EVS is a logical function           *
c *                                                                    *
c **********************************************************************
