Molecular decision trees realized by ultrafast electronic spectroscopy