Measuring the momentum distribution of cosmic ray muons