Introduction

Gamma–gamma coincidence spectrometry is a technique whereby spectra are constructed only from events defined by two or more gamma rays captured within a preset window of time. While the technique is commonly used in nuclear structure analysis to construct radioactive decay schemes, its application in neutron activation analysis (NAA) has been limited. Previous research has explored the technique’s usefulness in NAA, and experiments confirm that it has advantages to offer over singles counting [13]. Previous research also suggests reasons for its lack of popularity [4]. Total gamma detection efficiency is one issue. Secondly, there is only a limited number of elements for which coincidence offers improved detection limits. The most salient difficulty may be the technically tedious task of acquiring, processing and analysing coincidence data. Traditional analog systems for coincidence data acquisition are particularly complex. Only in recent years have improvements in electronics and computing made predominantly digital data acquisition systems attractive [47]. Nevertheless, it may be noted that these systems still require custom engineering and off-the-shelf solutions are not available to laboratories.

A research and development project was undertaken at the National Institute of Standards and Technology (NIST) to address this shortcoming. The goal of the project was to develop software to facilitate routine acquisition of γγ-coincidence and other custom-gated multi-detector spectra for activation analysis and related applications.

Theory

The current “list mode” approach to coincidence counting using digital systems involves acquiring data as a sequential list of gamma events with timestamps and energies. With a separate computer program to sort such a data set, events that have occurred within a certain time window of each other can be identified. These coincident events can then be binned to construct a spectrum.

Most recent digital acquisition systems offer some way of obtaining list mode data. However, this is not usually done in the most convenient and efficient way. For example, the digitizer unit may have to pause the acquisition repeatedly for the computer to read out the results, which incurs additional processing dead time. If data are to be written to disk immediately, this time-consuming operation will increase the time costs even further. List mode data, which generally consumes a large amount of storage space (e.g. gigabytes per hour in case of prompt gamma), will be formatted in some way unique to the hardware. The next step usually involves writing custom code to sort these data into desired spectra. The lack of a reliable system for routine acquisition of coincidence data likely deters scientists from even considering the use of coincidence NAA (cNAA) when it would otherwise be appropriate.

A fundamental question in approaching cNAA acquisition is whether list mode files are always the best approach. In the case of nuclear structure analysis, a variety of coincidence time windows may have to be examined, so post-acquisition data sorting is indispensable. In the case of cNAA, the nuclides of interest and their decay properties may be known in advance. If the coincidence window of interest is known, it may be preferable to reduce the incoming list data to analytically and visually meaningful spectra right away, without the intermediary file. Monitoring the results in real time may also aid in diagnosing problems with the experimental setup. Thus it was our goal to develop online coincidence sorting capabilities, while also keeping the option to save the raw data to file when needed. Radware, a program commonly used for nuclear decay scheme deduction, works with energy-gated projections created from coincidence matrices [8]. We also looked to such existing software for how to best manipulate and analyse the data.

A program (under the working title qpx) for data acquisition, reduction and analysis was developed with the goal of implementing a robust, flexible and transparent tool, easily accessible to researchers. The program was developed in C++ using the open source and multi-platform boost and Qt libraries, thus making the program compatible with Linux, OS X, Windows and potentially mobile platforms. The program is open source, available for download, use and modification by any researcher interested in contributing to its further development and improvement.Footnote 1 The following sections describe the high-level architecture of this program, included features, experiments carried out to validate its functionality, and a summary of results.

Software architecture

The qpx data acquisition and reduction engine is multi-threaded. It takes advantage of the parallel processing power of modern multi-core processors. Three broadly-defined processes are carried out in parallel: data acquisition, data parsing, and spectrum construction. The first involves communication with the signal digitizer electronics while the other two encompass the data reduction process, traditionally dubbed as “sorting”. The data cascades through the threads in a simple linear manner, as if through an assembly line. Data is transferred from one thread to the next via thread-safe FIFO (first in, first out) queues that act as dynamic buffers. The three worker threads are described in detail in the order that the data moves through them.

Acquisition

The software was initially developed and tested to work with the XIA LLC Pixie-4 digital pulse analyser module, which produces list mode output with timestamps at 13.3 ns resolution, energies at 16-bit (65 k channels) resolution and statistics on dead time incurred by field-programmable gate array (FPGA) electronics. As noted above, one of the chief concerns with list mode acquisition is dead time during the data transfer. In the case of the Pixie-4, the reason for pausing acquisition is to prevent the FPGA and the PC from accessing the same memory location simultaneously, thus resulting in non-deterministic program behavior and possible data corruption. A method was implemented whereby parts of the memory are used by the two devices interchangeably—i.e. one-half of the memory is reserved for writing new data, the other is being read out by the computer; then they switch places, and the process is repeated. This double-buffer method ensures that the digitizer never pauses or waits for the computer to read the data. Prior to this optimization, experiments showed that an additional 6.5 ms of live time were lost for each readout operation. This counting rate-dependent loss is eliminated completely, and thus dead time is upper-bounded by the limits of the digitization process in the hardware.

