# Evolve the Model Universe of a System Universe ††thanks: This work is
supported by the Co-tester project (No. 314544) funded by the Research Council
of Norway.

1st Tao Yue  Simula Research Laboratory
Oslo, Norway
<EMAIL_ADDRESS>0000-0003-3262-5577  2nd Shaukat Ali  Simula Research
Laboratory
Oslo Metropolitan University
Oslo, Norway
<EMAIL_ADDRESS>0000-0002-9979-3519

###### Abstract

Uncertain, unpredictable, real-time, and lifelong evolution causes operational
failures in intelligent software systems, leading to significant damages,
safety and security hazards, and tragedies. To fully unleash such systems’
potential and facilitate their wider adoption, ensuring the trustworthiness of
their decision-making under uncertainty is the prime challenge. To overcome
this challenge, an intelligent software system and its operating environment
should be continuously monitored, tested, and refined during its lifetime
operation. Existing technologies, such as digital twins, can enable continuous
synchronisation with such systems to reflect their most up-to-date states.
Such representations are often in the form of prior-knowledge-based and
machine-learning models, together called ‘model universe’. In this paper, we
present our vision of combining techniques from software engineering,
evolutionary computation, and machine learning to support the model universe
evolution.

###### Index Terms:

Model Universe, System Universe, Coevolution, Epigenetics, Machine Learning

##  I Motivation

Intelligent software systems are transforming business, life, and the global
economy. Machine learning (ML) techniques are often employed in such systems
to enable nontrivial autonomous decision-making under uncertainties, thereby
being intelligent [1]. Such systems are prone to unforeseen situations in
operation due to several factors, including 1) various degrees of uncertainty
in physical environments and networks; 2) the probabilistic, non-backwards-
traceable nature of the inner workings of the ML techniques employed; 3)
unpredictable or design-time-unknown operating environments; and 4) the
systems’ own continuous and lifelong learning/evolution.

Such uncertain, unpredictable, real-time, and lifelong evolution causes
operational failures in intelligent software systems, leading to significant
damages, safety and security hazards, and tragedies. Hence, ensuring the
dependability of such systems at design and development time alone is
insufficient to ensure their dependability in real-world operation. Current
approaches (e.g., testing) are insufficient before such systems are deployed
since it is impossible to know all the critical situations these systems will
experience in the real world. Some of these situations appear only during
their operations, and it is also hard (if even possible) to predict when and
why. To fully unleash intelligent software systems’ potential and facilitate
their wider adoption, ensuring the trustworthiness of their decision-making
under uncertainty is the prime challenge.

Hence, intelligent software systems should be continuously monitored, tested,
and refined with real-world data to ensure they can gracefully handle all
uncertain and unknown situations during their lifetime. Current technologies,
such as digital twins (digital and live representations of systems), can
enable continuous synchronisation with the systems to reflect their most up-
to-date states [2]. Such representations are often in the form of prior-
knowledge-based and ML models (i.e., model universe). The former is widely
used to represent software systems; however, such models have a limited
capability to support the runtime analyses, reasoning, validation, and
validation of intelligent software systems during their operations in
uncertain environments. This is simply because the prior knowledge required to
create these models is only partially available and, in some cases, has yet to
be discovered. Even worse, soon after their creation, these models become
obsolete and useless. This obsolescence is accelerated when ML techniques are
employed since ML models face performance degradation over time due to, for
example, data drift, and they must inevitably evolve when more data becomes
available during the operation of such systems. To stay alive and, therefore,
valid and functional, the model universe must continuously evolve to
faithfully represent the system of interest and its environment (i.e., system
universe).

##  II Concept Formulation and State-of-the-art

We present the key concepts and their relationships in Figure 1. In the rest
of the section, we discuss them in detail.

###  II-1 Model and system universes

A model is considered an ‘informative representation of an object, person or
system’ [3]. System models are simplified representations of reality’s
essential or relevant entities and their properties at particular points in
time and/or space that form particular interests, importance, and concerns and
serve specific purposes. Models are prevailingly used in software/system
engineering and are often classified into two categories regarding their
construction: prior-knowledge-based and data-driven models. The former
comprises models such as 3D models created with simulators (e.g., for virtual
surgical planning), Simulink, and Systems Modeling Language (SysML) models for
model-based system engineering [4, 5]; the latter mainly refers to ML models,
e.g., AlexNet for image classification [6] and YOLO for object detection [7].

Figure 1: Concepts and their relations. A system universe (an intelligent
software system and its operating environment) is represented by its model
universe (prior-knowledge-based and ML models with intelligent capabilities).

The model universe of a system universe provides the proper basis for
reasoning about the system universe and enables decision makings of all kinds.
Here, we use the term ‘universe’ to emphasise that our universe is 95% unknown
[8]; similarly, the system and model universes contain many unknowns.
Furthermore, knowing the universe is about understanding its formation and
evolution, and such an understanding is essential for building a theory based
on which scientific extrapolations can be made about the future of the
universe.

###  II-2 Uncertainties

The concept of ‘uncertainty’ can be traced back to the philosophical question
about the certainty of knowledge, debated by the ancient Greek philosophers,
including Aristotle. Uncertainty has attracted significant attention since it
is inherent in intelligent software systems and their operating environments
[9, 10, 11, 12, 13]. One representative example is the uncertain operating
environments of autonomous driving vehicles (i.e., external uncertainties) and
inherent uncertainties of their behaviours due to the use of ML models for
perception and path planning, among other decision-making tasks (i.e.,
internal uncertainties). Moreover, models aimed at understanding, reasoning,
and predicting system behaviours make assumptions of all kinds. Therefore, a
model universe devised for a system universe contains two types of
uncertainties: objective uncertainties, which refer to phenomena whose
existence and nature are independent of any observing agency, and subjective
uncertainties, which refer to information existing within some agency derived
from that agency’s observations and/or reasoning (i.e., belief agents) [14].
When gaining more knowledge, subjective uncertainties can evolve into
objective ones.

Uncertainties can also be classified into shallow uncertainties and deep
uncertainties. Being shallow means that the probabilities of the outcomes are
well known; therefore, future events can be reasonably predicted by the past.
On the other hand, deep uncertainties refer to contexts in which the
probabilities of the outcomes are poorly known, unknown, or unknowable, such
that past events can give little insight into future ones [8]. Though deep
uncertainties have been discussed in, for example, natural hazard risk
assessment [15] and financial investments in climate change [16], they are
rarely recognised in software engineering.

Uncertainties in ML refer to the lack of confidence in an ML model’s output.
Estimating them is essential to determine if they are low enough that the
output can be trusted. Typically, they are classified into (irreducible)
aleatory uncertainties and (reducible) epistemic uncertainties, referring to
the inherent stochasticity of the observations and the lack of training data.
The software engineering community has only recently studied uncertainty in
ML. It, therefore, still primarily focuses on, for example, applying
uncertainty quantification methods to supervise ML systems [17, 18, 19, 20]
with tool support [21, 22, 23]. All these works limit the scope to
uncertainties caused by the (inherent) limitations of learned ML models, that
is, not covering data quality uncertainty (e.g., where the quality of the
input data is lower than the training data’s) and scope compliance uncertainty
(concerning differences between a modelled context and its intended
application context), as classified in [24]. The gap between uncertainties
understood and captured in prior-knowledge-based models of the model universe
and uncertainties recognised and quantified in its ML models is also not yet
bridged.

###  II-3 Evolution of Prior-knowledge-based and ML models

The common practice of software engineering is to manually and offline evolve
models created based on prior knowledge with methods such as inference engines
(e.g., Daikon [25]). For instance, Zhang et al. proposed data-augmented model
evolution methods supported by model execution and simulation techniques [26]
to semi-automatically evolve Unified Modeling Language (UML) state machines
and uncertainty measurements. Considering the multi-paradigm modelling (MPM)
nature of the model universe, its evolution involves the evolution of models
belonging to the same modelling paradigm (e.g., SysML block definition
diagrams and state machines) and the coevolution of models across MPM (e.g.,
Modelica models and 3D CAD models). In the literature, solutions have been
proposed for MPM and co-simulations [27, 28], but not for the coevolution of
such models. For instance, UncerTolve [29] advanced state of the art by using
real operational data from CPSs to evolve test models in UML and subjective
uncertainties offline, and DeepCollision [30] and LiveTCM [31] evolve test
scenarios of autonomous driving vehicles in a 3D virtual environment with
reinforcement learning.

ML models are often statically learned from historical data with ML
techniques. Most domain adaptation and lifelong learning methods address data
drift offline, requiring the availability of both source and target domain
information beforehand, an assumption that prevents them from being applied in
real contexts. For instance, RISE-DT [18] is one such approach: it
automatically evolves a digital twin (with its model captured in automata and
its capability enabled with an ML model) to be applied to a different
application context of industrial elevator systems with transfer learning
offline. However, online methods must fit the real-time context of evolving
the model universe. Online domain adaptation has recently been proposed to
continuously handle data drift for semantic segmentation under ever-changing
conditions during deployment [32]. In addition, to learn from non-stationary
(where data become incrementally available over time) real-world data,
lifelong or continual learning – that is, continually evolving (via acquiring,
turning and transferring) knowledge throughout lifespans across domains –
seems promising [33]. The most recent advance in this field is online lifelong
and continual learning [34, 35], suitable for model universe evolution. Still,
we need to see applications and empirical studies, which are currently largely
unavailable. Despite these efforts, there needs to be a solution enabling the
holistic coevolution of the model universe.

###  II-4 Coevolution of model and system universes

Due to uncertainties, a system universe is naturally an evolutionary reality.
Therefore, its corresponding model universe should be an evolutionary model of
the evolutionary reality. Any mechanical model (without the dynamics of
changing for ‘good’) is doomed to be useless. As well put by George Box in
[36], ‘all models are wrong, but some are useful’. This statement initially
referred to statistical models but now generally applies to all models. During
modelling, assumptions are made to understand and predict the system universe.
When the system universe evolves, to be valid, the model universe needs to
evolve itself accordingly by 1) validating knowns (captured in the model
universe) with new information obtained from the system universe, 2) refining
subjective uncertainties, 3) discovering unknowns to invalidate captured
assumptions, and 4) recognise the unknowable.

