Sorting or classification of particles or molecules