1 Introduction

Amongst the fleet of nuclear physics detection systems, large High Purity Germanium (HPGe) arrays are very powerful instruments for nuclear structure studies and \(\gamma \)-ray spectroscopy in particular. The nuclear physics community has designed and operated HPGe arrays that offer a high and unmatched energy resolution and efficiency for several decades. The latest generation of HPGe arrays currently under-construction are the Advanced Gamma Tracking Array, AGATA [1], in Europe and, the Gamma-ray Energy Tracking Array, GRETA [2] in the USA. This new generation of arrays aims at fully reconstructing the interaction sequence of incoming \(\gamma \) rays that do not simply interact via a single photoelectric interaction. This technique subsequently allows the determination of direction of the incoming gamma and the full deposited energy, which increases greatly the photopeak energy efficiency of the array. The design of these arrays very much relies on a good determination of the interaction position in the crystal and the tracking algorithm efficiency. While the former is difficult to simulate, modern Monte-Carlo radiation transport codes are great tools to simulate the interaction in a material and to optimise the tracking algorithm and the overall array geometry. Therefore, right from the start of both the AGATA and GRETA projects, just over 20 years ago, a simulation code was developed using the CERN-based GEANT4 for radiation transport code [3, 4], which had just started to replace the widely used GEANT3 toolkit. The AGATA code was born. Since then, the AGATA code has been developed tremendously, following along the evolution of GEANT4. Figure 1 shows the simulated AGATA geometry.

While the design phase is now complete, the AGATA code is mostly used for the estimation of the array’s performance as the number of crystals increases from one experimental campaign to another and it remains an essential tool for the feasibility studies of new experiments and for data analysis.

Fig. 1
figure 1

Geometry of the AGATA 4\(\pi \) (left) and 2\(\pi \) (right) array as defined in the simulation code. Some aluminium capsules have been removed to reveal one triple cluster

In the Sects. 2 and 3, the AGATA code structure and content will be described, and some examples of ancillary detectors included in the distributed package will be presented. Section 4 provides an update of the performance response expected for the 4\(\pi \) array, using the latest tracking algorithm. In Sect. 5 a few examples of advanced simulations including some ancillary detectors will be given. Finally, future development will be presented in the Sect. 6.

2 The AGATA simulation code

2.1 Status

The AGATA collaboration continuously maintains the AGATA simulation code with new releases of GEANT4 and provides user support for its installation and execution. The code is now distributed via a GIT repository [5]. All advanced features presented in this article have been produced with GEANT4 10.5 and are currently being tested with the latest versions. The structure of the AGATA code still follows the structure of a native GEANT4 application. However, many new classes for new event generators and ancillary detectors have been added to take advantage of new capabilities in GEANT4 or extend the scope of the simulation code. With most event generators, the simulation output has remained in the ASCII format, which leaves the choice of data analysis tool to the users. The code is distributed with a version of the two tracking methods, the back-tracking algorithm (MGT) and the Orsay forward-tracking algorithm (OFT) [6, 7], however, the responsibility is left to the users to acquire the latest versions.

2.2 Recently added capabilities and tools

2.2.1 CAD geometry import

A key part of radiation detection simulation work is the definition of the detector geometry. Since radiation interactions occur in all material, simply defining the sensitive volume geometry of the detector is insufficient to provide an accurate prediction of the detector response. Therefore, to take into account interactions in the sensitive volume as well as in surrounding material and predict the impact the latter can have on the detector response, a description as detailed as possible of the entire detector must be implemented in the simulated geometry. In GEANT4, this can be achieved using the native geometry description classes. However, the toolkit also provides the option to import Computer Aided Design (CAD) files into the geometry. In the AGATA code, this was successfully carried out using the Geometry Description Markup Language (GDML) interface [8] to import the geometry of new reaction chambers and new auxiliary detectors. The import process comprises different steps. First, the STEP-format file of the ISP 10303-21 CAD standard drawing is converted into a GDML format file. Several open source or commercial software packages are available to the users for this. Commercial software such as FASTRAD usually offer extra utilities that facilitates the material assignment to each volumes. Finally the GDML has to be invoked during the geometry construction.