Without a suitable evolution mechanism, the difference between the model and
system universes becomes prominent, and decisions based on an outdated model
universe are prone to errors. To maintain the model universe’s usefulness, it
must be continuously evolved to remain alive. We, therefore, define evolution
in the model universe as its progression towards a direction from an uncertain
or worse state to a more certain or better one in terms of supporting the
system universe’s development, operation, and maintenance. We consider
coevolution in universes as an evolution involving interactions of more than
one model type in the model universe or interactions across the model and
system universes.

###  II-5 Coevolutionary algorithms

Evolutionary computation has been applied to solve many optimisation problems,
e.g., test optimisation [37, 38, 39], product configuration optimisation [40,
41], and optimisations in requirements engineering [42, 43]. A subset of
evolutionary algorithms, coevolutionary algorithms evaluate an individual’s
fitness based on how the individual performs against others in the population
[44], known as indirect fitness. Relationships such as competition and
cooperation among individuals are vital in designing coevolutionary
algorithms, which can help simulate real-world scenarios such as pedestrian
detection [44] and search for game-playing strategies [45].

Coevolutionary algorithms are often implemented in different metaheuristic
algorithms – such as genetic algorithms (GA), genetic programming, and
differential evolution [46] – evidence shows that coevolutionary and
conventional evolutionary algorithms can complement each other very well. In
software engineering, although coevolution has been leveraged in addressing
software development and testing challenges – as in test case generation by
coevolving test inputs and test oracles [47], automatic programming [48] and
software correction [49], and the coevolution of models and tests [50] – it is
still largely unexplored for addressing complex and practical problems
requiring novel coevolution strategies implemented in suitable evolutionary
algorithms.

###  II-6 Epigenetics and epigenetic algorithms

‘Epigenetics studies heritable changes in gene expression that occur without
changes in DNA sequence’ in response to environmental changes [51]. An example
is an octopus temporarily changing colour to one not encoded in its DNA in
response to environmental threats [52]. Several recent reviews have studied
the role of epigenetics in domesticated animals [53], plants [54], and humans
[55]. For instance, diverse environmental behaviours (e.g. stress, exercise,
and exposure to a toxic environment) bring epigenetic changes (both positive
and adverse) in humans during their life spans.

We postulate that epigenetic algorithms fit model universe evolution well
because 1) genes passed down from parents (genetic inheritance) cannot react
to sudden changes in the environment by themselves, but epigenetic
inheritance, by controlling how genes work, allows for fast adaptation when
appropriate, increasing the speed of convergence while maintaining stability
in a changing environment; 2) epigenetic mechanisms have the potential to
respond – and probably in most cases positively – to all types of
uncertainties if we constrain the direction of evolution; and 3) epigenetic
and coevolutionary algorithms are both nature-inspired and hence can be
naturally incorporated.

Only a few epigenetic algorithms have been proposed: epiGA [56] implements
gene silencing and integrates it into GA to control how genes are expressed or
turned on or off in response to environmental uncertainties; EpiLearn [57]
encodes dynamic environmental changes as an epigenetic layer in a learning
process to allow for adaptive and efficient learning; and RELEpi [57] supports
the coevolving decision making of groups of agents (swarms) in uncertain
environments, although it has not yet proven effective for real-world
problems.

Though these works demonstrate that epigenetic algorithms are a promising
direction for coping with uncertainty and unknowns, we are far from being able
to apply them to handle uncertainties in model universe evolution due to 1)
rarely seeing implementations of epigenetic mechanisms from biology, 2) the
lack of real-world applications, and 3) the unavailability of experimental
frameworks, empirical data, and research communities. This is because
epigenetics in biology is relatively new and complex, and epigenetic encoding
for real applications requires a deep understanding of application contexts,
problems to be solved, and epigenetic mechanisms.

Concluding remark. There is no holistic method for evolving the model universe
of a system universe under unknown uncertainties because the model universe’s
evolution: 1) needs to be online and autonomous, 2) is triggered at different
times and in different spaces, 3) is tightly entangled with uncertainties of
various types and degrees, 4) needs to coordinate diverse modelling paradigms,
and 5) needs to interact with the system universe during its operation
efficiently.

##  III The Way forward

###  III-1 Identify universe coevolution patterns

We first need to understand primary coevolution triggers (e.g., discovering
unknowns in prior-knowledge–based models, obtaining new data for adapting ML
models), the time points that trigger each coevolution (e.g., upon receiving a
new batch of data, as soon as an uncertain event occurs), and the conditions
under which each model needs to be evolved to keep themselves alive and the
data requirements (e.g., quality and quantity). Following the common practice
of model-based engineering, these understandings can be specified as a
metamodel, based on which methodologies and tools to specify, characterise,
and automatically identify each pattern can be proposed.

###  III-2 Inspired by coevolution mechanisms in nature

Coevolution mechanisms in nature can provide inspiration for designing and
applying coevolutionary algorithms; however, not all coevolution mechanisms
can be directly implemented in coevolutionary algorithms, mainly because these
mechanisms are complex and we have only a limited understanding of them. It is
therefore important to only implement their essential features. For instance,
some interactions between the model and system universes might be mapped to
commensalism, where the model universe benefits from the interactions with the
system universe (e.g., evolving itself with data received from the system
universe) while the system universe remains unaffected. Future research is
needed to systematically map universe coevolution patterns (representing the
problems to be solved) to coevolution mechanisms in nature, which will
leverage the identification of existing coevolutionary algorithms and the
development of novel coevolutionary algorithms to enable model universe
evolution.

###  III-3 Develop uncertainty taxonomy, metamodel, quantification, and
management methods

We need to develop a comprehensive uncertainty taxonomy to support end-to-end
uncertainty management, characterising and quantifying uncertainties (with the
uncertainty metamodel to be devised) which results in uncertainty models being
managed as part of the model universe. We will also need to integrate various
uncertainty quantification methods for ML and prior-knowledge–based models to
efficiently enable holistic end-to-end uncertainty quantification that
involves more than one quantification method, for example, connecting
subjective uncertainties from prior-knowledge models to objective
uncertainties from sensory data and, further, to uncertainties in ML models’
predictions, which could lead to uncertain decision making and the actuation
of physical devices. A solution needs to systematically select and base itself
on various uncertainty-related theories, such as probability theory for
quantifying the likelihood of known outcomes, possibility theory for
situations in which the probability of an event is unknown or unknowable,
Bayesian decision theory and Bayesian updating to update the prior knowledge
of belief agents about given events, prospect theory for (subjective) human
decision making under uncertainty and risk (e.g., pedestrians crossing roads),
chaos theory for modelling, analysing, and improving system robustness,
Dempster-Shafer theory in handling situations lacking complete information,
and combinations of theories, powering end-to-end uncertainty-aware model
universe evolution.

###  III-4 Propose coevolutionary algorithms and epigenetics-inspired
algorithms

An envisioned solution must be autonomous, data-augmented, and online, which
puts high requirements on its efficiency. To achieve this, we must first rely
on coevolutionary algorithms by developing optimal encoding mechanisms for
each coevolution pattern, defining subjective internal measures for fitness,
defining adaptive problem decomposition structures, and overcoming challenges
such as avoiding local optima, scaling, and measuring performance. In response
to uncertainties, we need to develop epigenetics-inspired algorithms that
mimic biological adaptations in species by encoding each model universe’s
evolution pattern in the form of genomes and epigenomes (both responsible for
the regulation and expression of genetic information), implementing generic
epigenetic operators based on three epigenetic mechanisms (DNA methylation,
histone modification, and RNA editing), and simulating uncertainties in gene
expressions through epigenetic changes by applying epigenetic operators to
genes in the model universe through mechanisms such as the introduction of
epigenetic drift (i.e., where the epigenetic marks change over time) and
combing different epigenetic operators.

###  III-5 Design multi-agent evolutionary reinforcement learning methods

We need to introduce coevolutionary algorithms to multi-agent reinforcement
learning by matching each model in the model universe as a learning agent, its
environment as the system universe, and other models (i.e., agents) in the
model universe. For instance, for policy-based reinforcement learning, one can
let agents compete or cooperate (or other coevolution mechanisms) to learn
from their interactions, evolve the agents’ policies via the coevolutionary
process, and design the agents’ rewards to encourage or discourage their
behaviours. We will introduce epigenetic mechanisms to coevolutionary
algorithms based on uncertainties under study, for example, by controlling
gene expressions in response to the environmental changes of individuals in an
agent’s population, influencing the evolution of individuals by controlling
genetic operators such as mutation rates, and controlling the selection of
individuals for reproduction. When integrating epigenetic and coevolutionary
algorithms with multi-agent reinforcement learning, we can use coevolutionary
algorithms to evolve the policies of multiple agents in a reinforcement
learning setting and use the epigenetic mechanisms to modulate the agents’
policies based on their experiences and interactions with other agents/models
and the environment (i.e., the system universe).

Impact. Intelligent software systems are used in many applications, such as
healthcare, agriculture, transportation, and manufacturing, and have an
enormous impact on our lives and demand a high degree of dependability on
these systems’ operations. With the envisioned solution, the dependability of
the current and future intelligent software systems will be significantly
improved through fully-fledged model universes capable of robustly dealing
with uncertainties in real time.

