We construct a mean field theory for the lattice model of a structural glass and solve it using the replica method and one step replica symmetry breaking ansatz; this theory becomes exact in the limit of infinite dimensions. Analyzing stability of this solution we conclude that the metastable states remain uncorrelated in a finite temperature range below the transition, but become correlated at sufficiently low temperature. We find dynamic and thermodynamic transition temperatures as functions of the density and construct a full thermodynamic description of a typical physical process in which the system gets trapped in one metastable state when cooled below vitrification temperature. We find that for such physical process the entropy and pressure at the glass transition are continuous across the transition while their temperature derivatives have jumps.Thermodynamics of structural glasses and of vitrification transition is a long standing problem in statistical physics. The essential feature of glass formation is a division of the phase space into an exponentially large number of similar compartments. The system gets trapped in one of these compartments and stays there forever in a complete defiance of ergodic hypothesis; this defines dynamical "states" of the system. Each of these states is characterized by a local order parameter (e.g. atoms positions, magnetization) that varies in space and distinguishes one state from another. This makes even a mean field theory difficult to construct because the thermodynamic ground state of the system (or any other particular state) has a unique configuration of the order parameter field, thus making it difficult to describe system in terms of average (and site independent) quantities. Few ways to resolve this difficulty were proposed recently [1][2][3][4][5][6][7]; they all share a common idea that states of the system with the same energy per site (but perhaps different total energies) are essentially equivalent and instead of studying one particular state one can average over all states with the same energy density.There are a few ways to implement averaging over states, the most convenient ones seem to be the clone method [5,6] and the introduction of a small random field conjugated to the order parameter (magnetization in case of spin glasses or density in structural glasses) [7]. The physical idea of the latter is that an infinitesimally small random field applied to a system with many metastable states rearranges the energies of low-lying states making the problem similar to one with quenched disorder. In a spin system, for example, we add to the Hamiltonian a magnetic field part: H → H + i h i S i with small random h i . The resulting change in the energy of a typical metastable state is of the order of √ Nh; because this energy interval contains a large number of metastable states, we expect that a small non-zero field would result in a large rearrangement of their energies but would not change the properties of individual states.Averaging over the random field co...