C   13/08/79 412031703  MEMBER NAME  LGTHCRN  (SOURCE)      FORTRAN
      SUBROUTINE LGTHCR( ECLS,EDG,JEG,COSTH, DCOSTH)
C
C     S.YAMADA  26-02-80   17:15
C     LAST MODIFICATION  28-02-80   15:35
C
C     CLUSTER POLAR ANGLE CORRECTION FOR THE BARREL PART.
C
C---- INPUT
C     ECLS=CLUSTER ENERGY
C     EDG =EDGE ENERGY FRACTION
C     JEG = 0(GAMMA),  NE.0(CHARGED)
C     COSTH = CLUSTER COS(TH)
C---- OUTPUT
C     DCOSTH = CORRECTION FOR COSTH
C
      DCOSTH = 0.
C---- CORRECTION DEPENDS ON THE CLUSTER ENERGY
      IF( ECLS.LE.0. ) GO TO 90
      IF( EDG.LT.0. .OR. EDG.GT. 1.0 )  GO TO 91
C
C---- ANGLE INDEPENDENT PART
      X = ALOG10( ECLS )
      IF( X.GT.-0.8239) GO TO 1
      DTHC = 0.0045*X-0.00245
      GO TO 10
    1 IF( X.GT.0.6532) GO TO 2
C     ENERGY  ( 0.15  --  4.5  ) GEV
      DTHC = -(0.001219*X+0.00725)
      GO TO 10
    2 DTHC = -0.008
C
C     ANGLE DEPENDENT PART
   10 DTHA = (0.0032*X+0.016)*EXP(-6.667*ABS(COSTH))
C
C---- COSTH CORRECTION AT THE BARREL EDGE
   30 DTHE = 0.
      IF( EDG.LE.0. ) GO TO 50
C---- CORRECTION IS DONE BY THE AMOUNT OF THE EDGE ENERGY FRACTION.
      IF(JEG) 40,31,40
C     GAMMA
   31 DTHE = (0.00913*X+0.0188)*EDG
      GO TO 50
C     CHARGED
   40 DTHE = ((0.12*EDG-0.18)*EDG+0.09)*EDG
C
   50 DCOSTH = DTHC+DTHA+DTHE
C////////// TEST
C     DATA MESS/0/
C      MESS = MESS+1
C      IF(MESS.LE.50)
C    $ WRITE(6,6000) ECLS,EDG,JEG,COSTH,X,DTHC,DTHA,DTHE,DCOSTH
C6000  FORMAT(' ECLS,EDG,JEG,COSTH=',2F7.3,I6,F8.4,
C    $        '   X,DTHC,DTHA,DTHE,DCOSTH=',5E10.3)
C//////////
      IF( COSTH.LT.0. ) DCOSTH = -DCOSTH
      RETURN
C
C---- ERRORS
   90 NER1 = NER1+1
      IF( NER1.LT.10 ) WRITE(6,690) ECLS,NER1
  690 FORMAT(/' ***** ERROR *****    WRONG INPUT FOR LGTHCR,  ECLS=',
     1      E12.4,'  NER=',I3)
      RETURN
C
   91 NER2 = NER2+1
      IF( NER2.LT.10 ) WRITE(6,691) EDG,NER2
  691 FORMAT(/' ***** ERROR *****    WRONG INPUT FOR LGTHCR,  EDG.FR =',
     1      E12.4,'  NER=',I3)
      RETURN
C
      END
