1 Introduction

Advanced scientific applications of high-purity germanium (HPGe) detectors often require a quantitative understanding on how the detector signal depends on the event topology. This requires a realistic simulation of the detector. Example applications are searches for physics beyond the Standard Model such as neutrinoless double-beta decay [1,2,3,4,5] and dark matter [6,7,8]. In such rare-event searches, it is essential to distinguish between signal and background events based on the shape of the detector signal.

A very important input to the simulation of HPGe detectors is the impurity density distribution, \(\zeta \), of the electrically active impurities in the germanium crystal as it strongly influences the electric potential, \(\Phi \). The calculation of \(\Phi \) is the first step in the simulation of an HPGe detector. Software packages like SolidStateDetectors.jl [9] (SSD), MJDSigGen [10] or the AGATA Detector Library [11] are able to perform a full simulation of HPGe detectors from field calculation to signal formation. It is crucial, though, to use the correct \(\zeta \) to obtain the correct electric field, which influences the drift of the charge carriers and, thus, the formed pulses. Often, the impurity density is measured via the Hall effect at different heights of a drawn crystal ingot by cutting thin slices out of the ingot. However, there is a rather large uncertainty on these impurity measurements and, in addition, assumptions have to be made how the impurity density changes in between. Usually, only a linear or quadratic change of the impurity density between the bottom and the top of a cylindrically shaped crystal is assumed. If an incorrect model for \(\zeta \) is assumed, wrong conclusions can be drawn in studies involving the subsequent parts of the simulation, e.g. in studies involving the mobility tensor.

An HPGe detector is, in principle, a \(p-n\) diode operated in reversed bias mode. The extent of the depleted volume for different bias voltages, \(U_B\), depends on \(\zeta \). The undepleted volumes are extensions of the detector contacts. Thus, the capacitance between those contacts depends on \(U_B\) and \(\zeta \). Therefore, \(\zeta \) can be studied by measuring the capacitance for different \(U_B\), a C–V curve, and comparing it to simulated C–V curves for different \(\zeta \).

Past work by Bruyneel et al. [12, 13] has shown that it is indeed possible to determine impurity density parameters based on C–V measurements. It was, however, limited to a best-fit approach without uncertainty estimates and with very few free parameters. Moving beyond this to impurity density models that have many free parameters and fully exploring such parameter spaces is very challenging due to the high numerical cost: Simulating a C–V curve requires repeated and numerically expensive field calculations. Even with the GPU-accelerated implementation in SSD and using multiple GPUs in parallel, it takes a few minutes to calculate one C–V curve. It is, therefore, prohibitive to perform these calculations directly during parameter inference as a proper exploration of the parameter space would take a very long time. The novel method presented here circumvents this problem by replacing the exact capacitance calculations with a machine-learned approximation function. It comprises the following steps:

  1. 1.

    Definition of a model for \(\zeta \) for a detector and including the allowed parameter space for its parameters, p.

  2. 2.

    Quasi-random generation of N parameters sets: \(X = \{p_i\}\) for \(i \in [1,N]\).

  3. 3.

    Calculation of the capacitance, \(c_i\), via SSD for each element of X: \(Y= \{c_i\}\) for \(i \in [1,N]\).

  4. 4.

    Training of a deep neural network, \({\mathcal {DNN}}\), on the generated data set: (X|Y).

  5. 5.

    Bayesian inference of the model on a measured C–V curve using the trained \({\mathcal {DNN}}\).

The generation of Y via field calculations can take a few days. Afterwards, the trained \({\mathcal {DNN}}\) can predict capacitances very quickly and with sufficient accuracy. This makes it possible to perform a Bayesian exploration of the full parameter space.

Note that this method can be used for detector optimisation in general: not only to fit \(\zeta \) but also to find optimal values for other design parameters of a detector.

2 Detector capacitance matrix

An HPGe detector with \(N \ge 2\) contacts can be seen as a system of N conductors which are capacitively coupled. A schematic of the capacitances for a system of two conductors is shown in Fig. 1.

Fig. 1
figure 1

Schematic of the capacitances for a system of two conductors on potentials \(U_i\) with charges \(Q_i\) together with the corresponding mutual, \({\textbf{C}}\), and Maxwell, \({\textbf{C}}^{*}\) capacitance matrices

The mutual capacitance, \(c_{ij}\), between two conductors i and j is defined as

$$\begin{aligned} c_{ij} = \dfrac{\partial Q_i}{\partial U_j}, \end{aligned}$$
(1)

where \(\partial Q_i\) is the change in charge on conductor i for a change in potential, \(\partial U_j\), of conductor j. The mutual capacitance is symmetric: \(c_{ij} = c_{ji}\). The self capacitance of conductor i, \(c_{ii}\), can be understood as a mutual capacitance where the other conductor is a grounded closed surface surrounding conductor i. In absence of any surroundings, this surface can be imagined as a grounded sphere with an infinite radius. In case of a typical HPGe detector in a grounded cryostat, the surface is defined through the grounded walls of the cryostat and the grounded parts of the holding structure of the detector.

The different \(c_{ij}\) are the elements of the so-called mutual capacitance matrix \({\textbf{C}}\). However, when working with a system of conductors, it is usually not very practical to work with \({\textbf{C}}\) as the elements cannot be studied individually. Therefore, the so-called Maxwell capacitance matrix [14],

$$\begin{aligned} {\textbf{C}}^{*} = \begin{bmatrix} c_{11}^{*} &{} \dots &{} c_{1N}^{*} \\ \vdots &{} \ddots &{} \vdots \\ c_{N1}^{*} &{} \dots &{} c_{NN}^{*} \end{bmatrix} = \begin{bmatrix} \sum \limits _{i=1}^{N}c_{1i} &{} -c_{12} &{} \dots &{} -c_{1N} \\ -c_{21} &{} \sum \limits _{i=1}^{N}c_{2i} &{} \dots &{} -c_{2N}\\ \vdots &{} \vdots &{} \ddots &{} \vdots \\ -c_{N1} &{} -c_{N2} &{} \dots &{} \sum \limits _{i=1}^{N}c_{Ni} \end{bmatrix}, \nonumber \\ \end{aligned}$$
(2)

is introduced which is generally more practical as it connects the potentials of all conductors, \({\vec {U}} = (U_1, \ldots , U_N)\), with the charges on all conductors, \({\vec {Q}} = (Q_1, \ldots , Q_N)\) via

$$\begin{aligned} {\vec {Q}} = {\textbf{C}}^{*} \cdot {\vec {U}} . \end{aligned}$$
(3)

The \({\textbf{C}}^{*}\) notation can be distinguished from the \({\textbf{C}}\) notation through its negative off-diagonal elements with

$$\begin{aligned} c_{ij}^{*} = -c_{ij} \quad \forall \,i \ne j. \end{aligned}$$
(4)

The elements of \({\textbf{C}}^{*}\) can be calculated [15] through the weighting potentialsFootnote 1 of the contacts, \({\mathcal {W}}_i\):

$$\begin{aligned} c_{ij}^{*} = \epsilon _0 \int _{V_{\textrm{W}}} \nabla {\mathcal {W}}_i({\vec {r}}) \cdot \epsilon _r({\vec {r}}) \cdot \nabla {\mathcal {W}}_j({\vec {r}})\,d{\vec {r}}, \end{aligned}$$
(5)

where \(\epsilon _0\) is the vacuum permittivity and \(\epsilon _r\) the relative permittivity of the medium at position \({\vec {r}}\). The integral is over the closed system volume \(V_{\textrm{W}}\).

Since the \(c_{ij}^{*}\) depend on \({\mathcal {W}}_i\) and \(\epsilon _r({\vec {r}})\), they depend on the geometry of the detector and its environment. If the detector is not fully depleted, the contacts which are touching these undepleted regions become enlarged, which is an effective change of geometry. The enlargement of the contacts depends on \(\zeta \) and \(U_B\). Thus, for a detector in a fixed environment, the capacitances become dependent on two variables:

$$\begin{aligned} c_{ij}^{*} = c_{ij}^{*}(\zeta , U_B). \end{aligned}$$
(6)

