Real-time compositional analysis of submicrometre particles