  The Collider Detector at Fermilab (CDF) is a general-purpose experimental
apparatus with an inner tracking detector for measuring charged particles,
surrounded by a calorimeter for measurements of electromagnetic and hadronic
showers. We describe a {\sc geant4} simulation and parameterization of the
response of the CDF central electromagnetic calorimeter (CEM) to incident
electrons and photons. The detector model consists of a detailed description of
the CEM geometry and material in the direction of the incident particle's
trajectory, and of the passive material between the tracker and the CEM. We use
{\sc geant4} to calculate the distributions of: the energy that leaks from the
back of the CEM, the energy fraction sampled by the scintillators, and the
energy dependence of the response. We parameterize these distributions to
accurately model electron and photon response and resolution in a custom
simulation for the measurement of the $W$ boson mass.
