{'fraction_non_alphanumeric': 0.03070175438596491, 'fraction_numerical': 0.014418859649122807, 'mean_word_length': 4.556198598842522, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Monte Carlo Simulation of Pile-up Effect in Gamma Spectroscopy

As it is well known, an ideal spectroscopy amplifier should have a constant amplification for pulses of all amplitudes, without distorting any of them. Unfortunately, some pulse distortion is always present because of electronic noise, gain drift due to temperature, pulse pile-up and limitations on the linearity of the amplifier (Knoll, 2000). Therefore, the final spectrum of the detected particles in the detection system is disturbed by these factors. In this chapter, we have concentrated on pile-up effect calculation over the gamma spectrum in a NaI(Tl) scintillation detector. The fact that pulses from a radiation detector are randomly spaced in time can lead to interfering effects between pulses, which are more likely to occur as the count rate increases. These effects are generally called pile-up. It is known that in a scintillation detector the highest possible radiation counting rate is controlled by the pulse pile-up characteristics of the detection system. In high true count rate (TCR) spectrometry, the pulse pile-up effect is considerable and its spectrum distortion can only be determined by Monte Carlo simulation. (Fazzini et al., 1995; Gostely, 1996; Tenney, 1984).


Introduction
As it is well known, an ideal spectroscopy amplifier should have a constant amplification for pulses of all amplitudes, without distorting any of them. Unfortunately, some pulse distortion is always present because of electronic noise, gain drift due to temperature, pulse pile-up and limitations on the linearity of the amplifier (Knoll, 2000). Therefore, the final spectrum of the detected particles in the detection system is disturbed by these factors. In this chapter, we have concentrated on pile-up effect calculation over the gamma spectrum in a NaI(Tl) scintillation detector. The fact that pulses from a radiation detector are randomly spaced in time can lead to interfering effects between pulses, which are more likely to occur as the count rate increases. These effects are generally called pile-up. It is known that in a scintillation detector the highest possible radiation counting rate is controlled by the pulse pile-up characteristics of the detection system. In high true count rate (TCR) spectrometry, the pulse pile-up effect is considerable and its spectrum distortion can only be determined by Monte Carlo simulation. (Fazzini et al., 1995;Gostely, 1996;Tenney, 1984).

Background
Pile-up phenomenon is well known; it can be divided into two general types, which have somewhat different effects on pulse height measurements. The first is known as peak pileup: it occurs when two or more pulses are sufficiently close together to be treated as a single pulse by the analysis system. The pile-up of pulses has the effect of removing them from the proper position in the pulse height spectrum, and the area under the full-energy peak in the spectrum will no longer be a true measure of the total number of full-energy events. The second type of pile-up is called tail pile-up and involves the superposition of the tail of a pulse to the next one. The effect of tail pile-up on the measurement is to worsen the energy resolution by adding wings to the shape of the recorded peaks. Since tail pile-up does not change the location of acquired events within the energy spectrum, it will not be considered in this work.
In the statistical analysis of pile-up, it is assumed that any inherent dead time of the detector and the preamplifier is small compared with the pile-up resolution time τ of the pulse www.intechopen.com processing system. This time τ is defined as the minimum time that must separate two events to avoid pile-up. Thus, the events which arrive at the amplifier with Poisson distribution are assumed to pile-up only if they occur within a time spacing less than τ (Knoll, 2000). In this chapter we describe the Monte Carlo simulation of the pile-up effect distortion over the gamma spectrum of a NaI(Tl) detector. First, MCNP Monte Carlo code was applied to calculate the pulse height spectrum and the detector efficiency. Then, a custom code was written in FORTRAN language to simulate the distortion in pulse height spectrum due to the pile-up effect for paralyzable and nonparalyzable systems by Monte Carlo method. The results of the simulations were compared with the experimental spectra of a 137 Cs source as well as with the experimental measurement of count rate performance of a gamma camera system (Mowlavi et al., 2006).

Algorithm of pile-up simulation
In the statistical analysis of pile-up, it is assumed that any inherent dead time of the detector and the preamplifier is small compared with the pile-up resolution time  of the pulseprocessing system. This time  is defined as the minimum time that must separate two events to avoid pile-up. Thus, the events which arrive at the amplifier with Poisson distribution are assumed to pile-up only if they occur within a time spacing less than τ .
True events are assumed to occur at a rate n and, due to pile-up, the recording system will perceive counts at a lower rate m, so: In general, the probability for a given count to be formed from the pile-up of (x+1) true events are (Knoll, 2000): Both the nonparalyzable and the paralyzable formulation have been used in pile-up simulation. The Monte Carlo calculation includes two steps, as described in the diagram of Figure 1. First, MCNP Monte Carlo code (Briesmeister, 2000) was employed to calculate the pulse height spectrum and the detector efficiency for the geometry configuration of the detection system. The simulated experimental configuration with MCNP does not take into account the actual energy resolution of the system as well as does not consider the pile-up effect.
In the second step, in order to obtain a more realistic simulation, we wrote a Monte Carlo code by FORTRAN PowerStaion 4.0 software language. The pulse height spectrum coming from the MCNP was convoluted by a Gaussian-spread function corresponding to the measured energy resolution. Then, to consider the pile-up effect, for paralyzable and nonparalyzable systems, we implemented a simulation based on Monte Carlo method. The following analytical function was applied for the pulse shape with t 0 starting time and a 0 amplitude:  Figure 2, it can be seen easily that the maximum amplitude of the pile-up pulse is 8.658. We considered the degree of pile-up as the number of pulses n p that made pile-up. For each true count rate (TCR), corresponding to the detector efficiency and source activity, the degree of pile-up is determined, according to the Eq. (2), by a random number (r) with uniform distribution in [0,1] interval. If r is less than P(0), one pulse is sampled from the Gaussian-spread Monte Carlo pulse height spectrum and the event is considered free of pile-up. Otherwise, if: n p pulses (n p = k) are sampled from the Gaussian-spread Monte Carlo pulse height spectrum.
After the determination of the number of pulses, the starting time of each pulse was simulated by a new random number with uniform distribution in [0,τ] interval. Finally the resulting pulse is obtained by linear superposition of the n p pulses. We assumed the absolute maximum of the resulting pulse as its amplitude and then we recorded it in the corresponding energy channel.

Materials and methods
We have used the pile-up code that we introduced before, to obtaine the spectrum with pileup disturbance and the sub-spectra due to multi pulses pile-up (Mowlavi et al., 2006). Experimental spectrum of 137 Cs source has been measured by a 3in×3in NaI(Tl) scintillation detector in a lead box as shown in Fig. 3. The count rate was about 1.723 × 10 5 per second. MCNP simulated spectrum by F8:p tally and measured spectrum are presented in Fig. 4. Differences of these spectra are clear, especially in the energy region higher than the photoelectric peak. www.intechopen.com The MCNP pulse height output spectrum is convoluted by a Gaussian function corresponding to the energy resolution of the NaI(Tl) detector.

Results and discussion
A comparison of experimental and pile-up computational spectra is presented in Fig. 5. The result shows a good agreement, just a little difference on the left side of photo peak at 0.662 MeV and two peak pile-up at 1.324 MeV which may be caused by tail pile-up. It can be seen the wide peak at 1.986 MeV produced by three peak pile-up. As well as, the full width at half maximum of these peaks are grown by increasing of the pile-up degree. Corresponding to the end point of the measured spectrum the pile-up occurs till sixth degree. The total Monte Carlo spectrum together with free of pile-up, 2, 3, 4, 5 and 6 pulses pile-up sub-spectra are presented in Fig. 6. It must be mention that these sub-spectra can be obtained just by Monte Carlo simulation. About 74.77 % count in the photo peak is due to free pile-up events, 23.27% is due to two pulses pile-up, 1.88% comes from three pulses pileup, and other portions are neglectable. It means that the main impurity under the photoelectric peak is due to two pulses pile-up.

Introduction
Scintillation gamma camera is a medical equipment, therefore it must be subjected to periodical reference tests. Intrinsic count rate is considered an important parameter to be measured during the acceptance test of the instrumentation and for the periodical monitoring of the system. The National Electrical Manufacturers Association (NEMA) and the International Atomic Energy Agency (IAEA) have published protocols for Quality Controls of Nuclear Medicine instrumentations with a detailed description of the experimental methods for the measurement of the intrinsic count rate performance (NEMA, 1994;IAEA, 1984). Based on the detailed description of the measurement procedures, it is possible to simulate the experimental condition by a Monte Carlo code analysis.
In the present work, MCNP code is used to calculate the pulse height spectrum and the gamma efficiency of a single crystal gamma camera. The simulated data so obtained are then processed by custom software to take into account the pile-up effect, a phenomenon which, at high count rate, produces a distortion in the detector spectrum which cannot be neglected.
To evaluate the consistency of the simulation, we compared the experimental measurement of intrinsic count rate performance with the Monte Carlo result.

Experimental measurement of intrinsic count rate
Intrinsic count rate test is an important measurement to evaluate the performance of a scintillation camera in terms of its response to an increasing incident gamma radiation. Our measurement was carried out on a gamma camera Siemens E. Cam equipped with a 9.5 mm thick NaI(Tl) single crystal detector. Following the mentioned protocols (NEMA, 1994;IAEA, 1984), we employed a 99m Tc source contained in a small vial (about 10MBq) with 22 copper absorbers, each 2 mm thick, placed over the source. The gamma camera was set with a 20% window at the 140.5 keV peak. Window Observed Count Rates (WOCR) was collected for 1 minute acquisitions, starting with all the absorbers in place over the source and then removing the uppermost absorbers one by one. This procedure increases the incident gamma radiation flux and the input count rate in inverse proportion to the attenuation factor of the absorber removed. Usually calibration of absorbers is calculated by www.intechopen.com measuring, in low count rate condition, the ratio between counts with the plate over the source and without it. In case of uniformity of the thickness of the copper plates, a mean attenuation factor A can be used (NEMA, 1994). For a number k of copper attenuation plates in place: where: N(0)= window true count rate(WTCR) calculated for k=0 absorber plates i A = individual attenuation factor of the copper plate number i R(k) = window observed count rate(WOCR) for k plates The configuration of the count rate test of a gamma camera has been shown in Fig. 7. Fig. 8 shows the experimental result of the count rate performance. In our measurement we evaluate the slope of the straight line of ln(WOCR) against k (number of plates over the source) in the low count rate range to determine the mean attenuation factor, A (Geldenhuys et al., 1988).

Monte Carlo simulation of intrinsic count rate performance
The Monte Carlo calculation includes two steps as describe in the diagram of Fig. 1. First, MCNP Monte Carlo code (Briesmeister, 2000) was employed to calculate the pulse height spectrum and the detector efficiency in detecting 140.5 keV gamma rays, for a NaI(Tl) crystal and the geometrical configuration shown in Fig. 7, for various numbers of copper plates removed. The three MCNP calculated spectra corresponding 1, 5, and 10 copper plates over the source are shown in Fig. 10-a, also Fig. 10-b shows the Gaussian spread of these spectra. It is clear that the gamma spectrum is varying with the number of copper plates over the source. Fig.  11 shows the total count per on particle from the source against the number of copper plates over the source.   Fig. 10. a) The three MCNP calculated spectra corresponding to 1, 5, and 10 copper plates over the source, b) the Gaussian spread of the spectra.
The simulated experimental configuration with MCNP does not take into account the actual energy resolution of the system as well as does not consider the pile-up effect.
In the second step, in order to obtain a more realistic simulation, we used the Monte Carlo pile-up code. First the pulse height spectrum coming from the MCNP was convoluted by a Gaussian-spread function corresponding to the measured 11.2% gamma camera energy resolution. Fig. 12 shows the experimental spectrum of the gamma camera crystal with 11.2% energy resolution at 140.5 keV peak. Then, to consider the pile-up effect, for paralyzable and nonparalyzable systems, we implemented a simulation based on Monte Carlo method. In the next section, Monte Carlo simulation has been done for  = 0.5, 1, 1.5 μsec values. Total count per one photon of source Number of plates Fig. 11. The total count per one particle from the source against the number of copper plates over the source. Fig. 12. The experimental spectrum of the gamma camera crystal at low count rate for a 99m Tc source.

