C   24/06/80 101072233  MEMBER NAME  KALIB2                 FORTRAN
      SUBROUTINE KALIB2
C     JUST CALL KALIBR WITH THE BLOCK DATA ATTACHED.
C     CODED ON 18.8.80 BY Y.WATANABE
C
      IMPLICIT INTEGER*2 (H)
#include "cdata.for"
C
      DATA INIT/0/,HRAN/0/
C
      IF(INIT.GT.0) GO TO 10
          IPHD = IBLN('HEAD')
      INIT=1
C
10        NPHD = IDATA(IPHD)
          IF(NPHD.LE.0) RETURN
          NHPHD = NPHD+NPHD
          HEXP=HDATA(NHPHD+ 9)
          HRUN=HDATA(NHPHD+10)
      IF(HRUN.LE.0) RETURN
      IF(HRUN.EQ.HRAN) RETURN
C       IF EQ ALREADY INITIALIZED FOR THE RUN.
      HRAN=HRUN
      CALL KALIBR
      RETURN
      END
      SUBROUTINE MUREG(DUMMY)
      RETURN
      END
C
      BLOCK DATA
      COMMON /CTLIM/ ISECLF
      COMMON/CBSTR/MODE
#include "ciouni.for"
      DATA ISECLF/2/
      DATA MODE/2/
      DATA NCALI/2/
      DATA KUNITA/23,24,8*0/
      DATA LUNITA/21,22,8*0/
      COMMON /CUNIT/ LUNMUC,LUNMUE,LUBADC
      COMMON /CALTEM/ICALUN,CALJET(4,1536)
#include "cgraph.for"
      DATA NDDINN,NDDOUT,MAXREC,IREADM,LABEL/3*0,1,0/
      DATA FREEZE/30*.FALSE./,JUSCRN/6/,LASTVW/0/,IPSVAR/1/
      DATA DSPDTL/6*.TRUE.,2*.FALSE.,.TRUE.,21*.FALSE./
      DATA LSTCMD/1/,LUNMUC,LUNMUE,LUBADC /10,11,13/,ICALUN/10/
      END
      BLOCKDATA
C  *--------------------------------------------------------
C  *  VERSION OF 09/10/78
C  *--------------------------------------------------------
C
      COMMON / CJCELL / NCELL(3),
     *                  NWIRES(3)
C       NCELL = NUMBER OF CELLS PER CHAMBER
C       NWIRES = NUMBER OF WIRES PER CELL
      DATA NCELL /24,24,48/
      DATA NWIRES /16,16,16/
C
#include "cjdrch.for"
C  ARRAY ABERR(8) SET TO MC VALUES, OVERWRITTEN BY KALIBR FOR REAL DATA
C                                                 J.OLSSON  17.9.80
C--------- END OF MACRO CJDRCH ------------
C       RDEC = MEAN RADII OF CHAMBER WALLS
C       PSIIN = ANGULAR INCREMENT OF FIRST WIRE LINE.
C       FIRSTW =  RADII OF FIRST MAIN POTENTIAL WIRES IN EACH RING
C       FSENSW =  RADII OF FIRST SENSE WIRES IN EACH RING
C       RINCR = DISTANCE BETWEEN TWO POTENTIAL WIRES
C       RDEPTH = DIFFERENCE OF TWO CHAMBER RADII
C       SWEDPL = WIRE STAGGERING, .GT.0 MEANS IN POS PHI FOR ZEROTH WIRE
C       YSUSPN = MAXIMUM VERTICAL DEPLACEMENT OF WIRE DUE TO GRAVITATION
C       TIMDEL = RESOLUTION IN EACH CHAMBER IN MM.
C       ZMAX = SENSITIVE HALF LENGTH OF WIRES
C       ZOFFS = OFFSET OF WIRES
C       ZRESOL = RESLUTION IN Z
C       ZNORM, ZAL, ZSCAL = PARAMETERS FOR CALCULATION OF Z - AMPLITUDES
C       DRIDEV, DRICOS, DRISIN = TILT ANGLE, COS, SIN
C       PEDES = OLD OVERALL Z AMPLIFIER PEDESTAL. UNUSED.
C       TZERO(3) = OVERALL DRIFT TIME ZEROES FOR EACH OF THE THREE JET
C               CHAMBER RINGS.
C       TOFIX(3) = TEMPORARY TZEROS FOR TOF AND PROP.TIME CORRECTIONS IN
C               PATTERN RECOGNITION
C       ABERR(8) = ABERRATION CORRECTION CONSTANTS USED IN FXYZ,JETXYZ
C       DRIROT(96,2),SINDRI(96,2),COSDRI(96,2) INDEPENDENT LORENTZ
C       ANGLES FOR THE 96 JET CHAMBER CELLS AND TWO DRIFT DIRECTIONS
C       AND THE CORRESPONDING SINES AND COSINES.
      DATA RDEC /196., 396.4 , 596.4, 797.33 /
      DATA PSIIN / 0.1309 , 0.1309 , 0.065450 /
      DATA FIRSTW / 206., 416., 627.33 /
      DATA FSENSW / 211., 421., 632.33 /
      DATA RINCR /10., 10., 10. /
      DATA RDEPTH / 200.4 /
      DATA SWDEPL / 0.20 /
      DATA YSUSPN / 0.07 /
      DATA TIMDEL / 6*0.35 /
      DATA ZMAX, ZOFFS, ZRESOL, ZNORM,ZAL,ZSCAL
     *          / 1180., -10., 1., 1000., 2687., 10. /
      DATA DRIDEV /0.349066 /,
     *     DRICOS /0.939693 /,
     *     DRISIN /0.342020 /
      DATA PEDES /50./
      DATA TZERO /3*0./
      DATA DRIROT/192*0.349066/
      DATA SINDRI/192*0.342020/
      DATA COSDRI/192*0.939693/
      DATA T0FIX /0.65, 0.71, 0.76/
      DATA ABERR / 0., 5., 5., 2.5,0.,0., 99999.,0./
      DATA DUMJDC /20*0./
