1 Introduction

Nowadays rare earth magnets, such as NdDyFeB, are a critical component in modern technologies and their recycling is of strategic importance for Europe aiming at responsible handling of valuable resources. Due to their economic and strategic relevance as well as supply risk, neodymium and dysprosium are classified together with 37 other elements and 9 substances as critical raw materials (CRMs) by the European Commission [1]. Measures to guarantee a secure and sustainable supply of CRMs are proposed in the European Critical Raw Materials Act [2], one of them regarding the recycling. An efficient recycling necessitates in front end a sorting of the magnets according to their elemental composition and, in particular, to their rare earth elements (REE) content. Such a task requires a suitable analytical method for qualitative and quantitative magnet analysis. In industrial scale this is a new challenge to take up since such an analysis must be done nondestructively, rapidly and on bulk, dense material.

Prompt Gamma Analysis based on Inelastic Neutron Scattering (PGAINS) is a promising non-destructive analytical technique for determination of the elemental composition of large, dense samples. It is based on the measurement of isotope-specific prompt gamma rays emitted from a nucleus in an excited state after an inelastic interaction with a fast neutron, i.e. (n,nγ) reaction as schematically shown in Fig. 1.

Fig. 1
figure 1

Schematic diagram of a fast neutron inelastic scattering process

Inelastic scattering occurs if the incident neutron energy exceeds the threshold energy required to elevate the nucleus on its excited energy level. The excited nucleus returns to its ground state by emission of one or more gamma rays. Since the position of the resolved energy levels is unique for each nucleus, the emitted prompt gamma-ray spectrum can be used as a signature to identify the type of nucleus and, if applied for a mixture of nuclei, allows for qualitative and quantitative analysis of the sample. The energy levels scheme is unique for each nucleus and defines the emission probabilities and energies of the emitted de-excitation gamma rays. For heavy nuclei with closely positioned energy levels, the emitted spectrum of gamma rays represents a continuum. The inelastic scattering cross section has resonances, which correspond to the different energy states and differences between these states of the composed nucleus. The proof of the PGAINS method principle has been demonstrated with the FaNGaS (Fast Neutron-induced Gamma-ray Spectrometry) instrument installed at Heinz Maier-Leibnitz Zentrum (MLZ) using the intense fission neutron beam delivered by the beamtube SR 10 of the FRM II reactor (Forschungs-Neutronenquelle Heinz Maier-Leibnitz) [3,4,5,6,7] and its potential for magnet characterization tasks was shown in a numerical study using a beam of 2.5 MeV monoenergetic neutrons [8].

Conceptually, PGAINS requires a source of fast neutrons, a measurement cell and one or more detectors [8]. However, as an active non-destructive analytical technique, its performance is a function of various physical factors and parameters, which require assessment prior to the design stage. Such tasks are difficult to solve analytically or by conducting comprehensive experiments. Monte Carlo particle transport codes are praised in a large number of such applied radiation transport tasks where it is necessary to simulate the transport of incident and secondary particles in complex 3D geometries. Monte Carlo simulations represent a powerful tool that uses random numbers to numerically solve complex physical and mathematical problems allowing to reproduce the motion of each particle and iterate the simulation for many particles to estimate their average behavior as well as its statistical fluctuation. Among such codes are Geant4 [9] and PHITS [10].

The internal routines and physical models implemented in various Monte Carlo codes can be different, which can yield discrepancies in the simulation results [11]. Moreover, no comprehensive qualitative and quantitative assessment of PHITS and Geant4 codes in application to fast neutron inelastic scattering simulation tasks has been published. In this work we aim to fill this scientific gap by conducting a performance intercomparison of PHITS and Geant4 codes in application to fast neutron inelastic scattering simulations using two different measurement configurations. One configuration aimed at assessing the gamma-ray energy deposition properties in detectors and consisted of a source of monoenergetic gamma rays over a broad energy range (100 keV–9000 keV) and a CeBr3 detector. The other configuration aimed at assessing the differences in neutron energy distribution, produced prompt gamma-ray spectra and consisted of a monoenergetic directional fast neutron source (2.5 MeV), a thin target of various materials (Fe, Nd, Dy and B), and a CeBr3 detector.

2 Methods and materials

2.1 Codes configuration

All the simulations conducted in this study were performed with Geant4 ver. 11.1.0 [9] using the Allpix2 framework [12], and PHITS ver. 3.28 [10, 13]. The configuration parameters for each of the codes are described in Table 1.

