Integration of the differential evolution algorithm and the Monte Carlo code to create a spectrometric detector model

A standard procedure for characterizing the high-purity germanium detector (HPGe), manufactured by Canberra Industries Inc [1], is performed directly by the company using patented methods. However, the procedure is usually expensive and must be repeated because the characteristics of the HPGe crystal change over time. In this work, the principles of a technique are developed for use in obtaining and optimizing the detector characteristics based on a cost-effective procedure in a standard research laboratory. The technique requires that the detector geometric parameters are determined with maximum accuracy by the Monte Carlo method [2] in parallel with the optimization based on evolutionary algorithms. The development of this approach facilitates modeling of the HPGe detector as a standardized procedure. The results will be also beneficial in the development of gamma spectrometers and/or their calibrations before routine measurements.


Introduction
The appearance in the sixties of semiconductor detectors of nuclear radiation was an important milestone in the development of experimental nuclear physics. At present, detectors occupy a leading place among devices that register radiation. They have great advantages over other types of detectors, the most important of which is high resolution. Other advantages of semiconductor detectors are: linearity in a wide energy range, short pulse rise time, relative simplicity and small size, as well as insensitivity to magnetic fields [3][4][5].
The task of practical gamma spectrometry is to determine the activity of radionuclides identified in counting samples. For this, the number of pulses per unit time Sm (E i ) is recorded -the count rate (response) in the FEPE of a given energy E i from a source with material m and unknown activity Am of the radionuclide in a fixed measurement geometry. In practice, two methods are used to determine Am from the measured responses Sm (E i ). One of them is the comparison of the counting sample with respect to the activity measure of the same radionuclide, when in the same geometry as for the counting sample, the response SM (E i ) is measured from the measure -a volume source with material M and known AM activity, with which the response Sm (E i ) from counting sample is compared (1): where q(E i ) -quantum yield or absolute intensity of the monoline E i of the radionuclide.
The relative self-absorption coefficients k M/m (E i ) differ from unity the more, the greater the difference in self-absorption in the materials of the counting sample and the corresponding measure. It can be seen from formulas (1) and (2) that the correctness of determining the activity of volumetric sources directly depends on the correctness of the determination of the relative coefficients of self-absorption.
The existing variety of materials of volumetric sources and measurement geometries encountered in the practice of gamma spectrometry makes it possible to take into account self-absorption by experimental methods when using calculation methods for this [6].
To accurately determine the absolute activity of the samples, the recorded intensity is multiplied by a number of correction factors, one of which takes into account the attenuation effect and is called the self-absorption coefficient. To determine which in the literature, it is proposed to use various engineering techniques.
One of the practical applications of the computational models of detectors is to determine the correction factor for objects of complex geometry and also to determine the optimal distance between the detector and the source.
A key element of calibration using Monte Carlo simulation is a perfect knowledge of the physical and geometric characteristics of the detector. Determining these parameters is commonly referred to as characterizing the detector. There are a number of articles that suggest a combination of the genetic algorithm [7] and the Penelope program for this procedure.

