Energy and dose rate dependence of a diamond detector in the dosimetry of 4–25 MV photon beams