C   20/03/97 703211012  MEMBER NAME  JEOSUM6  (PATRECSR)    SHELTRAN
C
C                        --- MACRO CADMIN ---
C
      LOGICAL*1 LBREAD
C
      COMMON / CADMIN / IEVTP,NRREAD,NRWRIT,NRERR,LBREAD(4),IFLG,IERCAL,
     +                  ISMEAR,IJETCI,NFLAGS(10)
C   20/03/97 703202250  MEMBER NAME  CALIBR   (PATRECSR)    SHELTRAN
C
C                                 NFLAGS IS AN ARRAY OF GENERAL FLAGS
C                                   (1) : USED BY RDDATE
C                                   (2) : USED BY RDTRIG
C                                   (3) : USED BY RDTRIG
C                                   (4) : USED BY RDTRIG / PRSTAT
C                                   (5) : USED BY EVREAD -COUNTS RECORDS
C                                   (6) : USED BY SUPERV -COUNTS ERRORS
C                                   (7) : USED BY EVWRIT -'HEAD'LESS EVS
C                                   (8) : USED BY EVREAD/RDMTCO (EVWRIT)
C                                   (9) : USED BY RDMTCO/EVWRIT
C                                  (10) : FREE
C
C                                  BLOCK DATA SET IN MEMBER JADEBD
C
C----------------------------------------------------------------------
C            MACRO CALIBR .... JADE CALIBRATION DATA COMMON
C----------------------------------------------------------------------
      COMMON/CALIBR/ ACALIB(1000)
                     DIMENSION HCALIB(100),ICALIB(100)
                     EQUIVALENCE(ACALIB(1),HCALIB(1),ICALIB(1))
C------------------------ END OF MACRO CALIBR -------------------------
C   20/03/97 703202250  MEMBER NAME  CALIBR0  (PATRECSR)    SHELTRAN
C----------------------------------------------------------------------
C            MACRO CALIBR .... JADE CALIBRATION DATA COMMON
C----------------------------------------------------------------------
      COMMON/CALIBR/HLGMAI(5760),HTAGSY(384),HJTCAL(51000),HMUCAL(3806),
     1              LGSTAT(90),LTAGST(6),JTSTAT(912),MUSTAT(100),
     1              RLGSUR(800),RTGSUR(200),RJTSUR(6),HJTSUR(9216),
     1              RMUSUR(1760),HFIXED(4000)
C------------------------ END OF MACRO CALIBR -------------------------
C   20/03/97 703202250  MEMBER NAME  CBCSMX   (PATRECSR)    SHELTRAN
C-----------------------------------------------------------------------
C             MACRO CBCSMX.... BOS COMMON + SIZE DEFINITION
C
C             THIS MACRO DEFINES THE IDATA/HDATA/ADATA NAMES AND
C             FIXES THE ACTUAL SIZE OF /BCS/. IT IS THUS IDEAL FOR
C             MAIN PROGRAMS OR THE SUPERVISOR. LDATA CAN BE USED BY BINT
C
C-----------------------------------------------------------------------
C
      COMMON /BCS/ IDATA(60000)
      DIMENSION HDATA(120000),ADATA(60000)
      EQUIVALENCE (HDATA(1),IDATA(1),ADATA(1))
      DATA  LDATA / 60000 /
C
C------------------------ END OF MACRO CBCSMX --------------------------
C   20/03/97 703202250  MEMBER NAME  CBCSMX0  (PATRECSR)    SHELTRAN
C-----------------------------------------------------------------------
C             MACRO CBCSMX.... BOS COMMON + SIZE DEFINITION
C
C             THIS MACRO DEFINES THE IDATA/HDATA/ADATA NAMES AND
C             FIXES THE ACTUAL SIZE OF /BCS/. IT IS THUS IDEAL FOR
C             MAIN PROGRAMS OR THE SUPERVISOR. LDATA CAN BE USED BY BINT
C
C-----------------------------------------------------------------------
C
      COMMON /BCS/ IDATA(45000)
      DIMENSION HDATA(90000),ADATA(45000)
      EQUIVALENCE (HDATA(1),IDATA(1),ADATA(1))
      DATA  LDATA / 45000 /
C
C------------------------ END OF MACRO CBCSMX --------------------------
C   20/03/97 703202250  MEMBER NAME  CBIN     (PATRECSR)    SHELTRAN
C----------------------------------------------------------------------
C                MACRO CBIN .... PARAMETERS OF READMC
C----------------------------------------------------------------------
      COMMON /CBIN/ TIME(6),ZOF,ZRS,ZL,ZSC,EPSI(3),DOUB(3),IRN(3)
C------------------------ END OF MACRO CBIN ---------------------------
C   20/03/97 703202250  MEMBER NAME  CBOSIBLN (PATRECSR)    FORTRAN
C---------------------------------------
C  MACRO CBOSIBLN .... BOS BANK POINTERS
C---------------------------------------
      COMMON/CBOSIB/
     #             IBHEAD,IBPATR,IBJHTL,IBTPEV,IBTPTR,IBFADC
     #            ,IBGVTX,IBLGCL,IBDEDX,IBATOF,IBTOFR,IBACLS
     #            ,IBLATC,IBTRIG,IBATST,IBATBP,IBALGL,IBTAGG
     #            ,IBATAG,IBJETC,IBJETV,IBTAGC,IBMUEV,IBMPRS
     #            ,IBN50S,IBALGN,IBZVTX,IBMUR1,IBMUR2,IBTPVX
     #            ,IBMTCO,IBMUCO,IBMJET,IBVECT,IBDUM1,IBDUM2
C------- END OF MACRO CBOSIBLN ---------
C   20/03/97 703202250  MEMBER NAME  CCYCP    (PATRECSR)    SHELTRAN
C----------------------------------------------------------------------
C           MACRO CCYCP .... JET CHAMBER HIT POINTERS (PATREC)
C----------------------------------------------------------------------
      INTEGER*4 HPTSEC
      COMMON/CCYCP/HPTSEC(98)
C     HPTSEC(I) = CDATA POINTER TO 1ST I*2 WORD FOR 1ST HIT OF CELL I
C------------------------ END OF MACRO CCYCP --------------------------
C   20/03/97 703202250  MEMBER NAME  CDATA    (PATRECSR)    SHELTRAN
C----------------------------------------------------------------------
C             MACRO CDATA .... BOS COMMON.
C
C             THIS MACRO ONLY DEFINES THE IDATA/HDATA/ADATA NAMES.
C             THE ACTUAL SIZE OF /BCS/ IS FIXED ON MACRO CBCSMX
C             OR BY OTHER MEANS. A DEFAULT SIZE OF 40000 IS GIVEN HERE.
C
C----------------------------------------------------------------------
C
      COMMON /BCS/ IDATA(40000)
      DIMENSION HDATA(80000),ADATA(40000),IPNT(50)
      EQUIVALENCE (HDATA(1),IDATA(1),ADATA(1)),(IPNT(1),IDATA(55))
      EQUIVALENCE (NWORD,IPNT(50))
C
C------------------------ END OF MACRO CDATA --------------------------
C   20/03/97 703202250  MEMBER NAME  CDATAMIN (PATRECSR)    SHELTRAN
C--------------------------------------------------
C  MACRO CDATAMIN .... MINIMUM SIZE JADE BOS COMMON
C--------------------------------------------------
      COMMON /BCS/ IDATA(1)
      REAL*4 ADATA(1)
      INTEGER*2 HDATA(2)
      EQUIVALENCE (HDATA(1),IDATA(1),ADATA(1))
C------------- END OF MACRO CDATAMIN ----------
C   20/03/97 703202250  MEMBER NAME  CDEDEDX  (PATRECSR)    SHELTRAN
CC---------------------------------------------------------------------
C         MACRO CDEDEDX  ---   LAST UPDATE: 07.04.87  L. SMOLIK
C-----------------------------------------------------------------------
      INTEGER*2 HDATA
C-----------
      COMMON/CALIBR/JPOINT(1)
      DIMENSION ACALIB(1)
      EQUIVALENCE(JPOINT(1),ACALIB(1))
C-----------
C     USER CAN CHANGE NHFCUT:   (L.BECKER 27.8.86)
C     DEFAULT:  NHFCUT=15  (JADEBD)
C
      COMMON /CDEDXU/ NHFCUT,PMCUT
C
      DATA NTRTOT / 60 /
C-----DATA NHFCUT / 15 /
C
      DATA ICALL/0/
      DATA ELMASS/0.000511/,PIOMAS/0.139/,FKAMAS/0.494/,PROTMA/0.938/
      DIMENSION  IZB(60),IJC(60),IJH(60),NW(60),LH(60)
      DIMENSION  LRFL(60),ALU(60),ARU(60),S(60)
      DIMENSION  G(60),DT(60),DL(60),DW(60),FCORR(60)
      DIMENSION  IXL(60,4),IXH(60,4)
      DIMENSION  ID0(20),AP(20),BP(20),CP(20),CL(20),CA(20)
C--DAYS OF GASFILLING           3.10.83
      DATA ID0 /150,240,50,150,38,160,29,119,103,266,13,153,153,60,
     & 60,190,190,42,107,217/
C--PRESSURE COEFFICIENTS       12.07.84
      DATA AP /3915.,4073.,4091.,4114.,4108.,4136.,4158.,4111.,12*1. /
      DATA BP /0.284,1.082,1.665,1.940,0.829,1.929,2.311,2.573,12*0. /
      DATA CP /7.2, 12.6,    5.0, 5.4,     9.9,6.4, 4.1,5.2, 12*0. /
C--SUBPERIOD FACTORS
      INTEGER LSP(3,20) / 3*400, 40,400,400, 50, 80,400, 68,100,400,
     *                    48*400 /
      REAL    SPF(3,20) / 3* 1., 1.,.91, 1.,.99, 1.,.97,1.01,.97,.99,
     *                    48*1. /
C--ATTACHMENT COEFFICIENTS  3.10.83
      DATA CL /0.00,0.70,1.30,1.85,2.30,2.70,3.05,3.40,3.65,3.90,
     +         4.15,4.40,4.60,4.75,4.95,5.10,5.20,5.30,5.40,5.50/
C
      DATA CA /1.51,1.77, 0.90,0.72, 0.618, 0.524, 0.563, 0.400,
     +         0.453, 0.500, 0.730, 0.614, 0.514, 0.636, 0.619,
     +         0.385,0.354,0.398,0.242,0.270/
