Measurement of charged particle yields from therapeutic beams in view of the design of an innovative hadrontherapy dose monitor