Studies of jet mass in dijet and W/Z plus jet events