Left–right asymmetry for pion and kaon production in the semi-inclusive deep-inelastic scattering process