C
C--SATURATION COEFFICIENTS
      REAL SATSO(7,20) / .62,4.0, .58,3.3, .69,4.0, .0007,
     *                   .57,4.0, .50,2.8, .52,3.1, .0007,
     *                   .52,3.6, .50,2.5, .51,3.5, .0005,
     *                   .47,3.2, .50,2.2, .50,2.8, .0005,
     *                   .35,1.7, .42,1.3, .44,2.6, .0005,
     *                   .35,3.1, .35,2.9, .40,3.9, .0005,
     *                   .33,3.5, .35,2.0, .39,2.9, .0005,
     *                   .31,2.4, .36,1.3, .41,2.3, .0005,
     *                   .25,2.2, .37,1.5, .40,1.8, .0005,
     *                   .25,2.8, .44,2.6, .41,1.6, .0005,
     *                   .22,2.0, .41,1.7, .40,1.4, .0005,
     *                   .33,.96, .46,.95, .43,1.3, .0005,
     *                   .34,.85, .45,.93, .49,0.78,.0005,
     *                   .30,1.0, .40,1.2, .49,0.80,.0005,
     *                   .28,1.4, .43,1.0, .52,0.76,.0005,
     *                   .25,1.3, .38,1.0, .51,0.66,.0005,
     *                   .29,1.66,.39,1.25,.55,0.67,.0005,
     *                   .264,2.34,.368,1.56, .436,1.35,.0005,
     *                   .252,2.58,.345,1.57, .407,1.19,.0005,
     *                   .259,2.28,.350,1.47, .424,1.16,.0005/
      REAL SATTO(6,20) / .77,.98, .58,.76, .45,.57,
     *                   .4 ,.72, .27,.35, .4 ,.60,
     *                   .26,.46, .41,.53, .51,.80,
     *                   .57,.89, .27,.48, .99,2.0,
     *                   .32,.59, .85,1.1, .23,.54,
     *                   .18,.23, .38,.75, .37,.50,
     *                   .28,.50, .99,1.2, .99,1.3,
     *                   .21,.40, .62,.89, .99,1.3,
     *                   .50,1.1, .50,.87, .50,1.1,
     *                   .50,.87, .50,.90, .50,1.0,
     *                   .50,.98, .50,.93, .50,.92,
     *                   .50,.78, .50,.73, .50,.76,
     *                   .50,.78, .50,.71, .50,.76,
     *                   .50,.68, .50,.69, .50,.77,
     *                   .50,.77, .50,.77, .50,1.12,
     *                   .50,1.0, .50,.88, .50,1.2 ,
     *                   .50,1.11, .50,.96, .50,1.23,
     *                   .50,15.0, .50,1.89, .50,5.25,
     *                   .50,1.87, .50,10.0, .50,10.0,
     *                   .50,1.98, .50,1.52, .50,10.0/
      REAL SATFAC(3,20) / 3*400. ,
     *                    3*400. ,
     *                    399.,    402.,    390.,
     *                    399.,    410.,    401.,
     *                    704.,    701.,    646.,
     *                    717.,    647.,    629.,
     *                    645.,    653.,    637.,
     *                    656.,    734.,    671.,
     *                    389.,    471.,    481.,
     *                    333.,    388.,    420.,
     *                    348.,    445.,    455.,
     *                    394.,    522.,    481.,
     *                    380.,    487.,    500.,
     *                    373.,    467.,    512.,
     *                    400.,    522.,    557.,
     *                    375.,    537.,    593.,
     *                    357.,    526.,    616.,
     *                    358.,    505.,    508.,
     *                    345.,    497.,    486.,
     *                    357.,    504.,    494./
      REAL SATQUA(3,20) / 12*0. ,
     *                    0.0054,  0.0000,  0.0051,
     *                    0.0056,  0.0000,  0.0065,
     *                    0.0070,  0.0000,  0.0036,
     *                    0.0000,  0.0000,  0.0000,
     *                   -0.0008,  0.0003,  0.0022,
     *                   -0.0018, -0.0014,  0.0006,
     *                   -0.0025, -0.0037, -0.0009,
     *                   -0.0039, -0.0049, -0.0020,
     *                   -0.0029, -0.0035, -0.0030,
     *                   -0.0025, -0.0022, -0.0012,
     *                   -0.0017, -0.0019, -0.0018,
     *                    0.0021,  0.0013,  0.0046,
     *                    0.0010,  0.0009,  0.0046,
     *                    0.0021,  0.0018,  0.0023,
     *                    0.0017,  0.0016,  0.0028,
     *                    0.0021,  0.0013,  0.0025/
C--CROSS TALK
      REAL CTALK(4) / .065, .031, .014, .007 /
C--FIELD DISTORTIONS
      REAL FTORT(2,8) / 1.04,.0 , 1.03,.20, 1.  ,.12, 1.  ,.08,
     *                  1.10,.18, 1.05,.08, 1.  ,.0 , 1.  ,.0  /
      DIMENSION IC(6),IHDT(16)
      LOGICAL TBIT
      DATA MTRNO1/Z FE0000/, MTRNO2/Z FE/
C-----DATA SALF/.342/, CALF/.940/
      DIMENSION TMAX(2,3),TSLP(2,3),VDREL(20)
      DATA TMAX /71.,80.,143.,159.,110.,115./
      DATA TSLP /3.2,3.6, 3.2, 3.6,1.73,1.87/
      DATA VDREL / 1.02,1.05,1.05,1.07, 16*1.07 /
C     DATA NMINO /0/, DMINX /0./, NMINX /0/
CC--------------------END OF MACRO------------------------------------
C   20/03/97 703202250  MEMBER NAME  CDEDEDX0 (PATRECSR)    SHELTRAN
CC---------------------------------------------------------------------
C         MACRO CDEDEDX  ---   LAST UPDATE: 27.08.86  L. BECKER
C-----------------------------------------------------------------------
      INTEGER*2 HDATA
C-----------
      COMMON/CALIBR/JPOINT(1)
      DIMENSION ACALIB(1)
      EQUIVALENCE(JPOINT(1),ACALIB(1))
C-----------
C     USER CAN CHANGE NHFCUT:   (L.BECKER 27.8.86)
C     DEFAULT:  NHFCUT=15  (JADEBD)
C
      COMMON /CDEDXU/ NHFCUT
C
      DATA NTRTOT / 60 /
C-----DATA NHFCUT / 15 /
      DATA ICALL/0/
      DATA ELMASS/0.000511/,PIOMAS/0.139/,FKAMAS/0.494/,PROTMA/0.938/
      DIMENSION  IZB(60),IJC(60),IJH(60),NW(60),LH(60)
      DIMENSION  LRFL(60),ALU(60),ARU(60),S(60)
      DIMENSION  G(60),DT(60),DL(60),DW(60),FCORR(60)
      DIMENSION  IXL(60,4),IXH(60,4)
      DIMENSION  ID0(20),AP(20),BP(20),CP(20),CL(20),CA(20)
C--DAYS OF GASFILLING           3.10.83
      DATA ID0 /150,240,50,150,38,160,29,119,103,266,13,153,153,60,
     &,6*0/
C--PRESSURE COEFFICIENTS       12.07.84
      DATA AP /3915.,4073.,4091.,4114.,4108.,4136.,4158.,4111.,12*1. /
      DATA BP /0.284,1.082,1.665,1.940,0.829,1.929,2.311,2.573,12*0. /
      DATA CP /7.2, 12.6,    5.0, 5.4,     9.9,6.4, 4.1,5.2, 12*0. /
C--SUBPERIOD FACTORS
      INTEGER LSP(3,20) / 3*400, 40,400,400, 50, 80,400, 68,100,400,
     *                    48*400 /
      REAL    SPF(3,20) / 3* 1., 1.,.91, 1.,.99, 1.,.97,1.01,.97,.99,
     *                    48*1. /
C--ATTACHMENT COEFFICIENTS  3.10.83
      DATA CL /0.00,0.70,1.30,1.85,2.30,2.70,3.05,3.40,3.65,3.90,
     +         4.15,4.40,4.60,4.75,4.95,5.10,5.20,5.30,5.40,5.50/
C
      DATA CA /1.51,1.77, 0.90,0.72, 0.618, 0.524, 0.563, 0.400,
     +         0.453, 0.500, 0.730, 0.614, 0.514,7*0.3 /
C
C--SATURATION COEFFICIENTS
      REAL SATSO(7,20) / .62,4.0, .58,3.3, .69,4.0, .0007,
     *                   .57,4.0, .50,2.8, .52,3.1, .0007,
     *                   .52,3.6, .50,2.5, .51,3.5, .0005,
     *                   .47,3.2, .50,2.2, .50,2.8, .0005,
     *                   .35,1.7, .42,1.3, .44,2.6, .0005,
     *                   .35,3.1, .35,2.9, .40,3.9, .0005,
     *                   .33,3.5, .35,2.0, .39,2.9, .0005,
     *                   .31,2.4, .36,1.3, .41,2.3, .0005,
     *                   .25,2.2, .37,1.5, .40,1.8, .0005,
     *                   .25,2.8, .44,2.6, .41,1.6, .0005,
     *                   .22,2.0, .41,1.7, .40,1.4, .0005,
     *                   .33,.96, .46,.95, .43,1.3, .0005,
     *                   .34,.85, .45,.93, .49,0.78,.0005, 49*0./
      REAL SATTO(6,20) / .77,.98, .58,.76, .45,.57,
     *                   .4 ,.72, .27,.35, .4 ,.60,
     *                   .26,.46, .41,.53, .51,.80,
     *                   .57,.89, .27,.48, .99,2.0,
     *                   .32,.59, .85,1.1, .23,.54,
     *                   .18,.23, .38,.75, .37,.50,
     *                   .28,.50, .99,1.2, .99,1.3,
     *                   .21,.40, .62,.89, .99,1.3,
     *                   .50,1.1, .50,.87, .50,1.1,
     *                   .50,.87, .50,.90, .50,1.0,
     *                   .50,.98, .50,.93, .50,.92,
     *                   .50,.78, .50,.73, .50,.76,
     *                   .50,.78, .50,.71, .50,.76, 42*0. /
      REAL SATFAC(3,20) / 3*400. ,
     *                    3*400. ,
     *                    399.,    402.,    390.,
     *                    399.,    410.,    401.,
     *                    704.,    701.,    646.,
     *                    717.,    647.,    629.,
     *                    645.,    653.,    637.,
     *                    656.,    734.,    671.,
     *                    389.,    471.,    481.,
     *                    333.,    388.,    420.,
     *                    348.,    445.,    455.,
     *                    394.,    522.,    481.,
     *                    380.,    487.,    500.,    21*500.  /
      REAL SATQUA(3,20) / 12*0. ,
     *                    0.0054,  0.0000,  0.0051,
     *                    0.0056,  0.0000,  0.0065,
     *                    0.0070,  0.0000,  0.0036,
     *                    0.0000,  0.0000,  0.0000,
     *                   -0.0008,  0.0003,  0.0022,
     *                   -0.0018, -0.0014,  0.0006,
     *                   -0.0025, -0.0037, -0.0009,
     *                   -0.0039, -0.0049, -0.0020,
     *                   -0.0029, -0.0035, -0.0030, 21*0.  /
