Paramagnetic resonance in ground and optically excited states of Tm2+ in alkaline earth fluorides