Monte Carlo simulations in treatment planning for hadrontherapy