# A Photon Imaging Detector Model with High Resolution and High Counting Rate
## 4 Simulation Results  
### Setting of Shaping Parameters  
Two CSA waveforms with an interval of 100 samples are input into the trapezoidal filter. The output waveforms of different filtering parameters are shown in Figure 7a. When the flat-top time is set to 0, the filtered waveform is a symmetrical triangular waveform, and the total duration of the waveform is \(\mathrm{t_{s}}=2\times\mathrm{t_{p}}\). When \(\mathrm{t_{s}}\) is less than the time interval \(\mathrm{T_{i}}\), the output waveform is not superimposed. When \(\mathrm{t_{s}}\) is equal to or greater than half of \(\mathrm{T_{i}}\), the output waveform begins to overlap, but has no impact on the peak value. When \(\mathrm{t_{s}}\) is equal to or greater than \(\mathrm{T_{i}}\), the peak value cannot be accurately extracted, due to superposition. The longer the shaping time, the larger the corresponding output waveform amplitude. This will not affect the centroid calculation result because the input waveform of the same event passes through filters with the same parameters, so the relative value of each output waveform will not change. One of the main purposes of shaping is to filter the noise. The following methods can be used to quantify the noise filtering effect. For two superimposed waveforms with the same amplitude at fixed time interval, the peak value is extracted after shaping by filter, which is recorded as P. Then, the input waveform is added with noise. After the same shaping operation as above, the peak value is extracted and recorded as \(P_{n}\). The effect of noise filtering can be characterized by the difference between the \(P\) and \(P_{n}\). Therefore, the shaping error can be defined as:  
\[E_{\mathrm{s}}=\sqrt{\left(P_{n}-P\right)^{2}}/P \tag{3}\]  
where \(P_{n}\) and \(P\) are the peaks that are extracted by shaping the input waveforms with and without noise using the same shaper, respectively. For the input waveform with an interval of 20 samples, a variation in the shaping error with shaping parameters under different noises is shown in Figure 7b, where \(\mathrm{T_{i}}\) is 20 samples (16 ns/sample), the input pulse amplitude is 1 V, and \(\mathrm{t_{ft}}\) = 0. As can be seen, when \(\mathrm{t_{s}}\) is less than \(\mathrm{T_{it}}\), the shaping error \(\mathrm{E_{s}}\) decreases with the increase in shaping time (\(\mathrm{t_{s}}=2*\mathrm{t_{p}}\)). According to the shape of the curve, the change in the shaping error can be divided into three regions. When the shaping time is less than \(\mathrm{T_{d}}\), the shaping error decreases rapidly with the increase in \(\mathrm{t_{s}}\). The greater the noise of the waveform, the more obviously the curve will decline. When \(\mathrm{t_{s}}\) is greater than \(\mathrm{T_{d}}\) and less than \(\mathrm{T_{u}}\), the shaping error changes slowly. When \(\mathrm{t_{s}}\) is equal to or greater than \(\mathrm{T_{u}}\), the error increases sharply. This is because the shaped pulses are superimposed, resulting in the inability to accurately extract the peak value. Therefore, if the shaping time  
Figure 7: **(a)** The output waveform of the same input waveform through filters with different parameters. The time interval is 100 samples (16 ns/sample), the flat-top time is 0, and the rise time is 25, 50, 75, and 100 samples, respectively. **(b)** Variation in shaping error with shaping times for different noise RMS. is set within a certain range (between Td and Tu), the shaper can achieve the best noise filtering effect. Because of the Poisson distribution of photon intervals, a fixed t\({}_{\text{s}}\) cannot maintain the best noise filtering effect for all input waveforms. Therefore, we propose an adaptive filtering strategy that automatically sets filtering parameters according to the pulse interval in the sampling window. According to the photon count rate of the work area, a number of filters with different shaping parameters are preset. During data acquisition, the appropriate shaper is automatically used according to the photon intervals.