# A multi-particle generation scheme through energy discretization in GEANT4 simulations for atmospheric applications

Ahmet Ilker Topuz

► To cite this version:

Ahmet Ilker Topuz. A multi-particle generation scheme through energy discretization in GEANT4 simulations for atmospheric applications. 2024. hal-04701889v2

HAL Id: hal-04701889

https://hal.science/hal-04701889v2

Preprint submitted on 24 Sep 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# A multi-particle generation scheme through energy discretization in GEANT4 simulations for atmospheric applications

A. Ilker Topuz¹

¹Manipal Centre for Natural Sciences, Centre of Excellence, Manipal Academy of Higher Education, Manipal 576104, India
aitopuz@protonmail.com

## Abstract

Various types of particles constitute the primary cosmic-ray beam at the top of the Earth's atmosphere, and these different particles might have separate roles depending on the purpose of a specific atmospheric application. In this study, a recipe that performs the simultaneous injection of diverse particles in the GEANT4 framework is demonstrated in order to mimic this property. This scheme is based on the utilization of multiple probability grids that are governed by the initial flux ratios, and the algorithms of this multi-particle generation are exhibited by using the primary cosmic proton flux as well as the primary cosmic alpha flux measured from the BESS-TeV spectrometer. It is revealed that this multi-particle generation method can be advantageous for a range of atmospheric applications, particularly in the areas where precise particle interaction modeling is required.

**Keywords:** GEANT4; Cosmic rays; BESS-TeV spectrometer; Multi-particle generation; Discrete energy spectra; Probability grid.

## 1 Introduction

Cosmic rays that are composed of mainly protons and alphas strike the atmosphere by interacting with the air molecules to create the extensive particle showers [1]. These interactions play a critical role in various atmospheric and space-related applications including but not limited to atmospheric dosimetry, neutron spectroscopy, and radiochemistry [2–4]. Understanding and accurately simulating these particle interactions is essential for predicting radiation exposure levels, studying particle propagation, and investigating the effects of cosmic radiation in both terrestrial and extraterrestrial environments.

Traditionally, either experimental or theoretical/computational data resources provide the necessary information about the energy spectrum as well as the particle population of the cosmic rays. The BESS-TeV spectrometer and the PAMELA spectrometer are dedicated to measuring the energy spectrum of the cosmic-ray particles [5, 6], whereas the particle generators such as CRY and CMSCGEN also produce the relatively appropriate parameters to be used in the accurate simulation models [7, 8]. Among the existing techniques is the probability table method where the discrete energy values along with their corresponding discrete probabilities are implemented in order to generate the associated particles [9], and a similar but limited approach has been already adopted in the MCNP6 code [10].
In this study, a multi-particle generation scheme within the GEANT4 simulation framework [11] that is designed to address the problem of simultaneous multi-particle injection by simulating the injection of various particles is introduced [12] as shown in Appendix A. This technique utilizes the probability grids [13–15] that are governed by the initial flux ratios to reflect the diverse particle composition observed in cosmic rays. By incorporating the measurements from the BESS-TeV spectrometer for the proton and alpha fluxes, the proposed method offers a more comprehensive and accurate simulation model. Additionally, this scheme allows for the specification of the initial particle generation locations as well as the momentum directions, which enhances its utility for a wide range of atmospheric applications. This study is organized as follows. While section 2 exhibits the current methodology to perform the simultaneous injection of the cosmic protons as well as the cosmic alphas in the GEANT4 framework, the conclusions from the present study are drawn in section 3.

## 2 Methodology

In view of the fact that the present objective is to carry out a multi-particle approach, it has been already demonstrated [13–15] that the current scheme might be used in order to implement the empirical particle energy spectra as in the case of the BESS-TeV spectrometer [6] where the discrete energies of cosmic-ray protons as well as cosmic-ray alphas are measured at the distinct particle fluxes. The first 28 non-zero energy bins between 1 and 68 GeV and their corresponding separate fluxes are taken into consideration, and the discrete probabilities of cosmic-ray protons are determined by the quotient between the particular proton flux value at a specific energy and the total proton flux as follows

