Skip to content

Modelling front-end electronics

The induced current on the readout electrode of a particle detector is typically processed by a shaper and amplifier. For a linear system, the output signal v(t) of the amplifier can be calculated by convoluting the input current i(t) with a transfer function f.

\[ v\left(t\right) = \int\limits_{0}^{t} f\left(t\right) i\left(t - t'\right)\text{d}t' \]

The function f (delta response function) corresponds to the output signal of the system for a Dirac delta input signal.

Garfield++ offers three options for specifying a transfer function:

  • providing a std::vector containing a list of timestamps and a std::vector containing the values of the transfer function at these times,
  • writing a C-style function (or a lambda) that returns the value of the transfer function for a given time t,
  • using a pre-implemented parameterisation.

In all three cases, the transfer function is given in the time domain.

The first option is illustrated in the drift tube example. As an example of the second approach, we consider the transfer function of a unipolar shaper (consisting of n integration stages with time constant τ = RC)

\[ f\left(t\right) = \text{e}^{n}\left(\frac{t}{t_{p}}\right)^{n}\text{e}^{-t/\tau}, \qquad t_{p} = n\tau \]

with the peak height normalized to unity. In the following snippet of code, we use the delta response function for a unipolar shaper with n = 1 and τ = 25 ns.

// Make a dummy component.
ComponentUser cmp;

// Create a sensor.
Sensor sensor;
const std::string label = "readout";
sensor.AddElectrode(&cmp, label);

// Set the range and binning of the signal (1000 bins between 0 and 200 ns).
const unsigned int nTimeBins = 1000;
const double tmin =   0.;
const double tmax = 200.;
const double tstep = (tmax - tmin) / nTimeBins;
sensor.SetTimeWindow(tmin, tstep, nTimeBins);

// Set the transfer function.
auto fT = [](double t) {
  constexpr double tau = 25.;
  return (t / tau) * exp(1 - t / tau);
};
sensor.SetTransferFunction(fT);

Instead of coding the transfer functions for the unipolar shaper ourselves, we could have used the helper class Shaper which takes as first argument the order n, as a second argument the time constant τ, as third argument the gain factor, and as fourth argument the type of shaper:

Shaper shaper(1, 25., 1., "unipolar");
sensor.SetTransferFunction(shaper);

The available shaper types are "unipolar" and "bipolar".

After simulating the induced current from one "event" (e.g. the electron and ion drift lines from one charged particle track), we can call

sensor.ConvoluteSignal("electrode");
which will convolute the induced current stored in the Sensor for the electrode labelled "electrode" with the transfer function that we specified above and replace the signal stored in the Sensor with the output of the convolution. Calling

sensor.ConvoluteSignals();

will do the convolution for all electrodes attached to the Sensor.

Examples dedicated to signal processing can be found in the directory Examples/Signals of the Garfield++ source tree.