A crystal routine for collimation studies in circular proton accelerators