$$p_{\text{Proton},i} = \frac{\phi_{\text{Proton},i}}{\sum_{i=0}^{28} \phi_{\text{Proton},i}} \quad \text{with} \quad \sum_{i=0}^{28} p_{\text{Proton},i} = 1 \qquad (1)$$

According to the BESS-TeV proton spectrum, the cosmic proton flux drastically declines when the kinetic energy of the cosmic-ray protons augments as depicted in Fig. 1(a).

<figure><img src="image_2.png" /><figcaption>Figure 1: BESS-TeV proton spectrum between 1 and 68 GeV (a) particle flux and (b) discrete probabilities.</figcaption></figure>
Since the contribution of the particle population after 68 GeV is negligible for the cosmic protons, a threshold value of 68 GeV is utilized in the current study. The tabular proton flux values from the BESS-TeV spectrometer in Table 1 of Appendix B permit to calculate the discrete probabilities for each energy bin as written in Eq. (1), and Fig. 1(b) illustrates the variation of the discrete probabilities determined from the BESS-TeV spectrometer with respect to the kinetic energies for the cosmic-ray protons.

In the similar fashion, the discrete probabilities of cosmic-ray alphas are calculated for an energy distribution lying on an interval between 1 and 86 GeV by using the following formula:

$$p_{\text{Alpha},j} = \frac{\phi_{\text{Alpha},j}}{\sum_{j=0}^{28} \phi_{\text{Alpha},j}} \quad \text{with} \quad \sum_{j=0}^{28} p_{\text{Alpha},j} = 1 \qquad (2)$$

As in the case of the cosmic-ray protons from the BESS-TeV spectrometer, the cosmic-ray alpha flux sharply decreases when the kinetic energy of the cosmic alphas rises as displayed in Fig. 2(a). In the same manner, the tabulated alpha flux values from the BESS-TeV spectrometer in Table 2 of Appendix C grant the ability to calculate the discrete probabilities for each energy bin as denoted in Eq. (2), and Fig. 2(b) shows the variation of the discrete probabilities calculated from the BESS-TeV spectrometer in terms of the kinetic energies for the cosmic-ray alphas.

<figure><img src="image_3.png" /><figcaption>Figure 2: BESS-TeV alpha spectrum between 1 and 86 GeV (a) particle flux and (b) discrete probabilities.</figcaption></figure>

In the wake of obtaining the discrete probabilities of the cosmic protons as well as the cosmic alphas, the latter step is to select the particle type. In order to attain this objective, it is necessary to find out the initial particle flux ratios, and the total cosmic particle flux denoted by $\sum \Phi$ consisting of protons as well as alphas is expressed as follows

$$\sum \Phi = \sum_{i=0}^{28} \phi_{\text{Proton},i} + \sum_{j=0}^{28} \phi_{\text{Alpha},j} \qquad (3)$$
Specifically, the probability of the cosmic-ray protons is

$$P_{\text{Proton}} = \frac{\sum_{i=0}^{28} \phi_{\text{Proton},i}}{\sum \Phi} = a \qquad (4)$$

whereas the probability of the cosmic-ray alphas is similarly

$$P_{\text{Alpha}} = \frac{\sum_{j=0}^{28} \phi_{\text{Alpha},j}}{\sum \Phi} = b \qquad (5)$$

where $P_{\text{Proton}} + P_{\text{Alpha}} = a + b = 1$. In accordance with the BESS-TeV spectrometer, a is considered as 0.8965 for the cosmic protons, while b is 0.1035 for the cosmic alphas in the present study. On the first basis, in order to start the particle injection, it is initially necessary to pick up a random number from the uniform distribution by using the following equation:

$$\xi_x = \text{G4UniformRand}(\xi) \qquad (6)$$

As described in the equation below, if the obtained random number is between 0 and a, then a proton is generated. In the same fashion, if this random number is between a and 1, then an alpha is injected.