C
C     COMMON / CJIONI / POTBEA, ZAROBE,
C    *                  POTTRI, ZAROTR,
C    *                  POTIVE, ZAROIV,
C    *                  POTRH0, ZAROR0,
C    *                  POTJET, ZAROJE,
C    *                  POTRH1, ZAROR1,
C    *                  POTRH2, ZAROR2,
C    *                  POTRH3, ZAROR3,
C    *                  POTOVE, ZAROOV,
C    *                  POTTOF, ZAROTO,
C    *                  POTVES, ZARVES,
C    *                  POTZJL, ZAROJL,
C    *                  POTZJR, ZAROJR
C       GIVES AVERAGE IONISATION POTENTIAL AND VALUE FOR Z*RHO/A FOR
C       BETHE BLOCH FORMULA FOR : BEAMPIPE, BEAM PIPE COUNTER, INNER
C       VESSEL WALL, 4 DIFFERENT ROHACELL LAYERS, DRIFTGAS , OUTER
C       VESSEL WALL, TOF COUNTER, VESSEL WALL IN Z, LEFT AND RIGHT
C       ALU SUPPORTS FOR WIRES AND ROHACELL
C     DATA POTBEA,ZAROBE        / 213.,1.3      /
C     DATA POTTRI,ZAROTR        / 36.1,.59      /
C     DATA POTIVE,ZAROIV        / 213.,1.3      /
C     DATA POTRH0, ZAROR0       / 102., 0.11 /
C     DATA POTJET,ZAROJE        / 284.4,.00295   /
C     DATA POTRH1,ZAROR1        / 102.,.07     /
C     DATA POTRH2,ZAROR2        / 102.,.07     /
C     DATA POTRH3, ZAROR3       / 102. , .09  /
C     DATA POTOVE,ZAROOV        / 213.,1.3     /
C     DATA POTTOF,ZAROTO        / 36.1,.59      /
C     DATA POTVES,ZARVES        / 213.,1.3     /
C     DATA POTZJL, ZAROJL       / 213., 1.3       /
C     DATA POTZJR, ZAROJR       / 213., 1.3       /
C
C
C     COMMON / CJSWLO / ITIMOD, MULSC, ELOSS
C     LOGICAL  ELOSS, MULSC
C       ITIMOD DETERMINES TYPE OF DRIFT TIME CALCULATION ( SEE JDTIM )
C       MULSC           IF TRUE MULTIPLE SCATTERING IS INCLUDED
C       ELOSS           IF TRUE ENERGY LOSS IS INCLUDED
C     DATA ITIMOD, MULSC, ELOSS / 1 , .TRUE., .TRUE. /
C
      COMMON / CJTRIG / PI, TWOPI
      DATA  PI, TWOPI / 3.141593, 6.283185 /
