
hec_adc.inc                hec_epio.inc        hec_par.inc
hec_beam.inc               hec_evth.inc        hec_paw.inc
hec_beam_sys_cluset.inc    hec_fadc.inc        hec_ped.inc
hec_beam_sys_clusters.inc  hec_geo.inc         hec_ped_sys.inc
hec_beam_sys_config.inc    hec_his_fit.inc     hec_runh.inc
hec_beam_sys_shifts.inc    hec_his_sys.inc     hec_search.inc
hec_cal.inc                hec_hvpar.inc       hec_search_1_sys.inc
hec_cal_coef.inc           hec_hvstat.inc      hec_slow_pc.inc
hec_crl.inc                hec_imp.inc         hec_stats_epio.inc
hec_cub.inc                hec_max.inc         hec_stats_trig.inc
hec_datacard.inc           hec_maxepio.inc     hec_tdc.inc
hec_dig.inc                hec_ntuple.inc      hec_tdc_sys.inc
hec_dig_sys.inc            hec_ntuple_sys.inc  hec_trig.inc
hec_dwpc.inc               hec_online.inc      hec_zebra.inc


-----------------------------------------------------------------------------
-----------------------------------------------------------------------------

hec_adc.inc 
c
c adc values
c *** WARNING ***
c must be preceded by the include file hec_par.inc
c 
c adc values for time slice i_t
c i_adc_ic_t(ic, i_t)                   adc values   "adc channel system" 
c i_adc_db_t(i_mod, i_seg, i_pad, i_t)  adc values   "database system" 
c i_adc_ph_t(i_eta, i_phi, i_z, i_t)    adc values   "physics system"
c
c first time slice only (useful for 1996 data)
c i_adc_ic(ic)                   adc values   "adc channel system" 
c i_adc_db(i_mod, i_seg, i_pad)  adc values   "database system" 
c i_adc_ph(i_eta, i_phi, i_z)    adc values   "physics system"
c
c packed 32 bit adc values for Oct. 1997 and beyond
c i_adc_pk(1:i_adc_dim)          16-bit packed adc values and channel#
c
c
      integer i_adc_ic_t(1:i_adc_dim, 
     +                   1:i_tim_dim)
      integer i_adc_db_t(1:i_mod_max, 1:i_seg_max, 1:i_pad_max, 
     +                   1:i_tim_dim)
      integer i_adc_ph_t(1:i_eta_max, 1:i_phi_max, 1:i_z_max, 
     +                   1:i_tim_dim)
c
      integer i_adc_ic(1:i_adc_dim)
      integer i_adc_db(1:i_mod_max, 1:i_seg_max, 1:i_pad_max)
      integer i_adc_ph(1:i_eta_max, 1:i_phi_max, 1:i_z_max)
c
      integer i_adc_pk(1:i_adc_dim, 1:i_tim_dim)
c
c equivalence for first time sampling
c
      equivalence (i_adc_ic(1), i_adc_ic_t(1, 1))
      equivalence (i_adc_db(1, 1, 1), i_adc_db_t(1, 1, 1, 1))
      equivalence (i_adc_ph(1, 1, 1), i_adc_ph_t(1, 1, 1, 1))
c
c max adc and time using preferred max finding package
c
      common /sssadc/ i_adc_ic_t,
     +                i_adc_db_t,
     +                i_adc_ph_t,
     +                i_adc_pk
c





______________________

 hec_beam.inc
C
C Contain the parameters of a reconstructed beam particle trajectory
C xbeam - beam x-coordinate at z=zbeam
C ybeam - beam y-coordinate at z=zbeam
C zbeam - z-coordinate, at which (x,y)-coordinates of a beam trajectory
C         are calculated. It should be set during the initialization stage.
C xslop - trajectory x-slop: at any z     x=xbeam+xslop*(z-zbeam)
C yslop - trajectory y-slop: at any z     y=ybeam+yslop*(z-zbeam)
C xbeam_ok - .TRUE., if beam x-projection is successfully reconstructed
C ybeam_ok - .TRUE., if beam y-projection is successfully reconstructed
      logical xbeam_ok, ybeam_ok
      real xbeam, ybeam, zbeam, xslop, yslop
      common/beam/xbeam,ybeam,zbeam,xslop,yslop,xbeam_ok,ybeam_ok
C


---------------------

hec_beam_sys_cluset.inc
C
C Common with input data for the LINEFIT subroutine
C Maximal number of MWPC planes is 5
C IVCLU = 0, if there is no cluster in the corresponding plane
C CCLU  is the cluster coordinate
C WCLU  is the cluster width
C ZCLU  is z-coordinate of the MWPC plane
C ZCLU2 = ZCLU**2
C
      INTEGER IVCLU
      REAL    WCLU, CCLU, ZCLU, ZCLU2
C
      COMMON/CLUSET/IVCLU(5),CCLU(5),WCLU(5),ZCLU(5),ZCLU2(5)
C


--------------------------


hec_beam_sys_clusters.inc
C
C Common with output data from the GETCLUST subroutine
C Maximal number of chambers is 5
C Maximal number of clusters in one plane is 10
C NCLUX(I_CHA) - number of clusters in x_plane of chamber I_CHA
C NCLUY(I_CHA) - number of clusters in y_plane of chamber I_CHA
C CLUX(1,J,I_CHA) - coordinate of J-th cluster in x-plane of chamber I_CHA
C CLUX(2,J,I_CHA) - width of J-th cluster in x-plane of chamber I_CHA
C CLUY(1,J,I_CHA) - coordinate of J-th cluster in y-plane of chamber I_CHA
C CLUY(2,J,I_CHA) - width of J-th cluster in y-plane of chamber I_CHA
C
      INTEGER NCLUX, NCLUY
      REAL CLUX, CLUY
      COMMON/CLUSTERS/NCLUX(5),NCLUY(5),CLUX(2,100,5),CLUY(2,100,5)
C


----------------------

hec_beam_sys_config.inc
C
C Common describing MWPC configuration
C Maximal number of MWPCs is 5
C ZXPLANE(I_CHA) -  z-coordinate of the x-plane of the chamber I_CHA
C ZYPLANE(I_CHA) -  z-coordinate of the y-plane of the chamber I_CHA
C STEP(I_CHA) - distance between the wires of the chamber I_CHA
C HSIZE(I_CHA) - half size of the chamber I_CHA
C XINV(I_CHA) - =1,  if wire numberig goes from low to high coordinate
C               =-1, if otherwise  (x-planes)
C YINV(I_CHA) - =1,  if wire numberig goes from low to high coordinate
C               =-1, if otherwise  (y-planes)
C NRFF - number of the first reference chamber
C NRFL - number of the last (second) reference chamber
C
      INTEGER NRFF, NRFL
      REAL ZXPLANE, ZYPLANE, STEP, HSIZE, XINV, YINV
      COMMON/CONFIG/ZXPLANE(5),ZYPLANE(5),STEP(5),HSIZE(5),
     +XINV(5),YINV(5),NRFF,NRFL



----------------------

