Detector simulation and particle reconstruction consumes a significant amount of processing time for high-complex particle collisions, such that performed at the Large Hadron Collider. In general, the time per event in Geant4-based simulations with CPU can be highly improved with an approach based on machine learning framework. In this work we employ CaloGAN, a tool comprised of a generative adversarial network (GAN) to simulate the electromagnetic shower of pions, positions, and photons. Such framework can accomplished reduced processing time like 2 to 3 orders of magnitude faster than typical CPU simulation and up to 5 orders of magnitude faster with the use of GPU. This presentation will show an adaptation of the electromagnetic calorimeter to describe the details of the CMS ECAL, provide the simulation of the electromagnetic showers in PbWO4 crystals, and discuss the shape of the energy deposit distributions obtained with the GAN in comparison to those produced with Geant4.