# HyPE: Attention with Hyperbolic Biases for Relative Positional Encoding

Giorgio Angelotti111Dr. Giorgio Angelotti, a physicist, data scientist, and
machine learning engineer, earned his PhD in Computer Science from the
University of Toulouse, France, in 2023<EMAIL_ADDRESS>Independent Researcher

###### Abstract

In Transformer-based architectures, the attention mechanism is inherently
permutation-invariant with respect to the input sequence’s tokens. To impose
sequential order, token positions are typically encoded using a scheme with
either fixed or learnable parameters. We introduce Hyperbolic Positional
Encoding (HyPE), a novel method that utilizes hyperbolic functions’ properties
to encode tokens’ relative positions. This approach biases the attention
mechanism without the necessity of storing the $O(L^{2})$ values of the mask,
with $L$ being the length of the input sequence. HyPE leverages preliminary
concatenation operations and matrix multiplications, facilitating the encoding
of relative distances indirectly incorporating biases into the softmax
computation. This design ensures compatibility with FlashAttention-2 and
supports the gradient backpropagation for any potential learnable parameters
within the encoding. We analytically demonstrate that, by careful
hyperparameter selection, HyPE can approximate the attention bias of ALiBi
[1], thereby offering promising generalization capabilities for contexts
extending beyond the lengths encountered during pretraining. The experimental
evaluation of HyPE is proposed as a direction for future research.

###### keywords:

relative positional encoding, attention bias, large context, transformer

##  1 Introduction

Transformer-based networks [2] have become pervasive across various fields,
including Natural Language Processing [3, 4, 5, 6], Computer Vision [7, 8],
and Offline Reinforcement Learning [9, 10]. Within Transformer-based
architectures, the attention mechanism in the Transformer block hones in on
the interrelations between token pairs in the input sequence. However, this
attention mechanism exhibits permutation invariance, which implies that
Transformers do not inherently discern the absolute and relative positions of
tokens in a sequence. To remedy this, Positional Encoding—employing either
fixed or learnable parameters—is integrated into the architecture [2, 11],
thereby augmenting the effectiveness of Transformers. Nevertheless, these
encoding strategies introduce limitations to their versatility, particularly
in their ability to adapt. Specifically, learnable positional encodings,
tailored to the length of the input sequence, become fixed upon training
completion, in parallel with the network weights. This inflexibility poses
significant challenges when dealing with sequences at testing time that
surpass the lengths encountered during training [1].

Subsequent sections will delve into the integration of positional encoding in
Transformer-based architectures, highlighting the existing limitations and
providing the rationale for the innovations presented in this study.

##  2 Positional Encoding

Let us first recap what is computed by the attention mechanism.

Let $X\in\mathbb{R}^{L\times d}$ represent the sequence of embedded tokens,
with $Q,K,V\in\mathbb{R}^{L\times d}$ denoting the query, key, and value
matrices, respectively, and $W^{Q},W^{K},W^{V}\in\mathbb{R}^{d\times d}$ being
the corresponding linear operators. The attention mechanism’s output (for a
single head) is then calculated as:

$O=\textrm{softmax}\left(\frac{QK^{T}}{\sqrt{d}}\right)V.$ (1)

Vaswani et al. [2] introduced positional information into Transformer models
by superimposing a sinusoidal signal—dependent on the token’s absolute
position—onto the $d$-dimensional embedding resulting from the initial
embedding layer. This sinusoidal bias represents the token’s position within
the sequence through a frequency that varies with its position. This bias
$a^{\textrm{Sin}}\in\mathbb{R}^{L\times d}$ is usually directly added to the
embedding before computing the queries, keys and values: $X\leftarrow
X+a^{\textrm{Sin}}$.

In pursuit of better generalization for larger contexts and accommodating
sequences beyond pre-training lengths, it is argued that relative distances
should be prioritized over absolute positions within the encoded
representation. To this end, Shaw et al. [11] proposed Relative Positional
Representations. The work in [11] suggests modifies keys and values by summing
to them learnable embeddings, whose paramaters are adjusted based on the
relative positions of tokens. Following a similar approach, Huang et al. [12]
expanded this method to absolute distance encoding and vector embeddings.
These approaches, in spite of their performances, are computational expensive.
In the T5 model [13], an attention bias $a^{\textrm{T5}}\in\mathbb{R}^{L\times
L}$—a function of the relative distances—is integrated into the attention
computation to encode the relative positions. Despite their adaptivity, such
relative positional encodings necessitate the storage of the full $O(L^{2})$
mask, which becomes impractical for extensive context windows. Moreover,
recent algorithmic advances enabling $O(L)$ computation of self-attention do
not fully accommodate the bias addition before the softmax [14, 15]. To date
(30 October 2023), the backward propagation of gradients for attention bias
parameters still faces stability issues in FlashAttention-1222Reference to the
official Triton implementation: https://github.com/Dao-AILab/flash-
attention/blob/83aef842beec1037eb8c1d9c3ef3ed8aae80b091/flash_attn/flash_attn_triton.py
[14], while FlashAttention-2333Reference to the official implementation:
https://github.com/Dao-AILab/flash-
attention/blob/83aef842beec1037eb8c1d9c3ef3ed8aae80b091/flash_attn/flash_attn_interface.py[15]
does not yet support attention biases.

Rotary Positional Encoding (RoPE)[16] includes both absolute positions and
relative distances. RoPE uses a block diagonal rotation matrix to multiply the
$W^{\\{Q,K\\}}$ weights. This encodes the position by rotating vectors created
from the stacked embeddings of consecutive queries and keys. The varying angle
of rotation with sequence position ensures the encoding of absolute positions,
while the relative position is captured through the vector construction from
consecutive embeddings. Since RoPE is injected through matmul operations and
does not leverage learned parameters, it allows for faster training and
inference than T5.

Nevertheless, all the presented method does not seem to generalize efficiently
when the model is evaluated on extrapolation of sequences of length
$L_{\textrm{Extra}}>L$ used for pre-training [1]. To tackle this issue, the
Attention with Linear Biases (ALiBi) paradigm [1] introduces a static, non-
learned linear relative positional bias directly into the softmax argument,
efficiently scaling Transformer architectures for extrapolation on longer than
training context windows. However, ALiBi still requires storing the $O(L^{2})$
mask, which while compatible with FlashAttention-1, is not yet accommodated by
FlashAttention-2.

Our research seeks to answer:

_Can we devise a method that mirrors ALiBi’s effectiveness, incorporates
learnable parameters, and harnesses FlashAttention-2’s full capabilities?_

We introduce Hyperbolic Positional Encoding (HyPE), an innovative approach
that can be mathematically nearly equivalent to ALiBi. Instead of adding a
relative distance bias to the softmax term, HyPE utilizes hyperbolic functions
and matrix multiplication properties to incorporate the information into the
$QV^{T}$ computation. This method integrates seamlessly into any Transformer
architecture leveraging FlashAttention, eliminating the need to store the full
$O(L^{2})$ mask by indirectly calculating it during matrix multiplication.

The forthcoming section provides a concise overview of hyperbolic functions
and our principal contribution.

##  3 Hyperbolic Relative Positional Encoding

Let us examine the hyperbolic sine function:

$2\sinh{(x)}=e^{x}-e^{-x},$ (2)

which can be expressed as truncated series

$\sinh{(x)}\approx x+O(x^{3})\quad\text{for}\quad|x|\ll 1.$ (3)

From Equation 2 follows that

$2\sinh{(x-y)}=e^{x-y}-e^{y-x}.$ (4)

This trivial identity will be fundamental for the ensuing discussion.

Define $a^{\textrm{HyPE}}\in\mathbb{R}^{L\times L}$ such that

$a^{\textrm{HyPE}}_{i,j}=-\tau\sinh{(\mu(j-i))}.$ (5)

Our goal is to efficiently integrate the hyperbolic positional bias
$a^{\textrm{HyPE}}$ into the softmax function’s argument in Equation 1.

Let $\eta^{\\{Q,K\\}}\in\mathbb{R}^{L\times 2}$ be:

$\eta^{Q}_{i,j}=\dfrac{\tau\sqrt{d}}{2}e^{(-1)^{j+1}\mu i}$ (6)
$\eta^{K}_{i,j}=(-1)^{j+1}e^{(-1)^{j}\mu i}$ (7)

with indices $i\in[0,\dots,L-1]$, $j\in[0,1]$ and parameters
$(\mu,\tau)\in\mathbb{R}^{2}$. Here, $\mu$ represents the slope and $\tau$ the
amplitude.

By concatenating $\eta^{\\{Q,K\\}}$ with $Q$ and $K$ respectively:

$\hat{Q}=\textrm{concat}(Q,\eta^{Q}),$ (8)
$\hat{K}=\textrm{concat}(K,\eta^{K}),$ (9)

we can express the product $\hat{Q}\hat{K}^{T}$ as:

$\hat{Q}\hat{K}^{T}=QK^{T}+\sqrt{d}a^{\textrm{HyPE}}.$ (10)

To illustrate, consider the explicit matrix multiplication:

