Modelling the observed stellar mass function and its radial variation in galactic globular clusters