Macro Monte Carlo for dose calculation of proton beams