A detector is disclosed for detecting X-ray and/or gamma radiation, including a scintillator element for converting the X-ray and/or gamma radiation into light. The scintillator element has at least one side surface, an upper side and a lower side, a first photodiode on the lower side of the scintillator element. The detector further includes an electronic evaluation device, a light source designed to illuminate the scintillator element, and a light-impermeable housing which surrounds the scintillator element, the first photodiode, the electronic evaluation device and the light source.