Fig. 2
figure 2

AGATA setup at LNL with the CAD imported geometry of the new PRISMA reaction chamber. By transparency, the GDML geometry of the SPIDER array is revealed inside the chamber

Figure 2 shows the AGATA detector with the new PRISMA [9] reaction chamber and the SPIDER array [10], as used at the Legnaro National Laboratory (LNL). Other CAD-to-GDML converted geometries that are available include the reaction chamber for VAMOS [11] and for MUGAST [12].

2.2.2 Event generators

New built-in event generator Back in 2004, for the toolkit release 6.0, the GEANT4 collaboration produced a new event generator class called G4GeneralParticleSource (GPS), which gives users a realistic method to simulate the radiation decay of nuclides. The new class allows users to specify spectral, spatial and angular distribution of the primary source particles via macros or command lines. The simulation of the decay is based on ascii data file taken from available nuclear database, which can be completed, corrected or even created directly by users. This feature has been added in the AGATA code as a new event generator option, on top of the original built-in generator G4ParticleGun and the AGATA external event generator class which simply reads as input a list of primary particles defined by their nature, position and momentum as input. The command line to run the Agata executable file with the GPS option is:./Agata -gps.

Alternative generator: In the AGATA simulation package the so-called “ Alternative Generator” (AG) has been developed to simulate experiments. This is used to estimate the performance of AGATA and check the feasibility of an experiment or to assist in the analysis of experimental data. Typical applications are for the estimation of peak-shapes and peak separation when performing lifetime measurements using methods based on Doppler Shift, i.e. Recoil-Distance Doppler Shift (RDDS) or Doppler-Shift Attenuation Method. To give realism to the spectra, a background consisting of an exponential shape and discrete \(\gamma \) rays emitted at selected energies can be added with individual intensities. This background has been introduced to model “ prompt background” seen in experiments with AGATA and the magnetic spectrometer VAMOS.

When using the AG a “ wall-clock time” can also be used. Each event has a start timestamp that is controlled by parameters of the beam in the simulations. The beam is modelled as a bunched beam of a given frequency, bunch width, and intensity given in particles per second (pps). The beam particles are produced with equal probability with the time of each bunch. This way beams that are completely random in their time structure as well as highly bunched beams can be simulated. A continues beam is simulated by matching the bunch width with the bunch frequency. Although this feature can be used to simulate random coincidences or, e.g. the buildup of \(\beta \)-decay background, its main use is to produce simulated data that can be analysed using the software as experimental data starting from \(\gamma \)-ray tracking (grt). Using the AG \(\gamma \)-ray sources can also be added. The sources can be of any nature, i.e. point-like calibration sources or volume sources to model radioactivity from a beam dump, for example. Each added source requires a data file describing the decay of the source as well as its geometry. The source activity, in kBq, is given together with data file to include the source in the simulation. The \(\gamma \)-ray sources and beam-structure share the same wall-clock time, i.e. they are emitted statistically according to activity and beam intensity. This allows the simulation of random coincidences or pile-up in the detectors in the case of high simulated count rate.

Gamma-ray source simulations were implemented to investigate different aspects of efficiency losses in the simulation as compared with experiments in the framework of the paper by Lalović et al. [13].

During a simulation the Alternative Generator generates events with several primary vertices, i.e. particles in the following order:

  1. 1.

    The “ prompt background” \(\gamma \) rays are generated.

  2. 2.

    The beam particle is generated.

  3. 3.

    If one or more \(\gamma \)-ray sources have been added, \(\gamma \) rays from possible decays are added.

The creation of the beam particle is taken care of by a class called Incoming_Beam. The Reaction class handles the nuclear reaction. It does not try to calculate or model absolute cross sections. The default is that every beam particle will react in the target, with a depth profile defined by a data file. An energy dependent cross section can be modeled using this file. If no such file is given an equal probability inside the target thickness is used. A second data file gives the angular distribution of the outgoing product. If an energy dependent angular distribution is needed it is possible to have only a fraction of the target active and run several simulations with different angular distributions varying with the energy of the beam at the reaction point. The reaction product is given by the change in Z and A counting from the beam. The levels that are to be excited in the product nuclei (and its partner if this is wanted) and the corresponding intensities can be added.