## References

  * [1] L. E. Lwakatare, A. Raj, I. Crnkovic, J. Bosch, and H. H. Olsson, “Large-scale machine learning systems in real-world industrial settings: A review of challenges and solutions,” _Information and software technology_ , vol. 127, p. 106368, 2020.
  * [2] T. Yue, P. Arcaini, and S. Ali, “Understanding digital twins for cyber-physical systems: A conceptual model,” in _Leveraging Applications of Formal Methods, Verification and Validation: Tools and Trends_ , T. Margaria and B. Steffen, Eds. Cham: Springer International Publishing, 2021, pp. 54–71.
  * [3] “Model,” 2023. [Online]. Available: https://en.wikipedia.org/wiki/Model
  * [4] A. L. Ramos, J. V. Ferreira, and J. Barceló, “Model-based systems engineering: An emerging approach for modern systems,” _IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications and Reviews)_ , vol. 42, no. 1, pp. 101–111, 2012.
  * [5] T. Wang, C. Tan, L. Huang, Y. Shi, T. Yue, and Z. Huang, “Simplexity testbed: A model-based digital twin testbed,” _Computers in Industry_ , vol. 145, p. 103804, 2023. [Online]. Available: https://www.sciencedirect.com/science/article/pii/S0166361522002007
  * [6] A. Krizhevsky, I. Sutskever, and G. E. Hinton, “Imagenet classification with deep convolutional neural networks,” _Communications of the ACM_ , vol. 60, no. 6, pp. 84–90, 2017.
  * [7] J. Redmon and A. Farhadi, “Yolo9000: better, faster, stronger,” in _Proceedings of the IEEE conference on computer vision and pattern recognition_ , 2017, pp. 7263–7271.
  * [8] N. Aghanim, Y. Akrami, M. Ashdown, J. Aumont, C. Baccigalupi, M. Ballardini, A. Banday, R. Barreiro, N. Bartolo, S. Basak _et al._ , “Planck 2018 results-vi. cosmological parameters (corrigendum),” _Astronomy & Astrophysics_, vol. 652, p. C4, 2021.
  * [9] X. Zhang, “Uncertainty-guided testing and robustness enhancement for deep learning systems,” in _Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering: Companion Proceedings_ , 2020, pp. 101–103.
  * [10] S. Y. Shin, K. Chaouch, S. Nejati, M. Sabetzadeh, L. C. Briand, and F. Zimmer, “Uncertainty-aware specification and analysis for hardware-in-the-loop testing of cyber-physical systems,” _Journal of Systems and Software_ , vol. 171, p. 110813, 2021.
  * [11] F. O. Catak, T. Yue, and S. Ali, “Uncertainty-aware prediction validator in deep learning models for cyber-physical system data,” _ACM Transactions on Software Engineering and Methodology (TOSEM)_ , vol. 31, no. 4, pp. 1–31, 2022\.
  * [12] L. Han, T. Yue, S. Ali, A. Arrieta, and M. Arratibel, “Are elevator software robust against uncertainties? results and experiences from an industrial case study,” ser. ESEC/FSE 2022. New York, NY, USA: Association for Computing Machinery, 2022, p. 1331–1342. [Online]. Available: https://doi.org/10.1145/3540250.3558955
  * [13] L. Han, S. Ali, T. Yue, A. Arrieta, and M. Arratibel, “Uncertainty-aware robustness assessment of industrial elevator systems,” vol. 32, no. 4, may 2023\. [Online]. Available: https://doi.org/10.1145/3576041
  * [14] M. Zhang, B. Selic, S. Ali, T. Yue, O. Okariz, and R. Norgren, “Understanding uncertainty in cyber-physical systems: A conceptual model,” in _Modelling Foundations and Applications_ , A. Wasowski and H. Lönn, Eds. Cham: Springer International Publishing, 2016, pp. 247–264.
  * [15] S. Almeida, E. A. Holcombe, F. Pianosi, and T. Wagener, “Dealing with deep uncertainties in landslide modelling for disaster risk reduction under climate change,” _Natural Hazards and Earth System Sciences_ , vol. 17, no. 2, pp. 225–241, 2017.
  * [16] D. Narita, I. Sato, D. Ogawada, and A. Matsumura, “Evaluating the robustness of project performance under deep uncertainty of climate change: A case study of irrigation development in kenya,” _Climate Risk Management_ , vol. 36, p. 100426, 2022.
  * [17] M. Weiss and P. Tonella, “Uncertainty quantification for deep neural networks: An empirical comparison and usage guidelines,” _arXiv preprint arXiv:2212.07118_ , 2022.
  * [18] Q. Xu, S. Ali, T. Yue, and M. Arratibel, “Uncertainty-aware transfer learning to evolve digital twins for industrial elevators,” in _Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering_ , 2022, pp. 1257–1268.
  * [19] Q. Xu, S. Ali, and T. Yue, “Digital twin-based anomaly detection with curriculum learning in cyber-physical systems,” _ACM Trans. Softw. Eng. Methodol._ , feb 2023, just Accepted. [Online]. Available: https://doi.org/10.1145/3582571
  * [20] F. O. Catak, T. Yue, and S. Ali, “Prediction surface uncertainty quantification in object detection models for autonomous driving,” in _2021 IEEE International Conference on Artificial Intelligence Testing (AITest)_ , 2021, pp. 93–100.
  * [21] M. Weiss and P. Tonella, “Uncertainty-wizard: Fast and user-friendly neural network uncertainty quantification,” in _2021 14th IEEE Conference on Software Testing, Verification and Validation (ICST)_. IEEE, 2021, pp. 436–441.
  * [22] Z. Zou, X. Meng, A. F. Psaros, and G. E. Karniadakis, “Neuraluq: A comprehensive library for uncertainty quantification in neural differential equations and operators,” _arXiv preprint arXiv:2208.11866_ , 2022.
  * [23] Y. Chung, I. Char, H. Guo, J. Schneider, and W. Neiswanger, “Uncertainty toolbox: an open-source library for assessing, visualizing, and improving uncertainty quantification,” _arXiv preprint arXiv:2109.10254_ , 2021.
  * [24] M. Kläs and A. M. Vollmer, “Uncertainty in machine learning applications: A practice-driven classification of uncertainty,” in _Computer Safety, Reliability, and Security: SAFECOMP 2018 Workshops, ASSURE, DECSoS, SASSUR, STRIVE, and WAISE, Västerås, Sweden, September 18, 2018, Proceedings 37_. Springer, 2018, pp. 431–438.
  * [25] M. D. Ernst, J. H. Perkins, P. J. Guo, S. McCamant, C. Pacheco, M. S. Tschantz, and C. Xiao, “The daikon system for dynamic detection of likely invariants,” _Science of computer programming_ , vol. 69, no. 1-3, pp. 35–45, 2007.
  * [26] M. Zhang, S. Ali, T. Yue, and R. Norgre, “Uncertainty-wise evolution of test ready models,” _Information and Software Technology_ , vol. 87, pp. 140–159, 2017.
  * [27] W. de Paula Ferreira, F. Armellini, and L. A. De Santa-Eulalia, “Simulation in industry 4.0: A state-of-the-art review,” _Computers & Industrial Engineering_, vol. 149, p. 106868, 2020.
  * [28] A. Barišić, I. Ruchkin, D. Savić, M. A. Mohamed, R. Al-Ali, L. W. Li, H. Mkaouar, R. Eslampanah, M. Challenger, D. Blouin _et al._ , “Multi-paradigm modeling for cyber–physical systems: A systematic mapping review,” _Journal of Systems and Software_ , vol. 183, p. 111081, 2022.
  * [29] M. Zhang, S. Ali, T. Yue, and R. Norgre, “Uncertainty-wise evolution of test ready models,” _Information and Software Technology_ , vol. 87, pp. 140–159, 2017. [Online]. Available: https://www.sciencedirect.com/science/article/pii/S0950584917302161
  * [30] C. Lu, Y. Shi, H. Zhang, M. Zhang, T. Wang, T. Yue, and S. Ali, “Learning configurations of operating environment of autonomous vehicles to maximize their collisions,” _IEEE Transactions on Software Engineering_ , vol. 49, no. 1, pp. 384–402, 2023.
  * [31] Y. Shi, C. Lu, M. Zhang, H. Zhang, T. Yue, and S. Ali, “Restricted natural language and model-based adaptive test generation for autonomous driving,” in _2021 ACM/IEEE 24th International Conference on Model Driven Engineering Languages and Systems (MODELS)_ , 2021, pp. 101–111.
  * [32] T. Panagiotakopoulos, P. L. Dovesi, L. Härenstam-Nielsen, and M. Poggi, “Online domain adaptation for semantic segmentation in ever-changing conditions,” in _Computer Vision–ECCV 2022: 17th European Conference, Tel Aviv, Israel, October 23–27, 2022, Proceedings, Part XXXIV_. Springer, 2022, pp. 128–146.
  * [33] G. I. Parisi, R. Kemker, J. L. Part, C. Kanan, and S. Wermter, “Continual lifelong learning with neural networks: A review,” _Neural networks_ , vol. 113, pp. 54–71, 2019.
  * [34] Z. Mai, R. Li, J. Jeong, D. Quispe, H. Kim, and S. Sanner, “Online continual learning in image classification: An empirical survey,” _Neurocomputing_ , vol. 469, pp. 28–51, 2022.
  * [35] B. Liu, “Learning on the job: Online lifelong and continual learning,” in _Proceedings of the AAAI Conference on Artificial Intelligence_ , vol. 34, no. 09, 2020, pp. 13 544–13 549.
  * [36] G. Box, “Robustness in the strategy of scientific model building,” in _Robustness in Statistics_ , R. L. LAUNER and G. N. WILKINSON, Eds. Academic Press, 1979, pp. 201–236. [Online]. Available: https://www.sciencedirect.com/science/article/pii/B9780124381506500182
  * [37] A. Arrieta, S. Wang, G. Sagardui, and L. Etxeberria, “Search-based test case prioritization for simulation-based testing of cyber-physical system product lines,” _Journal of Systems and Software_ , vol. 149, pp. 1–34, 2019.
  * [38] A. Panichella, F. M. Kifetew, and P. Tonella, “A large scale empirical comparison of state-of-the-art search-based test case generators,” _Information and Software Technology_ , vol. 104, pp. 236–256, 2018.
  * [39] R. A. Silva, S. d. R. S. de Souza, and P. S. L. de Souza, “A systematic review on search based mutation testing,” _Information and Software Technology_ , vol. 81, pp. 19–35, 2017.
  * [40] C. Henard, M. Papadakis, M. Harman, and Y. Le Traon, “Combining multi-objective search and constraint solving for configuring large software product lines,” in _2015 IEEE/ACM 37th IEEE International Conference on Software Engineering_ , vol. 1. IEEE, 2015, pp. 517–528.
  * [41] R. E. Lopez-Herrejon, L. Linsbauer, and A. Egyed, “A systematic mapping study of search-based software engineering for software product lines,” _Information and software technology_ , vol. 61, pp. 33–51, 2015.
  * [42] H. Zhang, M. Zhang, T. Yue, S. Ali, and Y. Li, “Uncertainty-wise requirements prioritization with search,” _ACM Transactions on Software Engineering and Methodology (TOSEM)_ , vol. 30, no. 1, pp. 1–54, 2020.
  * [43] Y. Zhang, A. Finkelstein, and M. Harman, “Search based requirements optimisation: Existing work and challenges,” in _Requirements Engineering: Foundation for Software Quality_ , B. Paech and C. Rolland, Eds. Berlin, Heidelberg: Springer Berlin Heidelberg, 2008, pp. 88–94.
  * [44] Y. Xu, X. Cao, and H. Qiao, “A low-cost pedestrian detection system with a single optical camera,” in _2006 6th World Congress on Intelligent Control and Automation_ , vol. 2. IEEE, 2006, pp. 8759–8763.
  * [45] C. D. Rosin and R. K. Belew, “New methods for competitive coevolution,” _Evolutionary computation_ , vol. 5, no. 1, pp. 1–29, 1997.
  * [46] X. Ma, X. Li, Q. Zhang, K. Tang, Z. Liang, W. Xie, and Z. Zhu, “A survey on cooperative co-evolutionary algorithms,” _IEEE Transactions on Evolutionary Computation_ , vol. 23, no. 3, pp. 421–441, 2019.
  * [47] A. Ouni, M. Kessentini, H. Sahraoui, and M. Boukadoum, “Maintainability defects detection and correction: a multi-objective approach,” _Automated Software Engineering_ , vol. 20, pp. 47–79, 2013.
  * [48] A. Arcuri and X. Yao, “Co-evolutionary automatic programming for software development,” _Information Sciences_ , vol. 259, pp. 412–432, 2014.
  * [49] J. L. Wilkerson, D. R. Tauritz, and J. M. Bridges, “Multi-objective coevolutionary automated software correction,” in _Proceedings of the 14th annual conference on Genetic and evolutionary computation_ , 2012, pp. 1229–1236.
  * [50] S. Koos, J.-B. Mouret, and S. Doncieux, “Automatic system identification based on coevolution of models and tests,” in _2009 IEEE congress on evolutionary computation_. IEEE, 2009, pp. 560–567.
  * [51] V. Bollati and A. Baccarelli, “Environmental epigenetics,” _Heredity_ , vol. 105, no. 1, pp. 105–112, 2010.
  * [52] N. Liscovitch-Brauer, S. Alon, H. T. Porath, B. Elstein, R. Unger, T. Ziv, A. Admon, E. Y. Levanon, J. J. Rosenthal, and E. Eisenberg, “Trade-off between transcriptome plasticity and genome evolution in cephalopods,” _Cell_ , vol. 169, no. 2, pp. 191–202, 2017.
  * [53] G. Vogt, “Facilitation of environmental adaptation and evolution by epigenetic phenotype variation: insights from clonal, invasive, polyploid, and domesticated animals,” _Environmental epigenetics_ , vol. 3, no. 1, 2017\.
  * [54] B. J. Kelly, J. R. Fitch, Y. Hu, D. J. Corsmeier, H. Zhong, A. N. Wetzel, R. D. Nordquist, D. L. Newsom, and P. White, “Churchill: an ultra-fast, deterministic, highly scalable and balanced parallelization strategy for the discovery of human genetic variation in clinical and population-scale genomics,” _Genome biology_ , vol. 16, pp. 1–14, 2015.
  * [55] R. R. Kanherkar, N. Bhatia-Dey, and A. B. Csoka, “Epigenetics across the human lifespan,” _Frontiers in cell and developmental biology_ , vol. 2, p. 49, 2014.
  * [56] D. H. Stolfi and E. Alba, “Epigenetic algorithms: A new way of building gas based on epigenetics,” _Information Sciences_ , vol. 424, pp. 250–272, 2018\.
  * [57] F. Mukhlish, J. Page, and M. Bain, “Reward-based epigenetic learning algorithm for a decentralised multi-agent system,” _International Journal of Intelligent Unmanned Systems_ , vol. 8, no. 3, pp. 201–224, 2020.