The absolute values of \(c_{ij}^{*}\) decrease with increasing \(U_B\). The \(U_B\) at which the detector becomes fully depleted is called the full-depletion voltage, \(U_B^{\textrm{fd}}(\zeta )\). For \(U_B > U_B^{\textrm{fd}}(\zeta )\), the values of \(c_{ij}^{*}\) basically do not change anymore. Thus, there are lower limits on the absolute values for the elements of \({\textbf{C}}^{*}\) for a given \(\zeta \):

$$\begin{aligned} c_{ij}^{l}(\zeta ) = |c_{ij}^{*}(U_B^{\textrm{fd}}(\zeta ))|. \end{aligned}$$
(7)

It should be noted here that a capacitance is an electrostatic quantity and is not frequency dependent. The reactance is the quantity which introduces a frequency dependence.

3 The experimental setup K1 and the detector Super-Siegfried

The test stand K1 is a small vacuum chamber with a cooling finger submerged directly in a liquid-nitrogen dewar. The n-type true-coaxial HPGe detector Super-Siegfried [16] was mounted on a special base plate which fitted on the cooling finger inside K1. The detector, together with the necessary holding structure, is depicted in Fig. 2. Closely around the holding structure a so-called hat is placed on top of the base plate, see in Fig. 3. The hat has an inner radius of 55 mm, an inner height of 105 mm and serves as an infrared shield. The base plate, the holding structure and the hat are all grounded.

Fig. 2
figure 2

Super-Siegfried within its grounded holding structure as mounted on the grounded base plate

Fig. 3
figure 3

Grounded infrared shield (hat) surrounding Super-Siegfried and its holding structure

The detector has a length of \(l_{\textrm{D}} = 70\) mm and a radius of 37.5 mm. The borehole has a radius of 5 mm and at the top and the bottom; it widens to a radius of 10 mm within about 3 mm. The inner borehole of Super-Siegfried is the only \(n^+\) contact and the mantle is divided into 19 \(p^+\) segments. For the measurements presented in this paper, the segments were not read-out separately, but were connected together into one single \(p^+\) contact. The \(n^+\) contact is lithium drifted and the \(p^+\) segments are established through boron implantation. The manufacturer provided two values for the impurity level at the top and at the bottom of the detector:

$$\begin{aligned} \zeta _{\textrm{M}}^{\textrm{top}}&= 0.44\cdot 10^{10}\,{\textrm{cm}}^{-3}, \nonumber \\ \zeta _{\textrm{M}}^{\textrm{bot}}&= 1.30\cdot 10^{10}\,{\textrm{cm}}^{-3}. \nonumber \end{aligned}$$

The operation voltage of the detector suggested by the manufacturer is 3000 V.

As the \(p^+\) segments are connected to form only one contact, the capacitance matrix of the detector is a \(2\times 2\) matrix as shown in Fig. 1, where the \(n^+\) and the \(p^+\) contacts are the two conductors 1 and 2. The base plate, holding structure and hat form the grounded shell around the two contacts. This is also shown in Fig. 4, which shows the schematic for the measurements of the mutual capacitance between the two contacts, \(c_{12}\). This is similar to what has been described in [13].

Fig. 4
figure 4

Schematic of the electronics used for the measurements of \(c_{12}\) of Super-Siegfried in K1

\(U_B\) is applied to the \(n^+\) contact and the \(p^+\) contact is held at ground over a termination resistor, \(R_2\). A pulse generator is connected to the \(p^+\) contact over its internal resistor, \(R_{\textrm{PG}}\), and an additional resistor \(R_1\) which serves in combination with \(R_2\) as a voltage divider. To measure \(c_{12}\), rectangular pulses with an amplitude of \(U_{\textrm{PG}}\) were generated and injected into the \(p^+\) contact. This corresponds to a change in the potential \(U_2\) which translates into a change of charge on the \(n^+\) contact, \(Q_1\), via Eq. (3):

$$\begin{aligned} Q_1 = - c_{21} \cdot U_2. \end{aligned}$$
(8)

Thus, given the electronic circuit, the measured capacitance, \(c_{12}^{\text {m}}\), can be calculated for different \(U_B\) from the measured \(Q_1(U_B)\) as

$$\begin{aligned} c_{12}^{\text {m}}(U_B) = \dfrac{-Q_1(U_B)}{U_{2}} = \dfrac{-Q_1(U_B)}{U_{\textrm{PG}} \cdot \left( \dfrac{R_{2}}{R_{\textrm{PG}} + R_1 + R_2}\right) }, \end{aligned}$$
(9)

where the values for the different components are \(R_{\textrm{PG}} = 50\,\Omega \), \(R_{1} = 6190\,\Omega \), \(R_{2} = 51.4\,\Omega \,\) and \(U_{\textrm{PG}} = 126\,{\textrm{mV}}\).

\(Q_1(U_B)\) was extracted from the induced pulses in the \(n^+\) contact as follows: The \(n^+\) contact was connected to a charge-sensitive preamplifier circuit typically used to read-out germanium detectors. The amplified signals were recorded with a sampling rate of 250 MHz and a pulse length of 20 µs by a Struck SIS3316 [17] analog-to-digital converter unit (ADC). The recorded pulses were inverted (\(\Rightarrow -Q_1\) becomes \(+Q_1\) in Eq. (9)), corrected for the decay of the charge in the amplification circuit and were calibrated [18, 19]. The parameters of the decay correction and calibration of the read-out circuit (preamplifier together with the ADC) were determined from pulses of background gamma events of known energy of a measurement at \(U_B = 3000\) V. An assumption made here is that the parameters of the decay correction and calibration are independent of \(U_B\) or, respectively, \(c_{12}\). After the decay correction and calibration, recorded pulses are often given in units of energy. For this study, the values were converted into charge pulses, Q(t), in units of charge, pC, based on the ionisation energy of germanium of 2.95 eV [20].

For \(U_B \ge U_B^{\textrm{fd}}\), the recorded pulses are rectangular pulses and their amplitude corresponds to \(Q_1\). This is, however, not the case for \(U_B < U_B^{\textrm{fd}}\). This is shown for three different \(U_B\) in Fig. 5.

Fig. 5
figure 5

Recorded response of the \(n^{+}\) contact of Super-Siegfried in K1 to generated rectangular pulses injected into the \(p^{+}\) contact for different \(U_B\). The zoom-in plot shows the fit of Q(t), see Eq. (10), to the tail of the pulse for \(U_{B} = 25\) V

Partially depleted detectors have to be modeled differently [21] within an electric circuit as shown in Fig. 6.

Fig. 6
figure 6

Schematic of the electronics describing a a fully depleted and b an only partially depleted detector with only two contacts. The depleted part is modeled with \(c_{12}\) while the undepleted part is modeled as an RC circuit with resistance \(R_{\textrm{u}}\) and capacitance \(c_{\textrm{u}}\)

The undepleted volume can be described as an additional RC component introducing also a frequency dependence to the signal and leading to longer pulses. This can be calculated for one dimensional systems [21]. In reality, that is usually very complicated. However, here, it is not necessary as we are only interested in the total charge, \(Q_t\), flowing through the circuit which can be determined by fitting the tail of Q(t) with

$$\begin{aligned} Q(t) = Q_{{\textrm{t}}} - Q_{\textrm{u}} \cdot e^{-t/\tau _{\textrm{u}}}, \end{aligned}$$
(10)

where \(Q_t\), \(Q_u\) and \(\tau _u\) are fit parameters. This is also illustrated in Fig. 5.

It should be noted that also single-segment to core capacitances could be measured by this technique if the segments would not be combined. These capacitances would be more sensitive to \(\zeta \) in the volume close to the respective segment. Hence, the \(\zeta \) dependence on z, and even a possible dependence on \(\varphi \), could be investigated more accurately. However, this would require to keep the other segments on the same potential as the core. Since the segment boundaries of this detector are very thin, \(\approx 0.5\) mm, such measurements would bear a great risk to damage the detector by a possible break through since there would be a very strong electric field of about 6 kV/mm.

4 Measurement of the C–V curve

The detector was operated at 60 different bias voltages,

$$\begin{aligned} U_{B,k} = 25\,{\textrm{V}} + (k-1) \cdot 50\,{\textrm{V}}\quad \forall ~k \in \{1, 2, \ldots , 60\}. \end{aligned}$$
(11)

