A pixel chamber to monitor the beam performances in hadrontherapy