The data acquisition thread commands the digitizer to begin acquisition and polls it at regular intervals for indication that new data is ready for readout. Upon positive response, the thread will fetch the data from the digitizer, package it with additional meta-data (live time, input count rate, lab clock) and pass it down to the next worker thread (the parser).

List output parsing

List mode data sorting involves two different processes. The first step is to perform parsing or decoding of hardware-specific list mode output data into useful data structures containing information about gamma event timing and energy (and potentially pulse shape, depending on the digitizer features). The second step is to bin events to appropriate spectra, possibly gated with some coincidence or anticoincidence logic. In the interests of modularity and scalability, the present software separates these two processes and carries them out independent of one another.

The parser thread is tasked with translating data from the digitizer-specific format into generic gamma event data. For example, in the case of the Pixie-4, there are significant issues with reconstructing timestamps correctly. We can solve this issue in this layer of the program and move on with the assurance that errors will not occur if the analytical layer of the program must ever be adapted for a different scientific goal. For example, there may arise a need to compare time-stamps on the computer side if required delay parameters lie outside of the FPGA’s capabilities (i.e. Compton suppression anti-coincidence, time of flight correlations). Correct time stamp reconstruction allows us to move the coincidence logic to the software layer which is more flexible than digitizer electronics.

Another advantage of this approach is that we can make the data acquisition part of the program modular—i.e. adaptable to different hardware that may output their raw data in different formats. As an example, we have written additional modules to make the software compatible with a multi-detector system using Iseg, Wiener and Mesytec modules on a Versa Module European (VME) platform. The adapted system has been successful in acquiring spectra from a 9-detector lanthanum bromide array. The software can be adapted to work with other digitizers if Application Programming Interface (API) kits are available from the manufacturers.

The parser thread outputs a stream of events identifying the detector, the time of the event and its energy. This generic data is ready for live binning to spectra, or it can also be saved to a file if there is any need foreseen for complete list mode data. Furthermore, the list mode file will be hardware-independent, conveniently formatted and readily interpreted (offline sorting) by the same software that generated it.

Spectra construction

In contrast to analog acquisition systems, the computer is not limited by hardware as to the number or types of spectra that it can construct, so long as the incoming data provides sufficient information to justify additional analytical perspectives. The third and final thread in the qpx acquisition engine receives a sequential queue of gamma events and passes a copy of each to the spectra objects that the user has requested it to construct. Each spectrum then applies its own logic gates and bins the events appropriately. The flexibility is in the fact that the user may choose to create any combination of coincidence-gated, anti-coincidence-gated or singles spectra, γγ-coincidence matrices or any other type of user-defined spectra, perhaps at multiple energy resolutions. All of these will be built up in parallel and in real time without additional hardware.

In object-oriented programming parlance, a “Spectrum” is a generic data type (class) that accepts gamma events and provides the client with some integrated information (a spectrum) based on the events received. Custom classes can be created that fit this definition but otherwise behave in unique ways. To start, qpx provides two basic types of spectra: Spectrum1D (hereafter 1D), traditional multi-channel analyser (MCA) spectra with optional coincidence gating logic, and Spectrum2D (hereafter 2D), two-detector coincidence matrices. These classes are further extensible with user-defined logic.

As examples of such flexibility, we may mention our attempts at two such classes. The first is a plot of count rate as a function of time. This could be modified to monitor percent dead time or, more usefully, to automatically generate multiple histograms for smaller periods of time. Current computers certainly have enough memory for such data sets to be constructed and they could be useful for examining nuclides with different decay times.

Another such example is a loss-free counting (LFC) spectrum as a derivation of the 1D type. The basic assumption is that losses due to electronics dead-time and pile-up can be compensated for while preserving the same statistical distribution for a given time-window. Since the Pixie-4 digitizer can periodically report on dead-time and number of counts prior to pile-up rejection, LFC capability can be implemented in the software layer. A basic LFC algorithm was implemented and tested to be effective for up to 30 % dead time. This result is comparable to that of LFC systems tested by other researchers [9]. For reliable and statistically-sound LFC capability, however, it would be advisable to implement advanced techniques.

