A model for the fast and accurate dose evaluation in hadrontherapy