Working code for analysing event rate and purity data.