Each measurement lasted 600 s. For lower \(U_{B,k}\), most of the observed pulses were induced by the pulse generator. For increasing \(U_{B,k}\), more pulses induced by gammas from natural radioactivity were recorded as the depleted volume and, thus, the active volume of the detector increased. However, the peak created by the pulse generator was always clearly identifiable. The spectra of \(Q_t\) of all pulses from all 60 measurements are shown in Fig. 7. For all measurements, the events induced by the pulse generator form a peak. The mean values of these peaks, \(Q_{{\textrm{t}},k}^{\upmu ,{\textrm{m}}}\), were determined by fits of scaled normal distributions as shown in Fig. 7.

Fig. 7
figure 7

Histograms of \(Q_{{\textrm{t}}}\) for different \(U_B\). The most dominant peak in each spectrum comes from pulser events. The \(Q_t\) from pulser events decreases for increasing \(U_B\). For higher bias voltages, also events from background events, mainly from environmental gammas, become visible in the range [0, 0.14] pC. The peak corresponding to events from 2614 keV gammas from the Tl\(^{208}\) decay is labelled. Inset: The fit to the peak of pulser events at \(U_B = 25\) V. The fitted parameter \(Q_{{\textrm{t}},k=1}^{\upmu ,{\textrm{m}}}\) is shown as a vertical line

Using Eq. (9), the determined \(Q_{{\textrm{t}},k}^{\upmu ,{\textrm{m}}}\) were converted to \(c_{12}^{{\textrm{m}},{\textrm{k}}}\) for all \(U_{B,k}\). The resulting C–V curve, \(c_{12}^{{\textrm{m}},k}\), is shown in Fig. 8a.

Fig. 8
figure 8

a C–V curve of Super-Siegfried as measured in K1. The error bars represent uncertainties conservatively determined by assuming 3% uncertainties on \(Q_{{\textrm{t}},k}^{\upmu ,{\textrm{m}}}\), \(R_{\textrm{PG}}\), \(R_{1}\), \(R_{2}\) and \(U_{\textrm{PG}}\) and using Gaussian error propagation. The uncertainties are highly correlated. b Negative differences, \(- \Delta c_{12}^{{\textrm{m}}}/\Delta U_B\), between the data points in a

As mentioned earlier, in theory, \(c_{12}\) should not change anymore for \(U_B > U_B^{\textrm{fd}}\). This does not take into account that the contacts are regions of the detector, which are doped more than three orders of magnitude higher than the bulk. With increasing \(U_B\), also very small volumes of the contacts become depleted. However, for reasonable values of \(U_B\) below the break-through voltage, the contacts never become completely depleted and \(-\partial c_{12}^{{\textrm{m}}} / \partial U_B\) never becomes entirely zero. This is demonstrated in Fig. 8b. Therefore, it is not trivial in general to define \(U_B^{\textrm{fd}}\). Here, we define it as \(-\Delta c_{12}^{{\textrm{m}}} / \Delta U_B \overset{!}{=}\ 10^{-3}\) pF/V: \(U_B^{\textrm{fd}}\approx 2600\) V. For \(U_B > 2600\) V, simulations are expected to result in a fully depleted detector for the correct \(\zeta \).

5 Simulation of the C–V curve

The C–V curve for a given \(\zeta \) was simulated with SolidStateDetectors.jl (SSD). Since version v0.7, SSD can be used to calculate \({\textbf{C}}^{*}\) of a detector while taking the influence of the environment into account. Since v0.8, it can also perform the required 3d field calculations for \(\Phi \) and \({\mathcal {W}}_i\) efficiently on GPUs.

In SSD, \(\Phi \) and \({\mathcal {W}}_i\) are calculated by solving Gauss’s law on adaptive 3d (cylindrical or Cartesian) grids via the iterative successive over-relaxation (SOR) algorithm [19]. As the potentials are calculated on grids, the integral in Eq. (5) is turned into a sum over the grid of \({\mathcal {W}}_i\). The gradient of \({\mathcal {W}}_j\) is determined through interpolation onto the grid of \({\mathcal {W}}_i\) as the two final grids are usually not identical due to the adaptive grid refinement.

In order to calculate the elements of the matrix via Eq. (5), \(\Phi \) and all \({\mathcal {W}}_i\) have to be calculated first. In contrast to \({\mathcal {W}}_i\), \(\Phi \) does not occur in Eq. (5). It is, however, required to determine the depleted volume which depends on \(\zeta \) and \(U_B\) [19]. This information is then passed to the calculation of the weighting potentials. In the calculation of the weighting potentials, the relative permittivity, \(\epsilon _r\), inside undepleted volumes was scaled by \(10^5\) as an approximation of infinity. This makes these areas quasi-conductive and results in equal potentials over these volumes. Thus, undepleted volumes in touch with a contact become extensions of this contact and will be on the same potential as applied to the contact.

The detector Super-Siegfried and the grounded holding structure and base plate as implemented in SSD are shown in Fig. 9. For the simulations, a cylindrical grid was chosen and the grid was limited to the dimensions of the hat. Fixed boundary conditions of 0 V were set at the outer edge in r and at both edges in z to mimic the grounded closed shell of the hat and base plate. In \(\varphi \), the grid was limited from \(0^{\circ }\) to \(120^{\circ }\) and periodic boundary conditions were set.Footnote 2

Fig. 9
figure 9

The geometry of the HPGe detector Super-Siegfried (dark grey), together with its holding structure and base plate (light grey) as implemented in SSD. The blue lines are segment boundaries of the \(p^+\) contact and the red cylinder is the \(n^+\) contact

It is very important to define the geometry of the detector, especially the geometry of the contacts, as realistically possible as it also influences the capacitance. Particularly, \(c_{12}^{l}\) depends on the exact geometry. For all simulations presented in this paper, the \(p^+\) contacts of the detector were fixed to a thickness of 0.5 µm as measured previously [19]. Lithium drifted contacts typically have thicknesses of \({\mathcal {O}}({\textrm{mm}})\). This thickness was not measured previously since irradiation of the inner borehole is not simple to achieve. Since the \(n^+\) contact thickness, \(d_{\textrm{Li}}\), is on the mm scale, it impacts \(c_{12}^{l}\) on a measurable scale. The \(n^+\) contact geometry is implemented as a tube with the inner radius being fixed at the borehole of the detector. The thickness of the tube, \(d_{\textrm{Li}}\), is a free parameter in the fit presented in this paper. The contact does not cover the widening of the borehole. At the bottom and the top of the contact, the outer edge of the tube is rounded off.

In the field calculation, the potential values of grid points inside the defined volumes of the contacts are fixed to the potential applied to the corresponding contact. In principle, the \(n^+\) contact could instead be modeled through \(\zeta \). The current implementation of a fixed potential inside the volume corresponds to a jump from the bulk impurity density to infinity at the surface of the contact volume as shown in Fig. 10. In future, it is envisioned to smooth this hard edge transition by adding some continuous function to the impurity at the \(n^+\) contact.Footnote 3 This smooth edge transition is also shown in Fig. 10. However, this is not yet part of the studies presented in this paper.

Fig. 10
figure 10

One-dimensional illustration of the envisioned modelling of the \(n^+\) layer for future simulations with SSD via a continuous increase of the impurity density from the impurity density of the bulk, \(\zeta _{\textrm{bulk}}\), to the impurity density of the \(n^+\) contact. The hard transition corresponds to the current implementation of the \(n^+\) layer in SSD, where the potential values inside the contact volume are fixed to the set contact potential

In SSD, custom signed impurity-densities can be defined where the sign of the given density determines the sign of the fixed space charges of the minority charge carriers at the specific location. Thus, the sign is used to specify the type (n or p) of the semiconductor at a specific location, \({\vec {r}} = (r, \varphi , z)\):

$$\begin{aligned} \zeta ({\vec {r}}) > 0\,{\textrm{cm}}^{-3}&\Leftrightarrow n\text {-type region}, \end{aligned}$$
(12)
$$\begin{aligned} \zeta ({\vec {r}}) < 0\,{\textrm{cm}}^{-3}&\Leftrightarrow p\text {-type region}. \end{aligned}$$
(13)

Typically, in simulations of HPGe detectors, a simple linear or quadratic change of \(\zeta \) is assumed along the crystal pulling axis z, based on certain levels of impurity provided by the manufacturer for some z values. A radial component is usually not assumed. Thus, for the detector Super-Siegfried, the signed impurity-density model based on manufacturer values becomes