C--CROSS TALK
      REAL CTALK(4) / .065, .031, .014, .007 /
C--FIELD DISTORTIONS
      REAL FTORT(2,8) / 1.04,.0 , 1.03,.20, 1.  ,.12, 1.  ,.08,
     *                  1.10,.18, 1.05,.08, 1.  ,.0 , 1.  ,.0  /
      DIMENSION IC(6),IHDT(16)
      LOGICAL TBIT
      DATA MTRNO1/Z FE0000/, MTRNO2/Z FE/
C-----DATA SALF/.342/, CALF/.940/
      DIMENSION TMAX(2,3),TSLP(2,3),VDREL(20)
      DATA TMAX /71.,80.,143.,159.,110.,115./
      DATA TSLP /3.2,3.6, 3.2, 3.6,1.73,1.87/
      DATA VDREL / 1.02,1.05,1.05,1.07, 16*1.07 /
C     DATA NMINO /0/, DMINX /0./, NMINX /0/
CC--------------------END OF MACRO------------------------------------
C   20/03/97 703202250  MEMBER NAME  CDSMAX   (PATRECSR)    SHELTRAN
C----------------------------------------------------------------------
C           MACRO CDSMAX .... PATTERN RECOGNITION CONSTANTS.
C----------------------------------------------------------------------
      COMMON/CDSMAX/DSMAX(16,3,2),DIRWR1(24,2),DIRWR3(48,2)
     *             ,DHALF(16,3,2),DTWICE(16,3,2),HMCH(16,3,2)
     *             ,IBCK(9),DBCK(30),TRMATS(96,2),TRMATC(96,2)
C------------------------ END OF MACRO CDSMAX -------------------------
C   20/03/97 703202250  MEMBER NAME  CGEOV    (PATRECSR)    SHELTRAN
C-----------------------------------------------------------------------
C                            MACRO CGEOV      VERTEX CHAMBER GEOMETRY
C-----------------------------------------------------------------------
C
      COMMON / CGEOV  / RPIPV,DRPIPV,XRLPIV,RVXC,DRVXC,XRLVXC,
     +                  ZVXCM,DZVCM,XRZVCM, ZVXCP,DZVCP,XRZVCP,
     +                  XRVTXC
C
C--------------------------- END OF MACRO CGEOV ------------------------
C
C   20/03/97 703202250  MEMBER NAME  CGEO1    (PATRECSR)    SHELTRAN
C-----------------------------------------------------------------------
C                            MACRO CGEO1 .... JADE GEOMETRY
C-----------------------------------------------------------------------
C
      COMMON / CGEO1 / BKGAUS,
     +                 RPIP,DRPIP,XRLPIP,   RBPC,DRBPC,XRLBPC,
     +                 RITNK,DRITNK,XRLTKI, R0ROH,DR0ROH,XR0ROH,
     +                 R1ROH,DR1ROH,XR1ROH, R2ROH,DR2ROH,XR2ROH,
     +                 R3ROH,DR3ROH,XR3ROH, ROTNK,DROTNK,XRLTKO,
     +                 RTOF,DRTOF,XRTOF,    RCOIL,DRCOIL,XRCOIL,
     +                 ZJM,DZJM,XRZJM,ZJP,DZJP,XRZJP,ZTKM,DZTKM,XRZTKM,
     +                 ZTKP,DZTKP,XRZTKP,ZBPPL,ZBPMI,ZTOFPL,ZTOFMI,
     +                 XRJETC,RLG,ZLGPL,ZLGMI,OUTR2,CTLIMP,
     +                 CTLIMM,DELFI,BLXY,BLZ,BLDEP,ZENDPL,ZENDMI,DEPEND,
     +                 XHOL1,XHOL2,YHOL1,YHOL2,BLFI
C
C------------------------- END OF MACRO CGEO1 --------------------------
C
C   20/03/97 703202250  MEMBER NAME  CGEO2    (PATRECSR)    SHELTRAN
C-----------------------------------------------------------------------
C                            MACRO CGEO2 .... JADE TAGGING GEOMETRY
C-----------------------------------------------------------------------
C
      COMMON / CGEO2 / FENDC,XYHOL1,XYHOL2,BLDPFW,ZMINBL,ZPLUBL,
     +                 XSC(2),YSC(2),RSC(2),ZMISC(2),ZPLSC(2),DZSC,
     +                 CHX(3,4),CHY(3,4),CHZ(3,4),WLEN,PITCH,WZDIS
C
C--------------------------- END OF MACRO CGEO2 ------------------------
C
C   20/03/97 703202250  MEMBER NAME  CGEO2COM (PATRECSR)    SHELTRAN
C---------  MACRO CGEO2COM       GEOMETRY OF FORWARD DETECTOR   -------
C
C---  LEAD GLASS BLOCKS
C     FENDC:  WIDTH (AND HEIGHT) OF BLOCKS
C     XYHOL1: DISTANCE FROM BEAM CENTRE TO EDGE OF FIRST
C             HORIZONTAL BLOCK
C     XYHOL2: DISTANCE FROM BEAM CENTRE TO EDGE OF FIRST
C             VERTICAL BLOCK
C     BLDPFW: DEPTH OF BLOCKS
C     ZMINBL: DISTANCE FROM INTERACTION POINT TO FRONT SURFACE
C             OF LEAD GLASS BLOCKS (-Z-DIRECTION, PLUTO/CELLO)
C     ZPLUBL: DISTANCE FROM INTERACTION POINT TO FRONT SURFACE
C             OF LEAD GLASS BLOCKS (+Z-DIRECTION, MARK J)
C---  LUMONITORS
C     XSC:    LENGTH OF LONG EDGE (1: A-COUNTER, 2: B-COUNTER)
C     YSC:    LENGTH OF SHORT EDGE
C     RSC:    DISTANCE FROM BEAM CENTRE TO CENTRE OF INNERMOST LONG
C             EDGE ON A-COUNTER
C     ZMISC:  DISTANCE FROM INTERACTION POINT TO FRONT SURFACE OF
C             LUMONITOR (-Z-DIRECTION, TOWARDS PLUTO/CELLO)
C     ZPLSC:  DISTANCE FROM INTERACTION POINT TO FRONT SURFACE OF
C             LUMONITOR (+Z-DIRECTION, TOWARDS MARK J)
C     DZSC:   THICKNESS OF LUMONITORS
C
C---  DRIFT CHAMBERS
C
C  CHX(I,J): XPOSITION OF WIRE 0 IN CHAMBER I (1-3) IN PLANE J (1-4)
C  CHY AND CHZ ANALOGOUS.     WLEN IS SENSITIVE LENGTH OF WIRES
C  PITCH IS WIRE DISTANCE IN XY-PLANE, WZDIS DISTANCE IN Z BETWEEN
C  THE ODD AND EVEN WIRE PLANES
C  WIRE 0 IS CLOSEST TO THE BEAM LINE
C  PRESENT DATA SETTING OF WIRES BASED ON "EDUCATED GUESSES"
C
C     ALL VALUES IN MM      BLOCK DATA SETTING IN SUBR. JADISP
C
C     DATA FENDC/81./,XYHOL1,XYHOL2/141.,151.5/,BLDPFW/400./,
C    1 ZMINBL,ZPLUBL /-5250.,5250./,
C    2 XSC /230.,150./, YSC /150.,70./, RSC /152.48,192.48/,
C    3 ZMISC/-4235.,-4135./, ZPLSC/4235.,4135./, DZSC/6./,
C    4 CHX/140.,-400.,-140.,140.,-400.,-140.,
C    5 140.,-400.,-140.,140.,-400.,-140./,
C    6 CHY /-400.,140.,-400.,-400.,140.,-400.,
C    7 -400.,140.,-400.,-400.,140.,-400./,
C    8 CHZ /-4770.,-4720.,-4770.,-4020.,-3970.,-4020.,
C    9 4020.,3970.,4020.,4770.,4720.,4770./,
C    A WLEN/800./, PITCH /25./, WZDIS/10./
C
C------ END MACRO CGEO2COM
C   20/03/97 703202250  MEMBER NAME  CGEO3    (PATRECSR)    SHELTRAN
C----------------------------------------------------------------------
C      MACRO CGEO3 .... JADE FORWARD DETECTOR GEOMETRY, 1981-3 VERSION
C----------------------------------------------------------------------
C
      COMMON / CGEO3 / ZPLUM2,ZMINM2,NRPBSC,PBSCR(4),PBSCZ(4)
C
C------------------------ END OF MACRO CGEO3 --------------------------
C
C   20/03/97 703202250  MEMBER NAME  CGEO3COM (PATRECSR)    SHELTRAN
C----------------------------------------------------------------------
C      MACRO CGEO3COM..  COMMENTS TO CONTENT OF COMMON /CGEO3/
C----------------------------------------------------------------------
C  ZMINM2 AND ZPLUM2 ARE DISTANCES FROM INTERACTION POINT TO FRONT SUR-
C  FACE OF -Z AND +Z FORWARD LEADGLASS, 1981-82 VERSION. THE BLOCK
C  DIMENSIONS ARE THE SAME AS FOR 1979-80, IN CGEO2
C
C  1983- ... TAGGING APPARATUS: LEAD SCINTILLATER UNITS
C  NRPBSC ARE NUMBER OF MODULES ON ONE SIDE IN Z
C  PBSCR1-4 ARE THE RADII FROM BEAMLINE TO SEGMENT JOINTPOINTS
C  PBSCZ1-4 GIVE THE Z COORDINATES, FROM MINUS Z TO PLUS Z
C------------------------ END OF MACRO CGEO3COM -----------------------
C   20/03/97 703202250  MEMBER NAME  CGRAPH   (PATRECSR)    SHELTRAN
C-----------------------------------------------------------------------
C                            MACRO CGRAPH .... GRAPHICS COMMON
C-----------------------------------------------------------------------
C
      LOGICAL DSPDTL,SSTPS,PSTPS,FREEZE