Four different reaction mechanisms are implemented:

  • Transfer reaction,

  • Fusion evaporation,

  • Fusion-fission,

  • Coulomb excitation.

Each of the four process are given a probability (\(P_{Tr}\) for transfer reaction etc.) with the following condition

$$\begin{aligned} P_{Tr}+P_{Fe}+P_{Ff}+P_{Ce}=1. \end{aligned}$$
(1)

satisfied. In each event a random number between 0 and 1 is chosen and used to select the reaction mechanism. Typically one of the probabilities is set to 1 and the other three to 0 but for target-beam-product combinations that are accessible via more than one reaction mechanism it is meaningful to give a non-zero weight to more than one probability. All kinematics are calculated using relativistic expressions. There are however limitations, such as the assumptions made about the fraction of the energy in fission going to kinetic energy of the fragments or into internal excitation of the fragments. Examples of uses of the AG are given in Sect. 5.

Fig. 3
figure 3

Tool chain for producing adf event from AGATA GEANT4 simulations. ADF files containing the positions and energies of \(\gamma \)-ray interactions are feed into the event builder of the agapro package and analysed as if from experimental data. Data from ancillary detectors are, as is the case for experimental data, added at the event merger level

Event generation for the AGAPRO analysis package: The introduction of a “ wall-clock time” into the AGATA simulation code gives the possibility to generate events in a format that can be read by the AGAPRO package (see Stézowski et al. in this issue). A code has been written that creates AGATA data format (adf) files that emulates experimental data files after the Pulse-shape analysis step. The wall-clock time step in the output of the GEANT4 simulation is converted into a 10 ns timestamp corresponding to the 100 MHz clock of the AGATA DAQ. Each crystal is treated independently, where the energy of the core is given as the sum of all interactions within the assumed shaping time of the amplifier (typically a few microseconds). The same is true for the energies of the segments. The used segmentation is that of the AGATA simulations, which mimics closely but not exactly the real segmentation (the segmentation is defined in an input file). As is the case for the experimental PSA, a maximum of one interaction point is produced per segment. For the simulations the interaction point position is the energy-weighted average position of all energy depositions in the segment. An energy dependent position resolution is then added, making sure that the position stays within the segment. Ancillary detectors can also be added by the use of shared libraries that produced the correct type of adf frame for that ancillary. This procedure is illustrated in Fig. 3.

2.2.3 Position resolution map

In real measurements, the interaction positions from Pulse Shape Analysis (PSA) are extracted with an effective resolution. Therefore, the interaction points from GEANT4 simulations need to be smeared with some resolution before proceeding with tracking. The position resolutions of AGATA detectors were studied in an in-beam experiment based on the energy resolution of Doppler-corrected \(\gamma \)-ray spectra [14], which giving average resolution of \(\sim \)2 mm (\(\sigma \)) for large energy deposited interaction points. By default, a position resolution (\(\sigma \)) with energy dependence

$$s(E_p)=s_0+s_1\sqrt{\frac{100\,\textrm{keV}}{E_p}},$$

is used to smear the simulated interaction points in xyz directions independently. Here, \(s_0=1.15\) mm and \(s_1=2.64\) mm are extracted from Table 5 of Ref. [14], \(E_p\) is the energy deposit of the interaction point in unit of keV. Further investigation of the AGATA position resolution was carried out via a “bootstrapping” method [15]. Clear asymmetries and position dependence were observed for the PSA position resolution. Based on this observation, it is clear that the simulation code would benefit from a position-sensitive position smearing, to make the simulation results more realistic.

