Monte Carlo simulation of Compton polarimeters