C
      COMMON / CGRAPH / JUSCRN,NDDINN,NDDOUT,IDATSV(11),ICREC,MAXREC,
     +                  LSTCMD,ACMD,LASTVW,ISTANV,
     +                  SXIN,SXAX,SYIN,SYAX,XMIN,XMAX,YMIN,YMAX,
     +                  DSPDTL(30),SSTPS(10),PSTPS(10),FREEZE(30),
     +                  IREADM,LABEL,LSTPS(10),IPSVAR
C
C------- END OF MACRO CGRAPH -------------------------------------------
C
C   20/03/97 703202250  MEMBER NAME  CGRSCL   (PATRECSR)    SHELTRAN
C
C-----------------------------------------------------------------------
C                            MACRO CGRSCL .... GRAPHICS VIEW SCALES
C-----------------------------------------------------------------------
C
      COMMON  / CGRSCL / XMINST(30), XMAXST(30), YMINST(30)
C
C------- END OF MACRO CGRSCL -------------------------------------------
C
C   20/03/97 703202250  MEMBER NAME  CHEADR   (PATRECSR)    SHELTRAN
C-------------------------------
C  MACRO CHEADR .... HEADER BANK
C-------------------------------
      COMMON /CHEADR/ IHEADR(54)
      INTEGER*2 HHEADR(108)
      EQUIVALENCE (IHEADR(1),HHEADR(1))
C --
C --  HHEADR(17) = EXPERIMENT NUMBER
C --  HHEADR(18) = RUN NUMBER
C --  HHEADR(19) = EVENT NUMBER
C --  HHEADR(38) = MAGNETIC FIELD (GAUSS)
C --
C--------- END OF MACRO CHEADR ------------
C   20/03/97 703202250  MEMBER NAME  CHSYM    (PATRECSR)    SHELTRAN
C---------  MACRO CHSYM    SYMBOLS USED IN GRAPHICS WRITING -----
      COMMON /CHSYM/ HSYM(36)
C------ END MACRO CHSYM
C   20/03/97 703202250  MEMBER NAME  CIOUNI   (PATRECSR)    SHELTRAN
C==MACRO CIOUNI=========================================
      COMMON/CIOUNI/IUNIT,JUNIT,NCALI,KUNITA(10),LUNITA(10)
C==ENDMACRO CIOUNI========================================
C   20/03/97 703202250  MEMBER NAME  CJDRCH   (PATRECSR)    SHELTRAN
C-----------------------------------------------------------------------
C                            MACRO CJDRCH .... JET CHAMBER CONSTANTS.
C-----------------------------------------------------------------------
C
      COMMON / CJDRCH / RDEC(4),PSIIN(3),RINCR(3),FIRSTW(3),FSENSW(3),
     +                  RDEPTH,SWDEPL,YSUSPN,TIMDEL(2,3),ZMAX,ZOFFS,
     +                  ZRESOL,ZNORM,ZAL,ZSCAL,DRIDEV,DRICOS,DRISIN,
     +                  PEDES,TZERO(3),DRIROT(96,2),SINDRI(96,2),
     +                  COSDRI(96,2),DRIVEL(96,2),T0FIX(3),
     +                  ABERR(8), DUMJDC(20)
C
C      BLOCK DATA SET TO MC VALUES, KALIBR WILL SET REAL DATA VALUES
C--->  A CHANGE OF THIS COMMON MUST BE DONE SIMULTANEOUSLY WITH  <----
C--->  A CHANGE OF THE BLOCK DATA                                <----
C
C--------------------------- END OF MACRO CJDRCH -----------------------
C
C   20/03/97 703202250  MEMBER NAME  CJTCAL   (PATRECSR)    SHELTRAN
C-------------------------------------------
C  MACRO CJTCAL .... JET CHAMBER CALIBRATION
C               ....  P. STEFFEN : 78/01/17
C-------------------------------------------
      COMMON /CJTCAL/ HJTCAL(50688)
                      INTEGER*2 HTMPED(1536), HAMCAL(8,1536,4)
                      EQUIVALENCE (HTMPED(  1),HJTCAL(   1))
     ,               ,            (HAMCAL(1,1),HJTCAL(1537))
C
C     HTMPED(IWIR)        : DRIFT TIME PEDESTAL IN UNITS OF .01
C     HAMCAL(IHIT,IWIR,J) : AMPLITUDE CALLIBRATION
C     J = 1 : AMP(-Z), IN UNITS OF 4096
C     J = 2 : PED(-Z), IN UNITS OF    1
C     J = 3 : AMP(+Z), IN UNITS OF 4096
C     J = 4 : PED(+Z), IN UNITS OF    1
C----------- END OF MACRO CJTCAL -----------
C   20/03/97 703202250  MEMBER NAME  CJVCEL   (PATRECSR)    SHELTRAN
C-----------------------------------------------------------------------
C                            MACRO CJVCEL     VERTEX CHAMBER CELLS/WIRES
C-----------------------------------------------------------------------
C
      COMMON / CJVCEL / MCELL,MWIRE
C
C--------------------------- END OF MACRO CJVCEL -----------------------
C
C   20/03/97 703202250  MEMBER NAME  CJVTXC   (PATRECSR)    SHELTRAN
C-----------------------------------------------------------------------
C                            MACRO CJVTXC     VERTEX CHAMBER
C-----------------------------------------------------------------------
C
      COMMON / CJVTXC / RVEC, ANG1, ANG2, DISTPW, FIRSTP, DISTW1,
     +                  ANGL, COSLOR, SINLOR,
     +                  ZRESV, ZMAXV, ZOFFV, ZNAMP, ZALV, TIMEV,
     +                  DRILOR(24), SNLORA(24), CSLORA(24),
     +                  DRVELO(24)
C
C--------------------------- END OF MACRO CJVTXC -----------------------
C
C   20/03/97 703202250  MEMBER NAME  CLBPGM   (PATRECSR)    SHELTRAN
C------------------------------------------
C  MACRO CLBPGM ....
C------------------------------------------
      COMMON /CLBPGM/ LBPGM(30)
C--------- END OF MACRO CLBPGM ------------
C   20/03/97 703202250  MEMBER NAME  CMESSG   (PATRECSR)    SHELTRAN
C==MACRO CMESSG=========================================
      COMMON /CMESSG/ MSGVAL(5)
C==ENDMACRO CMESSG========================================
C   20/03/97 703202250  MEMBER NAME  CMUBCS   (PATRECSR)    SHELTRAN
C----------START OF MACRO CMUBCS----------------------------------------
      COMMON /BCS/IDATA(1)
      DIMENSION HDATA(1),ADATA(1)
      EQUIVALENCE (HDATA(1),ADATA(1),IDATA(1))
C----------END OF MACRO CMUBCS------------------------------------------
C   20/03/97 703202250  MEMBER NAME  CMUCALIB (PATRECSR)    SHELTRAN
C
C
C
C
C
C=======================<< MACRO CMUCALIB >>============================
C
C LAST CHANGE  25/09/79  13.20 UHR   HARRISON PROSPER
C
C BANK NAMES, NUMBERS AND LENGTHS
C
C  NAME/NUMBER LENGTH  CONTENTS
C  MUCD   0      16    VERSION NUMBER AND DESCRIPTION.
C  MUOV   0       3    OVERALL JADE UNIT TRANSLATIONS.
C  MFFI   2     370    FIXED FRAME PARAMETERS.
C  MCFI   3     318    FIXED CHAMBER PARAMETERS.
C  MFSU   4     246    'SURVEY' FRAME PARAMETERS.
C  MCSU   5     634    'SURVEY' CHAMBER PARAMETERS.
C  MCEL   6    2220    'ELECTRONIC' CHAMBER PARAMETERS.
C  MCST   7     317    CHAMBER STATUS WORDS.
C  MUFI   8      36    FILTER (ABSORBER BLOCK) PARAMETERS.
C  MUYO   9      10    SIDE, TOP AND BOTTOM YOKE PARAMETERS.
C  MUEN  10      15    YOKE END-PLUG PARAMETERS.
C
C TOTAL LENGTH 4185 WORDS.
C
C-----------------------------------------------------------------------
C-----------------------------------------------------------------------
      COMMON /CALIBR/ LARRY(100),MUCAL(4185)
C-----------------------------------------------------------------------
C-----------------------------------------------------------------------
C
C
C               NVERSN
      DIMENSION DESCRP(15),HOVALL(6)
C                                                    19 WORDS
C
      EQUIVALENCE ( NVERSN,MUCAL(1) ),( DESCRP(1),MUCAL(2) ),
     *            ( HOVALL(1),MUCAL(17) )
C----------------------------------------------------19 WORDS SO FAR
C
C     HMFFIX(740)                                   370 WORDS
      DIMENSION HMFFIX(740)
      EQUIVALENCE ( HMFFIX(1),MUCAL(20) )
      DIMENSION HFACE(82),HSECT(82),HLAYER(82),HNORM(82),HLONG(82),
     *          HTRANS(82),HAC(82),HAL(82),HUNIT(82)
      EQUIVALENCE (HMFFIX(1),NFRAMS),(HMFFIX(3),HFACE(1)),
     *            (HMFFIX(85),HSECT(1)),(HMFFIX(167),HLAYER(1)),
     *            (HMFFIX(249),HNORM(1)),(HMFFIX(331),HLONG(1)),
     *            (HMFFIX(413),HTRANS(1)),(HMFFIX(495),HAC(1)),
     *            (HMFFIX(577),HAL(1)),(HMFFIX(659),HUNIT(1))
C---------------------------------------------------389 WORDS SO FAR
C
C
C     HMCFIX(636)                                   318 WORDS
      DIMENSION HMCFIX(636)
      EQUIVALENCE ( HMCFIX(1),MUCAL(390) )
      DIMENSION HFR(634)
      EQUIVALENCE (HMCFIX(1),NCHAMS),(HMCFIX(3),HFR(1))