C
C     GEOMETRICAL CONST
C
#include "cgeo1.for"
C
C      BKGAUS = MAGNETIC FIELD IN KGAUSS
C      RPIP   = RADIUS OF BEAM PIPE
C      DRPIP, XRLPIP = THICKNESS OF BEAM PIPE IN MM AND RADL
C      RBPC   = RADIUS OF BEAM PIPE COUNTERS
C      DRBPC, XRLBPC = THICKNESS OF BEAM PIPE COUNTERS IN MM AND RADL
C      RITNK = INNER RADIUS OF THE TANK
C      DRITNK, XRLTKI = THICKNESS OF INNER TANK WALL IN MM AND RADL
C      R0ROH  = RADIUS OF ZEROTH ROHACELL SUPPORT
C      DR0ROH, XR0ROH = THICKNESS OF ZEROTH ROHACELL SUPPORT ( MM,RADL )
C      R1ROH  = RADIUS OF FIRST ROHACELL SUPPORT
C      DR1ROH, XR1ROH = THICKNESS OF FIRST ROHACELL SUPPORT ( MM, RADL )
C      R2ROH  = RADIUS OF SECOND ROHACELL SUPPORT
C      DR2ROH, XR2ROH = THICKNESS OF SECOND ROHACELL SUPPORT ( MM, RADL)
C      R3ROH  = RADIUS OF THIRD ROHACELL SUPPORT
C      DR3ROH, XR3ROH = THICKNESS OF THIRD ROHACELL SUPPORT ( MM, RADL)
C      ROTNK = OUTER RADIUS OF THE TANK
C      DROTNK, XRTKO  = THICKNESS OF OUTER TANK WALL ( MM, RADL )
C      RCOIL  = RADIUS OF COIL
C      DRCOIL, XRCOIL = THICKNESS OF COIL IN MM AND RADL
C      ZJM = Z COORDINATE OF ALU SUPPORT FOR ROHACELL ( - Z )
C      DZJM,XRZJM = THICKNESS IN MM AND RADL
C      ZJP = Z COORDINATE OF ALU SUPPORT FOR ROHACELL ( + Z )
C      DZJP,XRZJP = THICKNESS IN MM AND RADL
C      ZTKM = Z COORDINATE OF TANK WALL FOR INNER DETECTOR ( - Z )
C      DZTKM,XRZTKM = THICKNESS IN MM AND RADL
C      ZTKP = Z COORDINATE OF TANK WALL FOR INNER DETECTOR ( + Z )
C      DZTKP,XRZTKP = THICKNESS IN MM AND RADL
C      ZTOFPL = MAX Z COORDINATE COVERED BY TOF COUNTERSAT +Z
C      ZTOFMI = MAX Z COORDINATE COVERED BY TOF COUNTERSAT -Z
C      ZBPPL  = MAX Z COORDINATE OF BEAM PIPE COUNTERS AT +Z
C      ZBPMI  = MAX Z COORDINATE OF BEAM PIPE COUNTERS AT -Z
C      XRJETC = RADL OF CHAMBER GAS IN MM ( NOT THICKNESS OF GAS!! )
C
      DATA BKGAUS / 5. /
      DATA RPIP, DRPIP, XRLPIP       / 123.,  5.3, 0.05 /
      DATA RBPC, DRBPC, XRLBPC       / 150., 10., 0.02 /
      DATA RITNK, DRITNK, XRLTKI     / 165.,  7., 0.08 /
      DATA R0ROH, DR0ROH, XR0ROH     / 181., 15., 0.008/
      DATA R1ROH, DR1ROH, XR1ROH     / 376., 30.,0.011/
      DATA R2ROH, DR2ROH, XR2ROH     / 586., 30.,0.011/
      DATA R3ROH, DR3ROH, XR3ROH     / 799.04, 25., 0.008 /
      DATA ROTNK, DROTNK, XRLTKO     / 847., 12., 0.14 /
      DATA RTOF, DRTOF, XRTOF        / 920., 20., 0.05 /
      DATA RCOIL, DRCOIL, XRCOIL     / 950., 90., 1.   /
      DATA ZJM , DZJM, XRZJM         / -1180., -5., 0.06 /
      DATA ZJP , DZJP, XRZJP         / 1180.,  5., 0.06 /
      DATA ZTKM,DZTKM,XRZTKM         / -1470.,  -7., 0.08 /
      DATA ZTKP,DZTKP,XRZTKP         / 1470.,  7., 0.08 /
      DATA ZTOFPL,ZTOFMI        /1615.,-1615./
      DATA ZBPPL,ZBPMI          / 750.,-750. /
      DATA XRJETC               / 29910.        /
C
C      LEAD GLASS DATA
C
C
C      RLG = INNER RADIUS OF LEAD GLASS ARRAY
C      ZLGPL,ZLGMI = MAXIMUM Z-COMPONENT OF CENTRAL LEAD GLASS ARRAY
      DATA RLG,ZLGPL,ZLGMI/1100.,1696.,-1696./
C
C      OUTR2 = (RLG + BLDEP)
C      CTLIMP = COS THMAX FOR PARTICLES HITTING THE CENTRAL LGARR
C      CTLIMM = COS THMAX FOR PARTICLES HITTING THE CENTRAL LGARR
      DATA OUTR2,CTLIMP,CTLIMM/1400.,0.839,-0.839/
C
C      DELFI = ANGULAR INCREMENT CORRESPONDING TO ONE BLOCK
C      BLXY  = DIMENSION OF ONE LEAD GLASS BLOCK IN XY DIRECTION
C      BLZ   = DIMENSION OF ONE LEAD GLASS BLOCK IN Z DIRECTION
C      BLDEP = DEPTH OF A LEAD GLASS BLOCK
C      BLFI = DIMENSION OF A BLOCK IN PHI
      DATA DELFI,BLXY,BLZ,BLDEP,BLFI/0.0748,140.,106.,300.,82.28/
C
C      ZENDPL = Z COORDINATE FOR END CAP LG FACE AT +Z
C      ZENDMI = Z COORDINATE FOR END CAP LG FACE AT -Z
C      DEPEND = DEPTH OF LG COUNTER END CAP
      DATA ZENDPL,ZENDMI,DEPEND/1514.,-1514.,226./
C
C      XHOL1,XHOL2  PARAMETRES FOR HOLE AROUND PIPE
C      YHOL1,YHOL2  PARAMETERS FOR HOLE AROUND PIPE
      DATA XHOL1,XHOL2/140.,320./
      DATA YHOL1,YHOL2/140.,320./
C
C
      END