$(\hat{Q}\hat{V}^{T})_{i,l}=\sum_{j=0}^{d+1}\hat{Q}_{i,j}\hat{V}_{l,j}=\sum_{j=0}^{d-1}\hat{Q}_{i,j}\hat{V}_{l,j}+\sum_{j=d}^{d+1}\hat{Q}_{i,j}\hat{V}_{l,j}=\sum_{j=0}^{d-1}Q_{i,j}V_{l,j}+\sum_{j=0}^{1}\eta^{Q}_{i,j}\eta^{K}_{l,j}.$
(11)

By utilizing the earlier identity (Equation 4):

$\sum_{j=1}^{2}\eta^{Q}_{i,j}\eta^{K}_{l,j}=\dfrac{\tau\sqrt{d}}{2}\left(-e^{\mu(l-i)}+e^{\mu(i-l)}\right)=-\tau\sqrt{d}\sinh{(\mu(l-i))}=-\sqrt{d}a^{\textrm{HyPE}}_{i,l}.$
(12)

Subsequently, the softmax function can be redefined:

$\hat{O}=\textrm{softmax}\left(\dfrac{\hat{Q}\hat{K}^{T}}{\sqrt{d}}\right)V=\textrm{softmax}\left(\dfrac{QK^{T}}{\sqrt{d}}+a^{\textrm{HyPE}}\right)V.$
(13)

In this fashion, the $a^{\textrm{HyPE}}$ bias is incorporated without explicit
storage, calculated indirectly during matrix multiplication.

For effective tensor partitioning across devices, $\eta^{\\{Q,K\\}}$ can be
stacked $n$ times, resulting in a dimension of $d+2n$ that is divisible along
the parallelism dimension.

###  3.1 Approximate Equivalence with ALiBi

Using the truncated series expression (Equation 3), we deduce that for
$\tau=1$ and $\mu=m<\frac{1}{L}$, where $m$ is ALiBi’s slope,

$a^{\textrm{HyPE}}(\mu,\tau=1)_{i,j}\approx
a^{\textrm{ALiBi}}(m=\mu)_{i,j}+O\left((j-i)^{3}\mu^{3}\right)\quad\text{for}\quad\lvert(j-i)\mu\rvert\ll
1.$ (14)

This result suggests that for an accurate selection of (hyper)parameters HyPE
can approximate ALiBi, while resorting to FlashAttention-2.

###  3.2 Selection of (hyper)parameters

Given the exponential divergence of $\sinh(x)$ for large $x$, we suggest
setting $\mu<L^{-1}_{\textrm{Extra}}$, where $L_{\textrm{Extra}}$ exceeds the
pre-training length $L$.

The amplitude $\tau$ may be static or dynamically adjusted through gradient
descent.

###  3.3 Multi-Head Attention Implementation

HyPE accommodates multi-head attention by defining head-specific
$\eta_{h}^{\\{Q,K\\}}$ and applying the concatenation steps. In this multi-
head context, each head can have a unique slope $\mu_{h}$, and $\tau_{h}$
could be a learnable amplitude.

###  3.4 Extending HyPE to Images and Multidimensional Data

HyPE is versatile and can be extended to process multidimensional data, such
as images. For instance, consider a 3D image structured as a parallelepiped
with dimensions $(L_{x},L_{y},L_{z})$. Here, each voxel represents a token,
identifiable by its 3D coordinates $(i,j,k)$. These voxels are fed into the
Transformer model as a flattened sequence of tokens with a total count of
$L_{x}L_{y}L_{z}$.

To adapt HyPE for this context, one must carefully align the
$\eta_{{x,y,z}}^{\\{Q,K\\}}$, matrices, ensuring that each token’s dimensional
indices are accurately represented. It is crucial to verify that the $\eta$
matrices relative to the same dimension corresponding to the same dimension
interact correctly during the matrix multiplication process. This precise
arrangement allows the computation of attention as follows:

$\hat{O}=\textrm{softmax}\left(\dfrac{QK^{T}}{\sqrt{d}}+a^{\textrm{HyPE}}_{x}+a^{\textrm{HyPE}}_{y}+a^{\textrm{HyPE}}_{z}\right)V.$
(15)

The same reasoning can be extended to input of any dimension.

##  4 Experimental Evaluation

The authors, as Independent Researchers with limited access to computational
resources, have deferred the experimental evaluation of the algorithm to
future work. We posit that a partial evaluation, constrained by computational
limitations, might lead to an incomplete analysis that might not fully
represent the merits of the proposed approach. Nonetheless, we invite
researchers worldwide to apply the technique within their own computational
environments and contribute to its empirical evaluation. The primary
challenges in implementing this approach may lie in the multiplication of low-
precision values and the allocation of memory.

##  5 Conclusion

This study tackled the challenge of devising a Relative Positional Encoding
that aligns with the results of ALiBi while leveraging the advancements in
FlashAttention technology. Our development of Hyperbolic Positional Encoding
(HyPE) requires storing only $O(4Lh)$ values—where $h$ represents the number
of attention heads—and is capable of implicitly integrating a hyperbolic
attention bias into the softmax argument of the attention mechanism via matrix
multiplication of altered queries and keys. This process necessitates an
additional memory allocation step for the queries before the attention
computation, which can then be efficiently performed using FlashAttention.
While the parameters of HyPE have the potential to be learnable, we
demonstrate that with appropriate fixed values, it can approximate the
attention bias characteristic of ALiBi. We also show that HyPE can incorporate
relative positions for input of any dimension, e.g. images. Comprehensive
experimental evaluation remains an objective for future work.

## References

  *   * Press et al. [2021] Press, O., Smith, N., Lewis, M.: Train short, test long: Attention with linear biases enables input length extrapolation. In: International Conference on Learning Representations (2021)
  * Vaswani et al. [2017] Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, Ł., Polosukhin, I.: Attention is all you need. Advances in neural information processing systems 30 (2017)
  * Devlin et al. [2018] Devlin, J., Chang, M.-W., Lee, K., Toutanova, K.: Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805 (2018)
  * Brown et al. [2020] Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J.D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al.: Language models are few-shot learners. Advances in neural information processing systems 33, 1877–1901 (2020)
  * Almazrouei et al. [2023] Almazrouei, E., Alobeidli, H., Alshamsi, A., Cappelli, A., Cojocaru, R., Debbah, M., Goffinet, E., Heslow, D., Launay, J., Malartic, Q., et al.: Falcon-40b: an open large language model with state-of-the-art performance. Technical report, Technical report, Technology Innovation Institute (2023)
  * Touvron et al. [2023] Touvron, H., Lavril, T., Izacard, G., Martinet, X., Lachaux, M.-A., Lacroix, T., Rozière, B., Goyal, N., Hambro, E., Azhar, F., et al.: Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971 (2023)
  * Dosovitskiy et al. [2021] Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., Houlsby, N.: An image is worth 16x16 words: Transformers for image recognition at scale. In: International Conference on Learning Representations (2021)
  * Oquab et al. [2023] Oquab, M., Darcet, T., Moutakanni, T., Vo, H., Szafraniec, M., Khalidov, V., Fernandez, P., Haziza, D., Massa, F., El-Nouby, A., et al.: Dinov2: Learning robust visual features without supervision. arXiv preprint arXiv:2304.07193 (2023)
  * Chen et al. [2021] Chen, L., Lu, K., Rajeswaran, A., Lee, K., Grover, A., Laskin, M., Abbeel, P., Srinivas, A., Mordatch, I.: Decision transformer: Reinforcement learning via sequence modeling. Advances in neural information processing systems 34, 15084–15097 (2021)
  * Janner et al. [2021] Janner, M., Li, Q., Levine, S.: Offline reinforcement learning as one big sequence modeling problem. Advances in neural information processing systems 34, 1273–1286 (2021)
  * Shaw et al. [2018] Shaw, P., Uszkoreit, J., Vaswani, A.: Self-attention with relative position representations. In: Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pp. 464–468 (2018)
  * Huang et al. [2020] Huang, Z., Liang, D., Xu, P., Xiang, B.: Improve transformer models with better relative position embeddings. Findings of the Association for Computational Linguistics: EMNLP 2020 (2020)
  * Raffel et al. [2020] Raffel, C., Shazeer, N., Roberts, A., Lee, K., Narang, S., Matena, M., Zhou, Y., Li, W., Liu, P.J.: Exploring the limits of transfer learning with a unified text-to-text transformer. The Journal of Machine Learning Research 21(1), 5485–5551 (2020)
  * Dao et al. [2022] Dao, T., Fu, D., Ermon, S., Rudra, A., Ré, C.: Flashattention: Fast and memory-efficient exact attention with io-awareness. Advances in Neural Information Processing Systems 35, 16344–16359 (2022)
  * Dao [2023] Dao, T.: Flashattention-2: Faster attention with better parallelism and work partitioning. arXiv preprint arXiv:2307.08691 (2023)
  * Su et al. [2021] Su, J., Lu, Y., Pan, S., Murtadha, A., Wen, B., Liu, Y.: Roformer: Enhanced transformer with rotary position embedding. arXiv preprint arXiv:2104.09864 (2021)


# Simulations of Compton Sequencing with the GRETINA Detector

