Classifiers for centrality determination in proton-nucleus and nucleus-nucleus collisions