Results and discussion
We recorded the MCNP result of the detector efficiency (R) in the second column of Table  1. The third column shows the activity of 99m Tc source (A n ) in the count rate test measurement. We have calculated the pulse height spectrum without pile-up in very low count rate TCR=1, and the pulse height spectrum with pile-up in TCR=R×A n , for any number of plates. The window observed count rate is the counts in the 20% window considering the pulse height spectrum with pile-up and the window true count rate is the counts in the 20% window considering the pulse height spectrum without pile-up (Table  1, columns 5, 6 and 7).  13 shows the Monte Carlo spectrums without pile-up effect and with pile-up effect in paralyzable and nonparalyzable detection systems for 3 copper plates. We like to note that in high TCR, the rate of pulses that escape from the energy window due to the pile-up is higher than the WOCR. For example, in paralyzable system, with tree copper plates, the number of pulses per second which, due to the pile-up escape from the energy window is 3.07 times WOCR. Also, the contribution in WOCR from the pile-up coming from pulses with energies lower than the window interval is negligible. In nonparalyzable system, in the same condition, the number of pulses per second that escape from the energy window due to the pile-up is 2.46 times WOCR and the count rate in the energy window due to the pileup of low energy pulses is negligible. So, in high TCR, for both paralyzable and nonparalyzable systems, the effect of pulse escaping from the window is more important than the increase of background due to the low energy pulse pile-up. www.intechopen.com In Fig. 14 it is reported the comparison of the pile-up defect in paralyzable and nonparalyzable systems and the sub-spectra of increasing number of pulse pile-up. In order to fund a good selection value for , we have done the count rate performance simulation for three values: =0.5, 1, 1.5 μsec. Fig. 15 shows the Monte Carlo and the experimental result of count rate performance.   Fig. 16; and the best agreement obtained is for =0.75 μsec (see Fig. 17). If we consider the nonparalyzable mode for the detection system, the results show a not bad agreement for =2.5 μsec, although around the peak of WOCT the difference between experimental and computational data is considerable in this mode. Finally, we must mention that the method can also be employed for other detectors and other counting systems (Sjöland et al., 1999;Wu et al., 1996), because it is easily customizable simply substituting some input parameters.

Conclusion
The Monte Carlo pile-up code that we developed can be used to correct pile-up distortion in gamma spectroscopy. At the first, we have compared and analyzed the experimental and computational spectrum considering pile-up effect of a 137 Cs source in a NaI(Tl) detector. The interesting sub-spectra have been obtained, which construct the MC spectrum with pile-up disturbance. The results have shown that the main background in the photoelectric peak is due to two pulses pileup, about 23.27% of counts. In high count rate situation the total count of the photoelectric peak reduces effectively due to removal of pulses by pile-up.
The second application of the pile-up code was used for gamma camera count rate performance test. The Monte Carlo simulation demonstrated that the gamma camera we tested behaves in presence of a high true count rate as a paralyzable system rather than as a nonparalyzable system. In low true count rate, paralyzable and nonparalyzable simulation results are close to each other. The result obtained by simulation of pile-up with this approach showed a good agreement with experimental measurement. As a future step, we plan to apply the code on the gamma spectrum of a Prompt Gamma Neutron Activation Analysis (PGNAA) system.