$$\begin{aligned} \zeta _{\textrm{M}}(z) = \zeta _{\textrm{M}}^{\textrm{bot}} + \dfrac{\zeta _{\textrm{M}}^{\textrm{top}} - \zeta _{\textrm{M}}^{\textrm{bot}}}{l_{\textrm{D}}} \cdot z, \end{aligned}$$
(14)

which comprises a linear profile in z and no modulation in r.

The depleted volumes for \(\zeta _{\textrm{M}}\) and \(d_{\textrm{Li}} = 1\) mm were calculated with SSD for all \(U_{B,k}\). The undepleted volumes are shown in Fig. 11 for selected \(U_{B,k}\).

Fig. 11
figure 11

Cross-section of Super-Siegfried mounted in K1 at \(\varphi = 36.7^{\circ }\) showing the undepleted volumes for \(\zeta _{\textrm{M}}\) and selected \(U_{B,k}\) in steps of 250 V (200 V for the last step to 2975 V) as differently shaded areas

It shows how the detector depletes from the mantle of the detector towards the borehole. It also shows that even for a bias voltage of 2975 V the detector does not become fully depleted. Thus, the overall impurity level of \(\zeta _{\textrm{M}}\) seems to be too high since \(U_{B}^{\textrm{fd}}\) was determined to be \(\approx 2600\) V.

The simulated C–V curve, \(c_{12}^{{\textrm{s}},k}\), in comparison to the measured C–V curve, is shown in Fig. 12. An uncertainty of

$$\begin{aligned} \sigma _c^{{\textrm{s}}}(c_{12}^{{\textrm{s}}}) = c_{12}^{{\textrm{s}}} \cdot 1\% + 1\,{\textrm{pF}} \end{aligned}$$
(15)

is assigned to \(c_{12}^{{\textrm{s}},k}\). The absolute uncertainty of 1 pF is motivated by a possible imperfect implementation of the geometry in comparison to reality. The 1% relative uncertainty is motivated by studies on the simulated capacitance for different levels of the fineness of the final grids of the calculated fields. A relative uncertainty is chosen for this source of uncertainty because the depleted volume is smaller for lower bias voltages (larger capacitances) requiring a finer refinement. In SSD, the refinement of the grids in the field calculations can be tuned [22]. The following settings were used for the simulations presented in this paper:

$$\begin{aligned} convergence\_limit&= 10^{-7},\\ refinement\_limits&= [0.2, 0.2, 0.1, 0.1, 0.1,\\&0.05, 0.03, 0.02, 0.01],\\ max\_distance\_ratio&= 3.0, \\ min\_tick\_distance&= (10\,{{\upmu }}{\textrm{m}}, 1^{\circ }, 10\,{{\upmu }}{\textrm{m}}). \end{aligned}$$
Fig. 12
figure 12

C–V curve, \(c_{12}^{{\textrm{s}},k}\), as simulated with SSD for \(\zeta _{\textrm{M}}\) together with the measured C–V curve, \(c_{12}^{{\textrm{m}},k}\), already shown in Fig. 8a

Figure 12 shows that the simulation predicts that the detector is not yet fully depleted for any \(U_{B,k}\) as the simulated C–V curve still decreases and does not reach its lower limit at \(U_{B,60}\). However, at \(U_{B,60}\), the simulated capacitance is lower than the measured capacitance limit \(c_{12}^{l,m} = c_{12}^{{\textrm{m}},60}\). This indicates that \(d_{\textrm{Li}}\) might be larger or that the implemented geometry does not perfectly describe reality. For low bias voltages, \(c_{12}^{{\textrm{s}},k}\) is larger than \(c_{12}^{{\textrm{m}},k}\). This means that the detector depletes faster in reality than in the simulation, indicating that the \(\zeta _{\textrm{M}}\) is too large at larger radii.

6 Model function for the impurity density

The comparison between \(c_{12}^{{\textrm{m}},k}\) and \(c_{12}^{{\textrm{s}},k}\) for \(\zeta _{\textrm{M}}\) suggests that the impurity density is not that high and not constant in r and a more complex model for \(\zeta \) is required.

Assuming a constant impurity density \(\zeta _{\textrm{c}}\), the range of sensitivity of the voltage scan to the absolute impurity levels can be estimated. For this, \(c_{12}^{{\textrm{s}}}\) is calculated for (\(U_B = 25\) V, \(d_{\textrm{Li}} = 1\,\)mm) and for different \(\zeta _{\textrm{c}}\) as shown in Fig. 13.

Fig. 13
figure 13

Capacitances \(c_{12}^{{\textrm{s}}}\) for (\(U_B = 25\) V, \(d_{\textrm{Li}} = 1\,\)mm) and for different constant levels of \(\zeta _{\textrm{c}}\) as simulated with SSD. The vertical solid lines mark the parameter space of the impurity level where \(c_{12}\) is sensitive to \(\zeta \). The impurity levels \(\zeta _{\textrm{M}}^{\textrm{bot}}\) and \(\zeta _{\textrm{M}}^{\textrm{top}}\) provided by the manufacturer are also indicated

For \(d_{\textrm{Li}} = 1\) mm, the simulated limit capacitance, \(c_{12}^{l,s}\), can be calculated with \(\zeta _{\textrm{c}} = 0\,{\textrm{cm}}^{-3}\). Even for \(\zeta _{\textrm{c}} = 10^{8}\,{\textrm{cm}}^{-3}\), \({c_{12}^{{\textrm{s}}} \approx c_{12}^{l,s}}\) meaning that the detector is already fully depleted at \({U_B = 25}\) V. Thus, this level can be seen as a lower limit, \(\zeta _{l}\), for the parameter space of impurity levels,

$$\begin{aligned} \zeta _{l} :=10^{8}\,{\textrm{cm}}^{-3}. \end{aligned}$$
(16)

At \(\zeta _{\textrm{c}} = 10^{11}\,{\textrm{cm}}^{-3}\), \(c_{12}^{{\textrm{s}}}\) is much larger than the measured capacitance at \(U_B = 25\) V. Thus, this level can be seen as an upper limit, \(\zeta _{\textrm{u}}\), for the parameter space of impurity levels,

$$\begin{aligned} \zeta _{\textrm{u}} :=10^{11}\,{\textrm{cm}}^{-3}. \end{aligned}$$
(17)

Figure 13 also shows that a logarithmic change in \(\zeta _{\textrm{c}}\) between \(\zeta _{l}\) and \(\zeta _{\textrm{u}}\) results in a change of \(c_{12}^{{\textrm{s}}}\) on a linear scale. Therefore, the (rz)-dependent signed impurity-density, \(\zeta _{\textrm{RZ}}(r, z|s)\), is defined as

$$\begin{aligned} \zeta _{\textrm{RZ}}(r, z|g) = \tanh (g\cdot x(r, z))\cdot 10^{|x(r, z)|}, \end{aligned}$$
(18)

where g is set to 1000 for this study and x(rz) is a function to and above \(-\zeta _{l}\). model \(\zeta _{\textrm{RZ}}\) on a logarithmic scale.Footnote 4 The sign of x(rz) is used to determine the type of the semiconductor at (rz), see Eqs. (12) and (13).

According to the simulation, the measurement is not sensitive to impurity densities below \(\zeta _{l}\) and above \(-\zeta _{l}\).Footnote 5 A parameter transformation, \({\mathcal {T}}\), is defined to model \(\zeta _{\textrm{RZ}}\) between \([-\zeta _{\textrm{u}},\zeta _{\textrm{u}}]\) and significantly reduce the influence of the parameter interval \([-\zeta _{l},\zeta _{l}]\):

$$\begin{aligned}&x(r, z) = {\mathcal {T}}(y(r, z)), \end{aligned}$$
(19)
$$\begin{aligned}&{\mathcal {T}}(y|v,x_{l}, x_{\textrm{u}}) = {{\,\textrm{sign}\,}}(y) \cdot x_{l} \cdot |y|^{\frac{1}{v}} + (x_{\textrm{u}} - x_{l}) \cdot y, \end{aligned}$$
(20)

with \(x_{l} = \log _{10}(\zeta _{l}\cdot {\textrm{cm}}^3)= 8\), \({x_{\textrm{u}}=\log _{10}(\zeta _{\textrm{u}}\cdot {\textrm{cm}}^{3})=11}\), \({v = 1000}\) and y(rz) is a function to model \(\zeta _{\textrm{RZ}}\) on the linear interval \([-1,1].\) The transformation is shown in Fig. 14. A linear change in y will result in a logarithmic change in \(\zeta _{\textrm{RZ}}\) which causes a change in \(c_{12}\) on a linear scale.