A position smearing map was created and arranged in a 2 mm grid, the same as the one used for PSA. Considering the geometry of the detectors, the position resolutions are defined in cylindrical coordinate, i.e., in \(\phi \), r and z directions for every grid point. To generate the position resolution map, we implemented a new simulation method. In this method, we first obtain the interaction points from a normal AGATA GEANT4 simulation. Then for every interaction point, a pulse shape response is deduced by linear interpolation of the AGATA Data Library (ADL) signal basis in 2 mm grid. The pulse shape responses from one detector are summed up in every event, and a certain noise level is added to generate the simulated pulse shape data. The simulated pulse shape data is then processed through the normal PSA algorithm in the same way as experimental data to obtain the analysed interaction positions. The position resolution of every grid point is extracted by comparing the PSA analysed positions with the GEANT4 simulated ones around this grid point. The position resolution obtained from this method is in general smaller than the 2 mm (\(\sigma \)) average resolution reported for the experimental data [14], which is expected, since there are effects like neutron damage, cross talk and time alignment in experimental signals making the signal shape deviated from the ADL basis, leading to a worse position resolution. Therefore, a scaling factor is applied to the original resolution map to make the average resolution at 2 mm (\(\sigma \)). Figure 4 shows the position resolution map obtained for one detector.

To use the resolution map, the closest grid point in the same segment is found for every simulated interaction. Then the resolutions assigned to that grid point are used to smear the original interaction in \(\phi \), r and z directions to get a new interaction point. In order to make the new interaction in the same segment as the original one, the closest grid point in the same segment is found for the new interaction and its position is used as the final position of the smeared interaction. Figure 5 shows an example of the AGATA responses with original uniform resolution and with the resolution map. A longer tail is observed with the implementation of resolution map.

Fig. 4
figure 4

Position resolution (\(\sigma \)) in \(\phi \) (r\(\times \)cos(\(\phi \))), r and z directions obtained for one detector. The resolutions are given in mm unit and projected in xy and xz planes

Fig. 5
figure 5

Simulation of 2 MeV \(\gamma \)-ray spectra with Doppler correction. The \(\gamma \)-ray is emitted from particle moving at 0.5c. The response of AGATA 4\(\pi \) array are obtained with 2 mm(\(\sigma \)) uniform resolution (black) and the resolution map (red)

3 Other systems

3.1 Other HPGe arrays

The implementation of AGATA in GEANT4 required the geometry definition of different shapes of crystals. The flexible approach that was developed to achieve this at the design stage of the project has facilitated the implementation of the crystal shape of other HPGe arrays. The crystal shapes of Miniball, Euroball and the USA equivalent of AGATA, GRETINA and GRETA, have all been defined and added to the AGATA code. All of these arrays benefit from the event generators and other utilities developed for AGATA simulations. They can be used as stand alone, coupled to other HPGe array for a hybrid configuration (e.g. AGATA with Miniball), or coupled to the other ancillary detectors.

3.2 Ancillary detectors and structures

As for other \(\gamma \)-ray arrays, the performance of AGATA can be enhanced by the detection in coincidence of the gamma-emitter nuclei as well as other products characteristic of the reaction of interest. In order to perform as realistic and complete simulation as possible many ancillary detectors have been added to the code over the years by different developers. To avoid clashes with previously defined detectors, each new detector must be given a new identification number. The list of these detectors together with their identification number can be displayed when running the simulation code with the help option (./Agata -h). Amongst these ancillary detectors already coupled to AGATA in real experiment are the FATIMA, PARIS, and SPIDER arrays. The PRISMA spectrometer is the very latest addition. The latter includes a preliminary implementation of the multi-wire proportional chamber and the ionisation chamber at the focal plane, and it relies on the interface available in GEANT4 to import a magnetic field map for the trajectory simulation of heavy ions in the quadrupole and dipole of the spectrometer. Figure 6 illustrates the coupling of the simulated AGATA array with the simulated PRISMA spectrometer. In this example, the magnetic field maps of the dipole and quadrupole were calculated using the original PRISMA simulation code, which was tuned for the detection of the \(^{90}\)Zr ions with a charge state q = + 30, and were imported into the AGATA simulation code. Just after the target, which is positioned at the centre of AGATA, a pair of \(^{90}\)Zr ions emerge with the same momentum vector. Each ion of the pair then undergoes the effect of the magnetic field, first in the quadrupole and then in the dipole, where their trajectories completely diverge, leaving only the ions with charge state q = + 30 reaching the focal plane detectors.

