The entire process of image formation and refocusing of light field photography with microlens array is simulated using the in-house software OTS based on real ray tracing. The optical system consists of a photographic lens and the microlens array which are specifically designed. Objects are placed in different distance before the lens, and images of them on the detector plane are got by imaging simulation algorithm. Utilizing the color, intensity and the corresponding direction information of light rays on the image plane, pictures focusing at different depth in the image space are calculated, so that we can refocus at different objects in different distance. The paper also details the basic requirement of optical system and this simulation process is a fundamental work of research on design method and performance of lens using in light field photography.