# Analytical Fitting of $\gamma$–ray Photopeaks in Germanium Cross Strip
Detectors

Steven E. Boggs<EMAIL_ADDRESS>Sean N. Pike

###### Abstract

In an ideal germanium detector, fully-absorbed monoenergetic $\gamma$–rays
will appear in the measured spectrum as a narrow peak, broadened into a
Gaussian of width determined only by the statistical properties of charge
cloud generation and the electronic noise of the readout electronics.
Multielectrode detectors complicate this picture. Broadening of the charge
clouds as they drift through the detector will lead to charge sharing between
neighboring electrodes and, inevitably, low-energy tails on the photopeak
spectra. We simulate charge sharing in our germanium cross strip detectors in
order to reproduce the low-energy tails due to charge sharing. Our goal is to
utilize these simulated spectra to develop an analytical fit (shape function)
for the spectral lines that provides a robust and high-quality fit to the
spectral profile, reliably reproduces the interaction energy, noise width, and
the number of counts in both the true photopeak and the low-energy tail, and
minimizes the number of additional parameters. Accurate modeling of the
detailed line profiles is crucial for both calibration of the detectors as
well as scientific interpretation of measured spectra.

###### keywords:

Germanium semiconductor detectors , Charge sharing , $\gamma$–ray spectroscopy
, $\gamma$–ray line profiles

††journal: Nuclear Instruments and Methods in Physics Research A

[a]organization=Department of Astronomy & Astrophysics, University of
California, San Diego,addressline=9500 Gilman Drive, city=La Jolla, state=CA,
postcode=92093, country=USA

[b]organization=Space Sciences Laboratory, University of California,
Berkeley,addressline=7 Gauss Way, city=Berkeley, state=CA, postcode=94720,
country=USA

##  1 Introduction

The Compton Spectrometer and Imager (COSI) is a soft $\gamma$–ray survey
telescope (0.2-5 MeV) designed to probe the origins of Galactic positrons,
reveal sites of ongoing element formation in the Galaxy, use $\gamma$–ray
polarimetry to gain insight into extreme environments, and explore the physics
of multi-messenger events [1, 2, 3]. The COSI detectors are custom, large-
volume (54 cm2 area, 1.5 cm thick) cross-strip germanium detectors utilizing
amorphous contact technologies [4]. Cross-strip electrodes on the opposite
faces, combined with signal timing, provide full 3D position resolution for
interactions within the detector. In this work we are focused on our original
2.0-mm strip pitch germanium detectors that flew on the COSI balloon payload
[1, 2].

When a $\gamma$–ray photon interacts in the germanium, either by
photoabsorption or Compton scattering, a fast recoil electron is produced
which knocks more electrons from the valence band to the conduction band,
leaving holes behind. The number of electron-hole (e-h) pairs is directly
proportional to the energy deposited, 2.96 eV per e-h pair in germanium. In an
applied electric field (+1500 V bias) these charge clouds will separate and
drift in opposite directions, electrons toward the cathode and holes toward
the anode. The $\gamma$–ray interaction energy is measured on both the cathode
(electron signal) and the anode (hole signal) strips independently by
measuring the integrated charge induced on each electrode by the charge clouds
drifting towards their respective electrodes. As these charge clouds drift in
the detector, their charge density profiles broaden due to both thermal
diffusion and mutual electrostatic repulsion. The finite size of the charge
clouds will result in some interactions having their charge collected on
multiple electrodes. Such interactions lead to either charge sharing between
strips, or low-energy tailing on spectral lines if the charge shared on the
neighboring strip falls below the detection threshold for that electrode.

Optimizing the spectral performance of these high-resolution germanium
detectors requires detailed knowledge of the photopeak and low-energy tail
profiles. Inadequate modeling of the shapes of the spectral line can affect
the overall spectral calibration of the instrument, as well as scientific
analysis of observed spectral features.

Figure 1:  Diagram of the process utilized to create the simulated spectra,
including the true photopeak, low-energy tail, and “measured” total. For a
given drift time, $\tau$, we sampled $10^{5}$ initial interaction positions
across the primary strip. The resulting charge cloud profiles,
$\lambda(x,\tau)$, were numerically integrated to determine the charge
(energy), $E_{1}$, collected on the primary strip as well as that collected on
the neighbor, $E_{2}$.

We present a novel shape function that reliably reproduces both the line
profiles and the underlying physical parameters for our spectra created with
charge sharing simulations, with minimal additional fit parameters.

In Section 2, we describe how we create simulated photopeak and low-energy
tail spectra utilizing a novel charge profile density model. In Section 3 we
review how germanium spectral lines with low-energy tails have been fit in the
past. Section 4 presents the shape function utilized in this work. In Section
5 we show how constraining some of the shape function parameters leads to more
robust estimates of the underlying physical parameters. Section 6 extends
these fits to higher and lower interaction energies. In Section 7 we
demonstrate how the shape function varies for line profiles that include the
effects of extended initial charge clouds (created by the recoil electron) and
present fit parameters accounting for effects of the recoil electrons. We
conclude with a discussion of applications and future directions.

##  2 Model Spectra

Figure 2:  Example model spectra for 661.66 keV photopeak interactions,
showing the individual true photopeak and low-energy tail components of the
model as well as the combined full spectra. (Top Left) Electron signals,
$\tau=50\,ns$ drift time, (Top Right) hole signals, $\tau=50\,ns$, (Bottom
Left) electron signals, $\tau=250\,ns$, (Bottom Right) hole signals,
$\tau=250\,ns$. Events with $\tau=50\,ns$ occur near the signal collection
electrode, while those with $\tau=250\,ns$ occur far from the collection
electrode.