Dr. Robert Crabbs
University of California, Berkeley
Dr. I-Yang Lee
Lawrence-Berkeley National Laboratory
Dr. Kai Vetter
Lawrence-Berkeley National Laboratory

###### Abstract

GRETA, the Gamma-Ray Energy Tracking Array, is an array of highly-segmented
HPGe detectors designed to track $\gamma$-rays emitted in beam-physics
experiments. Its high detection efficiency and state-of-the-art position
resolution enable it to reject Compton background and also sequence detected
interactions via Compton kinematics. In this paper, we use simulated photon
tracks to estimate how well interactions can be sequenced in the GRETA
detector. This lays the groundwork for subsequent $\gamma$-ray imaging
applications such as nuclear lifetime measurements.

##  1 Introduction

Gamma-ray tracking [1] [2] is a major advance in gamma-ray spectroscopy. A
4$\pi$ tracking-array would be a powerful instrument for a broad range of
experiments in low-energy nuclear science [3] [4], especially for the nuclei
far from the line of stability. Developments of these instruments are underway
[5] both in the US (GRETINA/GRETA) [6] [7] [8] and Europe (AGATA) [9] [10].
The GRETA collaboration has built a partial array, called the Gamma-Ray Energy
Tracking IN-beam Array (GRETINA). The array’s primary purpose is for high-
efficiency, high-precision $\gamma$-ray spectroscopy. Energy spectra of the
detected photons can help us to better understand the underlying nuclear
structure of the reaction products.

GRETINA’s position sensitivity allows experimenters to sequence photon tracks
via Compton kinematics. [11] This tracking is used, among other things, to
estimate the emission angle of a gamma ray relative to its parent nucleus’s
velocity. This is key for spectroscopy because it gives a way to correct
Doppler shifts in lab-frame photon energy. In a beam experiment, an
accelerator delivers high-energy projectiles to a thin target to produce
excited nuclei through fusion or other nuclear reactions. The product nuclei
proceed out of the target in a highly-collimated “recoil” beam traveling at
relativistic speeds (typically 0.05-0.4c, depending on the beam energy and the
kinematics of the nuclear reaction). The recoil nuclei then de-excite a short
time later and emit one or more characteristic gamma-rays. Some of these
photons will subsequently interact in the detector, leaving a track with one
or more discrete energy depositions (called “hits”).

Because the parent nuclei are moving relativistically in the lab-frame, the
Doppler-shift of the detected $\gamma$-rays poses a challenge to spectroscopy.
This shift can be quite significant (sometimes multiple hundreds of keV), with
the lab-frame energy $E_{Lab}$ given by:

$E_{Lab}~{}=~{}\frac{E_{CM}}{\gamma(1-\beta\cos{\phi})}$ (1)

where $E_{CM}$ is a $\gamma$-ray’s known CM-frame energy, $\beta c$ is the
parent nucleus’s lab-frame speed along the beam axis, $\gamma$ is the
corresponding Lorentz factor, and $\phi$ is the emission angle relative to the
parent’s velocity (as measured in the lab frame).

GRETINA’s position-sensitive modules allow us to correct for these Doppler
shifts by providing the locations of photon interactions in the detector
volume. We can estimate the emission angle $\phi$ using the path from the beam
target to the first hit in the detector. Using this emission angle, we can
then transform the measured lab-frame photon energy $E_{Lab}$ back into its
CM-frame energy $E_{CM}$.

Knowing the interaction sequence is useful for another reason – reduction of
Compton background. Previous-generation gamma detector arrays use Compton
suppression layers to reject partial-energy counts. In such setups, detector
regions are surrounded by a thick shell of secondary detector material. If a
photon scatters out of the sensitive HPGe region and subsequently interacts in
the secondary layer, the array rejects the event as Compton background. This
is key for accurate and precise measurement of photopeak energies, especially
in complex spectra with multiple peaks. (Note that the peaks may overlap by
tens of hundreds of keV due to the Doppler-shifting discussed above. This
makes it more difficult to distinguish Compton background from Doppler-shifted
photopeak counts, hence the need for Compton suppression.) The downside to
this approach is a large reduction in counts. The methods described in this
paper allow for a more selective discrimination of Compton background.

Furthermore, GRETINA’s excellent position- and energy-resolution also enable
$\gamma$-ray imaging. [12] [13] If we can accurately reconstruct the photon
source distributions from in-beam experiments, we can then measure nuclear
lifetimes more efficiently than is possible with current methods such as RDM.
[14] [15] [16]

Our goal here is to understand performance for sequencing photon interactions
detected in GRETINA’s segmented crystal array. This is key for using GRETINA
in the above-mentioned applications.

##  2 Compton Sequencing

There is a very important caveat – we do not know the sequence of hits in a
photon track. Consider that a 1.0 MeV photon traveling through HPGe has a
mean-free-path of several centimeters, and this distance decreases
exponentially with photon energy. Moving at the speed of light, then, the
photon covers the distance between interactions in mere picoseconds (1.0 cm =
33 ps). Drift times in HPGe are on the order of 100’s of nanoseconds, and
GRETINA’s 100MHz digitizer takes samples every 10 ns. Because of this, the
detector cannot distinguish the time sequence of interactions directly – all
the photon hits, from the initial scatter to the final photoabsorption –
appear to happen more or less simultaneously. Figure 1 illustrates the general
sequencing problem, which will be discussed in greater detail in Section 2.

Perhaps the simplest approach is to assume that the first hit is the one with
the highest energy deposition. Based on Compton kinematics and scattering
cross-sections, this assumption is valid much of the time – though it is not a
certainty. For example, a 1.0 MeV photon that scatters at 30° deposits 208 keV
in the detector. The scattered 792 keV photon then has a 36% chance to make a
greater deposit with the next hit, resulting in a false identification.

Figure 1: Illustration of the sequencing problem

Figure 2: $\gamma$-ray cross-sections in HPGe

Compton dominates for 150 keV $<E_{\gamma}<$ 8 MeV

While we cannot measure the sequence directly, we can deduce it using the
energy and position sensitivity of the detector. Recall that photons undergo
three main types of interactions in detectors: pair production,
photoabsorption, and Compton scattering. The kinematics of this last type of
interaction enables a technique called Compton Tracking, which is now widely
used in astrophysics, nuclear security, and other scientific work.

Consider a photon track with $N_{hits}$ total interactions. For each of these
interactions, we measure its 3D coordinates $\bm{X_{j}}=(x_{j},y_{j},z_{j})$
and energy deposition ${\Delta}E_{j}$. $\bm{X_{1}}$ and $\Delta E_{1}$
correspond to the first hit in the detector, $\bm{X_{2}}$ and $\Delta E_{2}$
with the second, and so on. The total track energy is defined as
$E_{tot}=\sum\Delta E_{j}$. Below a photon energy of about 4.0 MeV, pair
production is rare (refer to Figure 2 for a comparison of relative cross-
sections in HPGe [17]). For energies between around 200 keV and 4.0 MeV, then,
we can assume the track is composed of one or more Compton scatters, possibly
ending with a photoabsorption.

The kinematics of Compton scattering are well-defined. That is, if we know the
incident photon energy and the scattering angle, we can deduce the outgoing
photon energy and the energy imparted to the scattering electron. This energy
deposition is measured by the detector and is equal to:

$\displaystyle{\Delta}E$ $\displaystyle=E_{i}-E_{f}$ (2)
$\displaystyle=E_{i}-\frac{E_{i}}{1+\frac{E_{i}}{{m_{e}}c^{2}}(1-\cos{\theta})}$
(3)

Alternately, if we know the incident photon energy and the energy deposition
for the scatter, we also know the cosine of the corresponding scattering
angle:

$\displaystyle\mu$ $\displaystyle=\cos{\theta}$ (4)
$\displaystyle=1-{m_{e}}c^{2}\left(\frac{1}{E_{f}}-\frac{1}{E_{i}}\right)$ (5)
$\displaystyle=1-\frac{{m_{e}}c^{2}{\Delta}E}{E_{i}(E_{i}-{\Delta}E)}$ (6)

Note that there is a one-to-one mapping of energy deposition to scattering
angle – no two angles will yield the same energy deposition for the same
initial photon energy. This fact is at the core of Compton sequencing.

Suppose the first $N_{cs}=N_{hits}-1$ interactions are all Compton scattering.
In beam experiments, we don’t necessarily know where the photon originated
from, so we can’t (yet) say anything about the original photon heading vector
$V_{0}$, from the emission point to the first hit in the detector. However,
the locations of subsequent hits are known. We can define the photon’s
incidence vector on $\bm{X_{j}}$ as $\bm{V_{j}}=\bm{X_{j}}-\bm{X_{j-1}}$. If
$\bm{X_{j}}$ is not the last hit in the track, we can further define the
outgoing photon vector at $\bm{X_{j}}$ as
$\bm{V_{j+1}}=\bm{X_{j+1}}-\bm{X_{j}}$. Point $\bm{X_{j}}$ represents a
Compton scatter, and the measured scattering angle is equal to:

$\mu_{meas,j}=\frac{\bm{V_{j}}\cdot\bm{V_{j+1}}}{\lVert\bm{V_{j+1}}\rVert\lVert\bm{V_{j}}\rVert}.$
(7)