User interface

It was our intent that this software be powerful and intuitive. The data acquisition and reduction engine can be run with or without a graphical interface. The command line utility is geared towards scripted, automated experiments, and integration with sample changer systems. The graphical interface provides flexibility for configuring digitizers, controls the acquisition and viewing of spectra in real time, and also includes some rudimentary and novel analysis tools.

Digitizer controls include utilities for automatically finding optimal shaper settings (rise-time, flat-top, etc.) for detectors, and automatic amplifier gain-matching. Settings for each detector are saved in a database: calibrations persist between experiments and lab setups can be changed without having to repeat the calibration and optimization processes. An oscilloscope function is available (if enabled in digitizer) as well as list mode views with pulse traces for diagnostic purposes.

Spectra acquisition is performed with real-time display of multiple 1D spectra and one 2D spectrum of the user’s choice as shown in Fig. 1. The user may interactively select the types of spectra required and define the coincidence logic for each of them. For custom spectrum types, special parameters can also be set interactively. Acquisition can be scheduled for a set time and can be stopped and resumed at will. Newly defined spectra can also be built up from previously saved list data. The entire acquisition project (including all digitizer settings for reproducibility) can be saved as one file, or exported to commonly used formats (tka, n42, Radware matrices). A number of formats can also be imported (cnf, Radware) for analysis. The user can zoom and drag spectra to inspect their features. Visual parameters are easily changed for convenience and aesthetics.

Fig. 1
figure 1

Multiple MCA histograms and a coincidence matrix are provided in real-time during the acquisition process. Seen here are the singles and coincidence 1D histograms, and a coincidence matrix for an irradiated bovine liver standard reference material sample

Analysis tools are provided for both general classes of spectra. The 1D analysis tool performs interactive peak finding and fitting, energy calibration using a nuclide database, FWHM calibration, and peak integration using preset windows (SUM4 algorithm) and fitted Gaussian parameters. The 2D analysis tool allows the user to navigate the coincidence matrix and select specific energy ranges to gate on. Events within these ranges are projected into 1D spectra that can then be analysed with traditional gamma spectroscopy tools as shown in Fig. 2. Taking a cue from tools developed for nuclear structure analysis, we have also included a function that symmetrizes the coincidence matrix. This involves rebuilding the matrix so that the channels of one detector perfectly match up with those of the first prior to energy calibration (post-acquisition gain matching). After diagonally folding the matrix, total counts in a gated energy range are roughly doubled, thus increasing the statistical sample for quantitative measures. Coincidence counting NAA does not yet have as well developed an arsenal of analytical tools. Thus, there is much space for improvement by adapting useful tools developed in the nuclear structures field as well as possibly inventing new ones.

Fig. 2
figure 2

Coincidence matrix analysis with interactive energy gating, post-acquisition gain matching and matrix symmetrization. Seen here is the 152Eu spectrum, with energy-gated projections of the 344 and 778 keV coincidence

Discussion

The qpx software package was developed following the agile development paradigm. Many components have been completely redesigned as compared to the initial conception and the architecture has evolved to meet newly discovered needs. The initial development phase focused on ensuring proper communication with the Pixie-4 digitizer and the reliability of the multithreaded acquisition engine. Mid-term goals were the generalization and modularization of the engine to work with more data sources and expanding the graphical and analytical tools to make the software more useful to researchers on a routine basis. Testing of the user interface was carried out by both seasoned researchers and novice students. As the software matures, unit testing and validation will also be performed.

Initial testing was carried out with 60Co and 152Eu sources and, when possible, by comparing the data to results obtained with commercial data acquisition packages such as Genie-2000®. In the future, testing will involve the analysis of various irradiated samples. A two-detector system has been set up for coincidence prompt gamma measurements on the cold neutron beam at NCNR. This system will facilitate cNAA and nuclear structure experiments. It is hoped that the generalized solutions implemented in the program can be leveraged to advance other scientific applications without the need for separate ad-hoc tools. For example, with minimal additional code, it should be possible to adapt the existing spectrum classes for cosmic ray suppression [10, 11], time-of-flight measurements, disk chopper gating, higher-dimensional spectra for greater detector numbers (cubes, hyper-cubes), etc. Since the program is capable of interactively reconstructing spectra from saved list data, it could also serve as an educational tool in cases where access to a variety of radioactive sources is not possible. We may conclude that the software, in its present form, has generally met the objective of facilitating routine acquisition of γγ-coincidence and other custom-gated spectra for activation analysis and furthermore extends a bridge into the field of nuclear structure analysis.