We integrated motions up to 100 Myr back in time. We estimated that looking further back would not be of use since massive stars composing HMXBs should not live that long: according to the mass-age relation given in [1]}, a 10 M\(_{\odot }\)  star should not be able to stay longer than \(\sim \) 80 Myr on the main sequence. We split the time span into 500 time steps of 0.2 Myr, and performed 1000 iterations of orbit integration for each binary. For each time step of each iteration, we found the closest point of each spiral arm to the binary by minimising the distance that can be obtained using the equations describing the arms. We note respectively (R\(_B\) , \(\theta _B\) ) and (R\(_G\) , \(\theta _G\) ) the galactocentric polar coordinates of a given binary and of all the points constituting a spiral arm. Using the equation linking the radius and the azimuth of the spiral arms given in [2]} that also involves the pitch angle \(\psi \)  of the galactic arm, the distance between a binary and a spiral arm can be expressed as a function of \(\theta _G\)  alone:
\(\begin{split}D^2(t, \theta _G) =&R_B^2(t) + R_{G,ref}^2 e^{-2(\theta _G-\theta _{G,ref}(t))\,tan\,\psi }\\&-2R_B(t)\,R_{G,ref}\,e^{-(\theta _G-\theta _{G,ref}(t))\,tan\,\psi } cos(\theta _B(t)-\theta _G)\end{split}\) 
