Ab initio spectroscopy and photoinduced cooling of the trans-stilbene molecule.