$$\left\{ \begin{array}{ll} \text{If } 0 < \xi_x \le a \text{ then proton} & \\ \text{Else if } 1 - b < \xi_x \le 1 \text{ then alpha} & (7) \end{array} \right. $$

In the next step, another random number is picked up to set out the kinetic energy of the selected particle as depicted in Fig. 3.

<figure><img src="image_4.png" /><figcaption>Figure 3: Double probability grid that govern the kinetic energies for the particles constituting the present cosmic-ray beam.</figcaption></figure>

To further detail, a strategy to inject the incoming protons as well as the incoming alphas is subsequently integrated by means of G4ParticleGun as can be found in the previous studies. By recalling the unity condition, a grid is built by summing up the discrete probabilities, the
interval of which starts with 0 and ends in 1. Thus, each cell in this grid, i.e. the difference between two points on the probability grid, specifies a discrete probability. Then, a random number denoted by $\xi$ between 0 and 1 is generated by using the pre-defined uniform number generator called G4UniformRand(). Finally, this random number is scanned on the probability grid by checking the difference between the grid points, and the particular discrete energy is assigned when the random number matches with the associated cell.

## 3 Conclusion

To conclude, in this study, a multi-particle generation scheme through energy discretization in GEANT4 simulations, the basis of which is founded on the utilization of multiple probability grids that are governed by the initial flux ratios, is demonstrated for the atmospheric applications such as atmospheric dosimetry, neutron spectroscopy, and radiochemistry. It is worth noting that the present scheme also allows to define the separate initial locations as well as the separate momentum directions for the generation of different particles. The proposed approach is not only expected to improve the accuracy of cosmic ray simulations but also to expand their applicability to more sophisticated models, particularly in fields that demand precise particle interaction modeling such as atmospheric and space radiation studies.

# Appendix A - Multi-particle generation scheme through energy discretization

```c
/// \file B1PrimaryGeneratorAction.cc
```

```c
/// \brief Implementation of the B1PrimaryGeneratorAction class
```

```c
#include "B1PrimaryGeneratorAction.hh"
```

```c
#include "G4LogicalVolumeStore.hh"
```

```c
#include "G4LogicalVolume.hh"
```

```c
#include "G4Box.hh"
```

```c
#include "G4RunManager.hh"
```

```c
#include "G4ParticleGun.hh"
```

```c
#include "G4ParticleTable.hh"
```

```c
#include "G4ParticleDefinition.hh"
```

```c
#include "G4SystemOfUnits.hh"
```

```c
#include "Randomize.hh"
```

```c
#include <iostream>
```

```c
//... 0000000000 ... 0000000000 ... 0000000000 ... 0000000000 ...
```

B1PrimaryGeneratorAction::B1PrimaryGeneratorAction()

: G4VUserPrimaryGeneratorAction(),

fParticleGun(0)

```c
{
    G4int n_particle = 1;
```

```c
    fParticleGun = new G4ParticleGun(n_particle);
```

```c
}
```

```c
//... 0000000000 ... 0000000000 ... 0000000000 ... 0000000000 ...
```

B1PrimaryGeneratorAction::~B1PrimaryGeneratorAction()

```c
{
    delete fParticleGun;
```

<footnote>* License and Disclaimer</footnote>

<footnote>* The Geant4 software is copyright of the Copyright Holders of *</footnote>

<footnote>* the Geant4 Collaboration. It is provided under the terms and *</footnote>

<footnote>* conditions of the Geant4 Software License, included in the file *</footnote>

<footnote>* LICENSE and available at http://cern.ch/geant4/license. These *</footnote>

<footnote>* include a list of copyright holders.</footnote>

<footnote>* Neither the authors of this software system, nor their employing *</footnote>

<footnote>* institutes, nor the agencies providing financial support for this *</footnote>

<footnote>* work make any representation or warranty, express or implied, *</footnote>

<footnote>* regarding this software system or assume any liability for its *</footnote>

<footnote>* use. Please see the license in the file LICENSE and URL above *</footnote>

<footnote>* for the full disclaimer and the limitation of liability.</footnote>

<footnote>* This code implementation is the result of the scientific and *</footnote>

<footnote>* technical work of the GEANT4 collaboration.</footnote>

<footnote>* By using, copying, modifying or distributing the software (or *</footnote>

<footnote>* any work based on the software) you agree to acknowledge its *</footnote>

<footnote>* use in resulting scientific publications, and indicate your *</footnote>

<footnote>* acceptance of all terms of the Geant4 Software license.</footnote>
```c
}
}
}
}
}
fParticleGun->GeneratePrimaryVertex(anEvent);
}
// ... oooOOOOOo ... oooOOOOOo ... oooOOOOOo ... oooOOOOOo ...
```

## Appendix B - BESS-TeV discrete probabilities of cosmic protons

<table><caption>Table 1: BESS-TeV discrete probabilities of cosmic protons at the corresponding discrete energies between 1 and 68 GeV.</caption><thead><tr><th>E<sub>i</sub> [GeV]</th><th>φ<sub>Proton,i</sub> [m<sup>-2</sup>s<sup>-1</sup>sr<sup>-1</sup>GeV<sup>-1</sup>]</th><th>E<sub>i</sub> [GeV]</th><th>p<sub>Proton,i</sub></th></tr></thead><tbody><tr><td>0.00</td><td>0.000</td><td>0.00</td><td>0</td></tr><tr><td>1.08</td><td>350.000</td><td>1.08</td><td>0.139931881</td></tr><tr><td>1.26</td><td>322.000</td><td>1.26</td><td>0.128737331</td></tr><tr><td>1.47</td><td>298.000</td><td>1.47</td><td>0.119142002</td></tr><tr><td>1.71</td><td>271.000</td><td>1.71</td><td>0.108347257</td></tr><tr><td>2.00</td><td>241.000</td><td>2.00</td><td>0.096353095</td></tr><tr><td>2.33</td><td>208.000</td><td>2.33</td><td>0.083159518</td></tr><tr><td>2.71</td><td>174.000</td><td>2.71</td><td>0.069566135</td></tr><tr><td>3.16</td><td>145.000</td><td>3.16</td><td>0.057971779</td></tr><tr><td>3.69</td><td>119.000</td><td>3.69</td><td>0.047576840</td></tr><tr><td>4.30</td><td>95.200</td><td>4.30</td><td>0.038061472</td></tr><tr><td>5.01</td><td>73.500</td><td>5.01</td><td>0.029385695</td></tr><tr><td>5.84</td><td>56.300</td><td>5.84</td><td>0.022509043</td></tr><tr><td>6.81</td><td>43.400</td><td>6.81</td><td>0.017351553</td></tr><tr><td>7.93</td><td>31.500</td><td>7.93</td><td>0.012593869</td></tr><tr><td>9.25</td><td>22.500</td><td>9.25</td><td>0.008995621</td></tr><tr><td>10.80</td><td>15.900</td><td>10.80</td><td>0.006356905</td></tr><tr><td>12.60</td><td>11.200</td><td>12.60</td><td>0.004477820</td></tr><tr><td>14.70</td><td>7.710</td><td>14.70</td><td>0.003082499</td></tr><tr><td>17.10</td><td>5.330</td><td>17.10</td><td>0.002130963</td></tr><tr><td>19.90</td><td>3.630</td><td>19.90</td><td>0.001451294</td></tr><tr><td>23.20</td><td>2.480</td><td>23.20</td><td>0.000991517</td></tr><tr><td>27.10</td><td>1.620</td><td>27.10</td><td>0.000647685</td></tr><tr><td>31.60</td><td>1.090</td><td>31.60</td><td>0.000435788</td></tr><tr><td>36.80</td><td>0.717</td><td>36.80</td><td>0.000286660</td></tr><tr><td>42.90</td><td>0.484</td><td>42.90</td><td>0.000193506</td></tr><tr><td>50.00</td><td>0.315</td><td>50.00</td><td>0.000125939</td></tr><tr><td>58.30</td><td>0.207</td><td>58.30</td><td>0.000082759</td></tr><tr><td>68.00</td><td>0.134</td><td>68.00</td><td>0.000053573</td></tr></tbody></table>
# Appendix C - BESS-TeV discrete probabilities of cosmic alphas

<table><caption>Table 2: BESS-TeV discrete probabilities of cosmic alphas at the corresponding discrete energies between 1 and 86 GeV.</caption><thead><tr><th>E<sub>i</sub> [GeV]</th><th>φ<sub>Alpha,j</sub> [m<sup>-2</sup>s<sup>-1</sup>sr<sup>-1</sup>GeV<sup>-1</sup>]</th><th>E<sub>i</sub> [GeV]</th><th>p<sub>Alpha,j</sub></th></tr></thead><tbody><tr><td>0.00</td><td>0.00000</td><td>0.00</td><td>0</td></tr><tr><td>1.08</td><td>52.20000</td><td>1.08</td><td>0.180861048</td></tr><tr><td>1.26</td><td>47.80000</td><td>1.26</td><td>0.165616056</td></tr><tr><td>1.47</td><td>40.20000</td><td>1.47</td><td>0.139283796</td></tr><tr><td>1.71</td><td>32.10000</td><td>1.71</td><td>0.111219150</td></tr><tr><td>2.00</td><td>26.2000</td><td>2.00</td><td>0.090777001</td></tr><tr><td>2.33</td><td>21.70000</td><td>2.33</td><td>0.075185532</td></tr><tr><td>2.71</td><td>18.10000</td><td>2.71</td><td>0.062712356</td></tr><tr><td>3.16</td><td>13.70000</td><td>3.16</td><td>0.047467363</td></tr><tr><td>3.69</td><td>9.770000</td><td>3.69</td><td>0.033850813</td></tr><tr><td>4.29</td><td>7.670000</td><td>4.29</td><td>0.026574794</td></tr><tr><td>4.98</td><td>5.710000</td><td>4.98</td><td>0.019783843</td></tr><tr><td>5.84</td><td>3.980000</td><td>5.84</td><td>0.013789789</td></tr><tr><td>6.80</td><td>2.830000</td><td>6.80</td><td>0.009805302</td></tr><tr><td>7.94</td><td>2.070000</td><td>7.94</td><td>0.007172076</td></tr><tr><td>9.24</td><td>1.480000</td><td>9.24</td><td>0.005127861</td></tr><tr><td>10.80</td><td>1.02000</td><td>10.80</td><td>0.003534066</td></tr><tr><td>12.60</td><td>0.67600</td><td>12.60</td><td>0.002342185</td></tr><tr><td>14.70</td><td>0.47100</td><td>14.70</td><td>0.001631907</td></tr><tr><td>17.00</td><td>0.32700</td><td>17.00</td><td>0.001132980</td></tr><tr><td>19.90</td><td>0.21300</td><td>19.90</td><td>0.000737996</td></tr><tr><td>23.20</td><td>0.14600</td><td>23.20</td><td>0.000505857</td></tr><tr><td>27.10</td><td>0.09670</td><td>27.10</td><td>0.000335043</td></tr><tr><td>31.40</td><td>0.05890</td><td>31.40</td><td>0.000204075</td></tr><tr><td>36.70</td><td>0.04230</td><td>36.70</td><td>0.000146560</td></tr><tr><td>42.90</td><td>0.02850</td><td>42.90</td><td>0.000098746</td></tr><tr><td>49.90</td><td>0.01840</td><td>49.90</td><td>0.000063752</td></tr><tr><td>62.50</td><td>0.00940</td><td>62.50</td><td>0.000032569</td></tr><tr><td>86.10</td><td>0.00216</td><td>86.10</td><td>0.000074840</td></tr></tbody></table>

## References

[1] Zyla, P.A. and others, “Review of Particle Physics,” *PTEP*, vol. 2020, no. 8, p. 083C01, 2020.

[2] Lambert, Damien and Girard, Sylvain and Santin, Giovanni and Gaillardin, Marc and Morana, Adriana and Meyer, Arnaud and Vidalot, Jeoffray and Baggio, Jacques and Mekki, Julien and Cintas, Hugo and others, “Simulation-assisted Methodology for the Design of Fiber-based Dosimeters for a Variety of Radiation Environments,” *IEEE Transactions on Nuclear Science*, 2024.
[3] C. Cazzaniga, N. Bhuiyan, M. Kastriotou, D. Chiesa, S. Lilley, and C. D. Frost, "Fast Neutron Measurements for the Characterization of the ChipIr beamline," *IEEE Transactions on Nuclear Science*, 2024.

[4] M. Schubert, M. Lin, J. F. Clark, M. Kralik, S. Damatto, L. Copia, S. Terzer-Wassmuth, and A. Harjung, "Short-lived natural radionuclides as tracers in hydrogeological studies—a review," *Science of the Total Environment*, p. 170800, 2024.

[5] O. Adriani, G. Barbarino, G. Bazilevskaya, R. Bellotti, M. Boezio, E. Bogomolov, L. Bonechi, M. Bongi, V. Bonvicini, S. Borisov, et al., "PAMELA measurements of cosmic-ray proton and helium spectra," *Science*, vol. 332, no. 6025, pp. 69–72, 2011.

[6] Haino, Sadakazu and Sanuki, T and Abe, K and Anraku, K and Asaoka, Y and Fuke, H and Imori, M and Itasaki, A and Maeno, T and Makida, Y and others, "Measurements of primary and atmospheric cosmic-ray spectra with the BESS-TeV spectrometer," *Physics Letters B*, vol. 594, no. 1-2, pp. 35–46, 2004.

[7] Hagmann, Chris and Lange, David and Wright, Douglas, “Cosmic-ray shower generator (CRY) for Monte Carlo transport codes,” in *2007 IEEE Nuclear Science Symposium Conference Record*, vol. 2, pp. 1143–1146, IEEE.

[8] Biallass, Philipp and Hebbeker, Thomas, “Parametrization of the cosmic muon flux for the generator CMSCGEN,” *arXiv preprint arXiv:0907.5514*, 2009.

[9] Dermott E. Cullen, “Application of the Probability Table Method to Multigroup Calculations of Neutron Transport,” *Nuclear Science and Engineering*, vol. 55, no. 4, pp. 387–400, 1974.

[10] T. Goorley, M. James, T. Booth, F. Brown, J. Bull, L. Cox, J. Durkee, J. Elson, M. Fensin, R. Forster, et al., “Initial MCNP6 release overview,” *Nuclear technology*, vol. 180, no. 3, pp. 298–315, 2012.

[11] Agostinelli, Sea and Allison, John and Amako, K and Apostolakis, John and Araujo, H and Arce, Pedro and Asai, Makoto and Axen, D and Banerjee, Swagato and Barrand, GJNI and others, “GEANT4—a simulation toolkit,” *Nuclear instruments and methods in physics research section A: Accelerators, Spectrometers, Detectors and Associated Equipment*, vol. 506, no. 3, pp. 250–303, 2003.

[12] A. I. Topuz, “GEANT4 package - Multi-particle generation.” https://github.com/illcore/Multi_partICLE_generator.git, 2024.

[13] Topuz, Ahmet Ilker and Kiisk, Madis and Giammanco, Andrea, “DOME: Discrete oriented muon emission in GEANT4 simulations,” *Instruments*, vol. 6, no. 3, p. 42, 2022.

[14] Topuz, Ahmet Ilker and Kiisk, Madis and Giammanco, Andrea, “Particle generation through energy discretization and restrictive planes in GEANT4 simulations for potential applications of cosmic ray muon tomography,” in *Journal of Physics: Conference Series*, vol. 2438, p. 012150, IOP Publishing, 2023.

[15] Topuz, Ahmet Ilker, “COME: Cylindrical oriented muon emission in GEANT4 simulations,” *London Journal of Physics*, vol. 1, no. 1, 2024.