Temperature measurement of cold atoms using single-atom transits and Monte Carlo simulation in a strongly coupled atom-cavity system