*      DATA ZTOF/55.,25.,-23/
*
*   TOF data
*   first index  : 1 = A, 2 = B
*   second index : 1.. number of paddle
*   third index  : 1 = TDC, 2 = ADC

       REAL tof11(2,8,2),tof12(2,6,2)
       REAL tof21(2,2,2),tof22(2,2,2)
       REAL tof31(2,3,2),tof32(2,3,2)
       

c USEFUL TO CALCULATE POSITION WITH HIT JUST IN ONE PLANE
c middle y (or x) position of the upper and middle ToF-Paddle
c to calculate theta-angle without track information
       REAL tof11_x(8), tof21_y(2), tof31_x(3)
       REAL tof12_y(6), tof22_x(2), tof32_y(3)
       
       DATA tof11_x/ -17.85,-12.75,-7.65,-2.55,2.55,7.65,12.75,17.85/
       DATA tof12_y/ -13.75,-8.25,-2.75,2.75,8.25,13.75/
c       DATA tof21_y/ -3.75,3.75/
       DATA tof21_y/  3.75,-3.75/     ! paddles in different order
       DATA tof22_x/ -4.5,4.5/
       DATA tof31_x/ -6.0,0.,6.0/
       DATA tof32_y/ -5.0,0.0,5.0/

C----
       INTEGER left,right,itdc,iadc
       INTEGER tdc_ev, adc_ev, none_ev, none_find
       INTEGER offset, slope
       INTEGER tof11_i,tof21_i,tof31_i
       INTEGER tof12_i,tof22_i,tof32_i

       INTEGER i

*  S11 8 paddles  33.0 x 5.1 cm
*  S12 6 paddles  40.8 x 5.5 cm
*  S21 2 paddles  18.0 x 7.5 cm
*  S22 2 paddles  15.0 x 9.0 cm
*  S31 3 paddles  15.0 x 6.0 cm
*  S32 3 paddles  18.0 x 5.0 cm

        integer  ch11a(8),hb11a(8),ch11b(8),hb11b(8)
        integer  ch12a(6),hb12a(6),ch12b(6),hb12b(6)
        integer  ch21a(2),hb21a(2),ch21b(2),hb21b(2)
        integer  ch22a(2),hb22a(2),ch22b(2),hb22b(2)
        integer  ch31a(3),hb31a(3),ch31b(3),hb31b(3)
        integer  ch32a(3),hb32a(3),ch32b(3),hb32b(3)


        data ch11a / 4, 4, 4, 4,  1,  1, 2, 2/
        data hb11a / 1, 3, 5, 7, 10, 12, 2, 4/
        data ch11b / 2, 2, 2, 2, 1, 1, 1, 1/
        data hb11b / 6, 8, 12, 10, 8, 6, 4, 2/

        data ch12a / 3, 3, 3, 3, 3, 3/
        data hb12a / 2, 4, 6, 8, 10, 12/
        data ch12b / 4, 4, 4, 4, 4,  4/
        data hb12b / 12, 10, 8, 6, 4, 2/
        
        data ch21a / 1, 1/
        data hb21a / 1, 5/
        data ch21b / 2, 1/
        data hb21b / 9, 7/
        
        data ch22a / 1, 1/
        data hb22a / 3, 9/
        data ch22b / 2, 1/
        data hb22b / 11, 11/
        
        data ch31a / 2, 3, 3/
        data hb31a / 7, 9, 11/
        data ch31b / 2, 2, 2/
        data hb31b / 5, 3, 1/
        
        data ch32a / 3, 3, 4/
        data hb32a / 1, 5, 9/
        data ch32b / 3, 3, 4/
        data hb32b / 3, 7, 11/
      
        COMMON / tofcomm /tof11,tof12,tof21,tof22,tof31,tof32