hec_beam_sys_shifts.inc
C
C Common with the alignment constants for MWPCs
C SHIFTX(I_CHA) - x-shift for the x-plane of the chamber I_CHA
C SHIFTY(I_CHA) - y-shift for the y-plane of the chamber I_CHA
C BEAMX - x-position of beam at the 1-st reference MWPC
C BEAMY - y-position of beam at the 1-st reference MWPC
C
C If SHIFTX[Y] is set greater than 1000., the plane will be ignored
      REAL SHIFTX, SHIFTY, BEAMX, BEAMY
      COMMON/SHIFTS/SHIFTX(5),SHIFTY(5),BEAMX,BEAMY
C


------------------------


hec_cal.inc
c
c calibrated energies common
c *** WARNING ***
c must be preceded by the include file hec_par.inc
c 
c max adc and time using preferred max finding package
c hec_cal_ic(ic)              the energy (nA) in cell ic
c hec_cal_db(imod,iseg,ipad)  the energy (nA) in module=imod, segment=iseg and pad=ipad
c hec_cal_ph(ieta,iphi,iz)    the energy (nA) in eta=ieta, phi=iphi, z=iz
c ic_has_calib(ic)            .true. if channel ic has good calibration coefficients
c
      real hec_cal_ic(1:i_adc_dim)
      real hec_cal_ph(1:i_eta_max, 1:i_phi_max, 1:i_z_max )
      real hec_cal_db(1:i_mod_max, 1:i_seg_max, 1:i_pad_max)
      logical ic_has_calib(1:i_adc_dim)
c
      real hec_cal_ped_ic(1:i_adc_dim) 
      real hec_cal_rms_ic(1:i_adc_dim) 
c
      common /ssscal/ hec_cal_ic,
     +                hec_cal_db,
     +                hec_cal_ph,
     +                ic_has_calib,
     +                hec_cal_ped_ic,
     +                hec_cal_rms_ic



---------------------

hec_cal_coef.inc
c
c calibration coefficients common
c *** WARNING ***
c must be preceded by the include file hec_par.inc
c
c cal_version          file version
c hec_cal_coef(ic,i)   i = 1,4 for the 4 calibration parameters
c                        = 5 for the calibration flag  
c                        (1=good, 2=bad fit, 3=dead)
c
      integer cal_version
      real hec_cal_coef(1:i_adc_dim, 5)
c
      common /ssscac/ cal_version, hec_cal_coef
c



-----------------------

hec_crl.inc 
c
c correlation package common
c
c
c event counter
c
      integer nevtcrl
c
c set maximum number of slices and adcs that can be examined 
c with this package (do not increase the size of these as the
c memory of the entire hec_adc package rises like the cube of these
c dimensions)
c
      integer crl_maxsamp,crl_maxadc
      parameter (crl_maxsamp=16)
      parameter (crl_maxadc=50)
c
c ****  arrays with average, r.m.s. and correlation coefficients
c
      common /sssivcom/ dpave(crl_maxsamp,crl_maxadc),
     &                dprms(crl_maxsamp,crl_maxadc),
     &             dpcortim(crl_maxsamp,crl_maxsamp,crl_maxadc),
     &             dpcoradc(crl_maxadc,crl_maxadc,crl_maxsamp),
     &             dps1(crl_maxsamp,crl_maxadc),
     &             dps2(crl_maxsamp,crl_maxadc),
     &             dpsc2(crl_maxadc,crl_maxadc,crl_maxsamp),
     &             dpsc1(crl_maxsamp,crl_maxsamp,crl_maxadc),
     &             nevtcrl
c
      DOUBLE PRECISION dpave,dprms,dpcortim,dpcoradc
      DOUBLE PRECISION dps1,dps2,dpsc1,dpsc2



------------------------

 hec_cub.inc
c
c max adc and time common for simple cubic fit
c *** WARNING ***
c must be preceded by the include file hec_par.inc
c
c max adc and time using simple cubic fit
c adc_cub_ic(ic, 1)  max adc values (not pedestal subtracted) in channel ic
c adc_cub_ic(ic, 2)  max adc t values in channel ic in units of time samplings
c
      real adc_cub_ic(1:i_adc_dim, 2)
c
      common /ssscub/ adc_cub_ic
c



----------------

hec_datacard.inc
c
c *** WARNING ***
c must be preceded by the include file hec_par.inc
c see user/datacard.info for the description of the datacards
c
c common for datacard values
c
c card    variable   
c
c rnmode  i 1= run_mode 
c intyp   i 1= in_typ 
c npass   i 1= n_pass
c nevtm   i 1= n_evtmax 
c runpd   i 1= irunpd
c mkped   i 1= mk_ped
c         i 2= nt_ped(1)
c         i 3= nt_ped(2)
c         r 4= sc_ped
c         i 5= tr_ped
c         i 6= io_ped(1)
c         i 7= io_ped(2)
c         i 8= io_ped(3)
c         i 9= io_ped(4)
c         i 10= pr_ped
c mkcub   i 1= mk_cub
c         r 2= sc_cub
c         i 3= tm_cub
c         i 4= fl_cub
c         i 5= t1_cub
c         i 6= t2_cub
c mkdig   i 1= mk_dig
c         i 2= pr_dig
c         i 3= t0_dig
c mpref   i 1= m_pref
c mkhis   i 1= mk_his
c         i 2= io_his
c         i 3= his_srch_flg
c hiscon  i 1 = histo_switch(1)
c         i 2 = histo_switch(2)
c         i 3 = histo_switch(3)
c         i 4 = histo_switch(4)
c         i 5 = histo_switch(5)
c         i 6 = histo_switch(6)
c         i 7 = histo_switch(7)
c hisctit##  c  his_clus_title(j)
c hisclus##  i   1= his_clus_cell_array(1, j) = n
c            i   2= his_clus_cell_array(2, j) , etc.
c            i n+1= his_clus_cell_array(n+1, j)
c iocal   i 1= io_cal(1)
c         i 2= io_cal(2)
c         i 3= io_cal(3)
c rrunh   i 1= run_no_cr
c         r 2= e_beam_cr
c         i 3= i_part_cr
c         r 4= x_cryo_cr
c         r 5= y_tabl_cr
c beamc   i 1= mk_beam
c         r 2= z_beam 
c         i 3= hpr_beam 
c         i 4= io_beam(1)
c         i 5= io_beam(2)
c mkcrl   i 1= mk_crl
c         i 2= io_crl
c search  i 1= hec_s_dk
c         r 2= hec_s_algo(1)
c         r 3= hec_s_algo(2)
c         r 4= hec_s_algo(3)
c         r 5= hec_s_algo(4)
c         r 6= hec_s_algo(5)
c mkntp   i 1= mk_ntp
c         i 2= io_ntp
c         i 3= eunits_ntp
c         r 4= tfilter_ntp
c         i 5= nt_user_switch
c         i 6= random_ntp  
c online  i 1= auto_run
c         i 2= auto_rnnum
c         i 3= cr_tdc_wac_c
c         i 4= cr_tdc_wac_epi
c         i 5= cr_tdc_wac_mu
c
      integer run_mode
      integer in_typ(2)
      integer n_pass
      integer n_evtmax
      integer irunpd
      integer mk_ped
      integer nt_ped(2)
      real    sc_ped
      integer tr_ped
      integer io_ped(4)
      integer pr_ped
      integer mk_cub
      real    sc_cub
      integer tm_cub, fl_cub, t1_cub, t2_cub
      integer mk_dig, pr_dig, t0_dig
      integer m_pref
      integer mk_his, io_his, his_srch_flg
      integer histo_switch(7)
      integer his_clus_cell_array(i_adc_dim+1, nclust_dim)
      integer his_clus_ititle(nclust_dim)
      character*4 his_clus_title(nclust_dim)
      integer io_cal(3)
      integer run_no_cr
      real    e_beam_cr
      integer i_part_cr
      real    x_cryo_cr
      real    y_tabl_cr
      integer mk_beam
      real    z_beam
      integer hpr_beam
      integer io_beam(2)
      integer mk_crl
      integer io_crl
      integer hec_s_dk
      real    hec_s_algo(5)
      integer mk_ntp, io_ntp, eunits_ntp, nt_user_switch, random_ntp
      real tfilter_ntp
      integer auto_run, auto_rnnum
      integer cr_tdc_wac_c, cr_tdc_wac_epi, cr_tdc_wac_mu       
