On jet mass distributions in Z plus jet and dijet processes at the LHC