1. A detection apparatus for detecting photons, the detection apparatus comprising: a detection unit for detecting photons, wherein the detection unit is adapted to generate detection signal pulses being indicative of the detected photons, a pile-up determining unit for determining whether a detection signal pulse is caused by a pile-up event or by a non-pile-up event, a detection values generating unit for generating detection values depending on the detection signal pulses and depending on the determination whether the respective detection signal pulse is caused by a pile-up event or by a non-pile-up event wherein the detection values generating unit is adapted to: bin the detection signal pulses, which are caused by a non-pile up event into several bins depending on a property of the detection signal pulses, determine for each bin a non-pile-up number by counting the detection signal pulses of the respective bin, which are caused by a non-pile-up event, thereby generating a non-pile-up distribution, determine a pile-up number by counting the detection signal pulses, which are caused by a pile-up event, estimate a pile-up distribution such that the integral of the pile-up distribution corresponds to the product of the determined pile-up number with a provided expected mean number of photons contributing to a pile-up event, correct the non-pile up distribution based on the pile-up distribution, generate detection values depending on the corrected non-pile-up distribution.