In other words, $\mu_{meas,j}$ is the cosine of the angle between the incident
and outgoing photon directions as given by the coordinates of points
$\bm{X_{j-1}}$ to $\bm{X_{j+1}}$. This gives us a direct comparison to the
theoretical value given by the incident photon energy and energy deposition at
$\bm{V_{j}}$. Note that because a scattering interaction is anchored by three
points, this approach necessarily only applies to tracks with three or more
interactions. For a track of length $N_{hits}$, we only have $N_{hits}-2$
anchored scatterings for which the comparison to theory can be made. So, if
the if the source location is unknown, we need at least 3 total hits to
sequence a track.

As discussed above, we do not know the track sequence á priori. But using the
combination of theoretical Compton kinematics and the measured coordinates and
energy depositions, we can decide which sequences would not make physical
sense. Essentially, we can simply try all possible sequences and find the one
that best matches the Compton formula. This means evaluating a Figure of Merit
(FoM) for each permutation of the track sequence.

This approach can become computationally-intensive, because the number of
possible sequences scales factorially with the length of the track. An 8-hit
track (5,040 permutations) takes roughly 210 times longer to sequence than a
4-hit track (24 permutations). A single track with 12 or more hits can take an
hour to process on a mid-range computer from 2015. However, these longer
tracks are also fairly rare at the energies where Compton tracking applies
(below 4.0 MeV). For example, tracks with 8 or more hits account for less than
1.7% of all full-energy tracks at 1.0 MeV (Figure 3). We have chosen here to
disregard tracks with 7 or more interactions.

Figure 3: Track breakdown by length

(Relative errors are all within 0.15%)

We can also see that 1.0 MeV photons typically scatter multiple times before
being of low enough energy for photoabsorption. A large majority of the 1- and
2-hit tracks correspond to partial-energy detections (shown in green). Full-
energy detections (shown in red) become more common above three hits. Because
we cannot sequence partial-energy or 1-2 hit tracks with Compton kinematics,
and because we disregard tracks with 7 or more hits for computational
efficiency, sequenceable tracks account for only about 30% of the total at 1.0
MeV.

There are multiple figures of merit we can use to deduce the sequence of
interactions. One common FoM compares the cosines of the measured and
theoretical scattering angles (Eq. 7 and Eq. 4, respectively) for each
scattering in the track:

$FoM=\frac{1}{(N_{sc}-1)}{\sum_{j=2}^{N_{hits}-1}(\mu_{meas,j}-\mu_{calc,j})^{2}}$
(8)

This figure of merit is unitless and normalized to the number of scattering
points being compared. $\mu_{calc,j}$ is the angle predicted by the incident
photon energy and measured energy deposition (Eq. 7), and depends on
$E_{i,j-1}$, the incident photon energy at $\bm{X_{j}}$. $E_{i,j-1}$ is
calculated from the total energy of the track, minus all previous energy
depositions:

$\displaystyle E_{i,j-1}$
$\displaystyle=E_{tot}-\sum_{k=1}^{k=j-1}{\Delta}E_{k}$ (9)
$\displaystyle=\sum_{k=j}^{k=N_{hits}}{\Delta}E_{k}$ (10)

Incorrect sequences generally produce poor fits to the above equation. Suppose
we are testing a 4-hit track sequence with hits #2 and #3 swapped. (Figure 4)
In this case, the incident headings on $\bm{X_{2}}$ and $\bm{X_{3}}$ are both
incorrect. This means $E_{2}={\Delta}E_{2}+{\Delta}E_{4}$ instead of the
correct $E_{2}={\Delta}E_{3}+{\Delta}E_{4}$, and the calculated scattering
angles at $\bm{X_{2}}$ and $\bm{X_{3}}$ will reflect the inaccuracy.

Figure 4: Evaluating two different sequences

We can define an alternative FoM using the energy depositions instead of
scattering angle:

$FoM=\frac{1}{(N_{cs}-1)}{\sum_{j=2}^{N_{hits}-1}\frac{({\Delta}E_{meas,j}-{\Delta}E_{calc,j})^{2}}{{\Delta}E_{meas,j}^{2}}}$
(11)

Here, ${\Delta}E_{meas,j}$ is the measured energy deposition at $\bm{X_{j}}$.
${\Delta}E_{calc,j}$ is the measured energy deposition at $\bm{X_{j}}$. To
obtain a unitless figure of merit, the observed difference in measured vs.
calculated energy depositions is divided by $E_{meas,j}$. Normalizing in this
fashion weights each scatter equally, regardless of the magnitude of the
energy deposition. However, in most cases we want to prioritize accuracy on
the first (and sometimes second) interactions. As noted earlier, these early
interactions tend to have much higher energy depositions than subsequent hits
in the track. Normalizing by total track energy weights these high-energy
scatters over the small-energy ones near the end of a track:

$FoM=\frac{1}{E_{total}^{2}(N_{cs}-1)}{\sum_{j=2}^{N_{hits}-1}({\Delta}E_{meas,j}-{\Delta}E_{calc,j})^{2}}$
(12)

This is the normalization and figure of merit used to perform sequencing in
this study. However, there may be better choices that would provide better
discrimination between Compton background and photopeaks counts. One could
test different FoMs and evaluate them based on a desirable metric, such as the
reliability of sequencing the first 2 hits in a track (discussed further in
Section 4).

##  3 Interaction Grouping

Before moving on, it is important to discuss the non-trivial challenge of
identifying which hits belong to which photon track. During an in-beam
experiment, we may register millions of separate photon interactions over the
course of an hour. GRETINA will return a separate timestamp, energy
deposition, and set of 3D coordinates for each one.

Recall that each crystal in the GRETINA array is heavily segmented into 36
individual regions. These segments are relatively small (approx. 1.5 cm in
depth), which means it is unlikely for a high-energy gamma-ray to deposit its
full energy into a single crystal segment. When a photon scatters from one
segment into another, GRETINA records separate “events” for each triggered
segment. Note that an event can contain multiple hits – this occurs when the
photon interacts multiple times within a single crystal segment. To perform
sequencing, we need to group interactions from nearby segments to re-form a
photon track as a whole. We refer to this process as interaction “grouping” or
“clustering”.

The clustering process consists of several steps, illustrated in Figure 6.
First, interactions are grouped by trigger time. GRETINA’s electronics sample
at 100 MHz, with all segments synced to the same clock. Because the clocks are
synced, we can then apply a timing gate to group ”simultaneous” events and
hits. (Determining multiple hits within a segment is very challenging work.
This is currently one of the primary focuses of the signal decomposition team.
[18] [19])

A secondary effect arises from time gating. Coincident gamma rays will be
falsely clumped together, producing a single track with an unphysical energy.
To mitigate problems from such event pileup, a secondary layer of clustering
can be applied to re-separate interactions by spatial proximity. If two
interactions are more than several MFP’s apart, then they are unlikely to
belong to the same track. The software algorithm to accomplish the separation
is somewhat complicated, but the end result is that temporally-clustered
events are regrouped into a larger number of spatially-distinct tracks.

Implementations differ based on how “proximity” is defined. We can define it
in a solid-angle sense, or by using the 3D lab coordinates of each photon hit.
Our analysis uses this second approach. We set a hard threshold on the
physical distance between points in a given group. As long as a point is close
enough to any other point in the group, it remains in the group. The approach
is somewhat simplified – it is based on absolute distance between points. This
can incorrectly ungroup tracks for which the photon scattered from one
detector into another by crossing GRETINA’s inner cavity. A more correct
algorithm would use only the travel distance in the HPGe itself.

The choice of timing gate and spatial clustering threshold can be optimized
through energy spectra. We would expect interaction grouping to improve P/T
ratios, because it assembles photopeak tracks from events that would otherwise
have fallen into the Compton background. Spatial re-separation recovers some
of the photopeak counts that are erroneously grouped with other tracks.

Because the distance between hits depends on cross-section, spatial clustering
should vary by photon energy. We used several different calibration sources to
study this dependence: 152Eu, 60Co, 88Y, 22Na. Table 1 lists characteristic
$\gamma$-rays and the experimental dataset for each source.

Tables 3 and 4 list the P/T ratios obtained for a range of temporal and
spatial clustering thresholds. For the spatial threshold study, we kept the
temporal threshold constant at 250 ns, while for the temporal threshold study,
we kept the spatial threshold constant at 70.0 mm. Peak counts were taken from
10-12 keV regions centered about the known photopeak energies. Background was
defined by averaging counts over the regions immediately to the left and right
of the peaks, and was then subtracted from the peak counts using a trapezoidal
approximation.

Figure 5 illustrates how the peak-to-total (P/T) ratio improves with both
types of clustering. The improvements are modest but welcome – in this case, a
26% total improvement in P/T and 22% reduction in the Compton background for a
60Co source. The effect of spatial clustering threshold on the P/T ratio is
not as pronounced as we had expected, and generally, 300 ns / 80 mm thresholds
will work well for all photons between 120 keV and 1.8 MeV. The bolded
elements in the tables show where the P/T ratio reaches 99% of its maximum
value for a given peak energy.