Fig. 14
figure 14

Signed impurity-density \(\zeta _{\textrm{RZ}}({\mathcal {T}}(y))\), see Eq. (18), on the left axis and the parameter transformation \(x = {\mathcal {T}}(y)\), see Eq. (20), on the right axis as a function of y

The spatial dependence of the model \(\zeta _{\textrm{RZ}}(r,z)\) is implemented as a spatial dependence of y:

$$\begin{aligned} y(r, z) = y^{\textrm{bot}}(r) + \dfrac{y^{\textrm{top}}(r) - y^{\textrm{bot}}(r)}{l_{\textrm{D}}} \cdot z\, \end{aligned}$$
(21)

where the r dependence is modeled by \(y^{\textrm{bot}}(r)\) at \(z = 0\,\)mm and \(y^{\textrm{top}}(r)\) at \(z = l_{\textrm{D}}\). Both, \(y^{\textrm{bot}}(r)\) and \(y^{\textrm{top}}(r)\), are modeled as two cubic splines defined for four specific radial positions \(r_{\textrm{b,1}} = 20\) mm, \(r_{\textrm{b,2}} = 28\) mm, \(r_{\textrm{b,3}} = 33\) mm and \(r_{\textrm{b,4}} = 37.5\) mm.Footnote 6 The gradient of the splines at their left boundary, \(r_{{\textrm{b}},1}\), is set to zero, the gradient at the right boundary, \(r=37.5\) mm, is not fixed.

Thus, the model is defined by a set of 8 parameters, \(p_{\zeta }\), either defined in impurity levels

$$\begin{aligned} p_{\zeta } = \left( \zeta _1^{\textrm{bot}}, \zeta _2^{\textrm{bot}}, \zeta _3^{\textrm{bot}}, \zeta _4^{\textrm{bot}}, \zeta _1^{\textrm{top}}, \zeta _2^{\textrm{top}}, \zeta _3^{\textrm{top}}, \zeta _4^{\textrm{top}}\right) , \end{aligned}$$
(22)

or in values of y,

$$\begin{aligned} p_{\zeta _y} = \left( y_1^{\textrm{bot}}, y_2^{\textrm{bot}}, y_3^{\textrm{bot}}, y_4^{\textrm{bot}}, y_1^{\textrm{top}}, y_2^{\textrm{top}}, y_3^{\textrm{top}}, y_4^{\textrm{top}}\right) , \end{aligned}$$
(23)

as they can be transformed into each other via Eqs. (18)–(20) and their inverse functions.

An example impurity distribution of \(\zeta _{\textrm{RZ}}\) based on the values provided by the manufacturer is shown in Fig. 15 with

$$\begin{aligned} p_{\zeta ,\textrm{E}}&{=}&\left( \zeta _{\textrm{M}}^{\textrm{bot}}, \zeta _{\textrm{M}}^{\textrm{bot}}, \zeta _{\textrm{M}}^{\textrm{bot}}/10,-\zeta _{\textrm{M}}^{\textrm{top}}, \zeta _{\textrm{M}}^{\textrm{top}}, \zeta _{\textrm{M}}^{\textrm{top}}, \zeta _{\textrm{M}}^{\textrm{top}}/10, {-}\zeta _{\textrm{M}}^{\textrm{bot}}\right) . \end{aligned}$$
Fig. 15
figure 15

Example impurity distribution \(\zeta _{\textrm{RZ}}\) for \(p_{\zeta ,\textrm{E}}\) as a function of a z and b r. See text for details

The model allows to modulate the bulk impurity density of a detector including a possible boundary between n-type and p-type volumes as demonstrated with the example density, see Fig. 15. There, the main bulk of the detector is n-type but is p-type close to the mantle. For this detector, such a p-type volume close to the mantle is motivated by two aspects. First, when pulling the crystal via the Czochralski method, there could be some radial modulation of the impurities due to the process. Especially, since natural germanium is p-type and n-type dopants have to be added to the molten germanium. Secondly, the \(p^+\) contacts are heavily over-doped layers, \({\mathcal {O}}(10^{12}\,{\textrm{cm}}^{-3})\) or even higher. The thickness of the undepleted boron layers is very small, 0.5 µm, but there could be diffusion. This could lead to impurities reaching the magnitude of the bulk densities, \({\mathcal {O}}(10^{8-10}\,{\textrm{cm}}^{-3})\), penetrating deeper, \({\mathcal {O}}({\text {mm}})\), into the n-type germanium leading to compensation and type conversion.

7 Deep neural network for fast capacitance predictions

For a given set of values for (\(d_{\textrm{Li}}\), \(p_{\zeta _y}\)), a C–V curve can be calculated with SSD and, in principle, a fit to the measured C–V curve could be done. However, for each \(U_{B,k}\) three 3d field calculations would need to be performed resulting in 180 field calculations for the whole measured C–V curve. Even though each set of three 3d field calculations (with the specified refinement settings) takes less than a minute on a GPUFootnote 7 in SSD, it would not be feasible to set up an optimiser or a Bayesian fit.Footnote 8

Therefore, a deep neural network, \({\mathcal {DNN}}\), was developed which is able to predict the capacitance, \(c^{{\textrm{p}}}_{12}\), for a set of parameters (\(d_{\textrm{Li}}\), \(p_{\zeta _y}\)) much faster, \({\mathcal {O}}\)(µs). Here, \(U_B\) is added to the input parameters of the model. Even though this adds an extra dimension to the model, it simplifies the output as only one capacitance is predicted instead of a whole C–V curve:

$$\begin{aligned} p_{{\mathcal {D}}}&= (d_{\textrm{Li}}, p_{\zeta _y}, U_B), \end{aligned}$$
(24)
$$\begin{aligned} c_{12}^{{\textrm{p}}}&= {\mathcal {DNN}}(p_{{\mathcal {D}}}). \end{aligned}$$
(25)

The impurity model parameters \(p_{{\mathcal {D}}}\) form a 10-dimensional parameter space \({\mathcal {P}}_{{\mathcal {D}}}\). The following uniform distributions \({\mathcal {U}}(a,b)\) were chosen to quasi-randomly draw sets of input parameters for the generation of the training and test capacity datasets:

$$\begin{aligned} d_{\textrm{Li}}&\sim {\mathcal {U}}(0.2~{\text {mm}}, 5~{\text {mm}}),\nonumber \\ y_1^{\textrm{bot}}&\sim {\mathcal {U}}(0.018566145,1){} & {} \Leftrightarrow \zeta _{1}^{\textrm{bot}}\in [\zeta _{l}, \zeta _{\textrm{u}}] ,\nonumber \\ y_2^{\textrm{bot}}&\sim {\mathcal {U}}(0.018566145,1){} & {} \Leftrightarrow \zeta _{2}^{\textrm{bot}}\in [\zeta _{l}, \zeta _{\textrm{u}}] ,\nonumber \\ y_3^{\textrm{bot}}&\sim {\mathcal {U}}(-1,1){} & {} \Leftrightarrow \zeta _{3}^{\textrm{bot}}\in [-\zeta _{\textrm{u}}, \zeta _{\textrm{u}}] ,\nonumber \\ y_4^{\textrm{bot}}&\sim {\mathcal {U}}(-1,1){} & {} \Leftrightarrow \zeta _{4}^{\textrm{bot}}\in [-\zeta _{\textrm{u}}, \zeta _{\textrm{u}}] ,\nonumber \\ y_1^{\textrm{top}}&\sim {\mathcal {U}}(0.018566145,1){} & {} \Leftrightarrow \zeta _{1}^{\textrm{top}}\in [\zeta _{l}, \zeta _{\textrm{u}}] ,\nonumber \\ y_2^{\textrm{top}}&\sim {\mathcal {U}}(0.018566145,1){} & {} \Leftrightarrow \zeta _{2}^{\textrm{top}}\in [\zeta _{l}, \zeta _{\textrm{u}}] ,\nonumber \\ y_3^{\textrm{top}}&\sim {\mathcal {U}}(-1,1){} & {} \Leftrightarrow \zeta _{3}^{\textrm{top}}\in [-\zeta _{\textrm{u}}, \zeta _{\textrm{u}}] ,\nonumber \\ y_4^{\textrm{top}}&\sim {\mathcal {U}}(-1,1){} & {} \Leftrightarrow \zeta _{4}^{\textrm{top}}\in [-\zeta _{\textrm{u}}, \zeta _{\textrm{u}}] ,\nonumber \\ U_B&\sim {\mathcal {U}}(10~{\textrm{V}}, 3000~{\textrm{V}}).\nonumber \end{aligned}$$