We utilize the analytical charge cloud profiles derived in Boggs [5] to
simulate charge sharing within our germanium cross strip detectors. The
analytical approximations in that paper allow us to model the 1-D projected
charge density profiles for electron and hole clouds across the collection
electrodes as a function of their drift time ($\tau$) in the detector, which
maps directly to interaction depth within the detector. These charge profiles
include the effects of thermal diffusion and mutual electrostatic repulsion in
broadening the charge clouds. In this work we initially assume that the recoil
electron depostis all of its energy at a single point, but we include the
effects of a finite initial charge cloud distributions in Section 7. In order
to turn these charge density profiles for fixed drift times into spectra, we
sampled 105 initial interaction locations across the primary strip electrode
for each drift time (Fig. 1), numerically integrating the charge density
profile to determine the charge (energy) deposited on the primary strip
($E_{1}$) and neighboring strip ($E_{2}$). Once $E_{1}$ was determined for
each sampled location we added a random noise to $E_{1}$ based on our measured
resolution $\sigma_{m}(E)$, which is given approximately by:

$\sigma_{m}(E)=[2.17+0.65*\sqrt{E/1000}]/(2.35)\,keV;[E]=keV$ (1)

Each of these simulated interactions was classified into one of three
categories based on the charge (energy) deposited on the neighboring strip.
Events where $E_{2}=0$ (no charge sharing) were classified as “true photopeak”
events and contribute to the narrow Gaussian photopeak centered at the initial
interaction energy, $E_{0}$. Events where enough charge was shared on the
neighboring strip to exceed the trigger threshold of the readout electronics
on that strip ($E_{2}\geq E_{th}$) were classified as “triggered shared”
events. We are focused on analytical fitting of the single-strip photopeak
spectra in this work and hence are not considering these triggered shared
events any further here. The last classification is for events where charge
(energy) was collected on the neighboring strip, but not enough to trigger the
strip ($0<E_{2}<E_{th}$). These events were classified as “untriggered shared”
events and contribute to the low-energy tail on the spectral peak. (The COSI
readout electronics that flew on the balloon payload, which we are modeling in
this work, were not designed to read out neighboring strips unless the
interaction on the neighbor exceeded the trigger threshold.) We then proceed
to bin the “measured” energy $E_{1}$ into one of two spectra, the true
photopeak spectrum and the low-energy tail spectrum. Separating these two
spectral components through the modeling allows us to know the exact number of
counts in the true photopeak ($N_{p}$) and the low-energy tail ($N_{t}$)
separately, as well as study the shape of the low-energy tail independently of
the true photopeak. Adding these two spectra together creates our “measured”
full spectral line for a given drift time.

Electron signals |  |  |  |
---|---|---|---|---
$\tau$ [ns] |  $E_{0}$ [$keV$] |  $\sigma$ [$keV$] | $N[fit/sim]$ | $\chi_{R}^{2}$
10 | 661.62 | 1.18 | 0.97 | 21.22
50 | 661.56 | 1.21 | 0.94 | 40.94
100 | 661.51 | 1.23 | 0.90 | 55.60
150 | 661.46 | 1.26 | 0.88 | 66.34
200 | 661.41 | 1.28 | 0.85 | 75.19
250 | 661.34 | 1.30 | 0.83 | 82.52
|  |  |  |
Hole signals |  |  |  |
$\tau$ [ns] |  $E_{0}$ [$keV$] |  $\sigma$ [$keV$] | $N[fit/sim]$ | $\chi_{R}^{2}$
10 | 661.61 | 1.18 | 0.97 | 20.90
50 | 661.55 | 1.22 | 0.93 | 43.55
100 | 661.49 | 1.25 | 0.90 | 59.44
150 | 661.42 | 1.27 | 0.87 | 71.38
200 | 661.36 | 1.30 | 0.84 | 80.38
250 | 661.28 | 1.33 | 0.81 | 88.02
Table 1:  Gaussian fit parameters for full spectra. The simulated spectral
model assumes $E_{0}=661.66\,keV$ and $\sigma=1.15\,keV$. The quality of fits
are poor ($\chi_{R}^{2}\gg 1$), even for the shortest drift times
corresponding to minimal tailing. At longer drift times, the quality of fit
degrades, and the fit values for $E_{0}$, $\sigma$, and the number of events
in the peak ($N[fit/sim]$) become less accurate. Figure 3:  Gaussian-only fits
to the full spectra, 250 ns drift time. (Left) Electron signals, both the
fitted (and expected) values, $E_{0}$ = 661.34 keV (661.66),
$\sigma=1.30\,keV$ (1.15). (Right) Holes signals, $E_{0}$ = 661.28 keV
(661.66), $\sigma=1.33\,keV$ (1.15). The individual true photopeak and low-
energy tail components of the model spectra are shown for comparison. More
details are presented in Table 1.

In Figure 2 we show example electron-signal and hole-signal spectra for two
different drift times, $\tau=50\,ns$ which represent interactions near the
collection electrode and hence have minimal charge sharing with neighbor
strips, and $\tau=250\,ns$ which represents interactions far from the
collection electrode so exhibit maximum charge sharing with neighbor strips.
These spectra demonstrate how the untriggered shared events create the low-
energy tails on the photopeaks in our simulated spectra. (For clarity,
electron and hole spectra at the same drift time as shown here do not
correspond to the same interactions as longer electron drift times would
correspond to shorter hole drift times for the same interaction, and vice
versa.)

To motivate our need to derive more complicated fitting functions we have fit
our combined full spectra with a simple Gaussian shape function. As is evident
in Fig. 3, a simple Gaussian is not an adequate fit to the data, and
specifically does not reproduce the underlying parameters we are trying to
ascertain. Table 1 gives the best-fit parameters to $661.66\,keV$ lines
generated by our simulations for a range of drift times characteristic of our
germanium detectors. Several trends in this table are worth noting for later
comparison. First, the high $\chi_{R}^{2}$ values ($\gg\,1$) indicate poor
quality fits, and get worse for larger drift times (i.e., more charge
sharing). The fit value of $E_{0}$ is shifted to lower energies and $\sigma$
is broader than the actual noise value due to the Gaussian shape function
trying to account for the low-energy tail. Utilizing this simple Gaussian
shape function in spectral analyses can lead to erroneous gain calibrations as
well as inaccurate measurement of peak energies and potential Doppler shifts
and broadening for measured $\gamma$-ray lines. In addition, the simple
Gaussian fit significantly overestimates the number of counts in the true
photopeak ($N_{p}$) and leaves no characterization of the number of counts in
the tail ($N_{t}$).

##  3 Previous Analytical Fits

A wide variety of shape functions have been proposed to facilitate analytical
peak-fitting techniques for narrow $\gamma$–ray spectral lines in germanium
detectors. These shape functions universally share the fundamental feature
that the photopeak for totally-absorbed $\gamma$–rays where the resulting
charge clouds are fully collected on the electrode(s) is modeled by a Gaussian
peak of width $\sigma$, the center of which reflects the incident photon
energy, $E_{0}$, in a properly calibrated system. The width of the Gaussian is
determined by the statistical fluctuations in the initial e-h charge cloud
produced by the recoil electron combined with the electronic readout noise
[6].

Figure 4:  Example fits to tail-only spectra, 661.66 keV, $250\,ns$ drift
time. The low-energy tail spectra were fit with the tail components of the
shape function only, with all parameters unconstrained. Here we show only
electron signal spectra, but the hole signal spectra and resulting fits are
very similar. (Top left) Exponential tail only fit ($\chi_{R}^{2}$ = 13.37).
(Top right) Exponential + step tail ($\chi_{R}^{2}$ = 1.98). (Bottom left)
Short + long exponentials ($\chi_{R}^{2}$ = 1.27). (Bottom right) Exponential
+ linear tail ($\chi_{R}^{2}$ = 1.23). Both of the latter two shapes produce
high quality fits and reproduce the photopeak energy and the number of counts
in the tail; however, the last shape, exponential + linear tail, provides a
much more robust fitting as we vary the interaction energy and drift time. The
true photopeak and full spectra are shown only for comparison.

Measured spectral lines in germanium detectors always exhibit asymmetries.
There is inevitably an excess of counts on the lower-energy side of the peak,
low-energy tails, that have traditionally been attributed to a number of
physical process in the detector including charge trapping, inactive regions
in the detector, and escaped bremmstrahlung photons [7]. With the advent of
multi-electrode detectors such as the COSI cross-strip detectors, charge
sharing between multiple electrodes can be added to this list as a dominating
contributor to low-energy tails. Occasionally spectral peaks exhibit excess
events on the higher-energy side of the peak. Such high-energy tails are
primarily due to electronic pile-up [7] or cross-talk between neighboring
electrode electronics [2]. We will not consider high-energy tails further in
this work. While charge trapping is present in our germanium detectors for
both electron and hole signals, we are not including the effects of trapping
on our simulated line profiles. We will return to a discussion of charge
trapping in Section 8.

Comparison of the wide variety of proposed shape functions for germanium
detectors have been reviewed by multiple authors, e.g. [8, 9]. In general, the
shape functions that best fit experimental data combine the Gaussian peak with
an exponential low-energy tail, plus an additional component extending to
lower energies that is usually represented by either a step function or a
second longer exponential tail (or both) [10, 11]. Given the simplicity and
historical success of this general shape function, we adopt this as our
baseline approach.

These previous investigations into optimal shape functions were primarily
modeling the response of monolithic, single-electrode germanium detectors,
where the low-energy tails would extend indefinitely below the Gaussian peak.
The low-energy tails we are simulating in this work are due solely to
untriggered charge sharing on neighboring electrode strips, hence these low-
energy tails only extend below the peak ($E_{0}$) to energies
$E_{0}$-$E_{th}$, where $E_{th}$ is the trigger threshold energy for the
neighboring strip. For our germanium cross strip detectors this threshold is
at relatively low energies ($E_{th}=18\,keV$). Hence we introduce our first
modification to any adopted shape function by requiring a low-energy cutoff at
$E_{0}$-$E_{th}$.