Table 1 List of configuration parameters in the calculation by PHITS and Geant4

Throughout the calculations, generic models without any problem-specific settings were used since this study is intended to illustrate the standard performance of both codes.

For electron-gamma shower calculation, the standard EM package was activated by G4EmStandardPhysics_option4 in Geant4; whereas, EGS-5 was used in PHITS with the same energy cut-offs. For neutron transport, the cross section data library JENDL-4.0 [14] was used in a point-wise data format. To simulate the production of prompt gamma rays subsequent to fast neutron-induced reactions, Geant4 uses an intrinsic model to calculate the excitation energy of the residual nucleus. The residual nucleus was transferred to G4PhotonEvaporation to sample gamma rays by de-excitation. In PHITS, this procedure is done by the Event Generator Mode Ver.2 [17] combined with GEM Ver.2 [18] and EBITEM Ver.2 [15, 16]. To boost the statistical convergence of (n,X) particle production calculation, the incident neutrons were forced to interact with the target by G4GenericBiasingPhysics and [Forced collisions] functions of Geant4 and PHITS, respectively.

To score particles produced by interactions of target and incident neutrons, ParticleDistributions module in Geant4 and [T-Product] + [T-Cross] tallies in PHITS were used. To calculate event-by-event energy deposition, DepositionGeant4Module module and [T-deposit] tally were used in Geant4 and PHITS, respectively. The ParticleDistributions module is a custom module in Allpix2 created by the company Dynaxion for easier tracking of the particles that are not measured by the detector. It uses the G4UserSteppingAction to save individual steps of particles, and trace the steps to detect crossing of surfaces / creation processes, etc. DepositionGeant4 is a module by Allpix2, extended by Dynaxion with the ability to use CeBr3 scintillation detectors. The module uses the G4VSensitiveDetector to track energy depositions in the crystal, which is flagged as a detector. It adds up the energy deposition in the crystal in each event. On the other hand, the tallies used in PHITS are all native built-in functionalities. The number of energy bins were 16,384 or 9000 to imitate the energy resolutions of 1 kB or 2 kB multi-channel analyzers in actual detections. The energy resolution inherent to CeBr3 was not considered in this study to have a clear focus on the difference between the codes.

2.2 Simulation geometries

Using the above-mentioned code configurations, two different simulations were performed. In both simulations, parallel beams of either gamma rays or neutrons with diameters equal to the detector and target foil respectively were used. The first one is related to the gamma-ray energy deposition in the 5.08 cm × 5.08 cm cylindrical CeBr3 detector. For that, the detector is exposed to a parallel beam of gamma rays of energies ranging from 100 keV to 9 MeV, which corresponds to the energy range of prompt gamma rays emitted from fast neutron inelastic scattering. The beam of gamma rays has a diameter of 5.08 cm and is aligned with the symmetry axis of the cylindrical detector. The second simulation investigates the production of gamma radiation induced from the irradiation of iron-, neodymium-, dysprosium- and boron cylindrical foils (diameter: 2.82 cm, thickness: 0.2 cm) with a parallel beam of 2.5 MeV neutrons having the same diameter as the foils. The produced continuous gamma-ray spectra are collected with a 5.08 cm × 5.08 cm cylindrical CeBr3 detector positioned at an angle of 90° with respect to the neutron beam. The configuration options for the two simulation steps are summarized in Table 2. The geometrical models of the simulations created by PHIG-3D, one of the 3D geometry viewers of PHITS, are shown in Fig. 2. The number of simulation events was chosen to be 108 neutrons which was sufficient to have negligible statistical uncertainties (less than 1%) to enable unbiased comparison of the tally results between the two codes.

Table 2 Configuration options for the two simulation setups
Fig. 2
figure 2

Geometrical models for the simulation of the gamma-ray energy deposition (left) and simulation of the gamma-ray production induced by irradiation of iron, neodymium, dysprosium and boron foils with 2.5 MeV neutrons (right). The geometries were created with the 3D geometry viewer PHIG-3D of PHITS

3 Results and discussion

For all figures presented in this section, the PHITS simulation results are displayed in red, and the Geant4 simulation results are displayed in black.

3.1 Gamma-ray energy deposition simulation

The tallied gamma-ray energy deposition results in the CeBr3 detector are shown in Fig. 3.

Fig. 3
figure 3

Energy deposition of various monoenergetic gamma rays in the CeBr3 detector obtained with PHITS (red) and with Geant4 (black). Normalization per total number of source particles