Fig. 6
figure 6

PRISMA spectrometer defined as an ancillary detector in the AGATA simulation code. Green and blue tracks represent \(\gamma \)-ray tracks and \(^{90}\)Zr tracks, respectively

Like ancillary detectors, developers of the AGATA code have also defined the geometry of non-sensitive physical volumes such as reaction chambers or mechanical support structures. With this modular feature the users can just add these into their simulated setup when needed. The VAMOS and MUGAST reaction chambers at GANIL and the new PRISMA reaction chambers at LNL already mentioned in 2.2.1 have been defined as ancillary and, as such, they have a specific identification number assigned to them. Most of the ancillary detectors and mechanical structures have currently a hard coded fixed position and orientation with respect to the target position. For SPIDER, as for AGATA, inline commands have been defined to translate and rotate the array as needed by the users.

4 Basic simulated response of a 4\(\pi \) array

4.1 Efficiency

With the increasing number of crystals and the improvement of the electronics and the tracking algorithm, the efficiency of the existing arrays has been measured and compared with simulations. The observed discrepancies have been investigated in [13, 16] and are now believed to originate from a reduced active area of each germanium crystal. While in the simulation all crystals of a given shape are all identical with the same intrinsic efficiency, the measured intrinsic efficiency of each crystal is different. Each crystal will have a different impurity concentration, a different neutron damage history, and will see a different electric field distribution once biased. This non-homogeneity of the electric field is mostly observed around the central contact and at the back of the germanium crystal and produces electrically passive areas, which differ in size and lead to a different intrinsic efficiency from one crystal to another. The AGATA code provides the possibility to adjust the thickness of the passive areas for each type of crystal but not for individual ones. The default values are based on crystal scanning measurements and are set to 0.6 mm around the central contact and 1 mm at the back of the crystal, in the geometry files of the code (A180Solid.list). The corresponding simulated average intrinsic efficiency of a crystal is \(\sim 86.3\%\) at 1.3 MeV and is \(\sim 8\%\) higher than the measured one. When comparing the measured efficiency of the existing array at different \(\gamma \)-ray energy with the simulation, an overestimation up to \(12\%\) is observed in the simulation, as presented in [16]. A better agreement is found by increasing arbitrarily the passive area around the central contact and at the back to 2.5 mm and 3 mm, respectively. The average overestimation is then lower than \(5\%\).

Fig. 7
figure 7

Simulated photopeak efficiency of the AGATA 4\(\pi \) array considering a source at rest in the centre of the array, and different modes of operation: the calorimeter mode (circles), the core single sum (squares) and the \(\gamma \)-ray tracking mode (diamonds). The tracked efficiency with extended germanium passive area is displayed in red. The \(\gamma \) ray energies have been chosen to compare with the results reported in [17]. See text for details

The simulated efficiency of the 4\(\pi \) AGATA array as a function of the incident \(\gamma \)-ray energy is presented in Fig. 7. The results are given considering the equivalent response of a calorimeter, i.e. the sum of the energy deposited from all cores with no \(\gamma \)-ray tracking, the sum of all the single cores without add-back and the \(\gamma \)-ray tracking. This was produced with an isotropic mono-energetic source at rest emitting a single \(\gamma \) ray per event. The results can be compared with the initial simulations carried out by Farnea et al. [17] with no reaction chamber. In this work however, OFT, which is the adopted algorithm for the experimental data, was used with all the standard parameters. The impact of the passive area increase in the germanium crystal can be seen for the tracked efficiency. It is very similar to the impact reported in [16] on the core singles efficiency, which match the measured core efficiency. Therefore, the tracked efficiency of the full AGATA array presented in Fig. 7 as well as in Fig. 8, where an aluminium chamber of 2 mm thickness has been added, is considered realistic for a source at rest and low \(\gamma \)-ray multiplicity events. Further simulated efficiency of the full array for a source in motion and at higher multiplicity are provided in Table 1 together with the simulation results obtained with an ideal shell of germanium.

