Simultaneous determination of structure and optical transitions of individual single-walled carbon nanotubes