On the characterization of trace class representations and Schwartz operators