The enthalpic response of amorphous polymers depends strongly on their thermal and deformation history. Annealing just below the glass transition temperature (T_{g}) causes a large endothermic overshoot of the isobaric heat capacity at T_{g} as measured by differential scanning calorimetry, while plastic deformation (cold work) can erase this overshoot and create an exothermic undershoot. This indicates that a strong coupling exists between the polymer structure, thermal response, and mechanical deformation. In this work, we apply a recently developed thermomechanical model for glassy polymers that couples structural evolution and viscoplastic deformation to investigate the effect of annealing and plastic deformation on the accumulation of stored energy during cold work and calorimetry measurements of heat flow. The thermomechanical model introduces the effective temperature as an additional state variable in a nonequilibrium thermodynamics setting to describe the structural evolution of the material. The results show that the model accurately describes the stress and enthalpy response of quenched and annealed polymers with different plastic predeformations. The model also shows that at 30% strain in uniaxial compression, 45% of the applied work is converted into stored energy, which is consistent with experimental data from literature.