Figure 5: 60Co energy spectra using various

clustering levels

We also looked at signal-to-noise (SNR) ratios, defined as:

$SNR=\frac{\text{[Gross Peak Counts] - [Background Counts]}}{\text{[Background
Counts]}}$ (13)

Background under each peak was estimated with a trapezoidal approximation,
using average counts to either side of the peak. As we saw, the effects were
fairly small for thresholds above 80mm. For example, the SNR for the 1836.1
keV 88Y peak showed a maximum of 68.8 at 40 mm, but fell to 57.1 at 120 mm.
Therefore, we conclude that the data quality is not harmed by excessively
large clustering thresholds.

Figure 6: Illustration of interaction grouping

##  4 Sequencing Efficiency and Effectiveness

Compton sequencing is relatively straightforward on paper, but real-world
experimentation introduces some complications. For example, the ability to use
Compton kinematics for sequencing depends on photon energy. Higher energies
give longer tracks and hence more data to work with, but also more potential
sequences from which to choose. Below a certain energy, Compton sequencing
cannot be used because too many tracks will have one or two hits.

Real detectors also have finite position and energy resolution. [20] [21] This
means that the measured interaction coordinates $\bm{X_{j}}$ are only
approximations of the true locations. Therefore, the measured scattering
angles we compute from these positions are themselves uncertain, and the FoMs
calculated in Equation 12 will be nonzero – even for the correct sequence of
hits.

Even with perfect detector resolution, though, basic Compton kinematics are
also only an approximation. There is an assumption that the photon scatters
off of a free electron at rest. However, electrons in real materials have
characteristic binding energies that give them nonzero momentum prior to the
interaction. This extra momentum may cause a scattered photon to have
significantly different energy from that predicted by the Compton formula.
(The effect is known as “Doppler Broadening”. [22]) Because bound electron
momentum is inherently stochastic in nature, a deterministic calculation is
impossible – we can never be completely certain of any sequence deduced from
kinematics.

The severity of these problems depends on the application. Mis-sequencing
errors in $\gamma$-ray imaging are discussed in more detail in References [12]
and [13]. Doppler-shift corrections are also affected – a mis-sequenced track
changes the calculated emission angle. Consider – hits in a 1.0 MeV track will
typically be a few cm apart. Therefore, a mis-sequenced interaction will
result in an angular deviation of 10° or less with GRETINA’s 18 cm inner
radius. The Doppler correction (from Equation 1) for a 90° emission from a
nucleus moving at 0.3c is $E_{CM}/E_{Lab}=0.962$. The same correction for a
80° emission is $E_{CM}/E_{Lab}=1.01$, i.e. a difference of 4.8%. In this
particular case, the corrected photon energy is nearly 50 keV off.

To better quantify the effectiveness of sequencing, we used a detailed Geant4
model to generate simulated photon interactions within the GRETINA array. [23]
This allowed us to incorporate realistic detector geometry, detector
resolution, materials, and Doppler broadening into our study of Compton
sequencing. We used a stationary 1.0 MeV point source located at the center of
GRETINA’s central cavity, i.e. the origin in the Geant4 model (the $z$-axis is
oriented along the beam line) Each simulated track included the true sequence,
locations, and energy depositions for each associated photon interaction. Note
that the simulated output produced pre-grouped photon tracks – we did not need
to worry about clustering here. To reflect the response of a real detector, we
randomly re-ordered the interactions in each simulated track, then added
uniform Gaussian noise to the position and energy of each hit. The
intentionally randomized tracks were then run through the sequencing
algorithm. Lastly, we compared the known tracks with the Compton-sequenced
versions to determine the frequency of sequencing errors.

Correctly identifying the first interaction is key for Doppler-shift
corrections and Doppler-shift imaging. Additionally, the second interaction is
important when using the sequence for Compton imaging. We therefore looked at
error probabilities for mis-sequencing the first hit alone, the first and
second hits together, and for the track as a whole. Only full-energy tracks
were accepted for processing (±6 keV), or approximately 39% of the 100K
simulated tracks. (Refer back to Figure 3 for the breakdown of the simulated
tracks by length and energy.) 2-hit tracks were also included, and were
sequenced by assuming the higher-energy hit came first.

Tables 6 and 7 show mis-sequencing probabilities as functions of simulated
detector resolution for tracks with 2 to 6 hits. Table 8 gives similar numbers
for a typical detector as a function of the photon track length. For these
runs, detector resolution was kept constant with standard deviations of
$\sigma_{xyz}=$ 3.0 mm and $\sigma_{E}=$ 2.0 keV for position and energy
resolution, respectively. With perfect simulated detector resolution (i.e. no
uncertainty about the locations or energy of each interaction), we were able
to correctly reconstruct virtually all full-energy interaction sequences
correctly.

As discussed, Compton sequencing requires three or more photon hits to work.
The more hits in a photon track, the more scattering points we’ll have to
compare to kinematics. Intuitively, this should allow us to sequence longer
tracks with greater certainty. However, longer tracks also have more potential
ways to be mis-sequenced. (All things being equal, the probability of randomly
guessing a 6-hit sequence correctly is only 0.14%, versus 17% for a 3-hit
track.) Longer tracks also have more low-energy hits, which are
disproportionately affected by the detector’s finite position and energy
resolution. While we might be able to sequence the first few interactions
reliably, the tail end of a photon track is more difficult.

In addition, the percentage of sequenceable tracks depends on photon energy.
Low-energy photons tend to leave shorter tracks with fewer scatters. On the
other hand, high-energy photons have a lower probability of full-energy
deposition in the detector. Because we assume full-energy deposition in
sequencing, Compton background counts may not sequence properly.

The results of Table 8 suggest some important points. First, given 3.0 mm
position- and 2.0 keV energy-resolution in the detector, nearly half of all
full-energy tracks – 46% – show an error in the first two hits. This has
serious repercussions for Compton imaging – without some kind of filter,
nearly half of all tracks will contribute noise to the final image. The
situation is somewhat improved for Doppler-shift correction and imaging
(Reference [13]), both of which only require the first hit in a track. Still,
a full 1/3rd of tracks yield incorrect results here.

Track length also has a very significant impact. For example, the ratio of
correctly-sequenced to mis-sequenced 2-hit tracks here is 5.5, whereas for
4-hit tracks it is only 0.78. Because of this, it may be advantageous not to
use Compton sequencing in certain situations (e.x. for low-energy photon
emissions). If we only need to get the first interaction right, it may be more
accurate to simply assume it is the highest-energy hit.

Not having that first scattering point available for FoM calculations is a
significant limitation to our approach. As discussed earlier, the first hit
usually corresponds to the highest energy deposition. This also means that the
first hit is also likely to contribute the largest amount to the sequencing
FoM. At high photon energies, small deviations in scattering angle can yield
10’s of keV difference in energy deposition. Not so with lower-energy photons.
Since our FoM is normalized to the total track energy, this means sequencing
mistakes for low-energy hits are less noticeable in the final FoM. This is by
design, since we want to prioritize getting the first (i.e. higher-energy)
hits correct.

Table 2 shows a sample mis-sequenced track. Note that Compton sequencing on
this 6-hit track gave an incorrect location for the first interaction, despite
perfect detector position and energy resolution. This rare occurrence would
have been avoided had we been able to use our á priori knowledge of the source
location (the center of GRETINA’s central cavity). The FoM contribution from
the first hit in the computed sequence is quite high relative to the other FoM
contributions. The remaining hits happened to be arranged in such a way that
the subsequent hits still matched expectations from Compton kinematics fairly
well. This may sound wildly improbable at first glance. However, it can
actually take fairly large deviations in angle to skew the energy deposition
more than a few keV. Consider that the measured scattering angle is
calculated:

$\displaystyle\theta_{meas,i}$
$\displaystyle=\cos^{-1}{(\bm{\hat{V}_{i-1}}\cdot\bm{\hat{V}_{i}})}$ (14)
$\displaystyle\bm{\hat{V_{i}}}$
$\displaystyle=(\bm{X_{i+1}}-\bm{X_{i}})/\lvert\bm{X_{i+1}}-\bm{X_{i}}\rvert$
(15)

Again, $\bm{\hat{X_{0}}}$ is the photon emission point and $\bm{\hat{X_{1}}}$
is the first hit in the detector. We find $\theta_{meas,1}$ = 2.285 radians at
$\bm{\hat{X_{1}}}$ in the true sequence, while the angle calculated by Compton
kinematics is $\theta_{calc,1}$ = 2.204 radians. This is a difference of
3.51%, yet the corresponding difference in measured vs. calculated energy
deposition is only -0.93% (757.012 keV vs 764.042 keV). Even a 10.00%
difference in the initial scattering angle would only produce a 3.00% in
energy deposition (779.726 keV vs. 764.042 keV).

Lastly, we explored several different sequencing Figures-of-Merit:

$\displaystyle FoM_{1}$
$\displaystyle=\sum(\mu_{meas,i}-\mu_{calc,i})^{2}/N_{cs}$ (16) $\displaystyle
FoM_{2}$ $\displaystyle=\sum(\Delta E_{meas,i}-\Delta
E_{calc,i})^{2}/(N_{cs}E_{total}^{2})$ (17) $\displaystyle FoM_{3}$
$\displaystyle=\sum(\Delta E_{meas,i}-\Delta E_{calc,i})^{2}/(N_{cs}\Delta
E_{i}^{2})$ (18) $\displaystyle FoM_{4}$ $\displaystyle=\sum(\Delta
E_{meas,i}-\Delta E_{calc,i})^{2}/(N_{cs}E_{total}^{2})$ (19)

FoM 4 is somewhat different than the others – we take an educated guess at the
photon origin $\bm{X_{0}}$, and add it to the theoretical sequence for
evaluation. In lifetime experiments, for example, we might assume photons are
emitted at the origin even though the source is not stationary. This guess
might be off by several centimeters, but this may result in only a small
angular error (and smaller error in deposited energy). This approach therefore
provides an additional data point to compare to Compton kinematics. FoMs 1, 2,
and 3 apply to hits 2 through $N_{hits}-1$, while FoM 4 applies all hits 1 to
$N_{hits}-1$.

Table 9 summarizes the results. We found that comparing energy depositions and
normalizing to the total track energy (FoM 2) provides better results than
comparing cosines of scattering angles (FoM 1). Normalizing to total track
energy is also better than normalizing to the measured energy deposition at
each hit (FoM 3).

Note that FoM 4 did offer some improvement for (3.0 mm, 2.0 keV) detector
resolution. For this initial test, we placed our guess for $\bm{X_{0}}$ at
(0.0 mm, 0.0 mm, 60.0 mm), or 60.0 mm away from the true source location. In
lifetime measurements the emission points can be spread over a wide range (100
mm or more), so this seemed a reasonable first attempt. While we did not study
the FoM4 approach in great detail, the performance numbers in Table 9 are
promising. The results improved markedly as the guess for $\bm{X_{0}}$ came
closer to the true source location at (0.0 mm, 0.0 mm, 0.0 mm), approaching
near-100% accuracy when the guess was spot-on. However, this FoM definition
can actually degrade sequencing performance if the guess is too far off. We
therefore chose to use FoM 3 as the working definition for subsequent imaging
work.

An additional observation about sequencing – a good Figure-of-Merit ought to
be correlated with whether or not a track deposits its full energy in the
detector. One would expect partial energy tracks to match Compton kinematics
relatively poorly and thus have a worse FoM than a full-energy track. Because
of this, the Figure-of-Merit is a potential way to reduce background counts,
thereby improving P/T ratios for imaging or spectroscopy purposes. Receiver-
Operating Characteristic (ROC) curves are a standard method for evaluating the
classification effectiveness of a given filter. [24] We are interested in the
system sensitivity (true positive rate) and specificity (true negative rate)
as functions of a maximum FoM limit.

To explore this, we ran a series of tests using increasingly-stringent
sequencing FoM thresholds. Tracks were classified as “true positives” if they
were full-energy events and the first two hits were sequenced correctly. “True
negatives” were any partial-energy or incorrectly-sequenced track.
Unfortunately, as Figure 7 shows, the method’s sensitivity is not very high
for realistic values of detector position resolution. The ROC curve for (3.0
mm, 2.0 keV) resolution is only slightly above the “random guess” line. This
is consistent with Table 5, which shows that roughly 45% of full-energy tracks
contain sequencing errors in the first two hits. Tightening the sequencing FoM
limit greatly reduces the number of accepted counts, but has little affect on
the sensitivity. A different choice of FoM might yield more promising results.

Figure 7: ROC curves and choosing a

sequencing FoM limit

(TNR = 1 - FPR)

There are a number of metrics we could use to select an optimal filtering
parameter. The Youden index is one such metric, and is given by the sum of the
classification sensitivity and specificity. [25] The maximum value of this
index provides a reasonable choice for the parameter value. As we can see in
Figure 7, this gives an “ideal” FoM limit of 2.66 $\times$ 10-4 for 1.0 MeV
tracks with a detector of 3.0 mm position- and 2.0 keV energy-resolution.

##  5 Future Work

There are multiple directions where we could expand on the research presented
here. For example, we limited our study to a single photon energy. 1.0 MeV is
a typical emission energy, but sequencing performance is energy-dependent. How
strong that dependence is remains unknown.

The study of sequencing Figures-of-Merits might also be approached more
exhaustively. We explored 4 different FoM definitions, the 4th of which
introduced a new parameter – a guess for the position of the emission point.
This FoM showed promising performance but also had the potential to degrade
performance. What strategies might we employ around this technique for beam
experiments, where the source distribution is not a simple point-source?

Lastly, real-world experiments may involve multiple emission lines from the
same parent nuclei. We may not have the luxury of a clean, mono-energetic
energy spectrum. How sequencing may be impacted by complex, realistic energy
spectra is an open question.

## References

  * [1] I.Y. Lee. Gamma-Ray Tracking Detectors. 1999\. Nuclear Instrumentation and Methods in Physics Research A, Vol. 422 Pps. 195-200. http://www.sciencedirect.com/science/article/pii/S0168900298010936
  * [2] M.A. Deleplanque, I.Y. Lee, K. Vetter, et al. GRETA: Utilizing New Concepts in Gamma-ray Detection 1999\. Nuclear Instruments and Methods in Physics Research A, Vol. 430 Pps. 292-310. http://www.sciencedirect.com/science/article/pii/S0168900299001874
  * [3] DOE NSAC Reaching for the Horizon: The 2015 Long Range Plan for Nuclear Science. https://science.osti.gov/-/media/np/nsac/pdf/2015LRP/2015_LRPNS_091815.pdf
  * [4] NuPECC Long Range Plan 2017: Perspectives in Nuclear Physics. http://www.nupecc.org/lrp2016/Documents/lrp2017.pdf
  * [5] I-Yang Lee and J. Simpson. AGATA and GRETA: The Future of Gamma-Ray Spectroscopy. 2010\. Nuclear Physics News, Vol. 20 Pps. 23-28. https://doi.org/10.1080/10619127.2010.506124.
  * [6] S. Paschalis, I.Y. Lee, A.O. Macchiavelli, et al. The Performance of the Gamma-Ray Energy Tracking In-beam Nuclear Array GRETINA. 2013\. Nuclear Instruments and Methods in Physics Research A, Vol. 709 Pps. 44-55. http://www.sciencedirect.com/science/article/pii/S0168900213000508
  * [7] D. Weisshaar, D. Bazin, P. Bender, et al. The Performance of the Gamma-Ray Tracking Array GRETINA for Gamma-Ray Spectroscopy with Fast Beams of Rare Isotopes 2017\. Nuclear Instruments and Methods in Physics Research A, Vol. 847 Pps. 187-198. http://www.sciencedirect.com/science/article/pii/S0168900216312402.
  * [8] GRETA Collaboration. GRETA: The Gamma-Ray Energy Tracking Array. 2021\. https://sites.google.com/a/lbl.gov/greta/.
  * [9] S. Akkoyun, A. Algora, B. Alikhani, et al. AGATA: Advanced GAmma Tracking Array. 2012\. Nuclear Instruments and Methods in Physics Research A, Vol. 668 Pps. 26-58. http://www.sciencedirect.com/science/article/pii/S0168900211021516.
  * [10] AGATA Collaboration. AGATA: The Advanced GAmma Tracking Array. 2021\. https://www.agata.org/.
  * [11] K. Vetter. Gamma-Ray Tracking: New Opportunities for Nuclear Physics. 2002\. Nuclear Physics News, Vol. 12 #2, P. 15-20.
  * [12] R. Crabbs and I. Lee and K. Vetter. Using Compton Imaging to Locate Moving Gamma-Ray Sources in the GRETINA Detector. arXiv.org. Published 2020, Accessed 2020-07-05.
  * [13] R. Crabbs and I. Lee and K. Vetter. Using Doppler-Shift Imaging to Locate Moving Gamma-Ray Sources in the GRETINA Detector. arXiv.org. Published 2020, Accessed 2020-07-05.
  * [14] C. Morse, H. Iwasaki, A. Lemasson, et al. Lifetime Measurement of the 2+1 state in 74Rb and Isospin Properties of Quadrupole Transition Strengths at N = Z. 2018\. Physics Letters B, Vol. 787 Pps. 198-203. https://www.sciencedirect.com/science/article/pii/S037026931830844X.
  * [15] H. Iwasaki, A. Dewald, T. Braunroth, et al. The TRIple PLunger for EXotic beams: TRIPLEX for Excited-State Lifetime Measurement Studies on Rare Isotopes. 2016\. Nuclear Instruments and Methods in Physics Research A, Vol. 806, 123-131, doi; http://dx.doi.org/10.1016/j.nima.2015.09.091. URL https://www.sciencedirect.com/science/article/pii/S0168900215011626.
  * [16] R. Crabbs and I. Lee and K. Vetter. Using $\gamma$-Ray Imaging to Measure Nuclear Lifetimes in the GRETINA Detector. arXiv.org. Published 2020, Accessed 2020-07-05.
  * [17] M.J. Berger, J.H. Hubbell, S.M. Seltzer, J. Chang, J.S. Coursey, R. Sukumar, D.S. Zucker, and K. Olsen. XCOM: Photon Cross Sections Database. https://www.nist.gov/pml/xcom-photon-cross-sections-database. Accessed 2016-03-12.
  * [18] D. Radford. GRETA Decomposition Algorithm. GRETA Research Group (internal document). Published 2004-09-09.
  * [19] M. Cromaz. Personal communication. Lawrence Berkeley National Laboratory. Discussed 2016-04-06.
  * [20] K. Vetter and others. Three-Dimensional Position Sensitivity in Two-Dimensionally Segmented HPGe Detectors. 2000\. Nuclear Instrumentation & Methods in Physics Research A, Vol. 452 P. 223-238.
  * [21] K. Vetter and others. Performance of the GRETA Prototype Detectors. 2000\. Nuclear Instrumentation & Methods in Physics Research A, Vol. 452 P. 105-114.
  * [22] C. Ordonez and A. Bolozdynya and W. Chang. Doppler Broadening of Energy Spectra in Compton Cameras. 1997\. IEEE Nuclear Science Symposium, Vol. 2, P. 1361-1365.
  * [23] L. Riley and C. Campbell and H. Crawford. UCGretina v3.0 Geant4 model. 2015\. Personal communication.
  * [24] Wikipedia. Receiver Operating Characteristic. https://en.wikipedia.org/wiki/Receiver_operating_characteristic. Accessed 2016-05-12.
  * [25] Wikipedia. Youden’s J Statistic. https://en.wikipedia.org/wiki/Youden%27s_J_statistic. Accessed 2016-05-24.

