SMS dit: Photometric calibration of the supernova legacy survey fields