Temperature and density structure of hot and cool loops derived from the analysis of trace data