Source | Photon Energies | GRETINA Dataset
---|---|---
152Eu | 121.8, 344.3, 1408.0 keV | MSU_May2013_90deg__R29
60Co | 1173.3 keV | MSU_May2013_90deg__R16
88Y | 898.0, 1836.1 keV | MSU_May2013_90deg__R44
22Na | 511 keV | MSU_May2013_90deg__R48
Table 1: Sources used to optimize clustering thresholds

Hit | X | Y | Z | Ei | $\mu_{meas}$ |  $\Delta$Emeas |  $\Delta$Ecalc | FoM
---|---|---|---|---|---|---|---|---
True Sequence
(Src) | 0.000 | 0.000 | 0.000 | – | – | – | – | –
1 | -77.921 | 170.052 | 103.876 | 1000.000 | -0.654642 | 757.012 | 764.042 | (9.885E-06)
2 | -77.193 | 168.620 | 96.225 | 242.988 | 0.855815 | 34.633 | 15.591 | 7.252E-05
3 | -81.571 | 165.890 | 87.314 | 208.355 | 0.727474 | 21.966 | 20.837 | 2.549E-07
4 | -81.686 | 166.218 | 86.609 | 186.389 | -0.637781 | 82.652 | 69.705 | 3.352E-05
5 | -81.948 | 166.648 | 87.717 | 103.737 | 0.651133 | 8.124 | 6.861 | 3.189E-07
6 | -81.976 | 166.710 | 87.737 | 95.613 | – | 95.615 | – | –
Computed Sequence
(Src) | 0.000 | 0.000 | 0.000 | – | – | – | – | –
1 | -77.193 | 168.620 | 96.225 | 1000.000 | 0.632993 | 34.633 | 418.000 | (2.939E-02)
2 | -77.921 | 170.052 | 103.876 | 965.367 | -0.944982 | 757.012 | 758.845 | 6.722E-07
3 | -81.948 | 166.648 | 87.717 | 208.355 | 0.885275 | 8.124 | 9.311 | 2.818E-07
4 | -81.686 | 166.218 | 86.609 | 200.231 | -0.637860 | 82.652 | 78.272 | 3.835E-06
5 | -81.571 | 165.890 | 87.314 | 117.579 | -0.021635 | 21.966 | 22.380 | 3.422E-08
6 | -81.976 | 166.710 | 87.737 | 95.613 | – | 95.615 | – | –

Table 2: Sample Compton-Sequenced Photon Track (1000.0 keV, 6 hits)

All positions in mm and energies in keV.

Threshold | 121.8.1 keV | 344.3 keV | 511.0 keV
---|---|---|---
10.0 mm | 0.03568 ± 0.00013 | 0.01408 ± 0.00008 | 0.01822 ± 0.00005
20.0 mm | 0.06614 ± 0.00017 | 0.03919 ± 0.00012 | 0.06001 ± 0.00009
30.0 mm | 0.09503 ± 0.00021 | 0.06328 ± 0.00017 | 0.10762 ± 0.00014
40.0 mm | 0.10613 ± 0.00023 | 0.07390 ± 0.00018 | 0.13327 ± 0.00016
50.0 mm | 0.10999 ± 0.00024 | 0.07865 ± 0.00019 | 0.14599 ± 0.00017
60.0 mm | 0.11215 ± 0.00024 | 0.08124 ± 0.00020 | 0.15319 ± 0.00018
70.0 mm | 0.11332 ± 0.00024 | 0.08255 ± 0.00020 | 0.15694 ± 0.00018
80.0 mm | 0.11388 ± 0.00024 | 0.08312 ± 0.00020 | 0.15866 ± 0.00018
90.0 mm | 0.11411 ± 0.00025 | 0.08337 ± 0.00020 | 0.15940 ± 0.00019
100.0 mm | 0.11414 ± 0.00025 | 0.08347 ± 0.00020 | 0.15967 ± 0.00019
110.0 mm | 0.11410 ± 0.00025 | 0.08349 ± 0.00020 | 0.15972 ± 0.00019
120.0 mm | 0.11403 ± 0.00025 | 0.08344 ± 0.00020 | 0.15963 ± 0.00019
Threshold | 898.0 keV | 1173.3 keV | 1332.5 keV
10.0 mm | 0.00888 ± 0.00003 | 0.00858 ± 0.00004 | 0.00768 ± 0.00004
20.0 mm | 0.03443 ± 0.00007 | 0.03518 ± 0.00010 | 0.03179 ± 0.00009
30.0 mm | 0.06885 ± 0.00011 | 0.07328 ± 0.00017 | 0.06758 ± 0.00015
40.0 mm | 0.09160 ± 0.00013 | 0.09966 ± 0.00021 | 0.09265 ± 0.00019
50.0 mm | 0.10461 ± 0.00014 | 0.11545 ± 0.00023 | 0.10777 ± 0.00022
60.0 mm | 0.11236 ± 0.00015 | 0.12493 ± 0.00024 | 0.11691 ± 0.00023
70.0 mm | 0.11665 ± 0.00016 | 0.13029 ± 0.00025 | 0.12201 ± 0.00024
80.0 mm | 0.11883 ± 0.00016 | 0.13303 ± 0.00026 | 0.12465 ± 0.00024
90.0 mm | 0.11988 ± 0.00016 | 0.13433 ± 0.00026 | 0.12589 ± 0.00024
100.0 mm | 0.12033 ± 0.00016 | 0.13489 ± 0.00026 | 0.12644 ± 0.00025
110.0 mm | 0.12051 ± 0.00016 | 0.13517 ± 0.00026 | 0.12669 ± 0.00025
120.0 mm | 0.12055 ± 0.00016 | 0.13526 ± 0.00026 | 0.12677 ± 0.00025
Threshold | 1408.0 keV | 1836.1 keV |
10.0 mm | 0.00253 ± 0.00002 | 0.00487 ± 0.00002 |
20.0 mm | 0.01018 ± 0.00005 | 0.02051 ± 0.00005 |
30.0 mm | 0.02118 ± 0.00009 | 0.04588 ± 0.00008 |
40.0 mm | 0.02848 ± 0.00010 | 0.06454 ± 0.00011 |
50.0 mm | 0.03273 ± 0.00011 | 0.07554 ± 0.00012 |
60.0 mm | 0.03525 ± 0.00012 | 0.08220 ± 0.00013 |
70.0 mm | 0.03668 ± 0.00012 | 0.08595 ± 0.00013 |
80.0 mm | 0.03746 ± 0.00013 | 0.08789 ± 0.00013 |
90.0 mm | 0.03788 ± 0.00013 | 0.08885 ± 0.00013 |
100.0 mm | 0.03810 ± 0.00013 | 0.08928 ± 0.00013 |
110.0 mm | 0.03823 ± 0.00013 | 0.08948 ± 0.00013 |
120.0 mm | 0.03833 ± 0.00013 | 0.08955 ± 0.00014 |

Table 3: P/T ratios vs. spatial grouping threshold

Temporal threshold set at 250 ns

