The Heavy Ion Research Facility in Lanzhou is an ion cooler storage ring facility in China's Institute of Modern Physics. The beams are accumulated, electron cooled, accelerated, and extracted from the main cooler storage ring (CSRm) to the experimental ring or different terminals. The heavy ion beams are easily lost at the vacuum chamber along the CSRm when it is used to accumulate intermediate charge state particles. The vacuum pressure bump due to the ion-induced desorption in turn leads to an increase in beam loss rate. In order to avoid the complete beam loss, the collimation system is investigated and planned to be installed in the CSRm. First, the beam loss distribution is simulated considering the particle charge exchanged process. Then the collimation efficiency of the lost particles is calculated and optimized under different position and geometry of the collimators and beam emittance and so on. Furthermore, the beam orbit distortion that is caused by different types of errors in the ring will affect the collimation efficiency. The linearized and inhomogeneous equations of particle motion with these errors are derived and solved by an extended transfer matrix method. Actual magnet alignment errors are adopted to investigate the collimation efficiency of the lost particles in the CSRm. Estimation of the beam loss positions and optimization of the collimation system is completed by a newly developed simulation program.