c     
      common /sssdat/ run_mode,
     +                in_typ,
     +                n_pass,
     +                n_evtmax,
     +                irunpd,
     +                mk_ped, nt_ped, sc_ped, tr_ped, io_ped, pr_ped,
     +                mk_cub, sc_cub, tm_cub, fl_cub, t1_cub, t2_cub,
     +                mk_dig, pr_dig, t0_dig,
     +                m_pref,
     +                mk_his, io_his, his_srch_flg,
     +                histo_switch,
     +                his_clus_cell_array,
     +                his_clus_ititle, his_clus_title,
     +                io_cal,
     +                run_no_cr, e_beam_cr, i_part_cr,
     +                x_cryo_cr, y_tabl_cr,
     +                mk_beam,z_beam, hpr_beam, io_beam,
     +                mk_crl, io_crl,
     +                hec_s_dk, hec_s_algo,
     +                mk_ntp,io_ntp,eunits_ntp,tfilter_ntp,
     +                nt_user_switch, random_ntp,
     +                auto_run, auto_rnnum, 
     +                cr_tdc_wac_c, cr_tdc_wac_epi, cr_tdc_wac_mu
c



---------------------------------


hec_dig.inc
c
c max adc and time common for digital filtering method
c *** WARNING ***
c must be preceded by the include file hec_par.inc
c
c max adc and time for digital filtering method
c adc_dig_ic(ic, 1)     max adc values in channel ic (pedestal subtracted)
c adc_dig_ic(ic, 2)     max adc t values in channel ic in ns
c ic_has_amp_weights(ic) .true. if channel ic has good amplitude weight coefficients
c ic_has_tim_weights(ic) .true. if channel ic has good time weight coefficients
c
      real adc_dig_ic(1:i_adc_dim, 2)
      logical ic_has_amp_weights(1:i_adc_dim)
      logical ic_has_tim_weights(1:i_adc_dim)
c
      common /sssdig/ adc_dig_ic, 
     +                ic_has_amp_weights, 
     +                ic_has_tim_weights
c



-------------------------


hec_dig_sys.inc
c
c digital filtering system common
c *** WARNING ***
c must be preceded by the include file hec_par.inc
c
c read from weights file
c dig_weight_version   date of weight coefficient file release (ie 990506)
c dig_nslice           number of time slices used in filtering
c dig_nwpar            number of filtering weight parameters
c dig_slice_1          the first guess at the first time slice used in filtering
c dig_t_global         global time offset (ns) to synchronise to ref cell timing
c dig_ic_ref           reference cell ic for global time offset
c dig_amp_par(ic,dig_nslice,dig_nwpar)   parameters for the amplitude weight 
c dig_tim_par(ic,dig_nslice,dig_nwpar)   parameters for the time weights
c dig_t0_raw(ic)       raw t0 (ns) for each cell
c dig_t0(ic)           t0 (ns) for each cell
c
c dig_weight_amp(ic,dig_nslice)     amplitude weights for the event
c dig_weight_tim(ic,dig_nslice)     time weights for the event
c dig_ns(ic)                        time phases [0,25ns] for the event
c dig_slice_shift(ic)               time slice shifts wrt dig_slice_1 for the event
c
      integer mx_dig_nslice, mx_dig_nwpar      
      parameter(mx_dig_nslice=9, mx_dig_nwpar=9)            
c
      integer dig_weight_version
      integer dig_nslice
      integer dig_nwpar
      integer dig_slice_1
      real dig_t_global
      integer dig_ic_ref
      real dig_amp_par(i_adc_dim, mx_dig_nslice, mx_dig_nwpar)
      real dig_tim_par(i_adc_dim, mx_dig_nslice, mx_dig_nwpar)
      real dig_t0_raw(i_adc_dim)
      real dig_t0(i_adc_dim)
      real dig_weight_amp(i_adc_dim, mx_dig_nslice)
      real dig_weight_tim(i_adc_dim, mx_dig_nslice)
      real dig_ns(i_adc_dim)
      integer dig_slice_shift(i_adc_dim)
c
      common /sssdigsys/ dig_weight_version, 
     +                   dig_nslice, 
     +                   dig_nwpar, 
     +                   dig_slice_1, 
     +                   dig_t_global, 
     +                   dig_ic_ref,
     +                   dig_amp_par, 
     +                   dig_tim_par,
     +                   dig_t0_raw,
     +                   dig_t0,
     +                   dig_weight_amp, 
     +                   dig_weight_tim,
     +                   dig_ns,
     +                   dig_slice_shift
c



-----------------------------

hec_dwpc.inc
c
c beam chamber parameter DWPC common
c
      integer dwpc_dim
      parameter (dwpc_dim = 100)
      integer n_dwpc
      integer dwpc_words(dwpc_dim)
      common /ssswpc/ n_dwpc, dwpc_words


-------------------------------
hec_dwpc.inc
c
c beam chamber parameter DWPC common
c
      integer dwpc_dim
      parameter (dwpc_dim = 100)
      integer n_dwpc
      integer dwpc_words(dwpc_dim)
      common /ssswpc/ n_dwpc, dwpc_words
[mgf@marcie inc]$ cat hec_epio.inc
c
c epio common
c
      integer id_runh, id_evth, id_dwpc, id_adc_96, id_adc_97 
      integer id_tdc, id_fadc, id_slow, id_slow_pc,id_slow_sps
      integer id_slow_beam
      parameter (id_runh = 9)
      parameter (id_evth = 1)
      parameter (id_dwpc = 33)
      parameter (id_adc_96 = 35)
      parameter (id_adc_97 = 36)
      parameter (id_fadc = 37)
      parameter (id_tdc = 39)
      parameter (id_slow = 70)
      parameter (id_slow_pc = 71)
      parameter (id_slow_sps = 73)
      parameter (id_slow_beam = 74)
