C                                COMMENTS                                   *
*                                ========                                   *
*     A right REFERENCE system of coordinates is used  or                   *
*             deistvuet 'pravilo pravoi ruki':                                *
*     ukazat. palez sootv. hapravleniu osi  OZ,                             *
*     sredniy palec - OX i bol'shoi palec - OY.                             *
*                                                                           *
*                         INPUT ARGUMENTS:                                  *
*     'xc' - X (or Y) projection of shower (local) coordinate, E weigted!   *
*     xc is measured in cell size d (=3.81 cm), for orthogonal events this  *
*     value ranges from  ~-0.5 to ~0.5.                                     * 
*                                                                           *
*     'theta' is an angle !in DEGREES! [X (or Y) projection] of impact gamma*
*      this value may by of both signs, positive or negative                *
*                                                                           * 
*     'e'  is an energy of incident gamma [in GeV]                          *
*                                                                           *
*                        OUTPUT ARGUMENT:                                   *
*     'x_recon' is a correction value, in cell size d, too.                 *
*     The correction is carried out in a Z-plane, coinciding with a forward *
*     plane of 10 mm Al plate adjoined with a forward plane of Pb counters  *
*     This Z-plane is 19.3 cm away in downstream from a forward  Z-plane    *
*     of a box cover.                                                       * 
*                                                                           *
*      Calculation of 'y_recon' in Y-projection is evident                  *
*                                                                           *
*      If necessary theta could be measured in radians.                     *
*      For this, some Constants should be re_calculated (see the text below)*
C============================================================================
        real function x_recon(xc,theta,e)
c                     ------------------- 
        real t, pi
        parameter (pi=3.14159)
c
        t=(xc-Delta(theta,e))/Alpha(theta,e)
          if(abs(t).le.pi)                    then
        x_recon= xc + A(theta,e)*sin(t)
     *              + B(theta,e)*sin(2.*t)
     *              - C(theta,e)
c
                                              else
*        x_recon= xc - C(theta,e)
        x_recon=  - C(theta,e)
                                              endif
        return
        end
c==========================================
        real function A(theta,e) 
c                     ----------
        A=A_0(e)/(1+(theta/Th_a(e))**2)
        end
C====================================== 
        real function A_0(e)
c                     ------
        real t, par(3)
        data par /0.071, .176, .78/ 
c-----------------------------------
        t=e/par(3)
        A_0=(par(1)+par(2)*t**2)/(1+t**2)
        end
C========================================
        real function Th_a(e)
c                     -------
        real t, par(3)
        data par /55.7, 6.4, .18/ 
c---------------------------------
        t=e/par(3)
        Th_a=(par(1)+par(2)*t**2)/(1+t**2)
        end
C=========================================
        real function B(theta,e) 
c                     ----------
        B=B_0(e)/(1+(theta/Th_b(e))**2)
        end
C======================================
        real function B_0(e)
c                     ------
        real t, par(3)
        data par /0.014, .041, 2.2/ 
c---------------------------------------
        t=e/par(3)
        B_0=(par(1)+par(2)*t**2)/(1+t**2)
        end
C=======================================
        real function Th_b(e)
c                     -------
        real t, par(3)
        data par /9.5, 4.0, 1.8/ 
c---------------------------------------
        t=e/par(3)
        Th_b=(par(1)+par(2)*t**2)/(1+t**2)
        end
C=========================================
        real function Delta(theta,e)
c                     --------------
        Delta=theta/Th_delta(e)
        end
c=========================================
        real function Th_delta(e)
        real t, par(3)
        data par /514., 60.3, .29/ 
c---------------------------------------
        t=e/par(3)
        Th_delta=(par(1)+par(2)*t**2)/(1+t**2)
        end
C=============================================
        real function Alpha(theta,e) 
c                     --------------
        Alpha=Alpha_0(e)/(1+(theta/Th_alpha(e))**4)
        end
C================================================== 
        real function Alpha_0(e)
c                     ----------
        real t, par(3)
        data par /0.127, .157, .75/ 
c-----------------------------------
        t=e/par(3)
        Alpha_0=(par(1)+par(2)*t**2)/(1+t**2)
        end
C========================================
        real function Th_alpha(e)
c                     -----------
        real t, par(3)
        data par /184., 13.2, 0.16/ 
c----------------------------------
        t=e/par(3)
        Th_alpha=(par(1)+par(2)*t**2)/(1+t**2)
        end
c=============================================
        real function C(theta,e) 
c                     ----------
*        C=C_l(e)*sin(theta)
        C=C_l(e)*sin(theta/57.2958)
        end
C=============================================
        real function C_l(e)
c                     ------
        real par(2)
        data par /0.763, .0047/ 
c---------------------------------------
        C_l=par(1)*alog(1.+e/par(2))
        end
