I'm not so familiar, sorry...
[Step 1] Molecules are ionized and crashes into fragments.
[Step2] Then, the ions are accelerated and induced into magnetic field.
[Step3] In the magnetic field, the ions are affected by Lorentz force #F(N)# and their obrit is bended.
#F=q(vxxB)# (#q(C)# the charge of ion: #v(m"/"s)#: velocity of ion, #xx#: cross product, #B(T)#: magnetic flux density).
And of course...
#F=ma# (m(#kg#): mass of ion, #a(m"/"s^2#): acceleration) and you can conclude:
#a=(q(vxxB))/m#
The point is that #color(red)"orbit of lighter ions or fractions are bended"#
#color(red)"more easily than that of hevier ions."#
Acceleration rate #a# is proportional to #q/m#.
[Step4] Sort ions or fractions by #m/q#(i.e. the reciprocal of #q/m#) and record the relative abundance of ions. This is how you can find a mass of the molecule or mass of fragments.
This is a mass spectrum for 1-phenyl-1-butanone(#C_6H_5COC_3H_7#). Cited from http://www2.odn.ne.jp/had26900/topics_&_items2/about_MS1.htm
What you can find from the result…
148: The mass of the whole molecule, and this is exactly the same as #C_6H_5COC_3H_7#.
77: The mass is same as the phenyl group, #C_6H_5-#. This implies that the molecule might have benzene ring.
105: #105-77=28# is the mass of carbonyl group(#-CO-#). Thus we can expect the molecule to have #C_6H_5CO-# group.