The present invention relates to a method for compensating the deviation of an energetic beam of hadrons delivered by an irradiation unit of a hadron-therapy installation, with respect to an isocentre of a rotatable gantry supporting said irradiation unit, said irradiation unit comprising a collimator comprising an opening for the passage of said beam. The present invention also relates to a program comprising an algorithm for calculation of a correction to be applied to the position of an opening of a collimator of an irradiation unit of a hadron-therapy installation. The invention finally also relates to a hadron therapy installation.