  The Fermi LAT collaboration has built up a detailed Monte Carlo simulation to
characterize the instrument response and tune its performance. The simulation
code is built around the widely used GEANT4 toolkit and was carefully validated
against beam test and flight data. This poster shows how the full LAT
simulation is used to develop the event selection for the Cosmic-Ray Electron
(\emph{CRE}) analysis so as to optimize the instrument performance. In
particular, we will show in detail the determination of the geometry factor and
the residual hadron contamination. The very accurate MC simulation proved to be
fundamental to control the systematic uncertainties on the CRE spectrum
measured by the Fermi LAT.