Note that the distributions of \(\zeta _{n}^{{\textrm{bot}}/{\textrm{top}}}\) are not uniform due to the nonlinear transformation defined between \(y_{n}^{{\textrm{bot}}/{\textrm{top}}}\) and \(\zeta _{n}^{{\textrm{bot}}/{\textrm{top}}}\).

The distribution of \(d_{\textrm{Li}}\) is chosen based on typical lithium layer thickness values. \(U_B\) has to cover all values of \(U_{B,k}\). As Super-Siegfried is an n-type germanium detector, the range of the four parameters describing the density towards the borehole, at the top and bottom, are limited to the y region corresponding to an n-type density. The four parameters describing the density towards the mantle at the top and bottom, however, are allowed to include p-type impurity levels.

All individual parameter distributions can easily be transformed to uniform distributions \({\mathcal {U}}(0,1)\) on [0, 1]. Therefore, \({\mathcal {P}}_{{\mathcal {D}}}\) can be transformed into the 10-dimensional hypercube \([0, 1]^{10}\) with a parameter distribution \({\mathcal {U}}(0,1)^{10}\). In order to create a dataset to train the \({\mathcal {DNN}}\), \(N_{{\textrm{s}}} = 60000\) samples, were drawn according to

$$\begin{aligned} u_i \sim {\mathcal {U}}(0,1)^{10} \quad \forall \ i \in \{1, 2, \ldots , N_{{\textrm{s}}}\}\, \end{aligned}$$
(26)

via the quasi-random Golden Sequence [23, 24] sampling algorithm. It generates samples that are very evenly spaced in the unit hypercube.

Machine learning algorithms sometimes fail for parameter spaces with hard edges. Therefore, another transformation, \({\mathcal {T}}_{{\mathcal {N}}}\), was introduced to transform the \(u_i\) into unbound parameter intervals, \([-\infty , \infty ]\), such that each of the elements of \(u_i^{{\mathcal {N}}}\) is normally distributed around 0 with a standard deviation of 1:

$$\begin{aligned} u_i^{{\mathcal {N}}} = {\mathcal {T}}_{{\mathcal {N}}}(u_i). \end{aligned}$$
(27)

Each \(u_i^{{\mathcal {N}}}\) still corresponds to a specific \((d_{\textrm{Li}}, p_{\zeta }, U_B)\). For all \(u_i^{{\mathcal {N}}}\), the respective \(c_{12}^{{\textrm{s}}}\) is calculated with SSD to produce a labelled data set,

$$\begin{aligned} {\mathcal {D}}_u = \left\{ (u_i^{{\mathcal {N}}}| c_{12}^{{\textrm{s}},i})\right\} \quad \forall \ i \in \{1, 2, \ldots , N_{{\textrm{s}}}\}, \end{aligned}$$
(28)

which is divided into a training and a test set with a typical ratio of 80:20,

$$\begin{aligned} {\mathcal {D}}_u^{\textrm{train}}&= \left\{ (u_i^{{\mathcal {N}}}| c_{12}^{{\textrm{s}},i})\right\} \quad \forall \ i \in \{1, 2, \ldots , 0.8\cdot N_{{\textrm{s}}}\}, \end{aligned}$$
(29)
$$\begin{aligned} {\mathcal {D}}_u^{\textrm{test}}&= \left\{ (u_i^{{\mathcal {N}}}| c_{12}^{{\textrm{s}},i})\right\} \quad \forall \ i \in \{0.8\cdot N_{{\textrm{s}}}+1, \ldots , N_{{\textrm{s}}}\}. \end{aligned}$$
(30)

The distribution of generated samples of \(\zeta _{1}^{\textrm{bot}}\) and \(\zeta _{4}^{\textrm{bot}}\) for \({\mathcal {D}}_u\) and \({\mathcal {D}}_u^{\textrm{test}}\) are shown in Fig. 16. For both sets, the parameters are properly distributed over the respective parameter intervals.

Fig. 16
figure 16

Distributions of \(\zeta _{1}^{\textrm{bot}}\) and \(\zeta _{4}^{\textrm{bot}}\) from the samples of \({\mathcal {D}}_u\) and \({\mathcal {D}}_u^{\textrm{test}}\)

For machine learning, the Flux.jl [25, 26] package was used and the following configuration of \({\mathcal {DNN}}\) was found to produce good predictions for \(c_{12}\):

  • Number of nodes per layer: [10, 128, 128, 128, 128, 128, 1];

  • Type of all layers: Dense layer;

  • Activation function for all but the last layer: GELU;

  • No activation for the last layer.

The function to minimise,

$$\begin{aligned} loss(c_{12}^{{\textrm{p}}}, c_{12}^{{\textrm{s}}}) = \log (((c_{12}^{{\textrm{p}}} - c_{12}^{{\textrm{s}}})/{\textrm{pF}})^2/h + 1) \cdot h, \end{aligned}$$
(31)

was chosen as the loss function [27] with \(h = 4\).

The training of the \({\mathcal {DNN}}\) was performed with the samples of \({\mathcal {D}}_u^{\textrm{train}}\) in 3 subsequent optimisation cycles. The ADAM optimiser algorithm was used with the learning rates \(\eta \), number of epochs and batch sizes:

  1. 1.

    \(\eta = 10^{-2}\), 20 epochs and a batch size of 2048;

  2. 2.

    \(\eta = 10^{-3}\), 80 epochs and a batch size of 1024;

  3. 3.

    \(\eta = 10^{-4}\), 40 epochs and a batch size of 512.

The learning curves, i.e. the mean of the loss of all samples of a set after each epoch, of the training and test set are shown in Fig. 17.

Fig. 17
figure 17

Learning curves of \({\mathcal {D}}_u^{\textrm{train}}\) and \({\mathcal {D}}_u^{\textrm{test}}\). The vertical dashed lines mark the transitions between the three training cycles

The predicted capacitances of the trained model over the corresponding “true” value \(c_{12}^{{\textrm{s}}}\) are shown in Fig. 18 as a scatter plot. A perfect model would produce only points on the diagonal line \(c_{12}^{{\textrm{p}}} = c_{12}^{{\textrm{s}}}\). Most of the points lie close to that diagonal line and only a few points are further away, so-called outliers.

Fig. 18
figure 18

Scatter plot of \(c_{12}^{{\textrm{p}}}\) over \(c_{12}^{{\textrm{s}}}\) for the samples of \({\mathcal {D}}_u^{\textrm{train}}\) and \({\mathcal {D}}_u^{\textrm{test}}\) after the training of \({\mathcal {DNN}}\)

The distribution of absolute and relative difference between \(c_{12}^{{\textrm{p}}}\) and \(c_{12}^{{\textrm{s}}}\) for the training and test set are shown in Fig. 19.

Fig. 19
figure 19

Distribution of a absolute and b relative differences between \(c_{12}^{{\textrm{p}}}\) and \(c_{12}^{{\textrm{s}}}\) for the samples of \({\mathcal {D}}_u^{\textrm{train}}\) and \({\mathcal {D}}_u^{\textrm{test}}\). A Gaussian approximation of the relative differences of \({\mathcal {D}}_u^{\textrm{test}}\) is shown in b

A Gaussian approximation is fitted to the distribution of relative differences between \(c_{12}^{{\textrm{p}}}\) and \(c_{12}^{{\textrm{s}}}\) for the samples of the test set. The determined standard deviation of the Gaussian of \(1.5\%\) is used to estimate the uncertainty on the predicted value \(c_{12}^{{\textrm{p}}}\):

$$\begin{aligned} \sigma _c^{{\textrm{p}}}(c_{12}^{{\textrm{p}}}) = c_{12}^{{\textrm{p}}} \cdot 1.5\%. \end{aligned}$$
(32)

