A simulator for Timepix-like pixel front-ends

This work presents the development of a front-end simulation code for the Timepix3 readout chip [1], intended as digitizer stage in full detector simulation. The front-end electronics is modelled using an integrator stage and 3 parallel feedback loops with individually configurable time constants. The main feedback discharging the integrator consists of 3 low-pass filtered feedback loops. The leakage current compensation is approximated by an additional independent low-pass filtered feed-back loop. The system noise is modelled using independent bandwidth limited noise channels for pre-amplifier, feedback and threshold noise. The Timepix3 time of arrival (ToA) and time over threshold (ToT) measurement is implemented by a discriminator model with independent rise and fall times and 2 independent clock frequencies for ToA and ToT. The measured dependence of the ToT on the pre-amplifier input charge using test-pulses of a Timepix3 assembly is correctly reproduced for a wide range of discriminator settings.


Introduction
Detector simulation is an important tool to understand and validate experimental results.With the ground truth data included in the data set, a sufficiently realistic detector model is very valuable in the development and validation of track and particle reconstruction algorithms.In order to correctly describe the behaviour of the full detector system, charge deposition, charge transport and the pixel front-end electronics need to be accurately modelled.In this work, a simulation code for pixel front-end electronics employing the Krummenacher feedback loop system has been developed and tuned to the characteristics of the Timepix3 [1] ASIC (Application Specific Integrated Circuit).

Implementation
The Timepix3 pixel CSA (Charge Sensitive Amplifier) is implemented using the Krummenacher feedback architecture [2,3], a simplified schematics is given in figure 1(a).The incoming current pulse is converted into a triangular voltage pulse at the output of the preamplifier which is then compared against a threshold voltage.In the Timepix3 chip, this reference level is globally set for the pixel matrix using a tunable DAC (Digital-to-Analog Converter) located in the chip periphery [1].The DAC response has to be calibrated in order to be correctly set to a given charge threshold.In the same way also the discharge time which is controlled by the magnitude of the preamplifier discharge current is regulated via a dedicated 8-bit DAC.
The presented model aims to phenomenologically reproduce the behaviour of the pixel front-end and the computation entirely stays in the charge domain.In this way the model parameters such as discriminator threshold and discharge current are also kept in physical units of charge and time.The schema of the computational model is shown in figure 1(b).The pixel front-end is composed of an integrator stage and parallel feedback loops with individually configurable time constants.The main feedback discharging the integrator consists of 3 parallel weighted loops, each implemented as a first order Butterworth filter.The time constant of the first feedback branch is in the order of 50 ns, representing the main discharge pole in the feedback loop [3].In order to reproduce the measured -1 -behaviour of the Timepix3, two additional poles had to be added: a complex conjugate pole with a time constant of ~350 ns, resulting in a small oscillation in the undershoot of the output signal.And a second simple pole with a longer time constant of ~2.5 μs, providing a better approximation of the amplitude of the undershoot, see figure 2. The leakage current compensation (LCC) is approximated by an additional independent low-pass filtered feed-back loop with a much longer time constant of 10 μs.The sum of the discharge loop and the leakage current compensation loop cannot exceed the maximum discharge current, which corresponds to half the reset Krummenacher current in the actual pixel circuit [3,4].The system noise is implemented using independent bandwidth limited noise channels for pre-amplifier and feedback loops with configurable values for bandwith and equivalent noise charge (ENC) r.m.s.
The ToA (Time of Arrival) and ToT (Time over Threshold) simulation is performed by a discriminator model with independent rise and fall times, comparing  out in figure 1 In order to obtain this behaviour with a simple computational model, the integrator and low-and band-pass pass filters are implemented as discrete transfer functions [5] with   the feed-forward scaling and with   the feed-backward scaling parameters, respectively the zeros   and poles   of the filters in the z-domain.In order to reduce computational load the transfer function is set to idle and returns zero without further calculations when all  − and  −  are below a cut-off threshold.
For small input signals, here in the order of below ~1 ke-, the front-end electronics channel can approximately be modelled by convoluting the input current with the small signal impulse response [3] with  rise and  fall the rise time and fall time constants.In this small signal representation the RT0 time (Return to Zero) of the front-end output time is constant, independent of the magnitude of the input charge.However, in a Krummenacher circuit the feedback current saturates for larger input charges and the RT0 increases linearly with the total input charge.Of particular impact for the dependence of the ToT on the total input charge is the transition between small signal regime (where the RT0 is constant) and the feedback saturation regime (where the discharge current is constant).This is achieved by tapering the nominal feedback current  max [6], approximating a constant fraction discharge below a configurable small signal limit  as 3) The effect of this feedback tapering can be seen in figure 2, both in the signal shape and in the dependence of the ToT on the input charge.The charge vs ToT simulation on the right hand side of figure 2 shows a characteristic knee at input charges around 1 ke-, below which the ToT stays approximately constant for discriminator thresholds lower than the small signal limit, whereas the ToT increase becomes linear at higher input charges.3 Parameter tuning