The results from Fig. 3 indicate that at all energies there is a good agreement (within 5% margin) in the performance of the two codes, except for the double Compton regions. Locations of the deposition energy peaks as well as of the peaks due to secondary reactions are coherent. The deviations in the double Compton regions are attributed to the low energy fitting of Compton scattering cross section, which is orders of magnitude lower than that of photoelectric effect in this energy range. Owing to its low cross section, Compton scattering at low energies does not impact the general transport behavior but the energy taken away by scattered gamma rays is visible as the energy deposition below the full absorption peak.

3.2 Particle production simulation

The neutron flux as a function of energy inside the different foils is shown in Fig. 4. This tally shows the energy of neutrons after the first interaction in the foil material. With our results we find that there is a difference at energies above 2.2 MeV, which is attributed to non-interacting projectiles and elastically scattered projectiles. If they are excluded from the normalization of the results, the neutron flux in the sample agrees within 10% for neodymium and dysprosium. This exclusion is justified by the fact that inelastic scattering is of concern in this study. For iron and boron results reveal differences in the codes performance. The neutron energy is affected either by elastic scattering or inelastic scattering associated with nuclei excitation to bound states. Thus, the neutron energy distribution in the iron foil are characterized by pronounced peaks. They are attributed to inelastic scattering associated with the excited states of natural iron isotopes below 2.5 MeV. The gaps between inelastic peaks are seen in PHITS but not in Geant4 owing to the different models for the (n,n’) ejectile sampling as mentioned in Table 1. Both models sample the outgoing neutron angle, which is the only degree of freedom in the (n,n’) scattering, and Geant4 prioritizes kinematic consistency at the price of agreement with the cross section. In contrast, PHITS prioritize the agreement with the cross section. As a result, the neutron energy distribution calculated by PHITS has gaps at energies where neutron emission at a corresponding angle was hindered by the energy and momentum conservation. Geant4, on the other hand, effectively adjusts the angular distribution in order to satisfy the conservation law, allowing such emissions. Unlike the neutron energy distribution in the boron foil, the elastic scattering peak from 2.2 to 2.5 MeV is sharp because the neutron mass relative to the target mass is smaller. The neutron energy distribution in dysprosium, characterized by a sharp elastic peak followed by few discrete inelastic peaks and indistinct small peaks, is the extreme of the above tendency. Neutrons lose less energy by elastic scattering. This trend gets stronger for neodymium. More peaks are observed owing to the levels of its natural isotopes and the elastic peak is even sharper than that of iron. The peak structure is blurred in low energies because they come from inelastic scattering with large energy loss corresponding to high energy states. Owing to the dense energy levels in high energies, the inelastic peaks overlap each other. Observed discrepancies for boron can be attributed to the calculation kinematics, which are not explicitly written in the cross section data libraries. Among the four materials studied, neutrons in the boron foil are mainly down-scattered by elastic scattering because the cross sections of inelastic scattering 10B-(n,n'2)10B and 10B-(n,n'3)10B are more than 10 times lower than the elastic scattering cross section owing to large ΔJ or the reaction threshold close to 2.5 MeV. Consequently, the neutron energy distribution comprises a smooth curve by elastic scattering and small bumps below 1 MeV owing to 10B-(n,n'1)10B and 11B-(n,n'1)11B. The codes generate different neutron energy distributions above the bumps because of the different kinematics modeling of elastic scattering.

Fig. 4
figure 4

Neutron flux as a function of energy inside the four different foils. Normalization per total area

The gamma-ray spectra produced by inelastic scattering inside the foils are shown in Fig. 5. Next, the scattered neutrons from the target that hit the top of the CeBr3 detector were tallied, as shown in Fig. 6. This corresponds to the part of the neutrons that contribute to the neutron-induced background in the detector. Lastly, the gamma-ray energy deposition in the CeBr3 detector as a result of inelastic interactions is presented in Fig. 7.

Fig. 5
figure 5

Gamma rays produced by inelastic scattering inside the foils. Normalization per total number of source particles

Fig. 6
figure 6

Neutron flux at the surface of the 5.08 cm × 5.08 cm CeBr3 detector. Normalization per total area

Fig. 7
figure 7

Gamma-ray energy deposition in the CeBr3 detector for different foils. Normalization per total number of source particles