C---------------------------------------------------707 WORDS SO FAR
C
C     HMFSUR(492)                                   246 WORDS
      DIMENSION HMFSUR(492)
      EQUIVALENCE ( HMFSUR(1),MUCAL(708) )
      DIMENSION HDIST(82),HANG(82),HCLLO(82),HCLHI(82),HCTLO(82),
     *          HCTHI(82)
      EQUIVALENCE (HMFSUR(1),HDIST(1)),(HMFSUR(83),HANG(1)),
     *            (HMFSUR(165),HCLLO(1)),(HMFSUR(247),HCLHI(1)),
     *            (HMFSUR(329),HCTLO(1)),(HMFSUR(411),HCTHI(1))
C---------------------------------------------------953 WORDS SO FAR
C
C
C     HMCSUR(1268)                                  634 WORDS
      DIMENSION HMCSUR(1268)
      EQUIVALENCE ( HMCSUR(1),MUCAL(954) )
      DIMENSION HD1(634),HCTW(634)
      EQUIVALENCE (HMCSUR(1),HCTW(1)),(HMCSUR(635),HD1(1))
C--------------------------------------------------1587 WORDS SO FAR
C
C
C     HMCELE(4440)                                 2220 WORDS
      DIMENSION HMCELE(4440)
      EQUIVALENCE ( HMCELE(1),MUCAL(1588) )
      DIMENSION HDTP(634),HLTP(634),HLSF(4,634),HVDRFT(634)
      EQUIVALENCE (HMCELE(1),HVDR),(HMCELE(2),HDTP(1)),
     *            (HMCELE(636),HLTP(1)),(HMCELE(1270),HLSF(1,1)),
     *            (HMCELE(3806),HMCEDM),(HMCELE(3807),HVDRFT(1))
C--------------------------------------------------3807 WORDS SO FAR
C
C
C     HMCSTA(634)                                   317 WORDS
      DIMENSION HMCSTA(634)
      EQUIVALENCE ( HMCSTA(1),MUCAL(3808) )
C--------------------------------------------------4124 WORDS SO FAR
C
C
C     HFILDA(72)                                     36 WORDS
      DIMENSION HFILDA(72)
      EQUIVALENCE ( HFILDA(1),MUCAL(4125) )
      INTEGER*2 HBLLO(6),HBLHI(6),HBTLO(6),HBTHI(6),HBNLIM(36)
      INTEGER*4 IFCIND(6)
      INTEGER*2 HFILDA
      EQUIVALENCE (HBLLO(1),HFILDA(1)),(HBLHI(1),HFILDA(7)),
     *            (HBTLO(1),HFILDA(13)),(HBTHI(1),HFILDA(19)),
     *            (HBNLIM(1),HFILDA(25)),(IFCIND(1),HFILDA(61))
C--------------------------------------------------4160 WORDS SO FAR
C
C
C     HYKNMI(4),HYKNMO(4),HYKLDM(4),HYKTDM(4),BYOKE, 10 WORDS
C     IYKIND
      DIMENSION HYKNMI(4),HYKNMO(4),HYKLDM(4),HYKTDM(4)
      INTEGER*2 HYKTDM,HYKLDM,HYKNMI,HYKNMO
      EQUIVALENCE ( HYKNMI(1),MUCAL(4161) ),
     *            ( HYKNMO(1),MUCAL(4163) ),
     *            ( HYKLDM(1),MUCAL(4165) ),
     *            ( HYKTDM(1),MUCAL(4167) ),
     *            ( BYOKE,MUCAL(4169) ),( IYKIND,MUCAL(4170) )
C--------------------------------------------------4170 WORDS SO FAR
C
C
C    IZEII,IZEIO,IREP1,IREP2,IREP3,IREP4,IXYEP5,     15 WORDS
C    IZOEP1,IZOEP2,IZOEP3,IZOEP4,IZOEP5,CAEP2,
C    IEPIND,IEPSCT
C
      EQUIVALENCE ( IZEII,MUCAL(4171) ),( IZEIO,MUCAL(4172) ),
     *            ( IREP1,MUCAL(4173) ),( IREP2,MUCAL(4174) ),
     *            ( IREP3,MUCAL(4175) ),( IREP4,MUCAL(4176) ),
     *            ( IXYEP5,MUCAL(4177) ),( IZOEP1,MUCAL(4178) ),
     *            ( IZOEP2,MUCAL(4179) ),( IZOEP3,MUCAL(4180) ),
     *            ( IZOEP4,MUCAL(4181) ),( IZOEP5,MUCAL(4182) ),
     *            ( CAEP2,MUCAL(4183) ),( IEPIND,MUCAL(4184) ),
     *            ( IEPSCT,MUCAL(4185) )
C--------------------------------------------------4185 WORDS SO FAR
C
C=======================<< MACRO CMUCALIB >>============================
C
C
C
C
C
C   20/03/97 703202250  MEMBER NAME  CMUENP   (PATRECSR)    SHELTRAN
C ========== MACRO CMUENP ===================================
      COMMON/CMUENP/IZEII,IZEIO,IREP1,IREP2,IREP3,IREP4,IXYEP5,
     *              IZOEP1,IZOEP2,IZOEP3,IZOEP4,IZOEP5,CAEP2,
     *              IEPIND,IEPSCT
C   ======== ENDMACRO CMUENP =================================
C   20/03/97 703202250  MEMBER NAME  CMUFIL   (PATRECSR)    SHELTRAN
C =========== MACRO CMUFIL ==============================
      INTEGER*2 HBLLO(6),HBLHI(6),HBTLO(6),HBTHI(6),HBNLIM(36)
      INTEGER*4 IFCIND(6)
      INTEGER*2 HFILDA
      COMMON/CMUFIL/HFILDA(72)
      EQUIVALENCE (HBLLO(1),HFILDA(1)),(HBLHI(1),HFILDA(7)),
     *            (HBTLO(1),HFILDA(13)),(HBTHI(1),HFILDA(19)),
     *            (HBNLIM(1),HFILDA(25)),(IFCIND(1),HFILDA(61))
C   ==========ENDMACRO CMUFIL================================
C   20/03/97 703202250  MEMBER NAME  CMUFRCH  (PATRECSR)    SHELTRAN
C--------------START OF MACRO CMUFRCH-----------------------------------
C
C /CMUNIT/,/CMFFIX/,/CMFSUR/,/CMCFIX/,/CMCSUR/,/CMCELE/ AND /CMCSTA/ ARE
C   DESCRIBED ON 'F22ALL.JADEMUS(@MUINFOM)'. THEY CAN BE READ FROM
C   A OS DATA SET (PRESENTLY 'F22ALL.MUSQUEEZ.DATA'), OR FROM
C   THE APPROPRIATE MU CALIBRATION DATA BOS RECORD, E.G.,
C   'F22ALL.MUCALIB.DATA0001'.
C
      COMMON /CMUCDV/NVERSN,DESCRP(15)
C
      COMMON /CMUNIT/HOVALL(6)
C
      COMMON/CMFFIX/HMFFIX(740)
      DIMENSION HFACE(82),HSECT(82),HLAYER(82),HNORM(82),HLONG(82),
     *          HTRANS(82),HAC(82),HAL(82),HUNIT(82)
      EQUIVALENCE (HMFFIX(1),NFRAMS),(HMFFIX(3),HFACE(1)),
     *            (HMFFIX(85),HSECT(1)),(HMFFIX(167),HLAYER(1)),
     *            (HMFFIX(249),HNORM(1)),(HMFFIX(331),HLONG(1)),
     *            (HMFFIX(413),HTRANS(1)),(HMFFIX(495),HAC(1)),
     *            (HMFFIX(577),HAL(1)),(HMFFIX(659),HUNIT(1))
C
      COMMON/CMFSUR/HMFSUR(492)
      DIMENSION HDIST(82),HANG(82),HCLLO(82),HCLHI(82),HCTLO(82),
     *          HCTHI(82)
      EQUIVALENCE (HMFSUR(1),HDIST(1)),(HMFSUR(83),HANG(1)),
     *            (HMFSUR(165),HCLLO(1)),(HMFSUR(247),HCLHI(1)),
     *            (HMFSUR(329),HCTLO(1)),(HMFSUR(411),HCTHI(1))
C
      COMMON/CMCFIX/HMCFIX(636)
      DIMENSION HFR(634)
      EQUIVALENCE (HMCFIX(1),NCHAMS),(HMCFIX(3),HFR(1))
C
      COMMON/CMCSUR/HMCSUR(1268)
      DIMENSION HD1(634),HCTW(634)
      EQUIVALENCE (HMCSUR(1),HCTW(1)),(HMCSUR(635),HD1(1))
C
      COMMON/CMCELE/HMCELE(4440)
      DIMENSION HDTP(634),HLTP(634),HLSF(4,634),HVDRFT(634)
      EQUIVALENCE (HMCELE(1),HVDR),(HMCELE(2),HDTP(1)),
     *            (HMCELE(636),HLTP(1)),(HMCELE(1270),HLSF(1,1)),
     *            (HMCELE(3806),HMCEDM),(HMCELE(3807),HVDRFT(1))
C
      COMMON/CMCSTA/HMCSTA(634)
C
C---------------END OF MACRO CMUFRCH------------------------------------
C   20/03/97 703202250  MEMBER NAME  CMUSTAT  (PATRECSR)    SHELTRAN
C----------- START OF MACRO CMUSTAT ------------------------------------
C   LAST CHANGE 12.47 15/06/79 JOHN ALLISON.
C      /CMUSTT/
C
      COMMON / CMUSTT / MUTIT(100),NMU(100)
      REAL*8 MUTIT, MUT1(50), MUT2(50)
      EQUIVALENCE(MUTIT(1),MUT1(1)),(MUTIT(51),MUT2(1))