Devices and research methods
The gamma spectrometry equipment used in this study is the Canberra HPGe detector, model GC1518. The detector has 15% relative efficiency relative to a 3 x 3 "active area Nal (Tl) detector and a nominal FWHM of 0.825 keV at 122 keV and 1.8 keV at 1.33 MeV, and it works in conjunction with the DSA-LX multichannel Canberra analyzer Spectral analysis is performed using the Canberra Genie 2000 software package (Canberra, 2002) [8] The characterization of the detector was carried out experimentally using a set of standard sources OSGI-2-3.
The characterization methodology uses an experimental procedure to analyze the detector response to sources in its vicinity in the photon energy range from 10 keV to 2 MeV in combination with a computational process to determine the detector parameters using the MCNP code [9] with ENDF/B-VI Release 2. The result is a set of characteristics with an array of point source efficiencies at different locations around the detector.
To develop the methodology for the computational characteristics proposed in this work, the MCNP5 code was used, this is a probabilistic code for the transfer of neutrons, electrons and photons by the Monte Carlo method. MCNP5 gives the user control over the parameters of the numerical model, allowing the definition and modification of the geometry and materials of the detector. At the output, the program generates the SPP obtained as a result of modeling for any energy and its statistical uncertainty.
Thus, the object of study was the response of a semiconductor detector. The aim of the work was parametric modeling of a germanium detector using experimental results of calibration for efficiency. The research objective is to develop a methodology for obtaining and optimizing detector performance based on a cost-effective procedure in a standard research laboratory.
• Relevance: the use of the correct model of a detector made of ultrapure germanium using the Monte Carlo method is very important for obtaining the detection efficiency when it is impossible or difficult to carry out experimental measurements -in the case of large samples, samples with non-standard geometry, with large samples, when the efficiency difficult to evaluate experimentally. A • Analysis of important effects such as summing overlaps by efficiency Works available in scientific periodicals indicate the growing popularity of differential evolution as a simple and reliable optimizer, as well as the fact that such an algorithm demonstrates outstanding performance when optimizing a wide range of problems [10][11][12][13].
DE is based on a natural selection, a process that controls biological development. In the course of the DE operation, a multiple change occurs in a set of S individual solutions, called the population.
The algorithm works as follows: at the next step, candidates are randomly selected from the current population who will become parents (a set of possible solutions), and then using certain rules for selection, crossover and mutation, children are formed for the next generation.
DE can be applied to solve many optimization problems that standard algorithms do not fit, including cases where the objective function is discontinuous, non-differentiable, probabilistic, or highly nonlinear.
The DE algorithm consists of four simple and sequential steps: initialization, mutation, crossover, and selection. This is similar to other forward constellation search algorithms that use an original set of constellation (S) that is randomly selected as a possible solution. It consists of individual ND vectors, and each vector contains ND parameters that need to be optimized. The last three steps -mutation, crossover and selection -are repeated at each iteration to improve the original candidate solution until the maximum number of generation G is reached or the required fitness value is satisfied. DEAM uses ND -dimensional vectors as a collection (S) to find optimal parameters in the search space. The population set is defined as (3,4): , , , , … , , where i is called the target vector, а i -the number of individuals (possible solutions) in the population (i = 1,2, ... N), j -dimension of an individual vector (J = 1,2, ..., D), а G -generation index (G = l, 2, ..., G max ). Figure 1 shows a diagram of the proposed algorithm. The steps in this algorithm are detailed below.
The DEAM mutation causes the M d or M e operation during one iteration. The criterion used to switch between both types of mutation is as follows (6) where | | и | | -the norm of the standard deviation vectors of the row vectors of the population S for G and the initial generation, respectively, а -switch parameter that is used to switch between operations M d и M e , ϵ[0, 1]. For each target vector there is a mutant vector generated according to the M d , operation as described below (7): where the vectors ∝ и are selected randomly from the set, and, а α, β и γ -are different indices belonging to the range [1, N]. The vector ∝ is called the base vector, and F -is the mutation scaling control parameter, which is usually chosen in the range [0. 5,1].
Meanwhile, the M e mutation operation is also based on three separate individual vectors that are randomly selected from the population, but unlike M d ,, the index of one of these vectors can be the same index of the current target vector. Operation Me uses the full force applied to one single vector ∝ by two other vectors and . Similar to the EM algorithm, the force acting on ∝ from and is calculated based on the charges between vectors as follows (8): where f(X) is the value of the objective function for an individual vector X, и ,, are the best and worst individual vectors that implement the best and worst values of the objective function for the Gth generation, respectively, and G is the index, generation (G = 1,2, ..., G max ). The force acting on vectors на ∝ from и is calculated as (9,10): Then the resulting force applied к ∝ from and , calculated as (11): , After that, the mutant vector of operation M is calculated as follows (12): , Crossover. In this step, both the target vector X , and the mutant vector X are used to create a trial vector , , as described below (13): , , where rand is a random number in the range (0,1), I i is a random index chosen from the range [1, D], and CR ϵ [0.5, l] is a crossover control parameter. The test vector is equal to the mutant vector when CR = 1. The probe vector parameters should be checked if it is outside the valid search space to ensure that the parameter values are physical values. If any parameter exceeds the permissible limits of the search area, it is replaced with a new value as follows (14): ISFNST 2021 Journal of Physics: Conference Series 2155 (2022) 012020 IOP Publishing doi:10.1088/1742-6596/2155/1/012020 5 Selection. The sampling step is applied after the creation of N sample vectors. The process of choosing between the current target and trial vectors is based on the objective function values for both vectors. A vector with a small objective function is selected as a population member for the next generation G + 1. The selection process can be described as (15): Eventually, the reproduction of trace vectors (mutation and crossover) and selection stages continue until the predefined stop conditions are met.
Calibration of such a measuring system is carried out experimentally using certified reference sources and certified methods. Thus, the first step of the proposed technique is to obtain a set of FEPEs of the gamma-spectrometric system for use as a reference. Calibration The main challenge in the characterization process is to accurately determine several detector and crystal geometries that are not normally provided by the vendor.  Table 1 shows the geometric parameters that are used in the equivalent detector model. The third column in Table 1 shows the values provided by the manufacturer Canberra. The parameters in the same column without a value are the variables selected for the optimization problem. Columns 4 through 6 show the assignment of unknown geometric characteristics to the variables of the optimization problem , , as well as the minimum and maximum values of each variable, which were selected from the literature. All values are in mm In our case, the goal of the optimization problem is to find five detector parameters.
In the course of the work, a code was developed in the system of scientific and engineering calculations MATLAB [14], which optimally characterizes the detector module described in Table 1, using the DE algorithm and the MCNP program.
To solve this problem, only two MATLAB files are needed: the first file is used to obtain the values of five parameters. This file sets the initial parameters of the detector and crystal. Thereafter, the second program is called as a MATLAB function to implement the DE algorithm and returns the selected optimal five parameter values given the specified experimental data. After that, the function of the suitability of DE algorithms for each generation is applied. The structure of the developed optimization code is presented by the block diagram in Figure 3. The algorithm works as follows: at the next step, candidates are randomly selected from the current population who will become parents (a set of possible solutions), and then using certain selection rules, children are formed for the next generation. The last three steps -mutation, crossover and selection are repeated during iteration in order to optimize the objective function.
The objective function to be minimized is the sum of the squared relative differences between the IFP (FEPE) obtained by MCNP and the set of reference (experimental or calculated) IFPs according to the following equation (21): To obtain the characteristics of the spectrometer, an evolutionary algorithm with a population of 50 individuals (NP = 50) and a crossover ratio of 0.9 (CR = 0.9) was used. These values were adopted in accordance with a recommendation that states that the population size NP should take a value from five to ten times, depending on the number of variables n. The F mutation rate ranges from 0 to 2, according to the formula. In addition, a maximum of 100 generations was adopted as the stopping criterion.

Results
The estimated time required to complete the optimization process was approximately 215 hours (9 days) using a 3.4 GHz i7 processor. As a result, five new parameters of the detector model were obtained. To illustrate the merits of this solution, we compared the experimental .(FEPE) with a set of , generated by the MCNP code using a detector model with new parameters. There is good agreement between the experimental and calculated results. The maximum relative difference is below 2% over the entire studied range.

Conclusion
A computational method has been developed to obtain the characteristics of the HPGe spectrometer through the parallel implementation of an evolutionary algorithm (differential evolution) and a Monte Carlo simulation code (MCNP). The obtained characteristic of the detector was confirmed by comparing the experimental and calculated computational calibrations. At the same time, the relative differences between the results are below 2%. This value is below the minimum experimental error.