C   10/03/79 208201333  MEMBER NAME  LGHIST   (SOURCE)      FORTRAN
      SUBROUTINE LGHIST(NPCL)
C
C     S.YAMADA   10-03-79  22:40
C
C---- TEST HISTOGRAMS FOR LG-ANALYSIS
C
C
#include "cdata.for"
C
      COMMON /CLGPRM/ ITH,MAXCLS,IRLTHD,IRLTH2,IRLTH3
      DATA IST/0/
C
      IF( IST.NE.0 ) GO TO 1000
      CALL HBOOK1(1,'CLUST ENERGY(DY<0)$',100,0.,20.,0)
      CALL HBOOK1(2,'CLUST ENERGY(DY>0)$',100,0.,20.,0)
      CALL HBOOK1(3,'CLUST ENERGY(DY<0,CH)$',100,0.,20.,0)
      CALL HBOOK1(4,'CLUST ENERGY(DY>0,CH)$',100,0.,20.,0)
      IST = 1
C
C---- SET UP THE POINTER FOR THE LG-CLUSTER PROPERTIES.
 1000 NPCGI = NPCL+IDATA(NPCL+1)-1
C
C---- GET NO.OF CLUSTERS
      NCLST = IDATA(NPCGI+3)
C
      IF(NCLST) 100,100,1
C
C---- GET NO.OF WORDS FOR EACH CLUSTER.
    1 LSTEP = IDATA(NPCGI+21)
C---- SHOWER ENERGY CORRECTION IS CHECKED.
CCC   IF(IDATA(NPCGI+18).EQ.0) GO TO 100
C
      NPCLS = NPCL+IDATA(NPCL+3)-1
C
      NN = NCLST
      IF(NCLST.GT.MAXCLS) NN = MAXCLS
        DO 10 N=1,NN
C       XX = ADATA(NPCLS+9)
        YY = ADATA(NPCLS+10)
        IF(YY) 11,11,12
   11   NPLOT = 1
        GO TO 20
   12   NPLOT = 2
C
   20   CALL HFILL( NPLOT, ADATA(NPCLS+2), DUM,1.)
        IF( IDATA(NPCLS+8).EQ.0 ) GO TO 21
        NPLOT = NPLOT+2
        CALL HFILL( NPLOT, ADATA(NPCLS+2), DUM, 1.0)
C
   21   NPCLS = NPCLS+LSTEP
   10   CONTINUE
C
  100 RETURN
      END