C
C  NMU ARE USED FOR STATISTICS COUNTING IN THE MUON ROUTINES
C
C------------ END OF MACRO CMUSTAT -------------------------------------
C   20/03/97 703202250  MEMBER NAME  CMUTNY   (PATRECSR)    SHELTRAN
C ============= MACRO CMUTNY =================================
C   /CMUTNY/
C
C CONDENSED MU-FILTER PAARAMETERS FOR USE BY APPROXIMATE SIGNAL TO
C   COORDINATE CONVERSION SUBROUTINE MUTINY.
C
C HPLANS      NO. OF CHAMBER PLANES.
C HVDRAV      AVERAGE DRIFT VELOCITY.
C HDTPAV      AVERAGE DRIFT TIME PEDESTAL.
C HLTPAV      AVERAGE LONGITUDINAL TIME DIFFERENCE PEDESTAL.
C HLSFAV      AVERAGE LONGITUDINAL SCALING FACTOR.
C
C FOR EACH CHAMBER PLANE...
C
C HLY         LAYER NUMBER.
C HOR         ORIENTATION PARAMETER:
C             =1, WIRES PARALLEL TO BEAM, AND NORMAL PARALLEL TO
C                   X-AXIS - FACES 1(-X) AND 2(+X).
C             =2, WIRES PARALLEL TO BEAM, AND NORMAL PARALLEL TO
C                   Y-AXIS - FACES 3(-Y) AND 4(+Y).
C             =3, WIRES VERTICAL, AND NORMAL PARALLEL TO Z-AXIS -
C                   FACES 5(-Z) AND 6(+Z).
C HC1         FIRST CHAMBER NUMBER.
C HCN0        NORMAL       )
C HCL0        LONGITUDINAL )  COORDINATE OF 'ORIGIN' OF CHAMBER PLANE.
C HCT0        TRANSVERSE   )
C HSP         AVERAGE SPACING OF CHAMBERS.
C
C   (THE 'ORIGIN' IS AT ONE END OF THE WIRE OF THE FIRST CHAMBER IN THE
C PLANE.  THE END IS THAT WITH THE LOWEST LONGITUDINAL COORDINATE.)
C
      COMMON /CMUTNY/HPLANS,HVDRAV,HDTPAV,HLTPAV,HLSFAV,
     * HLY(48),HOR(48),HC1(48),HCN0(48),HCL0(48),HCT0(48),HSP(48)
C  ========= ENDMACRO CMUTNY =======================================
C   20/03/97 703202250  MEMBER NAME  CMUYOK   (PATRECSR)    SHELTRAN
C  =========MACRO CMUYOK ====================================
      INTEGER*2 HYKTDM,HYKLDM,HYKNMI,HYKNMO
      COMMON/CMUYOK/HYKNMI(4),HYKNMO(4),HYKLDM(4),HYKTDM(4),BYOKE,
     *              IYKIND
C  ==========ENDMACRO CMUYOK==================================
C   20/03/97 703202250  MEMBER NAME  COMTAG   (PATRECSR)    SHELTRAN
      COMMON/COMTAG/LISTOK,NLIST(64,9,2),
     1XMAP(64),YMAP(64)
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C
C COMTAG - THESE NUMBERS ARE NEEDED THROUGHOUT THE JOB BY ANALYSIS
C           ROUTINES
C ================================================================
C
C
C LISTOK->  FLAGS THAT NEIGHBOUR LIST HAS BEEN GENERATED
C
C NLIST ->  LIST OF CLOSEST NEIGHBOURS TO A BLOCK   (I,1) = NUMBER
C           OF CLOSEST NEIGHBOURS (I,2-9)ADC ADDRESSES OF NEIGHBOURING
C           BLOCKS  (CLUSFN).THE THIRD ARGUMENT REFERS TO THE MARK
C           OF TAGGING SYSTEM - EITHER MARK 2 OR MARK 3.
C
C XMAP(64) -> XMAP AND YMAP CONTAIN THE X,Y ADDRESSES OF THE BLOCKS IN
C YMAP(64) -> THE 1982 TAGGING SYSTEM
C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C   20/03/97 703202250  MEMBER NAME  CPATLM   (PATRECSR)    SHELTRAN
C----------------------------------------------
C  MACRO CPATLM .... PATTERN RECOGNITION LIMITS
C----------------------------------------------
      COMMON /CPATLM/ PATRLM(5),FLINLM(10),TRELLM(20),ZFITLM(10),BKK(20)
     *               ,XYF(20),IGFP(20),XBKK(40),IADMIN(5),YBKK(20)
      INTEGER IXYF(20),LMPATR(5),LMFLIN(10)
      INTEGER LMTREL(20),LMZFIT(10),IBKK(20)
      DIMENSION GFP(20),IXBKK(40),IYBKK(20)
      EQUIVALENCE (PATRLM(1),LMPATR(1)),(IXBKK(1),XBKK(1)),(IYBKK(1),
     *YBKK(1))   ,(FLINLM(1),LMFLIN(1)),(TRELLM(1),LMTREL(1))
     *           ,(ZFITLM(1),LMZFIT(1)),(BKK(1),IBKK(1))
     *           ,(XYF(1),IXYF(1)),(GFP(1),IGFP(1)),(IADMIN(1),IMCERT)
     *           ,(IYBKK(20),IPPASS),(IADMIN(2),IPFAST)
C----------- END OF MACRO CPATLM --------------
C   20/03/97 703202250  MEMBER NAME  CREPLY   (PATRECSR)    SHELTRAN
C--------------------------------------------
C  MACRO CREPLY .... OUTPUT COMMON FOR ALPHAN
C--------------------------------------------
      LOGICAL*1 QREPLY
      COMMON/CREPLY/NREPLY,REPLY(20),QREPLY(20)
      INTEGER*4 IREPLY(20)
      EQUIVALENCE (IREPLY(1),REPLY(1))
C---------- END OF MACRO CREPLY -------------
C   20/03/97 703202250  MEMBER NAME  CUNIT    (PATRECSR)    SHELTRAN
C---------------START OF MACRO CUNIT (LOGICAL UNIT NUMBERS)-------------
C
      COMMON /CUNIT/LUNMUC,LUNMUE
C
C LUNMUC  LOGICAL UNIT FOR MU CALIBRATION DATA.
C LUNMUE  LOGICAL UNIT FOR MU CALIBRATION DATA EDIT FILE.
C
C---------------END OF MACRO CUNIT--------------------------------------
C   20/03/97 703202250  MEMBER NAME  CWKTAG   (PATRECSR)    SHELTRAN
C
C
C------------ C O M M O N    C W O R K   F O R   T A G A N -------------
C
C
       COMMON/CWORK/MARK,IFLMRK,IMC,NCLST,NNEI,
     *              ISTMZ,ISTPZ,IENDMZ,IENDPZ,
     *              SIGX,SIGY,SIGEN,
     *              CAND(3),CLUS(9,2),CMAP(10,9),
     *              SADC(32,2),CATAG(192)
C
C
C CWORK - WORKSPACE USED ONLY ONCE PER EVENT FOR INTERNAL PROCESSING
C ==================================================================
C
C MARK   ->  WHICH 'MARK' OF TAGGER - 1 = 1981,2
C                                   - 2 = 1983 ONWARDS
C
C IFLMRK ->  SET TO '1' BY TAGMRK
C
C IMC    ->  SET TO '1' BY TAGMRK IF MC DATA
C
C CATAG  ->  CONTAINS THE ADC CONTENTS UNPACKED FROM ATAG
C
C SADC   ->  COMMON FOR ADC'S AFTER SORTING  (SORT 1)
C
C CMAP(I,1...9) ->  ADDRESS OF ADC'S IN CLUSTER I,SORT23 PUTS THESE IN
C                   ORDER OF ENERGY.
C
C CAND(3) ->  X, Y, AND ENERGY OF A FOUND CLUSTER IN AFTER CLSPS
C
C SIGX,SIGY,SIGEN ->  ERROR ON X, Y, AND ENERGY AFTER CLSPS
C
C CLUS(9,2) ->  ADC ADDRESS AND CONTENTS OF CLUSTERS - SORTED BY ENERGY
C
C NCLST   ->  NUMBER OF CLUSTERS THIS END
C ISTMZ   ->  POINTER TO START OF -Z DATA IN CATAG ( ALWAYS  1       )
C ISTPZ   ->  POINTER TO START OF +Z DATA IN CATAG ( EITHER 33 OR 25 )
C IENDMZ  ->  POINTER TO   END OF -Z DATA IN CATAG ( EITHER 32 OR 24 )
C IENDPZ  ->  POINTER TO   END OF +Z DATA IN CATAG ( EITHER 64 OR 48 )
C
C A.J.FINCH 24/2/84
C MODIFIED 12/3/84 CATAG PUT TO END AND INCREASED TO 192
C  TO ALLOW IT TO BE USED FOR 1979,80 TAGGER IN GRAPHICS
C LAST MOD : J. NYE  30/05/84  RE-ORGANIZED INCLUDING IFLMRK
C
C
C-----------------------------------------------------------------------
C
C   20/03/97 703202250  MEMBER NAME  CWORKEQ  (PATRECSR)    SHELTRAN
C-------------------------------------------------------
C  MACRO CWORKEQ .... PATTERN RECOGNITION CWORK POINTERS
C-------------------------------------------------------
      EQUIVALENCE
C                POINTERS FOR FXYZ HIT ARRAY .. PRIMARY L/R SOLUTION
     #          (HPHT0,HPWRK( 1)),(HPHT9,HPWRK( 2)),(HLDHT,HPWRK( 3))
C                POINTERS FOR CWORK SINGLE TRACK PATR BANK
     #         ,(HPTR0,HPWRK( 4)),(HPTR9,HPWRK( 5)),(HLDTR,HPWRK( 6))
C                POINTERS FOR TRACK ELEMENT HIT LABEL ARRAY
     #         ,(HPHL0,HPWRK( 7)),(HPHL9,HPWRK( 8)),(HLDHL,HPWRK( 9))
C                POINTERS FOR FXYZ HIT ARRAY .. OPPOSITE L/R SOLUTION
     #         ,(HPHT0A,HPWRK(10)),(HPHT9A,HPWRK(11)),(HLDHTA,HPWRK(12))
C               POINTER LIMIT ON FXYZ HIT ARRAY
     #         ,(HPHTLM,HPWRK(13))
C               POINTERS FOR
     #         ,(HPTE0,HPWRK(14)),(HPTE9,HPWRK(15)),(HLDTE,HPWRK(16))
C-------------- END OF MACRO CWORKEQ ------------------
C   20/03/97 703202250  MEMBER NAME  CWORKMG  (PATRECSR)    SHELTRAN
C ==========MACRO CWORKMG =============================
      EQUIVALENCE                    (ADWRK(91),K),
     * (ADWRK(92),ICL),(ADWRK(93),LRING),(ADWRK(94),KRING),
     * (ADWRK(95),LR),(ADWRK(96),IRIFLG),(ADWRK(97),IUDFLG),
     * (ADWRK(98),ILIM),(ADWRK(99),LR1),(ADWRK(100),IRL),
     * (ADWRK(101),ITK(1,1)),(ADWRK(141),DTEMP(1)),
     * (ADWRK(151),IPST),(ADWRK(152),IJFLG),(ADWRK(153),ICX),
     * (ADWRK(154),KT),(ADWRK(155),ISDL),(ADWRK(156),ISDR),
     * (ADWRK(157),ISP),(ADWRK(158),ISKP(1)),(ADWRK(168),HSP1(1)),
     * (ADWRK(178),ITOL),(ADWRK(179),IW),(ADWRK(180),A),
     * (ADWRK(181),DS),(ADWRK(182),IWT),(ADWRK(183),ICT),
     * (ADWRK(184),IKX),(ADWRK(185),LRCORN),(ADWRK(400),LUSE(1))
      DIMENSION LUSE(200),DTEMP(10),ITK(10,4),ISKP(10),HSP1(20)
      EQUIVALENCE (ILOUT,IBKK(3)),(ILIN,IBKK(4)),
     * (ILBOT,IBKK(8)),(DCELL,BKK(9))