Threshold | 121.8.1 keV | 344.3 keV | 511.0 keV
---|---|---|---
50 ns | 0.10762 ± 0.00024 | 0.07470 ± 0.00019 | 0.13428 ± 0.00016
100 ns | 0.11031 ± 0.00024 | 0.07820 ± 0.00019 | 0.14269 ± 0.00017
150 ns | 0.11160 ± 0.00025 | 0.07994 ± 0.00020 | 0.14770 ± 0.00017
200 ns | 0.11290 ± 0.00025 | 0.08178 ± 0.00020 | 0.15423 ± 0.00018
250 ns | 0.11332 ± 0.00025 | 0.08255 ± 0.00020 | 0.15694 ± 0.00018
300 ns | 0.11344 ± 0.00025 | 0.08324 ± 0.00020 | 0.15897 ± 0.00018
350 ns | 0.11341 ± 0.00025 | 0.08350 ± 0.00020 | 0.15958 ± 0.00018
300 ns | 0.11341 ± 0.00025 | 0.08373 ± 0.00020 | 0.16004 ± 0.00019
450 ns | 0.11343 ± 0.00025 | 0.08383 ± 0.00020 | 0.16023 ± 0.00019
500 ns | 0.11347 ± 0.00025 | 0.08393 ± 0.00020 | 0.16042 ± 0.00019
Threshold | 898.0 keV | 1173.3 keV | 1332.5 keV
50 ns | 0.09379 ± 0.00013 | 0.10276 ± 0.00021 | 0.09577 ± 0.00020
100 ns | 0.10356 ± 0.00014 | 0.11471 ± 0.00023 | 0.10715 ± 0.00022
150 ns | 0.10881 ± 0.00015 | 0.12089 ± 0.00024 | 0.11298 ± 0.00022
200 ns | 0.11443 ± 0.00015 | 0.12752 ± 0.00025 | 0.11932 ± 0.00023
250 ns | 0.11665 ± 0.00016 | 0.13029 ± 0.00025 | 0.12201 ± 0.00024
300 ns | 0.11825 ± 0.00016 | 0.13230 ± 0.00025 | 0.12401 ± 0.00024
350 ns | 0.11869 ± 0.00016 | 0.13282 ± 0.00026 | 0.12452 ± 0.00024
400 ns | 0.11901 ± 0.00016 | 0.13321 ± 0.00026 | 0.12488 ± 0.00024
450 ns | 0.11914 ± 0.00016 | 0.13336 ± 0.00026 | 0.12503 ± 0.00024
500 ns | 0.11925 ± 0.00016 | 0.13349 ± 0.00026 | 0.12514 ± 0.00024
Threshold | 1408.0 keV | 1836.1 keV |
50 ns | 0.02944 ± 0.00011 | 0.06653 ± 0.00011 |
100 ns | 0.03269 ± 0.00012 | 0.07500 ± 0.00012 |
150 ns | 0.03427 ± 0.00012 | 0.07915 ± 0.00012 |
200 ns | 0.03598 ± 0.00012 | 0.08386 ± 0.00013 |
250 ns | 0.03668 ± 0.00012 | 0.08595 ± 0.00013 |
300 ns | 0.03714 ± 0.00013 | 0.08757 ± 0.00013 |
350 ns | 0.03724 ± 0.00013 | 0.08800 ± 0.00013 |
400 ns | 0.03732 ± 0.00013 | 0.08830 ± 0.00013 |
450 ns | 0.03736 ± 0.00013 | 0.08841 ± 0.00013 |
500 ns | 0.03739 ± 0.00013 | 0.08850 ± 0.00013 |

Table 4: P/T ratios vs. temporal grouping threshold

Spatial threshold set at 70 mm

| Error in | Error in | Error in | Correctly
---|---|---|---|---
| Hit 1 | Hits 1-2 | Any Hit | Sequenced
Full-Energy | 33.54 ± 0.36 % | 45.98 ± 0.44 % | 52.76 ± 0.48 % | 47.24 ± 0.45 %
Partial-Energy | 47.31 ± 0.44 % | 58.81 ± 0.50 % | 61.13 ± 0.52 % | 38.87 ± 0.38 %

Table 5: Probability of sequencing errors for full-energy vs. partial-energy
tracks

1000.0 keV track energy, (3.0 mm, 2.0 keV) detector resolution

Position | Error in | Error in | Error in | Correctly
---|---|---|---|---
Resolution | Hit 1 | Hits 1-2 | Any Hit | Sequenced
0.0 mm | 10.15 ± 0.18 % | 13.07 ± 0.21 % | 14.68 ± 0.22 % | 85.32 ± 0.68 %
0.25 mm | 13.64 ± 0.21 % | 18.00 ± 0.25 % | 20.78 ± 0.27 % | 79.22 ± 0.64 %
0.50 mm | 17.28 ± 0.24 % | 23.06 ± 0.29 % | 26.86 ± 0.31 % | 73.14 ± 0.61 %
0.75 mm | 20.32 ± 0.27 % | 27.31 ± 0.32 % | 31.83 ± 0.35 % | 68.17 ± 0.58 %
1.0 mm | 22.89 ± 0.29 % | 30.87 ± 0.34 % | 35.96 ± 0.38 % | 64.04 ± 0.55 %
1.5 mm | 26.89 ± 0.31 % | 36.70 ± 0.38 % | 42.37 ± 0.42 % | 57.63 ± 0.51 %
2.0 mm | 29.75 ± 0.33 % | 40.66 ± 0.41 % | 46.83 ± 0.45 % | 53.17 ± 0.49 %
2.5 mm | 31.78 ± 0.35 % | 43.60 ± 0.43 % | 50.07 ± 0.47 % | 49.93 ± 0.47 %
3.0 mm | 33.54 ± 0.36 % | 45.98 ± 0.44 % | 52.76 ± 0.48 % | 47.24 ± 0.45 %
4.0 mm | 36.35 ± 0.38 % | 49.85 ± 0.47 % | 56.70 ± 0.51 % | 43.30 ± 0.42 %
5.0 mm | 38.18 ± 0.39 % | 52.53 ± 0.48 % | 59.32 ± 0.52 % | 40.68 ± 0.41 %
7.5 mm | 41.05 ± 0.41 % | 56.51 ± 0.51 % | 63.21 ± 0.55 % | 36.79 ± 0.38 %
10.0 mm | 42.63 ± 0.42 % | 58.98 ± 0.52 % | 65.55 ± 0.56 % | 34.45 ± 0.37 %

Table 6: Probability of sequencing errors vs. position resolution

1000.0 keV track energy, 2.0 keV energy resolution

Energy | Error in | Error in | Error in | Correctly
---|---|---|---|---
Resolution | Hit 1 | Hits 1-2 | Any Hit | Sequenced
0.0 keV | 33.73 ± 0.36 % | 45.93 ± 0.44 % | 52.59 ± 0.48 % | 47.41 ± 0.45 %
1.0 keV | 33.60 ± 0.36 % | 45.95 ± 0.44 % | 52.72 ± 0.48 % | 47.28 ± 0.45 %
2.5 keV | 33.59 ± 0.36 % | 46.04 ± 0.44 % | 52.81 ± 0.48 % | 47.18 ± 0.45 %
5.0 keV | 33.67 ± 0.36 % | 46.28 ± 0.44 % | 53.11 ± 0.49 % | 46.90 ± 0.45 %
7.5 keV | 34.07 ± 0.36 % | 46.72 ± 0.45 % | 53.67 ± 0.49 % | 46.33 ± 0.44 %
10.0 keV | 34.60 ± 0.37 % | 47.44 ± 0.45 % | 54.47 ± 0.49 % | 45.53 ± 0.44 %

Table 7: Probability of sequencing errors vs. energy resolution

1000.0 keV track energy, 3.0 mm position resolution

Track | Error in | Error in | Error in | Correctly
---|---|---|---|---
Length | Hit 1 | Hits 1-2 | Any Hit | Sequenced
2 hits | 15.31 ± 0.62 % | 15.31 ± 0.62 % | 15.31 ± 0.62 % | 84.69 ± 1.85 %
3 hits | 28.18 ± 0.66 % | 38.88 ± 0.80 % | 38.88 ± 0.80 % | 61.12 ± 1.08 %
4 hits | 38.03 ± 0.74 % | 52.56 ± 0.91 % | 56.20 ± 0.96 % | 43.80 ± 0.81 %
5 hits | 40.67 ± 0.87 % | 56.89 ± 1.09 % | 70.20 ± 1.26 % | 29.80 ± 0.72 %
6 hits | 40.68 ± 1.14 % | 58.34 ± 1.45 % | 80.79 ± 1.82 % | 19.21 ± 0.72 %
(All) | 33.54 ± 0.36 % | 45.98 ± 0.44 % | 52.76 ± 0.48 % | 47.24 ± 0.45 %

Table 8: Probability of sequencing errors vs. track length

1000.0 keV track energy, (3.0 mm, 2.0 keV) detector resolution

FoM | Error in | Error in | Error in | Correctly
---|---|---|---|---
Type | Hit 1 | Hits 1-2 | Any Hit | Sequenced
Type 1 | 40.22 ± 0.43 % | 47.91 ± 0.49 % | 52.25 ± 0.52 % | 47.75 ± 0.49 %
Type 2 | 33.28 ± 0.38 % | 45.11 ± 0.47 % | 51.27 ± 0.51 % | 48.73 ± 0.49 %
Type 3 | 56.16 ± 0.54 % | 62.47 ± 0.58 % | 67.91 ± 0.62 % | 32.09 ± 0.38 %
Type 4 | 13.79 ± 0.23 % | 34.10 ± 0.39 % | 43.44 ± 0.46 % | 56.56 ± 0.54 %
Table 9: Performance of multiple FoM definitions