C   20/08/82 209061341  MEMBER NAME  LGINIT   (SOURCE)      FORTRAN
      SUBROUTINE LGINIT
C
C     S.YAMADA   17-01-79   14:40
C     MODIFICATION   20-02-82   8:25 BY Y.WATANABE
C        DUE TO THE INSTALLATION OF THE NEW LG TRIGGER, THE THRESHOLD
C        OF BAD CHANNEL FOR ENDCAP IS INCREASED.
C     LAST MODIFICATION   20-08-82  13:25 BY S.YAMADA, JCALFL IS ADDED.
C                         06-09-82  13:40  THE MODIFIED VERSION LOADED.
C
C---- INITIALIZATION ROUTINE FOR THE LG-ANALYSIS PROGRAM
C---- LOAD IN BLOCK DATA WHEN CALLED.
      IMPLICIT INTEGER *2 (H)
      COMMON /CMSGCT/ LGMMAX,LGMSG(20)
C
C---- ERROR MESSAGE PRINTING PARAMETERS.
      LGMMAX = 5
        DO 400 K=1,20
  400   LGMSG(K) = 0
C
      RETURN
      END
C
C****************************************************************
C
C   17/12/78 C9030801   MEMBER NAME  LGBLCK   (JADELGS)     FORTRAN
      BLOCK DATA
C
C    S.YAMADA  01-09-78  12:15
C---- LAST MODIFICATION  08-03-79  22:30
C
C---- BLOCK DATA FOR THE LG-COUNTER GEOMETRICAL CONSTANTS
C
      IMPLICIT INTEGER *2 (H)
      COMMON /CLGDMS/ X0,RADIUS(6),RADSX0(6),THX0(4),
     1                ZEND(2),ZENDX0(2),ZWID(2),ZGAP(2),PHWID(2),
     2                ZECAP(4),ZECAPX(4),THECPX(2),
     3                ECXLST(24), ECYLST(24)
C
      COMMON/ CLGVRN/ NVRSN(20)
      DATA NVRSN/4*0, 178090112, 15*0/
C
C---- THE UNIT IS EITHER MM OR X0.
C
      DATA X0/22.39/
C
C---- RADIUS IN MM
C     RADIUS(1,2) = DISTANCE TO THE COIL SURFACES(INNER AND OUTER)
C     RADIUS(3,4) = DISTANCE TO THE LEAD GLASS SURFACES(TYPE A)
C     RADIUS(5,6) = DISTANCE TO THE LEAD GLASS SURFACES(TYPE A-PR)
C
      DATA RADIUS/ 950.0, 967.45, 1100.0, 1400.0, 1150.0, 1400.0/
C---- RADIUS IN X0
      DATA RADSX0/ 42.430, 43.209, 49.129, 62.528, 51.362, 62.528/
C
C---- THICKNESS OF EACH PART IN X0
C     THX0(1)=COIL EQUIV.,THX0(2)=GAP BETWEEN THE COIL AND THE L.G.
C     THX0(3)=TYPE A LEAD-GLASS,  THX0(4)=TYPE A-PR LEAD-GLASS
C
      DATA THX0/ 0.779, 5.920, 13.399, 11.166/
C
C---- THE BARREL ENDS
      DATA ZEND/ -1705.45, 1705.45/, ZENDX0/ -76.172, 76.172/
C
C---- COUNTER SIZE IN MM AND IN X0
      DATA ZWID/ 103.2, 4.609/,  PHWID/80.8, 3.609/
C
C---- COUNTER GAP
      DATA ZGAP/3.5, 0.156/
C
C---- END CAP WALL POSITIONS
      DATA ZECAP/ -1522.0, -1748.0, 1522.0, 1748.0/
      DATA ZECAPX/ -67.977, -78.071, 67.977, 78.071/
C        MORE ACCURATE VALUES 2-11-79
      DATA THECPX/ 226.0, 10.09/
C
C---- ECXLST,ECYLST   X AND Y POSITIONS OF THE ENDCAP COUNTERS
      DATA ECXLST/400., 350., 210., 70., 540., 490., 350., 210.,
     1          70., 680., 630., 490., 350., 210., 70., 820.,
     2          770., 2*630., 2*490., 350., 210., 70./
      DATA ECYLST/70., 210., 350., 400., 70., 210., 350., 490.,
     1          540., 70., 210., 350., 490., 630., 680., 70.,
     2          210., 350., 2*490., 2*630., 770., 820./
C
C
C---- LG ANALYSIS PARAMETERS
      COMMON /CLGPRM/ ITH,MAXCLS,IRLTHD,IRLTH2,IRLTH3, ZVRTX,DZVRTX
     $               ,IDUMM(2), JCALFL
C     IDUMM(2) IS TO KEEP SOME OLD PROG. HAPPY.
      DATA IDUMM/2*200/
C     JCALFL;  FLAG TO CHECK THE LG-CALIBRATION CONST.
      DATA JCALFL/0/
C                    IT IS SET TO 1 IN THE KLREAD IF THE RIGHT CONSTS
C                    ARE SET.
C
C---- THRESHOLD TO START CLUSTER SEARCH.  NOW ADC-DATA IS CALIBRATED
C     TO GIVE ENERGY IN MEV BEFORE ANALYSIS STARTS.
C---- THE MAXIMUM NUMBER OF CLUSTERS TO BE STORED.
      DATA ITH/45/, MAXCLS/80/
C
      DATA IRLTHD/5/, IRLTH2/2/, IRLTH3/3/
C---- (THRESHOLD TO SEPARATE NEARBY CLUSTERS.)
C
C----  DEFAULT Z-VERTEX
      DATA  ZVRTX/ 0.0/, DZVRTX/0.0/
C
      COMMON /CUNIT/ LUNMVC,LUNMUE,LUBADC
      DATA  LUNMVC/8/, LUNMUE/9/, LUBADC/13/
C
      COMMON /CLGBCH/ HABAD(2,3),HBBAD(2,2,2)
C     THE CUTS TO LIST UP BAD CHANNELS BASED ON F22WAT.LGBADCH
C     HABAD(J,I);  J=1 MIN. #CHANNELS
C                  J=2 MIN. (FRAQ. OF FIRING)*10**4
C                  I; 1=ALL CRATES, 2=EACH CRATE, 3=EACH ADC
C     HBBAD(K,J,I);K=1 MIN. (FRAQ. OF FIRING)*10**4
C                  K=2 AVERAGE PULSE HEIGHTS
C                  J;1=SUB, 2=KILL
C                  I=1 BARREL,I=2 END CAP
C
      DATA HABAD/600,20,60,20,18,20/
CCCCC DATA HBBAD/100,3,500,1000,500,3,1000,1000/
      DATA HBBAD/500,3,1000,1000,1500,3,1000,1000/
C                               ...14-11-80... NOT TO KILL...
      END