c
      integer*2 ibankbuf(40000)
      integer ipointep, lrecbuf, lepbuf
      common /sssepbuf/ ibankbuf, ipointep, lrecbuf, lepbuf




---------------------------------

hec_evth.inc
c
c event header common
c
c i_event       event number
c evt_time      Unix binary time of event. Use ctimef to decode it
c lpat_1(i)     i=1,16   bits of pattern unit 1 
c lpat_2(i)     i=1,16   bits of pattern unit 2
c lpat_3(i)     i=1,16   bits of pattern unit 3 
c lpat_4(i)     i=1,16   bits of pattern unit 4
c i_trigcnt(i)  i=1,64   number of events in run that have each 
c                        of above pattern unit bits turned on. 
c mwpc_signal_hit_count     number of events with signal in ANY wire 
c                           of any beam chamber
c mwpc_signal_xhit_count(i) i=1-5 number of events with x-signal in mwpc #i
c mwpc_signal_yhit_count(i) i=1-5 number of events with y-signal in mwpc #i
c
c lpat_4(3)   random trigger
c lpat_1(15)  pi/e trigger
c
      integer i_event, evt_rnum,evt_time
      logical lpat_1(16)
      logical lpat_2(16)
      logical lpat_3(16)
      logical lpat_4(16)
      integer ibittot
      parameter (ibittot=64)
      integer i_trigcnt(ibittot)
      integer mwpc_signal_hit_count
      integer mwpc_signal_xhit_count(5)
      integer mwpc_signal_yhit_count(5)
c
      common /sssevt/ i_event,evt_rnum,evt_time,
     +                lpat_1,lpat_2,lpat_3,lpat_4,
     +                i_trigcnt,
     +                mwpc_signal_hit_count,
     +                mwpc_signal_xhit_count, mwpc_signal_yhit_count
c


----------------------------

hec_fadc.inc
c
c adc values
c *** WARNING ***
c must be preceded by the include file hec_par.inc
c 
c adc values for time slice i_t
c i_fadc_ic_t(ic, i_t)              fadc values   "adc channel system" 
c
c
c packed 32 bit adc values for Oct. 1997 and beyond
c i_fadc_pk(1:i_fadc_dim)          16-bit packed adc values and channel#
c
c
      integer i_fadc_ic_t(1:i_fa_cdim, 1:i_fa_tdim)
ccc      integer i_fadc_ic_t(1:8, 1:100)
c
      integer i_fadc_pk(1:i_fa_tdim*i_fa_cdim/2)
ccc      integer i_fadc_pk(1:400)
c
      integer i_fadc_tim
      integer n_fadc_mod
c
      logical firstfadc
c
c max adc and time using preferred max finding package
c
      common /sssfadc/ i_fadc_ic_t,
     +                i_fadc_pk,
     +                i_fadc_tim,
     +                n_fadc_mod,
     +                firstfadc
c


------------------

hec_geo.inc
c
c geometry correspondence tables common
c *** WARNING ***
c must be preceded by the include file hec_par.inc

---> this common is so long - it desreves a seperate (its own) file!


-----------------
hec_his_fit.inc
c
c RESULT OF HISTOGRAM FITTING
c
c Impact parameter and Z clusters: i=1,3 for adc distribution,
c calibrated energy, and calibrated and hv corrected energy
c In case of noise runs, the index i runs on particle type
c
c  imp_clus_mean(i)     
c  imp_clus_mean_err(i)
c  imp_clus_sig(i)
c  imp_clus_sig_err(i)
c  imp_clus_noent(i)
c  imp_clus_chi2(i)
c  z_clus_mean(i)     
c  z_clus_mean_err(i)
c  z_clus_sig(i)
c  z_clus_sig_err(i)
c  z_clus_noent(i)
c  z_clus_chi2(i)
c
      real     imp_clus_mean(3),imp_clus_mean_err(3),imp_clus_sig(3),
     &         imp_clus_sig_err(3),imp_clus_chi2(3)
      real     z_clus_mean(3),z_clus_mean_err(3),z_clus_sig(3),
     &         z_clus_sig_err(3),z_clus_chi2(3)
      integer imp_clus_noent(3)
      integer z_clus_noent(3)
      common /histfit/ imp_clus_mean,
     &               imp_clus_mean_err,
     &               imp_clus_sig,
     &               imp_clus_sig_err,
     &               imp_clus_noent,
     &               imp_clus_chi2,
     &               z_clus_mean,
     &               z_clus_mean_err,
     &               z_clus_sig,
     &               z_clus_sig_err,
     &               z_clus_noent,
     &               z_clus_chi2


----------------


hec_his_sys.inc
c
c system histogram id common
c (must be preceeded by hec_geo.inc)
c
c adc pedestal values distribution
c
      integer id_ped
      parameter (id_ped = 1)
c
c adc pedestal values vs adc channel number
c
      integer id_ped_ic
      parameter (id_ped_ic = 2)
c
c adc pedestal rms values distribution
c
      integer id_rms 
      parameter (id_rms = 3)
c
c adc pedestal rms values vs adc channel number
c
      integer id_rms_ic 
      parameter (id_rms_ic = 4)
c
c adc(max) versus channel number 
c
      integer id_max_ic
      parameter (id_max_ic = 5)
c
c adc(max) map of front face 
c
      integer id_map
      parameter (id_map = 6)
cc
c adc(max)-ped distribution for each tower depth
c id = id_adc_z + i_z
c
      integer id_adc_z
      parameter (id_adc_z = 10)
c
c tdc distribution
c
      integer id_tdcd
      parameter (id_tdcd = 20)
c
c flash adc histograms
c
      integer id_fadc
      parameter (id_fadc = 100)
c
c adc(max)-ped distribution for each chanel
c id = id_adc_ic + ic
c
      integer id_adc_ic
      parameter (id_adc_ic = 1000)
c
c time(max) distribution for each channel for 1997 onwards 
c
      integer id_tim_ic
      parameter (id_tim_ic = 2000)
c
c time(max) distribution with TDC correction (ns)
c
      integer id_tim_icns
      parameter (id_tim_icns = 2500)
c
c time profile for each channel in 1997 onwards
c
      integer id_tprof_ic
      parameter (id_tprof_ic = 10000)
c
c tdc corrected time profile
c
      integer id_timns_ic
      parameter (id_timns_ic = 11000)
c
c energy in nA for each channel
c
      integer id_cal_ic
      parameter (id_cal_ic = 12000)
c
c energy in cells above sigma cut
c
      integer id_sigma
      parameter (id_sigma = 13000)
c
c set id of clusters of cells (energy reconstruction)
c
      integer id_clus
      parameter(id_clus = 15000)
      integer id_clus_cal
      parameter(id_clus_cal = 16000)
      integer id_clus_cal_hv
      parameter(id_clus_cal_hv = 17000)
c
c keep track of histogram ids actually used
c
      integer id_used_max
      parameter (id_used_max = 1000)
      integer n_id_used
      integer id_used(id_used_max)