Fig. 8
figure 8

Simulated photopeak efficiency after tracking. The two curves with open diamonds are taken from Fig. 7. The blue curve with solid diamond is the equivalent photopeak efficiency with a 2 mm aluminium reaction chamber added

Table 1 Simulated performance of AGATA compared with a closed Ge shell with equivalent thickness

4.2 Peak-to-Total ratio

The simulated peak-to-total ratio response of the 4\(\pi \) AGATA array for an isotropic source at rest is given in Fig. 9 as a function of the incoming \(\gamma \)-ray energy. Like for the efficiency in 4.1, the OFT algorithm was used for the tracking, using all standard tracking parameters. The peak-to-total ratio obtained in the calorimeter mode is very similar to the results reported in [17] with the exception of the ratio at 80 keV. The same observation is true with the corresponding efficiency curve. The difference may be due to the thin aluminium layer encapsulating the crystals, which is included in this work. As the incoming \(\gamma \)-ray energy increases the peak-to-total curves obtained with tracking clearly diverge from the calorimeter curves towards lower ratio values. This divergence coincides with the pair production process, which starts to become dominant. Figure 9 shows that the combine reduction of the active area of the crystal and the addition of a 2 mm thick aluminium chamber also deteriorate the peak-to-total ratio by a few percent. The largest effect is seen at low \(\gamma \)-ray energies and results mostly from the interactions in the chamber. At higher energies, the penetrating power of \(\gamma \) rays increases. Interactions in the passive areas at the back and around the central contact will more likely happen and this becomes the dominant factor in the reduction of the peak-total ratio.

Fig. 9
figure 9

Peak-to-Total ratio obtained with the same simulation conditions described in Fig. 7

4.3 Evolution with the number of crystals

Figure 10 gives an illustration of the benefits that the tracking technique provides when the number of crystals in the array increases. In this simulation a 1 MeV \(\gamma \) ray was emitted isotropically by a point source at rest at the centre of the array. The 2 mm aluminium chamber was included together with the additional passive area in the crystals mentioned in 4.1. This simple result shows how the benefit of tracking is immediate for the peak-to-total ratio even with the smaller number of crystals when this is compared with the sum of the core singles. On the other hand, for the efficiency, it is clear that the benefit of tracking is greater when the number of crystals increases. Although this may not appear like a huge gain in this basic simulation, the benefit of tracking on the efficiency appears huge when coincidence measurements of multiple \(\gamma \) rays are required, as illustrated in 5.1 below.

Fig. 10
figure 10

Photopeak efficiency (upper panel) and peak-to-total ratio (lower panel) at 1 MeV simulated with an isotropic source at rest in the centre of the array. An aluminium chamber of 2 mm thickness and extra passive area in all crystals were included in these simulations

5 Advanced simulated response

In this section, the simulation of three different types of AGATA experiments are given as examples.

5.1 Example 1 - High-spin decay of \(^{158}\)Er

The first example is the simulation of a high-spin excitation measurement in \(^{158}\)Er. For this, an input event file of 10\(^{8}\) decays was produced using an external event generator, which is also distributed with the AGATA code. For the input of the event generator, we assumed that the \(^{158}\)Er nuclei were travelling through a gold layer of 19 \(\mu \)g/cm\(^{2}\) thickness with a kinetic energy of 200 MeV. The excitation of \(^{158}\)Er nuclei was restricted to the population of states in two high-spin rotational excitation bands: the known normal deformed (ND) band and a super deformed (SD) band. The ND band started from the ground state with \(J^\pi =0^{+}\) to a 13.4 MeV excitation states with \(J^\pi =38^{+}\). The known relative intensities of the transitions were taken into account when randomly populating the excited states of this band, while the intensities for the SD band were set 10\(^{3}\) times lower. The SD band was assumed to start from an excited state at 10 MeV at spin 23 and extended up to a state at 34.1 MeV of spin 65. An arbitrary transition linking the two bands was also added. This link transition corresponded to an emission of a 4 MeV \(\gamma \) ray from the first state of the SD band and had only one occurrence every 100 events for which the SD band was populated.