We explored four (4) tailing shape functions in detail, keeping in mind our
simultaneous goals of finding a shape function that provides a robust and high
quality fit to the simulated spectra, reliably reproduces $E_{0}$, $\sigma$,
$N_{p}$, and $N_{t}$, and minimizes the number of fit parameters. Here we
define “robust” fits as ones where the parameters do not vary dramatically as
we vary the interaction energy and the drift times. The four models we have
explored are shown in Fig. 4, and summarized here.

1\. Exponential low-energy tail (2 parameters). Before adding any additional
components to the tail shape function we first looked at the single-component
exponential low-energy tail model. As can be seen in Fig. 4 (top left), this
single component model does not provide a quality fit of the tail, justifying
the need to look for an additional component to extend the tail to lower
energies.

2\. Exponential + step tail (3 parameters). The simplest additional component
we can add to this tail model is a step function that extends the tail shape
function to lower energies. The form of this shape function is the same as
used in [12], but with the addition of the low-energy cutoff. An example fit
utilizing this tail shape is shown in Fig. 4 (top right). This function does a
much better job qualitatively of modeling the complex tail shape, but the
quality of the fits ($\chi_{R}^{2}$) indicate there is room for further
improvement, and close inspection shows that the fit does not adequately
capture the slope of the extended tail at the lowest energies. Surprisingly,
however, the fits with this tail shape are very robust and do an excellent job
of reproducing the underlying physical parameters ($E_{0}$, $\sigma$, $N_{p}$,
$N_{t}$), with minimal parameters. We keep this quality in mind when
investigating the next two models.

3\. Short + long exponential tail (4 parameters). The next modification to the
shape function we pursued replaces the step function with a second, longer
exponential component to the tail [11]. An example fit utilizing this double
exponential is shown in Fig. 4 (bottom left). This shape function does an
excellent job of producing high quality fits ($\chi_{R}^{2}\sim 1$) to the
tail and overall full spectrum. That boded well for this model. However, we
find that this tail shape function produces less robust fits (in terms of
variation of the fitting parameters) than the exponential + step function, and
also does an inferior job of accurately reproducing $E_{0}$, $\sigma$,
$N_{p}$, and $N_{t}$.

4\. Exponential + linear tail (4 parameters). The fourth option we explored is
not as well represented in previous literature. We combined the short
exponential tail with a linear function extending to lower energies. A fit
utilizing this function is shown in Fig. 4 (bottom right). This shape function
does an excellent job in fitting the extended tails, with $\chi_{R}^{2}\sim
1$, comparable to the double exponential function. However, this shape
function also provides robust fits and reliably reproduces the underlying
physical parameters ($E_{0}$, $\sigma$, $N_{p}$, $N_{t}$). Hence, we have
selected this shape function as the most promising to pursue in greater
detail.

##  4 Empirical Tailing Model

We arrive at a shape function that includes three core components: a Gaussian
peak (3 parameters: $A$, $E_{0}$, $\sigma$), a short exponential low-energy
tail (2 parameters: $B$, $\Gamma_{S}$), and a long linear low-energy tail (2
parameters: $C$, $D$). The latter two components need to be cut off at higher
energies ($E_{0}$) and lower energies ($E_{0}-E_{th}$), as well as effectively
broadened by a noise term (1 parameter, $\sigma_{t}$). This latter noise term
for the tail component, $\sigma_{t}$, is often assumed equal to the noise
terms in the Gaussian peak, $\sigma$, but not always [8, 10]. We have chosen
to keep this as a free parameter for now and check whether consistency between
these fitted parameters justifies setting them equal or not. Technically, the
low-energy cutoff introduces an additional parameter to these fits, but this
is a known parameter for our detectors and is fixed in these fits
($E_{th}=18\,keV$).

The shape function we have selected that reflects all of these components is
given by the equation (8 parameters):

$f(E)=Ae^{\frac{-(E-E_{0})^{2}}{2\sigma^{2}}}+[Be^{\Gamma(E-E_{0})}+C(1+D(E-E_{0}))]*[1-erf(\frac{E-E_{0}}{\sqrt{2}\sigma_{t}})]*[1+erf(\frac{E-E_{0}+E_{th}}{\sqrt{2}\sigma_{t}})]$
(2)

The last two terms in brackets represent the high- and low-energy cutoffs to
the two tail components.

Figure 5:  Example, $\tau=250\,ns$, $E_{0}=661.66\,keV$, fits of the full
shape function to full spectra (8 unconstrained parameters). The overall
quality of fit is excellent: (Left) electron signals, ($\chi_{R}^{2}=1.218$),
(Right) hole signals, ($\chi_{R}^{2}=1.104$). But as can seen in both plots
the full shape function fit shifts and broadens the Gaussian photopeak while
overestimating the number of counts in the true photopeak and underestimating
the number of counts in the low-energy tail. The true photopeak and low-energy
tail spectral components are shown for comparison with the relevant components
of the fitted shape function (dotted lines) to illustrate how the
unconstrained full shape function can incorrectly reflect the underlying
components of the spectra.

In Fig. 4 (bottom right) we show just the tail components of this shape
function (short exponential tail and longer linear tail) fit to the low-energy
tail model spectra, keeping all of the fit parameters free. The tail shape
function does an excellent job of recreating the profile of the simulated
tail. It also does an excellent job of reproducing the true physical
parameters that we are trying to uncover: the initial interaction energy,
$E_{0}$, and the number of counts in the low-energy tail, $N_{t}$.

However, we encounter a challenge when we try to fit the full shape function
(Eqn. 2) to the full spectral lines. As can be seen in Fig. 5, this fit with
eight unconstrained parameters does not adequately distinguish between the
low-energy tail events and the true photopeak events. The result is that the
fitted Gaussian peak is broader than the true photopeak, with the fitted peak
energy shifted to lower energies. The number of counts in the true photopeak
($N_{p}$) are overestimated, while the number of counts in the low-energy tail
($N_{t}$) are underestimated. Effectively this full shape function fit is
utilizing the eight (8) unconstrained fitting parameters to maximize the
quality of the empirical fit (i.e., minimize $\chi_{R}^{2}$) at the expense of
producing inaccurate physical numbers. While the quality of fit is promising,
this model as implemented with eight unconstrained parameters does not meet
our requirement that the shape function reliably reproduce the underlying
physical parameters when fit to the full spectrum.

##  5 Constrained Tailing Model

To address this challenge, we returned to our simulated low-energy tail
spectra and the tail shape function to see if there are modifications we can
make to the tail shape function to more robustly reproduce the actual tail
parameters when doing the full shape function fit to the full spectrum. Here
is where our ability to model the low-energy tail spectra separately from the
true photopeak spectra becomes particularly powerful. In Table 2 we show the
best-fit parameters for the tail model fit to the low-energy tail spectra for
a range of drift times characteristic of our germanium detectors. For these
fits we held the fit parameter $E_{0}$ fixed at the known photon interaction
energy (661.66 keV) since this parameter is primarily driven in the full shape
function fits by the Gaussian peak. When we look closely at these fit
parameters three significant trends pop out.

Electron signals |  |  |  |  |  |
---|---|---|---|---|---|---
$\tau$ [ns] |  $\Gamma$ [$keV^{-1}$] | $C/B$ |  $D$ [$keV^{-1}$] | $\sigma_{t}/\sigma$ | $N_{t}[fit/sim]$ | $\chi_{R}^{2}$
10 | 0.53 | 0.14 | 0.030 | 0.81 | 0.98 | 0.96
50 | 0.50 | 0.13 | 0.027 | 0.85 | 0.99 | 0.92
100 | 0.50 | 0.13 | 0.027 | 0.86 | 0.99 | 1.05
150 | 0.50 | 0.13 | 0.028 | 0.86 | 0.99 | 1.40
200 | 0.51 | 0.13 | 0.029 | 0.85 | 0.99 | 1.23
250 | 0.51 | 0.13 | 0.029 | 0.85 | 0.99 | 1.20
Ave | 0.50 | 0.13 | 0.029 | 0.85 |  |
|  |  |  |  |  |
Hole signals |  |  |  |  |  |
$\tau$ [ns] |  $\Gamma$ [$keV^{-1}$] | $C/B$ |  $D$ [$keV^{-1}$] | $\sigma_{t}/\sigma$ | $N_{t}[fit/sim]$ | $\chi_{R}^{2}$
10 | 0.51 | 0.15 | 0.030 | 0.85 | 0.98 | 0.87
50 | 0.49 | 0.13 | 0.028 | 0.86 | 0.99 | 1.51
100 | 0.50 | 0.13 | 0.029 | 0.85 | 0.99 | 1.45
150 | 0.51 | 0.14 | 0.030 | 0.85 | 0.99 | 1.31
200 | 0.50 | 0.13 | 0.029 | 0.85 | 0.99 | 1.29
250 | 0.51 | 0.13 | 0.030 | 0.84 | 0.99 | 1.33
Ave | 0.50 | 0.13 | 0.029 | 0.85 |  |
Table 2:  Best-fit parameters to the tail shape function holding $E_{0}$ fixed
at 661.66 keV but allowing all the other parameters to vary.

First, the parameter $\Gamma$ in the fit for the exponential component of the
low-energy tail does not vary significantly over the full range of drift
times, nor between electron signals versus hole signals. The limited range of
these best-fit values suggests that we can help stabilize the full shape
function fits by fixing $\Gamma$ for our tail shape function. We chose a value
of $\Gamma$ averaged over both the electron signals and the hole signals as
well as the range of drift times, weighted by the number of counts in the low-
energy tails. This averaging resulted in us fixing the parameter $\Gamma\equiv
0.50\,keV^{-1}$ (at $E_{0}=661.66\,keV$).

Figure 6:  Constrained fits to the full spectra, for three different drift
times. (Left) Electron signals, (Right) hole signals. The quality of fits and
corresponding fit parameters are listed in Table 3. The individual true
photopeak and low-energy tail components of both the model spectra and the
fitted shape function are shown for comparison but were not used in the
fitting.

The second trend that we can see in Table 2 is that the ratio of the
amplitudes of the linear tail to the exponential tail, $C/B$, also remains
nearly consistent over the range of drift times for both the electron signals
and the hole signals. This is our second clue to stabilizing the tail shape
function fits by fixing the ratio $C/B$. Based again on the weighted average,
we fixed the ratio $C/B\equiv 0.13$ (at $E_{0}=661.66\,keV$).

