Thermal and photochemical generation of electronically excited organic molecules. Tetramethyl-1,2-dioxetane and naphthvalene