A relative uncertainty was chosen to account for the increasing difference between \(c_{12}^{{\textrm{p}}}\) and \(c_{12}^{{\textrm{s}}}\) for larger \(c_{12}^{{\textrm{s}}}\) as visible in Fig. 18. However, at capacitances above \(\approx 500\) pF an uncertainty of \(1.5\%\) seems to be an underestimation. This is mostly due to the small number of training samples with large capacitances. To improve the predictions for larger \(c_{12}^{{\textrm{s}}}\), the distributions from which the training samples are generated could be tuned in the future, such that more samples with larger capacitances are generated, e.g., more samples at lower bias voltages.

8 Bayesian fits of the impurity density

A predicted C–V curve \(c_{12}^{{\textrm{p}},k}\) can now be produced for a given set of \((d_{\textrm{Li}}, p_{\zeta })\) by evaluating the trained network \({\mathcal {DNN}}\) at \((d_{\textrm{Li}}, p_{\zeta }, U_{B,k})\) for all k.

For each predicted \(c_{12}^{{\textrm{p}}}\), an uncertainty is estimated by Gaussian error propagation of the three different sources of uncertainty:

$$\begin{aligned} \sigma _c(c_{12}^{{\textrm{p}}})^2 = \sigma _c^{{\textrm{m}}}(c_{12}^{{\textrm{p}}})^2 + \sigma _c^{{\textrm{s}}}(c_{12}^{{\textrm{p}}})^2 + \sigma _c^{{\textrm{p}}}(c_{12}^{{\textrm{p}}})^2, \end{aligned}$$
(33)

where \(\sigma _c^{{\textrm{s}}}\) is the uncertainty due to SSD, see Eq. (15), and \(\sigma _c^{{\textrm{p}}}\) is the uncertainty due to \({\mathcal {DNN}}\), see Eq. (32). The uncertainty due to the measurements, \(\sigma _c^{{\textrm{m}}}\), is motivated by the conservatively estimated uncertainty on \(c_{12}^{{\textrm{m}}}\), see Sect. 4:

$$\begin{aligned} \sigma _c^{{\textrm{m}}}(c_{12}^{{\textrm{p}}}) = c_{12}^{{\textrm{p}}} \cdot 3\%. \end{aligned}$$
(34)

The likelihood \({\mathcal {L}}\) of a predicted C–V curve \(c_{12}^{{\textrm{p}},k}\) can then be defined as

$$\begin{aligned} {\mathcal {L}}(c_{12}^{{\textrm{p}},k}) = \prod _{k = 1}^{60}{\mathcal {N}}\left( c_{12}^{{\textrm{p}},k}, \sigma _c(c_{12}^{{\textrm{p}},k})\right) (c_{12}^{{\textrm{m}},k}), \end{aligned}$$
(35)

which is the product over all k of normal distributions with mean value \(c_{12}^{{\textrm{p}},k}\) and standard deviation \(\sigma _c(c_{12}^{{\textrm{p}},k})\) evaluated at \(c_{12}^{{\textrm{m}},k}\).

The software package BAT.jl [28] was used to perform Bayesian fits for two different cases of \(\zeta _{\textrm{RZ}}\): One without any radial dependence of the impurity density, \({\mathcal {B}}_{\textrm{Z}}\), and one with a radial dependence through all 8 parameters of \(p_{\zeta }\), \({\mathcal {B}}_{\textrm{RZ}}\).

The Metropolis-Hastings sampling algorithm, as implemented by BAT.jl, was used with 8 chains and about 300,000 samples were accepted for both cases. Thus, about 1 million CV curves were predicted in total. It would take about 10 years to calculate these directly without the \({\mathcal {DNN}}\).

8.1 Bayesian fit of the impurity density without radial dependence

For \({\mathcal {B}}_{\textrm{Z}}\), the model for the fit only has 3 parameters:

$$\begin{aligned} p_{{\mathcal {B}}_{\textrm{Z}}} = (d_{\textrm{Li}}, \zeta ^{\textrm{bot}}, \zeta ^{\textrm{top}}), \end{aligned}$$
(36)

where the two parameters for the impurity density level are used at all \(r_{b,i}\) at the top and bottom in the \(\zeta _{\textrm{RZ}}\) model, respectively. A flat prior was chosen for \(d_{\textrm{Li}}\). For \(\zeta ^{\textrm{bot}}\) and \(\zeta ^{\textrm{top}}\), the prior distributions were chosen as broad truncatedFootnote 9 normal distributions, \({\mathcal {N}}_t\), in y around the respective y for the impurity levels provided by the manufacturer \(\zeta _{\textrm{M}}^{\textrm{bot}}\) and \(\zeta _{\textrm{M}}^{\textrm{top}}\). The broadness was chosen to express the large uncertainty on the values provided by the manufacturer and such that the entire parameter space was tested. The prior distributions for all three parameters are listed in Table 1.

Table 1 Prior distribution for all parameters from \({\mathcal {B}}_{\textrm{Z}}\). See main text for reasoning

The marginalised posterior distribution and the prior distribution of \(d_{\textrm{Li}}\) is shown in Fig. 20. The fit indicates a thickness of about 3 mm, which is quite thick. However, this parameter of the model is mainly sensitive to the end of the C–V curve and probably heavily impacted by possible imperfections of the implementation of the geometry of the detector. In addition, the detector is old and some growth of \(d_{\textrm{Li}}\) is expected.

Fig. 20
figure 20

Prior distribution and marginalised posterior distribution of \(d_{\textrm{Li}}\) from \({\mathcal {B}}_{\textrm{Z}}\). The smallest intervals (SI) containing certain amounts of probability are shown as shaded areas

The prior distributions and marginalised posterior distributions of \(\zeta ^{\textrm{bot}}\) and \(\zeta ^{\textrm{top}}\) are shown in Fig. 21.

Fig. 21
figure 21

a Prior distributions and b marginalised posterior distributions for \(\zeta ^{\textrm{bot}}\) and \(\zeta ^{\textrm{top}}\) from \({\mathcal {B}}_{\textrm{Z}}\)

The posterior distributions peaks are not too far away from \(\zeta _{\textrm{M}}^{\textrm{top}}\) and \(\zeta _{\textrm{M}}^{\textrm{bot}}\). However, there are two modes in both posterior distributions. This is also visible in the 2d-marginalised posterior distribution of \(\zeta ^{\textrm{bot}}\) and \(\zeta ^{\textrm{top}}\) in Fig. 22. The second mode can be explained by the symmetry of the setup. The detector could basically be physically inverted such that the top and bottom would be switched.

Fig. 22
figure 22

2d-marginalised posterior distribution of \(\zeta ^{\textrm{top}}\) and \(\zeta ^{\textrm{bot}}\) of \({\mathcal {B}}_{\textrm{Z}}\). The smallest intervals (SI) containing certain amounts of probability are shown as shaded areas

The posterior predictive of the difference between the predicted and measured capacitances, \(c_{12}^{{\textrm{p}}} - c_{12}^{{\textrm{m}}}\), is shown in Fig. 23. At voltages above 1000 V the posterior predictive is centred around 0. However, below 1000 V, it becomes very clear that the model with no radial dependence is not able to describe the measured C–V curve as the predictions do not describe the measurements. Lower bias voltages correspond to larger radii as the depleted region grows from the mantle towards the borehole, see Fig. 11. Thus, a radial dependence of the impurities towards larger radii is again suggested. The impurity density \(\zeta _{\textrm{RZ}}\) for the global mode of the fit \({\mathcal {B}}_{\textrm{Z}}\) is shown in Fig. 24.

Fig. 23
figure 23

Posterior predictive of the difference between the predicted, \(c_{12}^{{\textrm{p}}}\), and measured, \(c_{12}^{{\textrm{m}}}\), capacitances from \({\mathcal {B}}_{\textrm{Z}}\). The shaded bands mark areas of how probable a value of \(c_{12}^{{\textrm{p}}}-c_{12}^{{\textrm{m}}}\) is based on the posterior of \({\mathcal {B}}_{\textrm{Z}}\)

Fig. 24
figure 24

\(\zeta _{\textrm{RZ}}\) for the global mode from \({\mathcal {B}}_{\mathcal {Z}}\) as a function of a z and b r

8.2 Bayesian fit of the impurity density with radial dependence

For \({\mathcal {B}}_{\textrm{RZ}}\), the model for the fit has 9 parameters:

