Tomography of cold and hot QCD matter : tools and diagnosis