ToT calibration
The model parameter were tuned to reproduce the ToT calibration curve, given by the dependence of the ToT on input charge.ToT calibration curve was measured using test-pulses in a single pixel of a Timepix3 assembly for discriminator thresholds from ~500 e-to ~7 ke-.The input charge range was scanned in steps of 18.8 e-in the range of 500 e-to 10 ke-.The model parameters were selected such that a peaking time of the preamplifier output of 35 ns was obtained.The relative weights of the feedback branches were found using a least square fit to the measured ToT calibration curves.The resulting simulated ToT calibration curves are in very good agreement with test pulse measurements, lying within the 1  margin of the measurement, see figure 4. -4 -

ToA and timewalk
While three configurable clock periods can be simulated, in this example only two are used, namely 25 ns and 1.56 ns like in the Timepix3.Figure 5 shows the simulated ToA for input charge values ranging from the used threshold level of 2.9 ke-to 10 ke-.The result is consistent with published results [7,8].Also visible is the effect of the system noise of 80 e-ENC r.m.s, 7 e-r.m.s threshold noise and the long peaking time of the Timepix3 of ~35 ns for low charge inputs.The strong impact of the noise on the precision of the ToA measurement for lower input charges is clearly visible.While for e.g.

Pulse pileup
Double LED pulse measurements performed at DESY showed a reduction of measured ToT for the second LED pulse with decreasing interval between the pulses [9], indicating an effect of pulse pileup.This reduction could be reproduced very well by the simulation and is shown to be a consequence of the signal undershoot following a big input charge.Figure 6(a) shows a trail of 2 pulses of 5 ke-input charge spaced in time by 2 μs.Since the second pulse is injected while the preamplifier output is still in the undershoot stemming from the first pulse, the second output pulse starts from a negative offset and the integral feedback also includes contributions from the feedback branches with longer time constant originating in the first pulse.Consequently both the amplitude and the RT0 time of the second pulse are reduced.Figure 6(b) plots the measured ToT of the second pulse in dependence of the delay between the LED pulses, together with the results of the corresponding simulation.The model reproduces the experimental results for delays longer than ~2.5 μs, however for shorter delays experiment and simulation start to deviate significantly.The model can be tuned such that the experimental results are reproduced over the whole range, but this comes at the cost of increased deviations from the measured ToT calibration in figure 4. The reason for this lies in the fact that the model uses fixed time constants -5 -and fixed relative weights for the feedback branches, which is not the case for the real pixel front-end where both dynamically change with the front-end charge load.The correct modelling of the drift of time constants and weights is beyond the scope of this work and will be addressed in future.

X-ray fluorescence
In figure 7 the simulated ToT spectrum for an irradiation with a 241Am  source is plotted.For this simulations the model has been ported to the Allpix2 framework [10].The actual detector geometry of the experimental Timepix3 device, with the Si sensor thickness of 500 μm and 200 V sensor bias, has been replicated in the simulation.Since for the per-pixel ToT calibration using monochromatic X-rays only single pixel events are used, also in this case only single pixel events are taken into account.The value for the feedback current used in the simulation was chosen such that the mean ToT value is equal in measurements and simulations.The width of the simulated spectrum is in good agreement with the experimental values for a feedback current values generally used for  measurements, see figure 7  -6 -

Figure 1 .
Figure 1.The schematic of the circuit (a) and the model (b): the CSA in red is modelled as a integrator stage.The discharge of the integrator stage takes place via 3 independent low-pass filtered feedback loops in blue.In addition the leakage current compensation is implemented as low-pass filter with a cut-off frequency of ~10 kHz, in green.As opposed to the signals in the real circuit, the whole simulation is performed in charge domain.Two configurable band-width limited noise sources are added, a feedback current noise and preamplifier output noise ENC.

Figure 2 .
Figure 2. Left: preamplifier output current for input charges from 700 e-to 10 ke-.Right: the dependence of the ToT on the input charge for discriminator thresholds from ~400 e-to ~700 ke-.Please note that this simulation does not include any noise contributions.

Figure 3 Figure 3 .
Figure3shows the time series of the preamplifier output, threshold, discriminator and the feedback currents for a 10 ke-input pulse and 10 e-/ns discharge current.The preamplifier noise ENC was set to 60 e-r.m.s and the feedback current noise ENC to 0.01 e-/ns r.m.s.The undershoot caused by the complex conjugate pole is clearly visible as well as the small offset with slow recovery due to the leakage current compensation.

Figure 4 .
Figure 4.The ToT calibration of a single Timepix3 pixel measured using test pulse overlaid with corresponding simulated ToT values (black lines) for discriminator thresholds from 768 e-to 7.2 ke-.The measured ToT calibration is plotted with 1  error margins.
9 ke-input pulse only two ToA values are measured, at 3 ke-the measured ToA spreads over 5 values, figure 5(b).

Figure 5 .
Figure 5. a) The simulated timewalk without noise.The simulated ToA values are well separated within the bins of 1.56 ns.b) The simulated timewalk with 60 e-ENC preamplifier noise.The significant overlap of measured ToA especially for low input charges is clearly visible.

Figure 6 .
Figure 6.a) The simulation of two 5 ke-input pulses with a delay of 2 μs.b) The measured and simulated reduction of the ToT in dependence on the delay of the second pulse with respect to first pulse.Below ~2.5 μs the simulation deviate from the experimental results. (b).

Figure 7 .
Figure 7. a) Measured 59.5 keV fluorescence line with low feedback current ( Krum = 2).b) Measured and simulated spectral resolution dependence on the feedback current.