c
c set number of bins used in tdc time profiles (# of ns)
c
      integer ntdc_bin
      parameter (ntdc_bin = 2000)
c
c moments of the adc channels
c
      double precision adcmom(i_adc_dim, i_tim_dim, 3)
      double precision tdcmom(i_adc_dim, ntdc_bin, 3)
c
c moments of the maximum in each channel
c
      double precision maxmom(1:i_adc_dim, 3)
c
c array that stores signal (max-ped) for each ic
c and one that stores the error on this mean
c
      real average_max(i_adc_dim)
      real errmax(i_adc_dim)
c
c sum of the signal in each long. layer for each event
c
      real sig_sum(1:i_z_max)
c
c sum of signal from cells above X sigma, both HV uncorrected and
c HV corrected
c
      real sum_sigma(3),sum_sigma_hv(3)
c
c depth weights for clusters
c
      real depthw_adc(1:i_z_max)	
      real depthw_na(1:i_z_max)	
c
c number of energy clusters requested and index of which ones they are
c
      integer his_clus_num, his_clus_index(nclust_dim)
c
c first time slice content in 4 channels every (10th, 100th) ped event 
c
      real adc_ped_time_ic1(1:100)
      real adc_ped_time_ic2(1:100)
      real adc_ped_time_ic3(1:100)
      real adc_ped_time_ic4(1:100)
c
      common /sssonlinehid/ n_id_used, id_used, adcmom, maxmom, 
     + average_max, errmax, tdcmom, sig_sum, sum_sigma, 
     + sum_sigma_hv, depthw_adc, depthw_na,
     + his_clus_num, his_clus_index,                  
     + adc_ped_time_ic1,adc_ped_time_ic2,
     + adc_ped_time_ic3,adc_ped_time_ic4
c



------------------------------

hec_hvpar.inc
c
c Calorimeter HV geometry and correspondence tables 
c
c
c 1999-2000 TESTBEAM periods
c
c HV Module present: 3 HV CAL  modules, 24 channels each
c                    4 HV PM   modules, 12 channels each
c                    3 HV MWPC modules,  6 channels each
c
c******************************************************************************
c HV table for calorimer:
c connects each HV module and channel to the corresponding calorimeter module,
c gap (est1, pad1, pad2,est2), and longitudinal segment
c
c hvtodb(hv_mod,hv_ch,par)        
c        par = 1 cal_mod [1,3]  
c        par = 2 cal_gap [1,4] (est1,pad1,pad2,est2)
c        par = 3 cal_seg [1,4]
c
      integer nmodhv_cal_max,                     ! maximum # of HV modules
     +        nmodhv_pm_max,                      ! for calorimeter, PM, mwpc
     +        nmodhv_mwpc_max 
      parameter (nmodhv_cal_max = 3, nmodhv_pm_max = 4,     
     +	         nmodhv_mwpc_max = 3)
      integer nchhv_cal_max,                      ! max # of channels in each
     +        nchhv_pm_max,                       ! HV module
     +        nchhv_mwpc_max
      parameter (nchhv_cal_max = 24, nchhv_pm_max = 12,     
     +	         nchhv_mwpc_max = 6)
c
      integer nchcal_hv_used       ! actual # of HV channels used for cal. 
c
      integer hvtodb(0:nmodhv_cal_max-1,nchhv_cal_max,3)      
c
      common /ssshv /nchcal_hv_used,
     +               hvtodb



-----------------------


hec_hvstat.inc
c
c HV status for each cell
c *** WARNING ***
c must be preceded by the include file hec_par.inc
c
c 10/12/1999   C. Sbarra 
c
c variables:
c
c
c lhvstat       = global status of HV: T/F if infos available/unavailable  
c                 
c status of High Voltage for channel ic (bit packed)
c according to slow_control 
c
c ic_hv_known(ic) = T  slow control info present for ch ic
c                 = F  no slow control info for ch ic
c                 
c ic_hvstat(ic) = 0  everything ok - assumed so if no SC info
c               = bit 1 on  EST1 off/undervoltage
c               = bit 2 on  PAD1 off/undervoltage
c               = bit 3 on  PAD2 off/undervoltage
c               = bit 4 on  EST2 off/undervoltage
c
c ic_hv_cor(ic) = HV correction factor for channel ic
c                 when HV status known, 0 otherwise  
c
      integer ic_hvstat(i_adc_dim)
      real    ic_hv_cor(i_adc_dim)
      logical ic_hv_known(i_adc_dim), lhvstat
c
      common /ssshvstat/ic_hvstat, ic_hv_cor,
     +                  ic_hv_known, lhvstat     



----------------------------


hec_imp.inc
c
c IMPACT PARAMETER ARRAYS                
c 
c impact_point_name(i)   name of impact point i
c impact_point_x(i)      x-val for  "
c impact_point_y(i)      y-val fpr  "
c impact_point_index     index in the above arrays corresponding
c                        to the actual impact parameter when appropriate,
c                        zero otherwise
c
      integer impmax
      parameter(impmax=20)
      character*1 impact_point_name(impmax)
      integer impact_point_x(impmax)
      integer impact_point_y(impmax)
      integer impact_point_index      

c
      common /sssimp/  impact_point_name,
     +                 impact_point_x,
     +                 impact_point_y,
     +                 impact_point_index
c


----------------------------


hec_max.inc 
c
c max adc and time values common
c *** WARNING ***
c must be preceded by the include file hec_par.inc
c 
c max adc and time using preferred max finding package
c *** NOTE *** max adc are pedestal subtracted
c adc_max_ic(ic, 1)                    max adc values   "adc channel system" 
c adc_max_ic(ic, 2)                    max adc t values in ns
c adc_max_db(i_mod, i_seg, i_pad, 1)   max adc values   "database system" 
c adc_max_db(i_mod, i_seg, i_pad, 2)   max adc t values in ns
c adc_max_ph(i_eta, i_phi, i_z, 1)     max adc values   "physics system"
c adc_max_ph(i_eta, i_phi, i_z, 2)     max adc t values in ns
c
      real adc_max_ic(1:i_adc_dim, 2)
      real adc_max_db(1:i_mod_max, 1:i_seg_max, 1:i_pad_max, 2)
      real adc_max_ph(1:i_eta_max, 1:i_phi_max, 1:i_z_max, 2)
c
      common /sssmax/ adc_max_ic,
     +                adc_max_db,
     +                adc_max_ph
c


-----------------------

hec_maxepio.inc
c
c maximum epio buffer common
c
c set the size of the epio buffer for this run period
c
      integer*2 epdatabuf(40000), iepbufset(40000)
      common /sssepsetbuf/ epdatabuf, iepbufset     

-----------------------hec_ntuple.inc
c
c ntuple common
c
c sssntrun  --  run header ntuple
c sssntevt  --  event ntuple
c sssntsc   --  slow controls ntuple
c
      integer hec_runno,hec_runpd,hec_numevt,hec_parttype
      integer hec_peakf,hec_cal_version,hec_dig_version
      integer hec_eunit,hec_shower,hec_cells_used
      integer hec_ieta(i_adc_dim),hec_iphi(i_adc_dim),hec_iz(i_adc_dim)
      integer hec_ic(i_adc_dim),hec_index(i_adc_dim),hec_adc_max
      real hec_beame,hec_cryox,hec_tabley,hec_zbeam
      real hec_ped_rms(i_adc_dim)
c
      integer hec_evtno,hec_trig(5)
      real hec_signal(i_adc_dim)
c
      integer hec_xbeam_ok,hec_ybeam_ok
      real hec_xbeam,hec_ybeam,hec_xslop,hec_yslop
c
      real hec_lartemp(8),hec_press
      integer hec_time,hec_hvstat(i_adc_dim)
      real hec_hvcor(i_adc_dim)
      integer hec_adc_used       
c
      common /sssntrun/ hec_runno,hec_runpd,hec_beame,hec_numevt,
     +                  hec_parttype,
     +                  hec_cryox,hec_tabley,hec_zbeam,
     +                  hec_peakf,hec_cal_version,hec_dig_version,
     +                  hec_shower,hec_eunit,hec_adc_max,hec_index,
     +                  hec_cells_used,
     +                  hec_ped_rms,hec_ieta,hec_iphi,hec_iz,
     +                  hec_ic
c
      common /sssntevt/ hec_evtno,hec_trig,
     +                  hec_signal,
     +                  hec_xbeam,hec_ybeam,hec_xslop,hec_yslop,
     +                  hec_xbeam_ok,hec_ybeam_ok
c
      common /sssntsc/ hec_time,hec_lartemp,hec_press,
     +                 hec_adc_used,hec_hvcor



-------------------------


hec_ntuple_sys.inc
c
c ntuple system common
c *** WARNING ***
c must be preceded by the include file hec_par.inc
c
c set id's of ntuples
c
c run ntuple
c
      integer id_ntuple_run
      parameter (id_ntuple_run = 100)
c
c event ntuple
c
      integer id_ntuple_evt
      parameter (id_ntuple_evt = 101)
c
c slow control ntuple
c
      integer id_ntuple_slc
      parameter (id_ntuple_slc = 102)
c
      integer cell_list(i_adc_dim), i_good_cells
      common /sssntsys/ cell_list, i_good_cells


---------------------


 hec_online.inc
c
c *** WARNING ***
c must be preceded by the include file hec_par.inc
c
c online mode common
c
c
c online mode flag
c
      logical onflag
c
c flag for end of run
c
      logical eorflag
c
c flag for existence of online runfile
c
      logical runfile
c
c run number of requested data file
c
      integer irun
c
c input file name for online data
c
      character*18 infname
c
c user requests trigger type to look at for this run
c
      integer trigreq
c
c sums to find average energy in each depth
c
      real depth_mom0(i_z_max),depth_mom1(i_z_max),depth_frac(i_z_max)
      integer pion_count,elec_count,phys_trig_count
c
c count number of triggers processed 
c
      integer i_proc	
c
      common /sssonline/onflag,eorflag,runfile,irun,trigreq,
     +                  depth_mom0,depth_mom1,depth_frac,i_proc,
     +                  pion_count, elec_count, phys_trig_count,
     +                  infname
c



-------------------------

hec_par.inc
c
c shared parameters
c
c i_adc_dim       max adc channel number used (for array dimension)
c i_tim_dim       max number of time samplings per channel
c i_adc_max       max adc value
c
c i_mod_max       max number of modules       (for array dimension)
c i_seg_max       max number of segments      (for array dimension)
c i_pad_max       max number of pads          (for array dimension)
c
c i_eta_max       max number of towers in eta (for array dimension)
c i_phi_max       max number of towers in phi (for array dimension)
c i_z_max         max number of readout depth (for array dimension)
c
c nclust_dim      maximum number of clusters allowed for histogram
c                 and online packages
c
c warning!!!
c for backward compatibility with old run periods, you can only 
c INCREASE any of the following numbers (except adc_val_max!).
c
      integer i_adc_dim
      parameter (i_adc_dim = 310) !max adc channel number
      integer i_tim_dim
      parameter (i_tim_dim = 96) !max number of time samplings
      integer adc_val_max
      parameter (adc_val_max = 4095) !max adc value
c
      integer i_mod_max, i_seg_max, i_pad_max
      parameter (i_mod_max = 3)
      parameter (i_seg_max = 5)
      parameter (i_pad_max = 24)
c
      integer i_eta_max, i_phi_max, i_z_max
      parameter (i_eta_max = 14)
      parameter (i_phi_max = 6)
      parameter (i_z_max   = 5)
c
c trigger fadc variables
c
      integer i_fa_cdim, i_fa_tdim
      parameter (i_fa_cdim = 8)
      parameter (i_fa_tdim = 100)
c
      integer nclust_dim
      parameter (nclust_dim = 60)


-----------------------


hec_paw.inc
c
c paw common
c
      integer i_paw_ini
      parameter (i_paw_ini = 2000000)
c
      real hmemor(i_paw_ini)
      common /pawc/ hmemor


--------------------------

hec_ped.inc
c
c pedestal values common
c *** WARNING ***
c must be preceded by the include file hec_par.inc
c
c adc_ped(ic)       adc pedestal     (real)  Prefered method
c adc_rms(ic)       adc pedestal rms (real)  
c adc_ped_run(ic)   adc pedestal     (real)  Computed over a run
c adc_rms_run(ic)   adc pedestal rms (real)  
c adc_ped_evt(ic)   adc pedestal     (real)  Computed at each event
c adc_rms_evt(ic)   adc pedestal rms (real)  
c
      real adc_ped(1:i_adc_dim)
      real adc_rms(1:i_adc_dim)
      real adc_ped_run(1:i_adc_dim)
      real adc_rms_run(1:i_adc_dim)
      real adc_ped_evt(1:i_adc_dim)
      real adc_rms_evt(1:i_adc_dim)
c
      common /sssped/ adc_ped,
     +                adc_rms,
     +                adc_ped_run,
     +                adc_rms_run,
     +                adc_ped_evt,
     +                adc_rms_evt
c


----------------------------


 hec_ped_sys.inc
c
c pedestal computation common
c *** WARNING ***
c must be preceded by the include file hec_par.inc
c
c i_ped_evt1         number of events used in pass 1
c i_ped_evt2         number of events used in pass 2
c i_adc0_1(ic)       number of peds used pass 1
c i_adc0_2(ic)       number of peds used pass 2
c ped_rej(ic)        fraction of peds rejected by sigma cut
c r_adc1(ic)         adc sums
c r_adc2(ic)         adc**2 sums
c
      integer i_ped_evt1
      integer i_ped_evt2
      integer i_adc0_1(1:i_adc_dim)
      integer i_adc0_2(1:i_adc_dim)
      real ped_rej(1:i_adc_dim)
      double precision r_adc1(1:i_adc_dim)
      double precision r_adc2(1:i_adc_dim)
c
      common /ssspds/ i_ped_evt1, i_ped_evt2, 
     +                i_adc0_1, i_adc0_2, ped_rej, r_adc1, r_adc2
c


----------------------

 hec_runh.inc
c
c run header common
c
c run_no    run number
c e_beam    beam energy
c i_part    particle type   (1=e, 2=mu, 3=pi)
c x_cryo    cryostat x position (cm)
c y_tabl    trigger table y position (cm)
c run_start Unix binary time of run start
c           can be translated to readable format with ctimef
c adc_temp  ADC crate temperature (Celsius)
c
      integer run_no          
      real    e_beam 
      integer i_part
      real    x_cryo
      real    y_tabl
      real    adc_temp
      logical calo_on_flag
      logical mwpc_on_flag
      integer run_start
c
      common /sssrun/ run_no,e_beam,i_part,x_cryo,y_tabl,
     +                calo_on_flag,mwpc_on_flag,run_start,
     +                adc_temp
c


--------------------------

 hec_search.inc
c
c signal searching algorithms common
c *** WARNING ***
c must be preceded by the include file hec_par.inc
c
c the following variables are filled by all searching algorithms
c see also the comments in the main search routinr hec_search_evt
c
c for each event
c
c hec_s_chan(ic)   
c    .false. = no valid signal found in channel ic
c    .true.  = valid signal found in channel ic
c    if no algorithm selected, all .true.
c
c hec_s_result(ic, j)  
c    for a channel with valid signal, adc value of channel ic 
c    where j is a time slice index such that adc max is at j=3
c    for a channel with no valid signal, all zeros.
c    meaningful only if hec_s_chan(ic) is .true.
c
c hec_s_im(ic)
c    index of timeslice (i_t) of the adc max which is at j=3
c    in hec_s_result
c    meaningful only if hec_s_chan(ic) is .true., but not
c    meaningful for the dummy search algorithm (number 0)
c
c the following variables are filled by the package using the
c above variables
c
c hec_s_hit
c    .true. = at least one channel with valid signal
c    if no algorithm, then .true.
c
c hec_s_cells      
c    number of channels with valid signal
c    if no algorithm, this is equal to i_adc_used
c
c cumulative over a run
c
c hec_s_count(ic)  
c    number of events in which channel ic had a valid signal
c    if no algorithm, this is the number of events considered
c
c From work by D. Striegel
c
      logical hec_s_chan(i_adc_dim)
      real    hec_s_result(i_adc_dim, i_tim_dim)
      integer hec_s_im(i_adc_dim)
      logical hec_s_hit
      integer hec_s_cells, hec_s_count(i_adc_dim)
c      
      common /ssshec_s/ hec_s_chan, 
     +                  hec_s_result,
     +                  hec_s_im,
     +                  hec_s_hit, 
     +                  hec_s_cells, 
     +                  hec_s_count


-------------------------

hec_search_1_sys.inc
c
c signal searching algorithm 1 common
c
c the following variables pertain to the searching algorithm 1
c
c for each event
c
c hec_s_start start timeslice to search maximum
c hec_s_stop  stop timeslice to search maximum
c
c hec_s_five, hec_s_seven  logical indicating the # of time slices to look at
c              puls shape:  hec_s_five =.FALSE.
c                           hec_s_seven=.FALSE.    => take 3 timeslices
c
c                           hec_s_five =.TRUE.
c                           hec_s_seven=.FALSE.    => take 5 timeslices
c
c                           hec_s_five =.TRUE.
c                           hec_s_seven=.TRUE.     => take 7 timeslices
c
c hec_s_lvl                sigma level to accept an event
c
c hec_s_mc                 apply the sigmacut for searching or not
c
c hec_s_tcomp              used
c
c From work by D. Striegel
c
      logical hec_s_five, hec_s_seven
      integer hec_s_start, hec_s_stop, hec_s_tcomp
      logical hec_s_mc
      real hec_s_lvl
      
      common /ssshec_s1/ hec_s_five, hec_s_seven, 
     +                   hec_s_start, hec_s_stop, 
     +                   hec_s_tcomp,
     +                   hec_s_mc, hec_s_lvl




-------------------------------


hec_slow_pc.inc
c
c SLOW CONTROL PC DATA
c
c *** must be preceeded by hec_hvpar.inc
c
c --- High Voltage module for CALORIMETER:
c
c hv_cal_hv(i,j)
c      high voltage values (V) module i, channel j
c hv_cal_i(i,j) 
c      current values (muA) module i, channel j
c
c --- High Voltage module for PM:
c
c hv_pm_hv(i,j)
c      high voltage values (V) module i, channel j
c hv_pm_i(i,j)   
c      current values (muA) module i, channel j
c
c --- High Voltage module for MWPC:
c
c hv_mwpc_hv(i,j)
c      high voltage value (V) module i, channel j
c hv_mwpc_i(i,j) 
c      current values (muA) module i, channel j
c
c --- Pressure (mbar) of LAr vapor 
c
c cryo_press
c
c --- Temperature (K) in Cryostat (only 7 out of 8 points filled)
c
c cryo_temp(i) 
c     temperature value
c
c
      integer nval_temp_max
      parameter (nval_temp_max = 8)
c
      real hv_cal_i( 0:nmodhv_cal_max-1 , nchhv_cal_max )
      real hv_cal_hv( 0:nmodhv_cal_max-1, nchhv_cal_max)
      real hv_pm_i( 0:nmodhv_pm_max-1 , nchhv_pm_max)
      real hv_pm_hv( 0:nmodhv_pm_max-1 , nchhv_pm_max)
      real hv_mwpc_i( 0:nmodhv_mwpc_max-1 , nchhv_mwpc_max)
      real hv_mwpc_hv( 0:nmodhv_mwpc_max-1 , nchhv_mwpc_max )
      real cryo_press
      real cryo_temp(nval_temp_max)

      common /ssspcslow/hv_cal_i,hv_cal_hv,
     +	                hv_pm_i,hv_pm_hv,
     +	                hv_mwpc_i,hv_mwpc_hv,
     +                  cryo_press,cryo_temp





--------------------------

 hec_stats_epio.inc
c
c epio banks statistics
c
c keep count of number of banks read
c
c stat_runh   run header
c stat_slow   slow control
c stat_evth   event header
c stat_dwpc   beam chamber
c stat_adc    adc values
c stat_fadc   fadc
c stat_tdc    tdc
c
      integer stat_evth
      integer stat_dwpc
      integer stat_adc
      integer stat_fadc
      integer stat_tdc
      integer stat_runh
      integer stat_slow
c
      common /sssepiostat/ stat_evth,
     +                     stat_dwpc,
     +                     stat_adc,
     +                     stat_fadc,
     +                     stat_tdc,
     +                     stat_runh,
     +                     stat_slow
c


---------------------------


 hec_stats_trig.inc
c
c trigger statistics
c
c keep count of number of daq and wac triggers
c
c stat_daq_e       for trig_daq_e       this is "pi/e*c" (prescaled)
c stat_daq_epi     for trig_daq_epi     this is "pi/e"   (prescaled)
c stat_daq_mu      for trig_daq_mu      this is "mu"     (prescaled)
c stat_random      for trig_random      this is "calib"
c stat_random_hard for trig_random_hard this is "rand"   (prescaled)
c
c stat_wac_c       for trig_wac_c
c stat_wac_epi     for trig_wac_epi
c stat_wac_mu      for trig_wac_mu
c
      integer stat_daq_e 
      integer stat_daq_epi
      integer stat_daq_mu
      integer stat_random
      integer stat_random_hard
      integer stat_wac_c
      integer stat_wac_epi
      integer stat_wac_mu
c
      common /ssstrigstat/ stat_daq_e,
     +                     stat_daq_epi,
     +                     stat_daq_mu,
     +                     stat_random,
     +                     stat_random_hard,
     +                     stat_wac_c,
     +                     stat_wac_epi,
     +                     stat_wac_mu
c


----------------------

hec_tdc.inc
c
c tdc common
c
c the tdc is the time between the trigger and the first time
c sampling.  Therefore, the time associated to time slice i of a
c given cell for cubic fit timing is given by
c 
c t(ns) = (i - 1)*25 + tdc_ns
c
c tdc_raw         raw tdc value in tdc units for this event
c tdc_ns          wac corrected tdc values in ns for this event
c tdc_raw_to_ns   conversion factor from tdc to ns scales
c
c the following words are for experts only
c tdc_raw_shift   tdc shift (different wac trigger) for this event
c tdc_br_point    tdc wrap around constant for this event
c tdc_wac_c       wac_c for that run
c tdc_wac_epi     wac_epi for that run
c tdc_wac_mu      wac_mu for that run
c tdc_wac_reference    one of the three above values. It is defined by the
c                      daq trigger type, which was used in the reference run,
c                      chosen for the time tuning of OF filtering weights .
c
c tdc_dubious     .true., if the current TDC value is inside TDC break-
c                  point region. It means that the value MAY be incorrect 
c                  by 25 nsec. It should be either checked and corrected 
c                  (if necessary) by user or the event should be rejected, 
c                  if such the check is impossible
c tdc_guard_region
c
c tdc_ns_shift       time slice shift to correct October 1997 tdc
c
      integer tdc_raw
      real tdc_ns
      real tdc_raw_to_ns
c
      integer tdc_raw_shift
      integer tdc_br_point
      integer tdc_wac_c, tdc_wac_epi, tdc_wac_mu, tdc_wac_reference
c
      real tdc_ns_shift
      logical tdc_dubious
      integer tdc_guard_region
      
      common /ssstdc/ tdc_raw, 
     +                tdc_ns, 
     +                tdc_raw_to_ns,
     +                tdc_raw_shift,
     +                tdc_br_point, 
     +                tdc_wac_c, 
     +                tdc_wac_epi, 
     +                tdc_wac_mu,
     +                tdc_wac_reference,
     +                tdc_dubious,
     +                tdc_guard_region,
     +                tdc_ns_shift
c 


--------------------------


hec_tdc_sys.inc
c
c tdc detail common
c
c tdc header word
c tdc_status   status of tdc data (1 is ok)
c tdc_n_data   number of tdc data words minus one
c tdc_i_event  tdc event number
c
c tdc data words
c tdc_data(i)        tdc values for tdc channel i (0 to 7)
c tdc_data_status(i) tdc channel i status word (0 is ok)
c
c beware that the tdc channels are not necessarily ordered.
c for example, tdc_n_data can equal 2 and the only valid data could be in
c tdc_data(0), tdc_data(3) and tdc_data(6)
c channel  0   contains the TDC value
c channels 1-2 used by the calibration people;
c channels 3-4 contain clock information;
c channels 5-7 unused
c
      integer tdc_status, tdc_n_data, tdc_i_event
      integer tdc_data(0:7), tdc_data_status(0:7)
c
      common/ssstds/ tdc_status,
     +               tdc_n_data,
     +               tdc_i_event,
     +               tdc_data,
     +               tdc_data_status



---------------------------


 hec_trig.inc
c
c event trigger common
c
c the following useful trigger logical words are extracted
c or constructed from the pattern units (see hec_evth.inc and
c hec_trig.f)
c ML  99/08/26  improved with DAQ trigger words and
c               tdc wrap around flags
c 
c triggers constructed from pattern unit bits
c trig_e
c trig_epi
c trig_halo
c trig_mu
c trig_mucounters
c trig_pi
c trig_physics
c trig_pretrigger
c
c actual triggers used in DAQ
c trig_daq_e       this is "pi/e*c" (prescaled)
c trig_daq_epi     this is "pi/e"   (prescaled)
c trig_daq_mu      this is "mu"     (prescaled)
c trig_random      this is "calib"
c trig_random_hard this is "rand"   (prescaled)
c
c status
c trig_bad         flags normally impossible trigger combinations
c
c flags for tdc wrap around constants
c in principle, one should use a different tdc wrap around constant
c depending on which one of the following flags is set (at most only one
c of these flags is set in one event)
c trig_wac_c
c trig_wac_epi
c trig_wac_mu
c 
      logical trig_e           
      logical trig_epi         
      logical trig_halo        
      logical trig_mu          
      logical trig_mucounters  
      logical trig_pi          
      logical trig_physics     
      logical trig_pretrigger
      logical trig_daq_e
      logical trig_daq_epi
      logical trig_daq_mu
      logical trig_random    
      logical trig_random_hard
      logical trig_bad
      logical trig_wac_c
      logical trig_wac_epi
      logical trig_wac_mu
c
      common /ssstrg/ trig_e,           
     +                trig_epi,         
     +                trig_halo,        
     +                trig_mu,          
     +                trig_mucounters,  
     +                trig_pi,          
     +                trig_physics,     
     +                trig_pretrigger,
     +                trig_daq_e,     
     +                trig_daq_epi,
     +                trig_daq_mu,
     +                trig_random,
     +                trig_random_hard,
     +                trig_bad,
     +                trig_wac_c,      
     +                trig_wac_epi,      
     +                trig_wac_mu      
c


-------------------------


hec_zebra.inc
c
c zebra common
c
      integer ibcsl
      parameter (ibcsl = 1600000)
c
      integer ifence(2)
      integer lev
      real blvect(1600001)
      common /zzz/ ifence,lev,blvect
c
      integer iquest(100)
      common /quest/ iquest
c
      integer iq(ibcsl)
      integer lq(ibcsl)
      integer*2 iq2(2*ibcsl)
      real q(ibcsl)
      equivalence (iq(1),q(1),lq(9)),(lq(1),lev),(iq(1),iq2(1))
c
      integer ipointz
      common /inamen/ ipointz
c
      integer ixstor
      common /comsto/ ixstor
c
c set maximum number of banks to search per event
c
      integer maxbanks
      parameter (maxbanks = 200)
c
c common for FZ statistics
c ***** needed?
c
      integer influn
      integer infsta
      integer infofz(40)
      common /fzstat/ influn,infsta,infofz

--------------------------------------------------
--------------------------------------------------
