C   09/11/78            MEMBER NAME  NPECERO  (WORKS)       FORTRAN
      SUBROUTINE NPECER(JBE,Z,COST,PENUM)
C     S.YAMADA    12-12-77
C---- CALCULATE NUMBER OF PHOTOELECTRONS BY CERECKOV LIGHT.
C
C INPUT
C     JBE=1 FOR BARREL PART,  =2 FOR END CAP
C     Z=DEPTH OF THE SOURCE TRACK IN THE LEAD GLASS( RAD.LENGTH )
C     COST=COS(THETA) OF THE SOURCE TRACK W.R.TO THE NORMAL OF
C          THE CATHODE SURFACE.
C
C OUTPUT
C     PENUM=NO.OF PHOTOELECTRONS/1RAD.LENGTH LONG TRACK.
C
C---- AN EMPIRICAL FORMULA IS USED.
C---- PHOTOMULTIPLIER AREA IS ASSUMED TO COVER THE WHOLE SURFACE.
C---- TO GET THE REAL PHOTOELECTRON NUMBER PENUM SHOULD BE MULTIPLIED
C     BY THE RATIO (CATHODE AREA/LEAD GLASS CROSS SECTION).
C
      DIMENSION A(2),B(8,2,2)
      DATA B/32.43, -9.609, -265.4, 1129., -1548., 689.6, 19.66, 0.,
     1  .2925, .5996, -0.1503, 7.148, -1.226, -17.22, 1.66, 11.21,
     2   22.57, -1.9, -285.2, 1459.0,-2780., 2306., -689.5, 0.,
     3   .1789, .8967, .0754, 3.593, -0.702, -10.41, .84, 7.068/
C
      PENUM = 0.
C---- CHECK POSITION
      IF(Z.LT.0. .OR. Z.GT.13.4 ) GO TO 90
      IF(ABS(COST).GT.1.0) GO TO 90
C---- DETERMINE A
      JBEW = JBE
C---- PROTECTION AGAINST FAULS JBE INPUT.
      IF(JBEW.LT.1) JBEW = 1
      IF(JBEW.GT.2) JBEW = 2
        DO 1 IA=1,2
        X = COST
        IF(IA.EQ.1) X = X*X
        F = B(8,IA,JBEW)
          DO 2 J=2,8
          JR = 9-J
          F = F*X+B(JR,IA,JBEW)
    2     CONTINUE
        A(IA) = F
    1   CONTINUE
C---- FUNCTN=A(1)+CC(COST)*EXP(0.55*Z)+A(2)*Z
C
      CC = ((0.8751*COST-0.8362)*COST+0.3924)*COST-2.0
      CC = 10.**CC
      IF(JBEW.EQ.2) CC = 1.5*CC
      EXPARG = EXP(0.55*Z)
      PENUM = A(1)+CC*EXPARG+A(2)*Z
      RETURN
C
      DATA MESS/0/
   90 IF(MESS.EQ.0) WRITE(6,600) JBE,Z,COST
  600 FORMAT(' ***** WRONG INPUT FOR NPECER *****',I6,2E12.3)
      MESS = 1
      RETURN
      END