Fig. 11
figure 11

Simulation of the \(^{158}\)Er \(\gamma \) decay, assuming a 4 MeV energy \(\gamma \) transition between two collective rotational bands at high spin. The responses of a 4\(\pi \) and 3\(\pi \) AGATA array with a 4-\(\gamma \) gate condition are displayed in blue and magenta, respectively

Fig. 12
figure 12

Simulation of the \(^{158}\)Er \(\gamma \) decay, assuming a 4 MeV energy \(\gamma \) transition between two collective rotational bands. The responses of a 4\(\pi \) AGATA array and the Euroball with a 4-\(\gamma \) gate condition are displayed in blue and red, respectively

The resulting event file contained all the necessary formatted information on the \(\gamma \) emitter \(^{158}\)Er and on the \(\gamma \) cascade for each events to be used directly as input in the AGATA code. Three simulations were performed with the same input file. The first two were performed with a 3\(\pi \) and a 4\(\pi \) AGATA array and the third with the Euroball array for comparison. With the AGATA array, the OFT tracking algorithm was used to construct the Doppler-corrected energy of \(\gamma \) rays. With Euroball, a separate analysis code was produced to provide the equivalent output information, as no tracking is needed. In all cases, the output was formatted into a ROOT tree [18]. The three ROOT trees were then analysed event by event using a multi-gating technique traditionally used in high-spin experiment analysis [19] to construct a multiple \(\gamma \) coincidence energy spectra. Figure 11 shows the results obtained for the two AGATA configurations when a 4-\(\gamma \) gating is applied amongst the 21 transitions observed in the SD band. The inset of that figure is a magnification of the 4 MeV region around the linking transition. It is clear that a peak appears at 4 MeV with both configurations, however, with a potential background in that region during a real experiment, the 4\(\pi \) configurations gives a much higher chance to discover such a weak transition. The equivalent energy spectrum obtained with Euroball is given in Fig. 12. Although the sum of the energy measured in neighbouring crystals was not accounted for in the Euroball simulation analysis, there is no peak to be seen at 4 MeV with this array.

5.2 Example 2 - Coulomb excitation of \(^{58}\)Fe

As a second example of advanced simulations we show a Coulomb excitation experiment. A beam of 222 MeV \(^{58}\)Fe ions impinge on a 1 mg/cm\(^2\) \(^{208}\)Pb target. The angular distribution of the Coulomb excited ions follow a Rutherford distribution and the excited states are populated according to calculations with the GOSIA code [20]. The SPIDER detector is used as ancillary detector for the back scattered \(^{58}\)Fe ions. In Fig. 13 the setup as simulated is shown, together with particles from 20 simulated events. Iron ions are shown as blue lines whereas \(\gamma \) rays are illustrated with green lines.

Fig. 13
figure 13

Geometry of AGATA and spider together with tracks of 20 simulated events. The blue lines are \(^{58}\)Fe ions, the green lines are \(\gamma \) rays

Fig. 14
figure 14

Simulated \(\gamma \)-ray spectra of the \(^{208}\)Pb(\(^{58}\)Fe,\(\gamma \)) reaction. The Spider detector was used to detect the recoiling iron ions. Doppler Correction performed after \(\gamma \)-ray tracking. The inset shows the region 1000-1950 keV

Fig. 15
figure 15

Geometry of AGATA together with tracks of 5 simulated events. The blue lines are the heavy ions (\(^{64}\)Ni and \(^{62}\)Fe ions) and the green lines are \(\gamma \) rays. The cyan coloured box represents the geometrical acceptance of the simulated magnetic spectrometer. For details, see text

Fig. 16
figure 16