The third trend that we can see in Table 2 is that the slope of the linear
component of the tail, $D$, also remains nearly consistent over the range of
drift times for both the electron signals and the hole signals. This is our
third clue to stabilizing the tail shape function fits by fixing the slope
$D$. Based again on the weighted average, we fixed the slope $D\equiv
0.29\,keV^{-1}$ (at $E_{0}=661.66\,keV$).

Finally, the fourth trend that we can see in Table 2 is that the ratio of the
noise terms, $\sigma_{t}/\sigma$, also remains nearly constant over the range
of drift times for both the electron signals and the hole signals. This
provides our fourth clue for stabilizing the tail shape function fits by
fixing the ratio of these noise terms. Based again on the weighted average, we
fixed the ratio $\sigma_{t}/\sigma\equiv 0.85$. Notably, this ratio is not
unity, which justifies defining $\sigma_{t}$ as a separate parameter from
$\sigma$.

Electron signals |  |  |  |  |
---|---|---|---|---|---
$\tau$ [ns] |  $E_{0}$ [$keV$] |  $\sigma$ [$keV$] | $N_{p}[fit/sim]$ | $N_{t}[fit/sim]$ | $\chi_{R}^{2}$
10 | 661.66 | 1.15 | 1.00 | 1.00 | 1.20
50 | 661.66 | 1.15 | 1.00 | 0.99 | 0.98
100 | 661.66 | 1.15 | 1.00 | 0.98 | 1.33
150 | 661.65 | 1.15 | 1.01 | 0.97 | 1.24
200 | 661.65 | 1.15 | 1.01 | 0.97 | 1.31
250 | 661.64 | 1.16 | 1.02 | 0.97 | 1.39
|  |  |  |  |
Hole signals |  |  |  |  |
$\tau$ [ns] |  $E_{0}$ [$keV$] |  $\sigma$ [$keV$] | $N_{p}[fit/sim]$ | $N_{t}[fit/sim]$ | $\chi_{R}^{2}$
10 | 661.66 | 1.15 | 1.00 | 0.99 | 0.92
50 | 661.66 | 1.15 | 1.00 | 0.99 | 0.96
100 | 661.65 | 1.15 | 1.00 | 0.99 | 0.86
150 | 661.65 | 1.15 | 1.00 | 0.98 | 1.02
200 | 661.64 | 1.16 | 1.01 | 0.98 | 1.17
250 | 661.63 | 1.16 | 1.02 | 0.97 | 1.18
Table 3:  Best-fit parameters for constrained fits to the full spectra. The
simulated spectra assume $E_{0}=661.66\,keV$ and $\sigma=1.15\,keV$. The full
shape function with constrained parameters ($\Gamma$, $C/B$, $D$,
$\sigma_{t}/\sigma$ held fixed) still produces high-quality fits with
$\chi_{R}^{2}$ comparable to the unconstrained version, but reliably
reproduces $E_{0}$, $\sigma$, $N_{p}$, and $N_{t}$.

By fixing the parameters $\Gamma$, $C/B$, $D$, and $\sigma_{t}/\sigma$, we
have effectively reduced the number of free parameters in our shape function
from eight (8) to four (4), just one additional parameter over the pure
Gaussian peak ($B$). This additional parameter is effectively the amplitude of
the low-energy tail component.

In Fig. 6 we show simulated spectra ($E_{0}=661.66\,keV$) fit to the refined
shape function, Eqn. 2 with $\Gamma$, $C/B$, $D$, and $\sigma_{t}/\sigma$ held
fixed. The constrained shape function still does an excellent job in
reproducing the overall shape of the full spectrum. It also does a better job
of characterizing the underlying true photopeak and low-energy tail spectra.
Most importantly, this constrained shape function reliably reproduces the
underlying physical parameters as documented in Table 3. The quality of fits
($\chi_{R}^{2}$) remain good for the full range of drift times. The true
photopeak parameters, $E_{0}$ and $\sigma$ are consistently reproduced in the
fits, and the number of counts within the true photopeak ($N_{p}$) are
reliably reproduced with $\leq 2\%$ systematic error, and the number of counts
within the low-energy tail ($N_{t}$) with $\leq 3\%$ systematic error. So far,
as verified at $E_{0}=661.66\,keV$ at least, this constrained tail fit has met
our goals for the shape function (quality of fit, reliable parameter
estimates, minimal parameters).

$E_{0}$ [keV] |  $<\Gamma>$ [$keV^{-1}$] | $<C/B>$ |  $<D>$ [$keV^{-1}$] | $<\sigma_{t}/\sigma>$ | $<\chi_{R}^{2}>$
---|---|---|---|---|---
59.54 | 0.55 | 0.15 | 0.025 | 0.85 | 1.21
122.06 | 0.55 | 0.14 | 0.028 | 0.85 | 1.17
356.02 | 0.52 | 0.14 | 0.029 | 0.85 | 1.17
511.00 | 0.51 | 0.13 | 0.029 | 0.85 | 1.25
661.66 | 0.50 | 0.13 | 0.029 | 0.85 | 1.26
898.04 | 0.50 | 0.13 | 0.028 | 0.84 | 1.21
1173.24 | 0.49 | 0.13 | 0.028 | 0.84 | 1.19
1274.53 | 0.48 | 0.13 | 0.028 | 0.85 | 1.16
1332.50 | 0.48 | 0.13 | 0.027 | 0.85 | 1.11
1674.73 | 0.47 | 0.13 | 0.027 | 0.85 | 1.16
1836.06 | 0.46 | 0.12 | 0.027 | 0.85 | 1.19
Table 4:  Best-fit parameters at various interaction energies $E_{0}$ to the
tail shape function, averaged over electrons and holes as well as drift times,
holding $E_{0}$ fixed but allowing all the other parameters to vary. These
spectral simulations assume a point-like initial interaction (see Section 7).
These parameters are also plotted in Fig. 8.

##  6 Generalization to Other Energies

Our constrained shape function works well for fitting the spectrum of
monoenergetic interactions at 661.66 keV (${}^{137}Cs$). The immediate
question is whether the constrained shape function can adequately meet our
requirements for fitting at other $\gamma$–ray energies. To answer this
question we reproduced the analysis above for a range of additional energies,
representing common laboratory calibration source monoenergetic line energies:
59.54 keV (${}^{241}Am$), 122.06 keV (${}^{57}Co$), 356.02 keV (${}^{133}Ba$),
511.00 keV (${}^{22}Na$), 898.04 keV (${}^{88}Y$), 1173.24 keV (${}^{60}Co$),
1274.54 keV (${}^{22}Na$), 1332.50 keV (${}^{60}Co$), 1674.73 keV
(${}^{58}Co$), and 1836.06 keV (${}^{88}Y$). The primary factors that vary in
the detector response for these energies are that the measured noise
$\sigma_{m}$ increases with energy (Eqn. 1), and the effects of repulsion on
the charge cloud profile are larger at higher energies [5]. Table 4 documents
the average best-fit parameters over this range of energies. The quality of
fit ($<\chi_{R}^{2}>$) remains very good over the full range of energies. As
at $661.66\,keV$, $\Gamma$, $C/B$, and $D$ do not vary significantly for a
given interaction energy between electron signals and hole signals and as we
varied the drift times, _but the average values of these parameters do vary
with photon energy itself._ The ratio $<\sigma_{t}/\sigma>$ varies very little
with energy, remaining nearly constant at $<\sigma_{t}/\sigma>\sim 0.85$.

Figure 7:  Example constrained shape function fits. (Top Left) 59.54 keV,
electron signals ($\chi_{R}^{2}=1.21$). (Top Right) 59.54 keV, hole signals
($\chi_{R}^{2}=1.03$). (Bottom Left) 1173.23 keV, electron signals
($\chi_{R}^{2}=1.05$). (Bottom Right) 1173.23 keV, hole signals
($\chi_{R}^{2}=1.20$). $E_{0}$, $\sigma$, $N_{p}$, and $N_{t}$ remain well
reproduced by the fits.

In Fig. 7 we show example fits for 59.54 keV and 1173.23 keV model spectra,
for drift times of 250 ns (maximum tailing), utilizing the energy-specfic
fixed parameters from Table 4. The quality of fits remain excellent despite
the wide range in energy.

##  7 Extended Initial Charge Cloud

Now we turn to the impact of extended charge distributions of electron-hole
pairs created by the recoil electron following the initial $\gamma$–ray
interaction. Extended initial charge cloud distributions will become
increasingly important for higher interaction energies, such as those we are
measuring in $\gamma$–ray applications of our germanium detectors. In Boggs
[5], we discussed a simple approach to modeling the effects of initially
extended charge clouds by assuming that the initial charge cloud can be
approximated at $t=0$ as a sphere of uniform charge density and finite radius
$R_{0}$. The size of this initial charge cloud can be estimated using the
practical electron range, $D_{p}$, in germanium as a function of recoil
electron energy, which can be estimated by the following formula [13]:

$D_{p}(E)=\alpha E[1-\beta/(1+\gamma E)]$ (3)

With $\alpha=0.83\,\mu m\cdot keV^{-1}$, $\beta=0.9841$, and
$\gamma=0.0030\,keV^{-1}$. This estimate of the practical range for electrons
in germanium is accurate to $\sim 10\%$, which is adequate for our purposes.
For our charge cloud estimates, we assume for a given $E_{0}$ that
$R_{0}=D_{p}/2$, effectively that the recoil electron deposits its energy
uniformly in a sphere with a diameter equal to the full practical range. This
assumption is conservative, overestimating the full extent of the initial
charge cloud and hence the impacts of charge sharing on simulated tail
spectra.