The gamma-ray spectra are complementary to that of neutrons because they are the remainder of energy given by the incoming neutrons. It should be noted that the gamma rays beyond 2.5 MeV are all attributed to neutron absorption, by which the target nuclei can release an energy equal to the sum of the energy of the incident neutron (2.5 MeV) and the neutron binding energy. Comparison of the produced gamma-ray spectra in the four studied materials, as shown in Fig. 7, reveals the following behavior. First, the analysis of the prompt gamma-ray signatures indicated a good agreement between the codes (within 20% margin). The two codes generate similar prompt gamma-ray spectra because gamma rays are in principle emitted by the de-excitation cascade through the nuclear level scheme based on the level scheme taken from the same database RIPL-3 (Reference Input Parameter Library). However, there are two noteworthy differences between the codes. In the spectrum of boron, the peak slightly below 7 MeV is broad in PHITS and thin in Geant4. As this peak is attributed to gamma-ray emission followed by neutron absorption, the target nucleus has a large recoil velocity owing to its small mass. The gamma-ray peaks are smeared out by the Doppler effect. Doppler broadening is considered in both codes but due to slowdown of the recoil nucleus before gamma-ray emission, the broadening was less pronounced in Geant4. This is not the case for heavy targets or gamma rays subsequent to inelastic scattering because of small nuclear recoil velocity. The other difference is the treatment of gamma-ray emission from highly excited states. The level scheme of RIPL-3 is not complete at high energies therefore both codes supplement it by theoretical models. Gamma-ray absorption cross section, used as the inverse cross section in the model, in Geant4 is based on giant-dipole resonance, which has cross sections in MeV energy range. On the other hand, PHITS uses single-particle estimates regardless of the energy. As a result, the gamma-ray spectra simulated by PHITS, in particular those of boron and iron, have continua owing to the model. In contrast, those simulated by Geant4 are more faithful to the level scheme of RIPL-3.

An excellent agreement (within 10% margin) between the two codes in tallied neutron flux at the detector surface indicated reasonable neutron diffusion based on cross section data libraries in both codes. However, quite a different behavior is demonstrated by the prompt gamma-ray spectra energy deposition in the CeBr3 detector. Indeed, the observed discrepancies at different energies can be attributed to the difference of the gamma-ray source spectra produced in the foil, given the energy deposition of gamma rays in the CeBr3 detector was in good agreement as in Fig. 3.

4 Conclusion

In this paper an intercomparison of PHITS ver. 3.28 and Geant4 ver.11.1.0 codes in application to Prompt Gamma analysis based on Inelastic Scattering (PGAINS) was conducted. The primary goal was not only to address the differences in particle production and transport between the two codes, but also to assess the energy deposition of the produced prompt gamma rays in a CeBr3 detector.

From the comparison of gamma rays energy deposition in CeBr3 detector it was found that both codes have a good agreement except at lower energies. The observed differences in spectral shape can be explained by the treatment of Compton scattering at low energies. However, these discrepancies do not concern the presence of the deposited energy signatures, which are coherent.

The simulation study for particle production in foils from four different materials demonstrated differences in the tallied characteristics as a function of the material. Thus, the neutron energy distribution tallied inside the dysprosium, neodymium, iron and boron foils as well as the tallied neutron flux at the CeBr3 detector surface showed an excellent agreement between the two codes. Minor discrepancies were observed for boron, which can be explained by the calculation kinematics of elastic scatterings. In the produced prompt gamma-ray spectra element specific photopeaks are present at correct energies. Only for iron and boron the observed behavior of the two codes is different due to the modeling of gamma-ray de-excitation at high excitation energies. Geant4 faithfully traces the level scheme of the database; whereas, PHITS is more dependent on its theoretical model. We assume that the major contribution to the discrepancies in CeBr3 deposited gamma-ray spectra can be attributed to the source gamma-ray spectrum hump around 3 MeV seen in Fig. 5. This hump comes from the gamma-ray de-excitation of the compound nuclei formed by absorption of incoming neutrons, modeled in a way different in Geant4 and PHITS.

However, analysis of the code’s performance in application to PGAINS simulations demonstrated that both PHITS and Geant4 codes represent a flexible powerful tool for such tasks. A natural continuation of this work may include the following directions. First, evaluation of the method performance with other materials and evaluation of other Monte Carlo code performance for fast neutron inelastic scattering simulations. Second, study on the limits and possibilities of other than CeBr3 room temperature medium resolution detector options for measurement of prompt gamma-ray spectra, such as CdZnTe and LaBr3(Ce), which coupled with validation of numerical models relative to the experimentally measured data, represents an interesting premise for future research in this domain.