Simulated \(\gamma \)-ray spectra of the \(^{64}\)Ni(\(^{238}\)U, \(\gamma ^{62}\)Fe) reaction. The VAMOS spectrometer was simulated by its geometrical coverage and a \(b\rho \) acceptance code. Doppler Correction performed after \(\gamma \)-ray tracking. The insets show the regions 840-900 keV (\(2^+_1\rightarrow 0^+_1\) transition) and 1260-1320 keV (\(4^+_1\rightarrow 2^+_1\) transition). For details, see text

Interaction points from the simulations were packed, smeared, and tracked according to the standard procedure with position independent resolution. Doppler Correction is performed on the basis of the angle of the first hit in the \(\gamma \)-ray track, the angle of the hit Spider segment, and the energy deposited in the Spider detector. The resulting \(\gamma \)-ray spectrum, together with the non-Doppler corrected version, is shown in Fig. 14.

5.3 Example 3 - multi-nucleon transfer to \(^{62}\)Fe

As a final example, the simulation of an experiment aiming at measuring lifetimes in moderately neutron-rich iron nuclei [21] is presented. This is a multi-nucleon reaction with a downstream spectrometer. A beam consisting of \(^{238}\)U ions impinged on a 1 mg/cm\(^{2}\) think \(^{64}\)Ni target. A degrader of 5.7 mg/cm\(^2\) natural magnesium was positioned at different distances from the target to simulate a RDDS experiment. Examples of such experiments performed with AGATA and magnetic spectrometers can be found in the review of Bracco et al. [22]. In this simulation a rectangular parallelepiped is used to simulate the geometrical opening of a magnetic spectrometer. AGATA and the schematic spectrometer is shown in Fig. 15. Every ion that passes this volume has its mass and kinetic energy registered and stored in the list-mode output file.

For each simulated event the transfer reaction creates a \(^{62}\)Fe ion in an excited state, either of the \(2^+_1\) or \(4^+_1\) states. The angular distribution of the ions are taken from a data file. To save execution time the ions are also limited to the direction of the opening of the simulated spectrometer. In addition 20 \(\gamma \) rays are emitted, with energies sampled from an exponential background that has been modeled on experimental data from earlier experiments. The interaction from the \(\gamma \) rays in AGATA were packed, smeared, and tracked according to the standard procedure. For the spectrometer part of the simulation, the charge state of each ion was calculated using the Shina model. This allowed to see if the \(b\rho \) was within limits of the simulated magnetic spectrometer (in this example VAMOS [11, 23, 24]).

Results of the simulation of the transfer reaction for RDDS measurements are shown in Fig. 16. The black solid line shows the expected spectrum for a target-degrader distance of \(40 \mu \)m. In red dashed \(\gamma \) rays emitted after the start of the degrader are shown. Gamma-rays emitted “ in-flight”, i.e. between the target and the degrader, are shown in dotted brown. This features allows the use of simulations to estimate peak-shapes to better fit complicated spectra. Finally, spectra for \(700 \mu \)m distance are shown in dashed-dotted blue and dashed-dotted-dotted black. The later is simulated without the 20 supplementary background \(\gamma \) rays.

6 Outlook

The AGATA collaboration has continued to maintain and develop the AGATA simulation code, whether to take advantage of new features distributed in the latest GEANT4 releases or to expand the range of event generators or the list of ancillary detectors. One future improvement that would benefit the predictive power of the code would be to model the electrical passive area of each crystal, individually, estimating it either indirectly from the manufacturer measured intrinsic efficiency or measuring it directly during the crystal scanning process.

There are also more recent simulation tools which have been developed in recent years within the nuclear physics community and which often aim at providing a complete data analysis and simulation framework. The migration of the AGATA code to some of these frameworks has already started and a version of the code is available in the Nuclear Physics Tool (NPTool) [25] and in the Simultation Toolkit fOr Gamma-ray Spectroscopy (STOGS) [26]. There are plans to do the same with FairRoot [27]. All these frameworks are built directly or virtually on top of the GEANT4 radiation transport code and, since GEANT4 is compatible with GDML (Geometry Description Markup Language) format files, developers have converted the AGATA geometry into GDML to facilitate this migration. For the AGATA collaboration, this is seen as an opportunity to rejuvenate the code and make it accessible to a larger community of researchers.