A molecular logic of sensory coding revealed by optical tagging of physiologically-defined neuronal types