C ==========ENDMACRO CWORKMG==========================
C   20/03/97 703202250  MEMBER NAME  CWORKMX  (PATRECSR)    SHELTRAN
C   30/10/79 910301050  MEMBER NAME  CWORKMX  (PATRECSR)    FORTRAN
C   16/09/79 C9092001   MEMBER NAME  CWORKMX  (UKSOR)       FORTRAN
C ==========MACRO CWORKMG =============================
      EQUIVALENCE (ADWRK(291),HUSE(1)),(ADWRK(391),K),
     * (ADWRK(392),ICL),(ADWRK(393),LRING),(ADWRK(394),KRING),
     * (ADWRK(395),LR),(ADWRK(396),IRIFLG),(ADWRK(397),IUDFLG),
     * (ADWRK(398),ILIM),(ADWRK(399),LR1),(ADWRK(400),IRL),
     * (ADWRK(401),ITK(1,1)),(ADWRK(441),DTEMP(1)),
     * (ADWRK(451),IPST),(ADWRK(452),IJFLG),(ADWRK(453),ICX),
     * (ADWRK(454),KT),(ADWRK(455),ISDL),(ADWRK(456),IBFIT),
     * (ADWRK(457),ISP),(ADWRK(458),ISKP(1)),(ADWRK(468),HSP1(1)),
     * (ADWRK(478),ITOL),(ADWRK(479),IW),(ADWRK(480),A),
     * (ADWRK(481),DS),(ADWRK(482),IWT),(ADWRK(483),ICT),
     * (ADWRK(484),IKX),(ADWRK(485),LRCORN)
      DIMENSION HUSE(200),DTEMP(10),ITK(10,4),ISKP(10),HSP1(20)
      EQUIVALENCE (ILOUT,IBKK(3)),(ILIN,IBKK(4)),
     * (ILBOT,IBKK(8)),(DCELL,BKK(9))
C ==========ENDMACRO CWORKMG==========================
C   20/03/97 703202250  MEMBER NAME  CWORKPR  (PATRECSR)    SHELTRAN
C---------- END OF MACRO CWORKPR --------------
C----------------------------------------------
C  MACRO CWORKPR .... PATTERN RECOGNITION CWORK
C----------------------------------------------
      COMMON /CWORK/ HPLAST,HPFREE,HPWRK(30),ADWRK(600),
     ,               HPRO,HNTR,HNTCEL(98),IPCL(200),NRHT(200),
     ,               NWR1(200),DS1(200),SL1(200),
     ,               NWR2(200),DS2(200),SL2(200),
     ,               LBL(200),NTREL(200),ICRO(200),
     ,               NTR,HNREL(100),HISTR(9,100),HRES(168),
     ,               NTRLM,RLMTR(3,5),
     ,               WRK(7000)
                     DIMENSION TRKAR(200,11),ITRKAR(200,11),
     ,                         LMRTR(3,5)
                     EQUIVALENCE (IPCL(1),TRKAR(1,1),ITRKAR(1,1))
                     EQUIVALENCE (LMRTR(1,1),RLMTR(1,1))
         DIMENSION IWRK(7000),HWRK(14000),IDWRK(600),HDWRK(1200)
                     EQUIVALENCE (IWRK(1),WRK(1),HWRK(1))
                     EQUIVALENCE (IDWRK(1),ADWRK(1),HDWRK(1))
C---------- END OF MACRO CWORKPR --------------
C   20/03/97 703202250  MEMBER NAME  CWORKZV  (PATRECSR)    SHELTRAN
C====  MACRO CWORKZV  ==================================
C-------------------------------------------
C   RESULTS + INTERM. STORAGE OF ZVERTF
C   P. STEFFEN (79/01/21)
C---------------------------------------------
      COMMON /CWORK/ FZRSLT(12)
     ,             , HUFLO,HOFLO,MAXZ,HIST(100)
     ,             , HPTSEC(98)
     ,             , NZ1(16),NZ2(16), HLB1(8),HLB2(8)
     ,        , HZ1(8,16),HZ2(16,16), FI1(8,16),FI2(8,16),HTMP(100)
                     INTEGER*4 HPTSEC
                     INTEGER IZRSLT(12)
                     EQUIVALENCE (IZRSLT(1),FZRSLT(1))
C
C==  ENDMACRO CWORKZV  ========================================
C   20/03/97 703202250  MEMBER NAME  CXYFIT   (PATRECSR)    SHELTRAN
C--------------------------------------
C  MACRO CXYFIT .... XYFIT EQUIVALENCES
C--------------------------------------
          LOGICAL TBIT
          EQUIVALENCE(ADWRK(1),TYPE1)
          EQUIVALENCE(ADWRK(2),XSTR)
          EQUIVALENCE(ADWRK(3),YSTR)
          EQUIVALENCE(ADWRK(4),RSTR)
          EQUIVALENCE(ADWRK(5),DXSTR)
          EQUIVALENCE(ADWRK(6),DYSTR)
          EQUIVALENCE(ADWRK(7),DRSTR)
          EQUIVALENCE(ADWRK(8),TYPE2)
          EQUIVALENCE(ADWRK(9),XEND)
          EQUIVALENCE(ADWRK(10),YEND)
          EQUIVALENCE(ADWRK(11),REND)
          EQUIVALENCE(ADWRK(12),DXEND)
          EQUIVALENCE(ADWRK(13),DYEND)
          EQUIVALENCE(ADWRK(14),DREND)
          EQUIVALENCE(ADWRK(15),NPTYPE)
          EQUIVALENCE(ADWRK(16),COEFF1)
          EQUIVALENCE(ADWRK(17),COEFF2)
          EQUIVALENCE(ADWRK(18),COEFF3)
          EQUIVALENCE(ADWRK(19),COEFF4)
          EQUIVALENCE(ADWRK(20),RMSFIT)
          EQUIVALENCE(ADWRK(21),NPUSED)
          EQUIVALENCE(ADWRK(22),CURVT)
          EQUIVALENCE(ADWRK(23),DCURV)
          EQUIVALENCE(ADWRK(24),CURV1)
          EQUIVALENCE(ADWRK(25),CURV2)
CC
          INTEGER*2JTR(10),NHITIN(10)
          REAL*4CHITR(10)
          EQUIVALENCE(ADWRK(26),JTR(1))
          EQUIVALENCE(ADWRK(31),NHITIN(1))
          EQUIVALENCE(ADWRK(36),CHITR(1))
C         - - - - - - - - - - - - - - - -
C         EQUIVALENCE(ADWRK(45),CHITR(10))
          EQUIVALENCE(ADWRK(46),NTRTOT)
CC
          EQUIVALENCE(ADWRK(47),NHIT)
          EQUIVALENCE(ADWRK(48),NTRAK)
          EQUIVALENCE(ADWRK(49),KNTROL)
          EQUIVALENCE(ADWRK(50),ISTORY)
          LOGICAL*1LARR(4),PRINT,FATAL,BADFIT,SETFLG
          EQUIVALENCE(ADWRK(51),LARR(1),PRINT)
          EQUIVALENCE(          LARR(2),FATAL)
          EQUIVALENCE(          LARR(3),BADFIT)
          EQUIVALENCE(          LARR(4),SETFLG)
CC
          EQUIVALENCE(ADWRK(61),SP1,ISP1)
          EQUIVALENCE(ADWRK(62),SP2,ISP2)
          EQUIVALENCE(ADWRK(63),SP3,ISP3)
          EQUIVALENCE(ADWRK(64),SP4,ISP4)
          EQUIVALENCE(ADWRK(65),SP5,ISP5)
          EQUIVALENCE(ADWRK(66),SUMX)
          EQUIVALENCE(ADWRK(67),SUMY)
          EQUIVALENCE(ADWRK(68),SUMXY)
          EQUIVALENCE(ADWRK(69),SUMX2)
          EQUIVALENCE(ADWRK(70),SUMX3)
          EQUIVALENCE(ADWRK(71),SUMX4)
          EQUIVALENCE(ADWRK(72),SUMX2Y)
          EQUIVALENCE(ADWRK(73),X1)
          EQUIVALENCE(ADWRK(74),Y1)
          EQUIVALENCE(ADWRK(75),X2)
          EQUIVALENCE(ADWRK(76),Y2)
CCC
          EQUIVALENCE(ADWRK(93),NMPROG)
          EQUIVALENCE(ADWRK(94),NPTS)
C         EQUIVALENCE(ADWRK(95),NDF)
          EQUIVALENCE(ADWRK(96),XMID)
          EQUIVALENCE(ADWRK(97),YMID)
          EQUIVALENCE(ADWRK(98),SINTH)
          EQUIVALENCE(ADWRK(99),COSTH)
          EQUIVALENCE(ADWRK(100),C2)
          EQUIVALENCE(ADWRK(101),C3)
          EQUIVALENCE(ADWRK(102),C4)
          EQUIVALENCE(ADWRK(103),CURV)
          EQUIVALENCE(ADWRK(104),CHIFIT)
          EQUIVALENCE(ADWRK(105),CHICIR)
          EQUIVALENCE(ADWRK(106),XFIRST)
          EQUIVALENCE(ADWRK(107),XLAST)
          EQUIVALENCE(ADWRK(108),NGOOD)
          EQUIVALENCE(ADWRK(109),NBAD)
          EQUIVALENCE(ADWRK(110),NEXTRA)
          LOGICAL*1USED(80)
          EQUIVALENCE(ADWRK(111),USED(1))
C          - - - - - - - - - - - - - -
C         EQUIVALENCE(ADWRK(130),USED(80))
          REAL*4AX(80),AY(80)
          EQUIVALENCE(ADWRK(131),AX(1))