$$\begin{aligned} p_{{\mathcal {B}}_{\textrm{RZ}}} = (d_{\textrm{Li}}, p_{\zeta }). \end{aligned}$$
(37)

The prior distributions for all parameters are shown in Table 2. For \(d_{Li}\), a flat prior was chosen. For the 6 parameters \(\zeta _{1-3}^{{\textrm{top}}/{\textrm{bot}}}\), truncated normal distributions based on the marginalised posterior distributions of \(\zeta ^{\textrm{bot}}\) and \(\zeta ^{\textrm{top}}\) from \({\mathcal {B}}_{\textrm{Z}}\) were chosen. For the two parameters \(\zeta _{4}^{{\textrm{top}}/{\textrm{bot}}}\), broad truncated normal distributions centred around 0 were chosen based on the conclusions drawn from \({\mathcal {B}}_{\textrm{Z}}\), that assumed impurities in \({\mathcal {B}}_{\textrm{Z}}\) were too high at larger radii.

Table 2 Prior distribution for all parameters from \({\mathcal {B}}_{\textrm{RZ}}\). See main text for reasoning

The prior distribution and marginalised posterior distribution of \(d_{\textrm{Li}}\) are shown in Fig. 25. The posterior distribution is very similar to the case without radial dependence.

Fig. 25
figure 25

Prior distribution and marginalised posterior distribution of \(d_{\textrm{Li}}\) from \({\mathcal {B}}_{\textrm{RZ}}\). The smallest intervals (SI) containing certain amounts of probability are shown as shaded areas

The prior distributions and marginalised posterior distributions for the 8 parameters of \(\zeta _{1-4}^{{\textrm{top}}/{\textrm{bot}}}\) are shown in Fig. 26.

Fig. 26
figure 26

Prior distributions and marginalised posterior densities of the 8 parameters describing \(\zeta _{\textrm{RZ}}\) of \({\mathcal {B}}_{\textrm{RZ}}\). The \(\zeta \)-axes cover the total parameter space for all parameters. The smallest intervals (SI) containing certain amounts of probability are shown as shaded areas

The two posterior distributions at \(r_{b,1}\) are very similar to the posterior distributions of the case without radial dependence. That was expected since the posterior predictive of the first case indicated that no modulation is required at smaller radii but is required at larger radii. This is also indicated by the posterior distribution of the two parameters \(\zeta _{4}^{{\textrm{top}}/{\textrm{bot}}}\) which describe the impurity density at the mantle of the detector. The two posterior distributions are very broad, but favour a very low impurity density and even a possible p-type volume close to the mantle. The broadness comes from the increasing estimated relative uncertainty on the predicted capacitances towards lower bias voltages because the capacitance becomes in general larger towards lower bias voltages. Another reason for the broadness is that the two parameters are only sensitive to the first few data points of the measured C–V curve.

The posterior predictive of the difference between the predicted and measured capacitances, \(c_{12}^{{\textrm{p}}} - c_{12}^{{\textrm{m}}}\), is shown in Fig. 27.

Fig. 27
figure 27

Posterior predictive of the difference between the predicted and measured capacitances of \({\mathcal {B}}_{\textrm{RZ}}\). The shaded bands mark areas of how probable a value of \(c_{12}^{{\textrm{p}}}-c_{12}^{{\textrm{m}}}\) is based on the posterior of \({\mathcal {B}}_{\textrm{RZ}}\)

In contrast to the \({\mathcal {B}}_{\textrm{Z}}\) model, the bands are centred around zero for all bias voltages. The predictions become less precise towards lower bias voltages due to the previously explained reasons for the broadness of the marginalised posterior distributions of \(\zeta _{4}^{\textrm{top}}\) and \(\zeta _{4}^{\textrm{bot}}\).

The impurity density \(\zeta _{\textrm{RZ}}\) for the global mode of the fit is shown in Fig. 28.

Fig. 28
figure 28

Global mode of the fitted impurity density of \({\mathcal {B}}_{\textrm{RZ}}\)

9 Impact of impurity densities on pulse formation

The electric field, \({\vec {\mathcal {E}}}\), and the pulses of one event spawned at (r = 37 mm, \(\varphi = 30^{\circ }\), z = 35 mm) were simulated with SSD for three different \(\zeta \) at the operation voltage of 3000 V:

  • \(\zeta _{\textrm{M}}\) with \(d_{\textrm{Li}} = 3\) mm: \(\zeta _{\textrm{M}}^*,\)Footnote 10

  • \(\zeta _{\textrm{RZ}}\) for the global mode of \({\mathcal {B}}_{\textrm{Z}}\): \(\zeta _{{\mathcal {B}}_{\textrm{Z}}}\),

  • \(\zeta _{\textrm{RZ}}\) for the global mode of \({\mathcal {B}}_{\textrm{RZ}}\): \(\zeta _{{\mathcal {B}}_{\textrm{RZ}}}\).

The electric field strength at (\(\varphi = 30^{\circ }\), z = 35 mm) over r and the normalised pulses from the \(n^+\) contact of the simulated event are shown in Fig. 29 for the three different \(\zeta \) models.

Fig. 29
figure 29

a The electric field strength at (\(\varphi = 30^{\circ }\), z = 35 mm) over r and b normalised pulses of the \(n^+\) contact of an event spawned at (r = 37 mm, \(\varphi = 30^{\circ }\), z = 35 mm) as simulated with SSD for the three different impurity density distributions \(\zeta _{{\mathcal {B}}_{\textrm{Z}}}\), \(\zeta _{{\mathcal {B}}_{\textrm{RZ}}}\) and \(\zeta _{\textrm{M}}^*\)

The electric field strength close to the contacts differs significantly for the three cases. The field strength from \(\zeta _{\mathcal {B_{\textrm{Z}}}}\) is significantly less radius dependent than that from \(\zeta _{\textrm{M}}^*\). This causes the pulse to become faster at the end. The radial decrease of impurities in \(\zeta _{\mathcal {B_{\textrm{RZ}}}}\) further reduces \(|{\vec {\mathcal {E}}}|\) close to \(p^+\) contact. The field strength close to the \(n^+\) is further increased. Nevertheless, the pulses for \(\zeta _{{\mathcal {B}}_{\textrm{Z}}}\) and \(\zeta _{{\mathcal {B}}_{\textrm{RZ}}}\) are very similar.

However, the effect of \(\zeta \) on the simulated pulses also depends on the charge drift model describing the mobility tensor and its dependence on the electric field. For the simulated pulses shown in Fig. 29b, the charge drift model from the AGATA Detector Library [11, 29] as implemented in SSD [9] was used with its default parameters. The differences in the pulses for the three \(\zeta \) models show how important it is to use the correct impurity density distribution when using pulse shapes from measurements to tune the parameters of the drift model.

10 Summary and outlook

The capacitance matrix of a germanium detector was explained in detail and it was shown how the capacitances depend on the depletion of the detector and, thus, on the impurity density distribution of the crystal. The setup K1 and the true-coaxial n-type germanium detector Super-Siegfried were introduced and it was explained how to measure one of the elements of the capacitance matrix of the detector for different bias voltages. The measured C–V curve was compared to a C–V curve simulated for the impurity density distribution as provided by manufacturer. The comparison suggested a radial dependence of impurity densities. This was confirmed by a Bayesian fit which optimised the impurity density model with only a dependence on the z-axis of the detector. A model including a radial dependence of the impurity density was introduced. The Bayesian fit of this model to the measured C–V curve provided a good description of the data. This indicates that the crystal under study really has an r dependent impurity density distribution with a very low level of electrically active impurities close to the detector edge.

A novel method was introduced that uses a deep neural network, trained on GPU-accelerated capacitance calculations, to enable full Bayesian parameter inference on complex impurity density models.

The possibility to determine impurity density distributions from capacitance measurements opens a road to study mobility tensors and drift models by comparing measured and simulated pulses without the uncertainties otherwise introduced by the lack of knowledge on these impurity densities. The knowledge of the impurity densities is also important for pulse-shape analysis used in rare-event searches where the exact understanding of the pulse formation is critical to discriminate between signal and background events.

It should be noted that the method presented here can also be used to optimise general detector properties during the detector design phase. In addition, the method has the potential to determine impurity distributions based on impurity-sensitive detector properties other than capacitance. Inferring impurity from voltage-dependent properties like the shape of the depletion volume, determined by Compton scanning, or the total active volume will be the subject of future work.