Code for analysing particle detection rates.