The application describes an X-ray detector for use in a medical equipment, wherein the detector comprises an unit for transforming X-ray radiation into electrical charge, a first capacitor for being charged by an electrical charge, wherein the first capacitor is electrically connected to the unit for transforming, a second capacitor for being charged by an electrical charge, and a first gain switching gate, wherein the second capacitor is electrically connected with the unit for transforming if the first gain switching gate is in on-state, wherein the detector is adapted to switch on the first gain switching gate for short periods.