We have repeated the analysis performed above for the characteristic
$\gamma$–ray calibration energies of fitting the low-energy tail spectra and
determining the average best-fit parameters. These results are shown in Table
5 and Fig. 8. These results show that the adopted tail shape function
continues to provide an excellent fit to the tail spectra, both in terms of
quality of fit ($<\chi_{R}^{2}>$) as well as reproducing the physical
parameters, even when the spectra include the effects of an extended initial
charge cloud. Below interaction energies of $\sim 1000\,keV$ the recoil
electron range has little effect on the fits. At higher energies, we can start
to see slight divergence in the best-fit parameters for $<\Gamma>$, $<C/B>$,
and $<D>$ compared to the point interaction case, though the ratio
$<\sigma_{t}/\sigma>$ remains largely unchanged between the two cases.

$E_{0}$ [keV] |  $<\Gamma>$ [$keV^{-1}$] | $<C/B>$ |  $<D>$ [$keV^{-1}$] | $<\sigma_{t}/\sigma>$ | $<\chi_{R}^{2}>$
---|---|---|---|---|---
59.54 | 0.56 | 0.16 | 0.026 | 0.85 | 1.25
122.06 | 0.55 | 0.14 | 0.028 | 0.85 | 1.18
356.02 | 0.52 | 0.14 | 0.029 | 0.85 | 1.23
511.00 | 0.51 | 0.13 | 0.029 | 0.85 | 1.23
661.66 | 0.50 | 0.13 | 0.028 | 0.85 | 1.26
898.04 | 0.50 | 0.13 | 0.028 | 0.84 | 1.20
1173.24 | 0.48 | 0.13 | 0.027 | 0.85 | 1.11
1274.53 | 0.48 | 0.14 | 0.027 | 0.85 | 1.21
1332.50 | 0.47 | 0.14 | 0.026 | 0.85 | 1.11
1674.73 | 0.45 | 0.14 | 0.025 | 0.86 | 1.30
1836.06 | 0.44 | 0.15 | 0.024 | 0.85 | 1.13
Table 5:  Extended initial charge cloud. Best-fit parameters at various
interaction energies $E_{0}$ to the tail shape function, averaged over
electrons and holes as well as drift times, holding $E_{0}$ fixed but allowing
all the other parameters to vary. These spectral simulations assume a
spherical extended initial charge cloud. These parameters are also plotted in
Fig. 8.

Given that our initial analysis in Section 6 ignored the recoil electron range
by assuming the initial charge clouds were concentrated at a single point, and
the analysis in this section overestimates the effects of extended initial
charge clouds by assuming spherical symmetry, we anticipate that the best-fit
parameters for a realistic initial charge cloud distribution would lie
somewhere between these two extremes. As seen in Table 4 and Table 5, these
parameters are identical below $\sim 1000\,keV$. For higher energies, we can
average the results for the two extreme cases to give an estimate of the best-
fit parameters for realistic initial charge cloud distributions. Curve fits to
the average of these best-fit parameters are plotted in Fig. 8. Fortunately,
these parameters vary smoothly and predictably as a function of $\gamma$–ray
interaction energy. The energy dependence ($[E]=keV$) of the parameter
$\Gamma(E)$ is fit by the function:

$\Gamma(E)=0.547-(5.39\times 10^{-5})E;[\Gamma]=keV^{-1}$ (4)

The ratio $C/B(E)$ is fit by the function:

$C/B(E)=0.131+\frac{1.44}{E}$ (5)

The parameter $D(E)$ is fit by the function:

$D(E)=0.0312-\frac{0.336}{E}-(3.13\times 10^{-6})E;[D]=keV^{-1}$ (6)

We can effectively fix $\sigma_{t}/\sigma\equiv 0.85$ for all energies.
Characterization of these trends enable us to utilize the constrained tail
shape function at arbitrary photopeak energies with some confidence that we
are accounting for the finite range of the initial recoil electron.

Figure 8:  The best-fit average tail shape function parameters $<\Gamma>$,
$<C/B>$, $<D>$, and $<\sigma_{t}/\sigma>$ for our range of interaction
energies, showing the parameters derived for point-like initial interactions
(crosses) and extended initial charge clouds (diamonds). Also shown are the
best-fit curves (dotted lines) to $\Gamma(E)$ (Eqn. 4), $C/B(E)$ (Eqn. 5), and
$D(E)$ (Eqn. 6) for the average of these two extreme cases.

##  8 Discussion

In order to optimize the spectral performance of high resolution germanium
detectors, very careful energy calibrations need to be performed using
monoenergetic $\gamma$–ray line sources of known energies. As seen with the
simple Gaussian fits to the true asymmetric line profiles presented in Section
2, utilizing ill-fitting shape functions to fit the asymmetric line profiles
will lead to incorrect determination of the true photoabsorption peak, and
hence skew the subsequent energy calibrations for the detector. Conversely,
detailed analysis of scientific spectral data requires a detailed
understanding of the instrumental line profiles to accurately identify line
energies, as well as potential Doppler broadening and shifts – important
factors in our astrophysical program.

In this work we have considered the effects of charge sharing as the dominant
factor in creating low-energy tails in our multi-electrode germanium
detectors. We have not included charge trapping in these spectral simulations.
While charge trapping can be a significant factor in producing low-energy
tails in germanium detectors, our ability to measure the full 3-D position of
photon interactions within our detector volume allows us to largely correct
the effects of trapping on the collected spectra. The details of the charge
trapping correction are beyond the scope of this current work, but suffice it
to say that our work to correct the effects of charge trapping largely led to
our in-depth analysis of spectral profiles presented in this paper.

One of the advantages of the work presented here is the simplicity of the
simulations used to generate the charge-sharing spectra, as well as the
simplicity of the shape function used to characterize the resulting photopeaks
and low-energy tails. While the shape function utilized in this work produces
complicated line profiles, these profiles reliably reproduce the underlying
physical parameters of the simulated spectra with only one additional
parameter over a simple Gaussian peak.

The shape function developed in this work has multiple future applications to
the COSI program. The line profile will enable us to accurately perform the
energy calibration of the instrument, including characterizing and correcting
the effects of charge trapping in the detectors. The profiles themselves
provide a useful tool for simulating the expected spectral performance of the
instrument. Finally, the shape function will be a critical component in the
scientific analysis and interpretation of the astrophysical data.

##  9 Acknowledgements

This work was supported by the NASA Astrophysics Research and Analysis (APRA)
program, grant 80NSSC21K1815. Thanks to J. Tomsick for feedback on this work.

## References

  * Kierans et al. [2017] C. A. Kierans, S. E. Boggs, J.-L. Chiu, A. Lowell, C. Sleator, J. A. Tomsick, A. Zoglauer, M. Amman, H.-K. Chang, C.-H. Tseng, et al.,  The 2016 super pressure balloon flight of the compton spectrometer and imager,  arXiv preprint arXiv:1701.05558 (2017).
  * Sleator et al. [2019] C. C. Sleator, A. Zoglauer, A. W. Lowell, C. A. Kierans, N. Pellegrini, J. Beechert, S. E. Boggs, T. J. Brandt, H. Lazar, J. M. Roberts, et al.,  Benchmarking simulations of the compton spectrometer and imager with calibrations,  Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment 946 (2019) 162643.
  * Tomsick et al. [2021] J. A. Tomsick, S. E. Boggs, A. Zoglauer, E. Wulf, L. Mitchell, B. Phlips, C. Sleator, T. Brandt, A. Shih, J. Roberts, P. Jean, P. von Ballmoos, J. M. Oliveros, A. Smale, C. Kierans, D. Hartmann, M. Leising, M. Ajello, E. Burns, C. Fryer, P. Saint-Hilaire, J. Malzac, F. Tavecchio, V. Fioretti, A. Bulgarelli, G. Ghirlanda, H.-K. Chang, T. Takahashi, K. Nakazawa, S. Matsumoto, T. Melia, T. Siegert, A. Lowell, H. Lazar, J. Beechert, H. Gulick, The compton spectrometer and imager project for mev astronomy, 2021. URL: https://arxiv.org/abs/2109.10403. doi:10.48550/ARXIV.2109.10403.
  * Amman et al. [2007] M. Amman, P. N. Luke, S. E. Boggs,  Amorphous-semiconductor-contact germanium-based detectors for gamma-ray imaging and spectroscopy,  Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment 579 (2007) 886–890.
  * Boggs [2023] S. E. Boggs,  Modeling charge cloud dynamics in cross strip semiconductor detectors,  Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment (2023) 168310.
  * Jorch and Campbell [1977] H. Jorch, J. Campbell,  On the analytic fitting of full energy peaks from ge (li) and si (li) photon detectors,  Nuclear Instruments and Methods 143 (1977) 551–559.
  * Longoria et al. [1990] L. Longoria, A. Naboulsi, P. Gray, T. MacMahon,  Analytical peak fitting for gamma-ray spectrum analysis with ge detectors,  Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment 299 (1990) 308–312.
  * McNelles and Campbell [1975] L. McNelles, J. Campbell,  Analytic approximations to peak shapes produced by ge (li) and si (li) spectrometers,  Nuclear Instruments and Methods 127 (1975) 73–81.
  * Helmer and Lee [1980] R. Helmer, M. Lee,  Analytical functions for fitting peaks from ge semiconductor detectors,  Nuclear Instruments and Methods 178 (1980) 499–512.
  * Phillips and Marlow [1976] G. W. Phillips, K. W. Marlow,  Automatic analysis of gamma-ray spectra from germanium detectors,  Nuclear Instruments and Methods 137 (1976) 525–536.
  * Varnell and Trischuk [1969] L. Varnell, J. Trischuk,  A peak-fitting and calibration program for ge (li) detectors,  Nuclear Instruments and Methods 76 (1969) 109–114.
  * Pike et al. [2022] S. N. Pike, M. S. Mandigo-Stoba, F. A. Harrison, W. R. Cook, B. W. Grefenstette, H. Miyasaka,  Properties of redlen cadmium zinc telluride with respect to x-ray spectroscopy,  Journal of Astronomical Telescopes, Instruments, and Systems 8 (2022) 046002\.
  * Wohl et al. [1984] C. Wohl, R. Cahn, A. Rittenberg, T. Trippe, G. Yost, F. Porter, J. Hernandez, L. Montanet, R. Hendrick, R. Crawford, et al.,  Review of particle properties,  Reviews of Modern Physics 56 (1984) S1.