C          - - - - - - - - - - - - - -
C         EQUIVALENCE(ADWRK(210),AX(80))
          EQUIVALENCE(ADWRK(211),AY(1))
C          - - - - - - - - - - - - - -
C         EQUIVALENCE(ADWRK(290),AY(80))
C---------- END OF MACRO CXYFIT --------------
C   20/03/97 703202250  MEMBER NAME  CZGEO    (PATRECSR)    SHELTRAN
C-----------------------------------------------------------------------
C                            MACRO CZGEO      Z CHAMBER GEOMETRY
C-----------------------------------------------------------------------
C
      COMMON / CZGEO  / RZCHI,RZCHA,NZRPSI,NZZ,Z1ZCH,Z2ZCH,ZCHA,ZCHB,
     +                  ZCHSS,ZCHDL,ZCHDLL,DLZZ,DLZPHI,DLZW1,DLZW2
C
C----------------------------END OF CZGEO-------------------------------
C
C   20/03/97 703202250  MEMBER NAME  CZSPRM   (PATRECSR)    SHELTRAN
C
C  COMMON FOR Z-RESOLUTION PARAMETERS,   USED IN SUBR. AMPS2Z
C
      COMMON / CZSPRM / NZSPRD,
C                                           PARMS FOR RESOLUTIONS
     * AZSRS0(3), AZSRSA(3),
C                                           PARMS FOR CUTS
     * AZSCT1(3), AZSCT2(3), AZSCT3(3), AZSCT4(3),
C                                           SECOND HIT
     * AZSSHT(5,3),
C                                           SECOND HIT DISTANCE
     * AZSSHD(3),
C                                           AVE RESOLUTIONS
     * AZSSAV(3),
C                                           ZSPD BANK FILL FLAG
     * LZSPDF
      LOGICAL LZSPDF
C   20/03/97 703202250  MEMBER NAME  CZVPAR   (PATRECSR)    SHELTRAN
C====MACRO CZVPAR===================================
C-------------------------------------------
C   RESULTS FROM ZVERTF
C   P. STEFFEN (79/01/26)
C---------------------------------------------
      COMMON /CZVPAR/ LBZVDF,ZLOW,  BINZ,  NBINZ,
     ,                NWRDR1,LWRDC0,LWRDC1,LWRDC2,
     ,                IDZ1LM,IDZ2LM,NPKMIN,SBRAT,DFIMAX,
     ,                DZVPAR(5)
C==ENDMACRO CZVPAR========================================
C   20/03/97 703202250  MEMBER NAME  MVERTEX1 (PATRECSR)    SHELTRAN
C     MACRO FOR VERTEX-FIT ROUTINES
      COMMON /CWORK1/ NT,T(2000),NV,V(200),A(300),B(24),NTIND(20),S(20),
     *                CHITR(20),
     *                JTGOD(50),JTBAD(50),VSAVE(10),V2(20,20)
C
      DIMENSION IT(2),IV(2)
      EQUIVALENCE (T(1),IT(1)),(V(1),IV(1))
C   20/03/97 703202250  MEMBER NAME  MVERTEX2 (PATRECSR)    SHELTRAN
C     MACRO FOR VERTEX-FIT ROUTINES ( AXIS AND STATISTICS )
      COMMON /CVTX2/ MODE,TAXIS(12),SVR,HVTXST(120)
C
      DIMENSION IVTXST(1)
C
C   20/03/97 703202250  MEMBER NAME  VTXDEF   (PATRECSR)    SHELTRAN
C********************************************************************
C*                                                                  *
C*             X - Y - Z   V E R T E X   F I T                      *
C*                                                                  *
C*       INPUT PARAMETERS IN /CWORK1/ (MM, MEV, RADIANS)            *
C*       ================                                           *
C*       NT    = TOTAL NR OF TRACKS OF EVENT                        *
C*       IT(1) =         FLAG (0 = TRACK INCOMPLETE OR BAD, NOT USED*
C*                             1 = GOOD, BUT DO NOT USE IN VERTEXFIT*
C*                             2 = GOOD)                            *
C*       T( 2) = +-R     RADIUS(+ MEANS ANTICLOCKWISE LOOKING TO -Z)*
C*          3  = PHI     AZIMUTH AT POINT XT,YT,ZT                  *
C*          4  = THETA   POLAR ANGLE TO XY-PLANE(0=VERTICAL TO BEAM)*
C*          5  = XT      .                                          *
C*          6  = YT      . FIRST MEASURED POINT ON TRACK            *
C*          7  = ZT      .                                          *
C*          8  = DPHI    ERROR OF PHI                               *
C*          9  = DTHETA  ERROR OF THETA                             *
C*         10  = DXT     .                                          *
C*         11  = DYT     . ERROR OF XT,YT,ZT                        *
C*         12  = DZT     .                                          *
C*         13  = NPT     NUMBER OF POINTS ON TRACK (INTEGER)        *
C*         14  = 0       NOT USED ON INPUT                          *
C*         15  = S0      INITIAL ARCLENGTH ( = 0. OR CLOSEST        *
C*                          APPROACH TO RUNVERTEX )                 *
C*         16-40         FOR INTERNAL USE (SEE BELOW)               *
C*        (41-80)        2. TRACK                                   *
C*         .....         ........                                   *
C*                                                                  *
C*       OUTPUT PARAMETERS IN /CWORK1/ (MM, MEV, RADIANS)           *
C*       =================                                          *
C*       FOR TRACKS WITH IT(1) GT 0                                 *
C*       IT(1) =         FLAG (3 = TRACK WAS USED IN VERTEXFIT)     *
C*       T( 3) = PHI     AZIMUTH AT POINT XT,YT,ZT                  *
C*          5  = XT      .                                          *
C*          6  = YT      . POINT ON TRACK NEAREST TO VERTEX         *
C*          7  = ZT      .                                          *
C*         10  = DXT     .                                          *
C*         11  = DYT     . ERROR OF XT,YT,ZT                        *
C*         12  = DZT     .                                          *
C*         14  = NV      NUMBER OF VERTEX TO WHICH TRACK BELONGS (I)*
C*         15  = S       EXTRAPOLATED ARC LENGTH (USUALLY NEGATIVE) *
C*       ALL OTHER T'S ARE UNCHANGED                                *
C*                                                                  *
C*       NV    = TOTAL NUMBER OF VERTICES                           *
C*       IV(1) =         FLAG (0 = NO VERTEX FIT                    *
C*                             1 = BAD VERTEX FIT                   *
C*                             2 = VERTEX OF 1- OR COLLINEAR 2-PRONG*
C*                             3 = GOOD VERTEX FIT                  *
C*                             4 = E+E- PAIR VERTEX                 *
C*                             5 = ISOLATED SINGLE TRACK VERTEX)    *
C*       V( 2) = X       .                                          *
C*          3  = Y       . VERTEX COORDINATES                       *
C*          4  = Z       .                                          *
C*          5  = DX      .                                          *
C*          6  = DY      . ERROR OF X,Y,Z                           *
C*          7  = DZ      .                                          *
C*       IV(8) = NTR     NUMBER OF TRACKS USED IN VERTEX FIT        *
C*       V( 9) = CHI2    CHISQARE OF FIT (N.D.F. = 2*NTR-3)         *
C*       IV(10)= NTRALL  NUMBER OF TRACKS BELONGING TO THIS VERTEX  *
C*        (11-20)        2. VERTEX                                  *
C*         .....         .........                                  *
C*                                                                  *
C*       INTERNAL PARAMETERS                                        *
C*       ===================                                        *
C*       IT(1) IS SET NEGATIV TEMPORARILY IF TRACK BELONGS TO VERTEX*
C*       T(16) = COULOMB SCATTERING ERROR ( TANKWALL )              *
C*       T(17) = COULOMB SCATTERING ERROR ( NEW BEAMPIPE ONLY )     *
C*       T(18) = S TO TANKWALL NEAR                                 *
C*       T(19) = S TO BEAMPIPE NEAR                                 *
C*       T(20) = PROJ. TRACKLENGTH IN RPHI                          *
C*       T(21) = SIN(PHI0)                                          *
C*       T(22) = COS(PHI0)                                          *
C*       T(23) = TAN(THETA)                                         *
C*       T(24) = COS(THETA)                                         *
C*       T(25)   UNUSED                                             *
C*       T(26) = S TO TANKWALL FAR                                  *
C*       T(27) = S TO TANKWALL NEAR                                 *
C*       T(28) = S.D. X                                             *
C*       T(29) = S.D. Y                                             *
C*       T(30) = S.D. Z                                             *
C*                                                                  *
C*       NEW INTERNAL PARAMETERS ( 31 - 40 )               BY KLE   *
C*       -----------------------                                    *
C*       IT(31)= 1 FOR 'COMFIT'TED TRACKS, 0 ELSE                   *
C*                                      ( COVAR. DEFAULTS :   )     *
C*       T(32) = RPHI COVARIANCE : X**4 ( 180 SIG**2/N / L**4 )     *
C*       T(33) = RPHI COVARIANCE : X**3 ( 0.0 )                     *
C*       T(34) = RPHI COVARIANCE : X**2 ( -18 SIG**2/N / L**2 )     *
C*       T(35) = RPHI COVARIANCE : X**1 ( 0.0 )                     *
C*       T(36) = RPHI COVARIANCE : X**0 ( 9/4 SIG**2/N )            *
C*       T(37) = SIG**2/NPT IN ZS                                   *
C*       T(38) = PROJ. TRACKLENGTH IN ZS                            *
C*       T(39) = S0(ZS) - S0(RPHI)                                  *
C*       T(40) = COVARIANCE TERM FOR ANGULAR ERROR                  *
C*                                                                  *
C********************************************************************
C*                                                                  *
C*   MODES :                                                        *
C*  =========                                                       *
C*   BIT 31 ON --> STARTPOINT IS RUNVERTEX ( NOT FIRST MEASURED )   *
C*   BIT 30 ON --> RUNVERTEX CONSTRAIN                              *
C*   BIT 29 ON --> AXIS CONSTRAIN                                   *
C*   BIT 28 ON --> FITS IN RPHI AND Z ARE INDEPENDENT               *
C*   BIT 27 ON --> LOCAL STATISTICS FROM VERTEX                     *
C*   BIT 26 ON --> OVERWRITE PATR-BANK FOR TYP 2 WITH HELIX-        *
C*                 PARAMETERS                                       *
C*   BIT 25 ON --> MESSAGE FROM VTXEE IF FAILED                     *
C*                                                                  *
C********************************************************************
