Segmented ionization chambers for beam monitoring in hadrontherapy