A new method based on noise counting to monitor the frontend electronics of the LHCb muon detector

A new method has been developed to check the correct behaviour of the frontend electronics of the LHCb muon detector. This method is based on the measurement of the electronic noise rate at different thresholds of the front-end discriminator. The method was used to choose the optimal discriminator thresholds. A procedure based on this method was implemented in the detector control system and allowed the detection of a small percentage of front-end channels which had deteriorated. A Monte Carlo simulation has been performed to check the validity of the method.


Introduction
The muon detector of the LHCb experiment [1,2] is composed of 5 stations (M1-M5) placed along the beam axis and with a total area of 435 m 2 . It identifies muons with an efficiency higher than 99% per station [2], provides fast information for the high-p T muon trigger at the earliest level (Level-0) and muon identification for the high-level trigger and offline analysis. Each station is divided in 4 regions (R1-R4), with increasing distance from the beam pipe. The linear dimensions of the regions R1, R2, R3, R4 and their segmentations scale in the ratio 1:2:4:8. With this geometry, the particle flux and channel occupancy are expected to be roughly the same over the four regions of a given station. Multi-wire proportional chambers (MWPC) are used everywhere, except in the inner region of station M1 (M1R1) where the expected particle rate exceeds safety limits for MWPC ageing. In this region triple-GEM detectors [1] are used. The detector comprises 1380 chambers with 122112 readout channels. The front-end electronics of each channel are equipped with the CARIOCA chip [3] which performs the signal amplification, shaping and discrimination. The detector is designed to work for many years in a high radiation environment. Therefore to minimize the ageing effects, the chambers should operate at the lowest possible gain [4] compatible with the high efficiency required [5], and the discriminator thresholds should be as low as possible compatible with an acceptable noise rate.
During the many years forseen for the data taking of the experiment, the stability of the readout channels must be monitored and any possible ageing effect or breakdown of the front-end electronics should be quickly and effectually detected. In this paper we describe a new method [6,7]  method consists [8] in counting the electronic noise rate as a function of the threshold of the discriminator 1 for each channel. It allows to check the correct behaviour of the frontend electronics and to choose the optimal values of the discriminator thresholds. The threshold scan procedure was implemented in the LHCb detector control system and is systematically applied during the operation of the experiment.

The front-end electronics
To meet the required condition on rate capability and resolution, the MWPCs of the muon detector were partitioned in pads of different size and capacitance. The readout was performed on the cathodes or/and on the anodes of the chambers. Each channel of the front-end electronics comprises an amplifier, a shaper and a discriminator. Each CARIOCA chip comprises 8 readout channels and two CARIOCAs were mounted on a front-end board which therefore performs the readout of 16 chamber pads.

The amplifier
The amplifier of the CARIOCA chip can be wired to handle either negative polarity for anode channels or positive polarity for cathode pads. The sensitivity of the amplifier, defined as the output pulse amplitude per unit δ -like charge, was measured as a function of the capacitance (C det ) of the detector. In figure 1a the dependence of the sensitivity on the pad capacitance is shown.
The gain of the amplifier (figure 1b) was measured as function of frequency at C det ≃ 0. The 3dB limits were found to lie near 20 and 50MHz, for positive and negative input polarity. The output of each amplifier, which has the same sign for cathode and anode readout, is sent to a discriminator.

The discriminator
A 8-bit digital-to-analog converter (DAC) with 256 steps allows to change the threshold of each discriminator in steps of 2.35 mV which corresponds to a single DAC register unit (r.u.). The threshold can vary from positive to negative values, with the exception of a "bias" interval V b ≃ ±26 mV (figure 2) around zero. In this region the transition between positive and negative threshold occurs within one DAC register. The amplitude of the signal at the input of the amplifier depends on the capacitance of the pad read by the front-end.
For an ideal discriminator with no bias interval, the dependence of the noise counting rate on the threshold is a bell-shaped distribution (figure 3a). Two parameters of this distribution will be considered in the following: the counting rate at zero threshold (R 0 ) and the r.m.s. (σ R ) of the distribution.
For the CARIOCA discriminator, because of its bias interval, only the tails of the bell-shaped -3 -distribution can be measured. A threshold scan will therefore result in a double-arm curve with a cusp (figure 3b), the right (left) arm corresponding to the positive (negative) tails.
To monitor the MWPC readout channels a check of the stability of the σ R values of all the 122k channels is periodically performed. For each channel, σ R must be inferred from the corresponding threshold scan distribution. This evaluation would be more precise if the shape of the distribution were known. To find out this distribution in the present experimental situation, a Monte Carlo (MC) simulation was performed.

The Monte Carlo simulation
The MC simulation comprises the generation of the noise signal sent to the discriminator by the amplifier and the calculation of the output rate of the discriminator as a function of its threshold. The effect of the dead time of the CARIOCA was evaluated. The bias interval was not considered in the MC but will be taken into account later.

The noise signal
The noise at the input of the front-end electronics is assumed to have a flat frequency spectrum 2 (white noise), resulting from the superposition of a great number of contributions which occur randomly. This noise is then filtered by the amplifier and sent to the discriminator. Therefore the passband of the amplifier determines the frequency spectrum of the noise at the discriminator input. In the MC this passband was approximated to a rectangular one, extending from 20 MHz to 50 MHz, which corresponds to the 3 dB bandwith of the amplifier (figure 1b). This approximation will allow to compare easily the MC results with Rice's theory [9], and is expected to give a satisfactory representation of the experimental situation.
The time dependence of the noise signal V (t) at the input of the discriminator was generated as a superposition of N = 60000 sinusoids according to the formula: The frequency f k and the phase φ k were randomly extracted in the intervals 20 − 50 MHz and 0 − 2π respectively. The noise signal was calculated every 3 ns, assuming A = 1 in equation 3.1.
With an upper frequency of ∼ 50 MHz this sampling of the noise is sufficiently dense to give a correct description of the signal. The MC generates 2 × 10 8 consecutive values of the noise signal, corresponding to a time interval of 600 ms. As shown in the next section, this time interval gives a number of threshold crossings sufficiently high to simulate with good statistics the tails of the threshold scan distribution. In figure 4a we report a small part of the simulated noise signal.
To check the accuracy of the noise simulation a discrete Fourier transform (DFT) of 10 6 consecutive noise values (corresponding to a 3 ms time interval) was performed. The results, shown in figure 4b, reproduce quite well the bandwidth assumed in the MC, giving confidence in the signal generation procedure. 2 The detector capacitance may modify the noise frequency spectrum. This effect has negligible consequence on the experimental results (see section 4.1) and therefore was neglected in the MC. The distribution of the noise amplitudes, calculated with equation (3.1) every 3 ns, is reported in figure 5a. The r.m.s. of this distribution, deduced from a Gaussian fit, is σ V = 173.1 ± 1.8. The same points, reported in figure 5b with logarithmic-quadratic scales, appear to be perfectly aligned up to (V /A) 2 ≃ 9 × 10 5 . This confirms that the distribution of the noise amplitudes is, with an excellent approximation, a Gaussian up to ∼ 6σ . As a further check σ V was also calculated from the series of generated values of V (t), according to the formula: a value in quite good agreement with the one obtained with the Gaussian fit.
The quantity σ V is related to the equivalent noise charge (ENC) which is defined as the δ -like charge sent to the front-end which delivers an output signal equal to σ V .

The discriminator counting rate
To identify the threshold crossings, a continuous noise signal was necessary. This was obtained by a linear interpolation between consecutive pairs of MC generated points. The discriminator was considered to fire when this signal crosses the threshold with positive (negative) slope for positive (negative) thresholds. The counting rate (R) of the discriminator was then determined as a function of its threshold. 3 The result is reported in figure 6a. The same points, reported in figure 6b with logarithmic-quadratic scales, are perfectly aligned up to (V thr /A) 2 ≃ 9 × 10 5 . This confirms [9][10][11] that the distribution of the noise counting rate (figure 6a) is, with an excellent approximation, a Gaussian up to ∼ 6σ . A Gaussian fit to this distribution gives an r.m.s. value σ R = 170.3 ± 1.5. Within the errors, the MC results shown in figure 5 and figure 6 confirm the relation predicted by Rice [9]: which links the r.m.s. of two a priori different distributions, and allows to evaluate σ V and therefore the ENC of a channel, by measuring its noise rate as a function of the discriminator threshold.
With an ideal discriminator without any bias interval, the counting rate would depend on V thr (figure 6a) according to the formula: The counting rate (R 0 ) at zero threshold, calculated from a fit to the MC results (figure 6), is 35.7 ± 1.7 MHz, in quite good agreement with the value calculated with the Rice formula 4 for a flat bandwidth: where f a = 20 MHz and f b = 50 MHz are the lower and upper cut-off frequencies of the bandwidth. 3 In this section the discriminator was assumed to have no bias interval. 4 The Rice formula [9] differs by a factor 2 from equation (3.5) because in that paper both the positive-slope and negative-slope threshold crossing are counted. If the exact passband G( f ) (figure 1b) of the front-end amplifier is considered, the rate at zero threshold may be calculated numerically from the general Rice formula [9]: where W ( f ) is the power spectrum of the noise at the input of the discriminator and W ( f ) ∝ G 2 ( f ) for white noise. From equation (3.6) it turns out to be R 0 ≃ 38 ± 3 MHz for negative polarity and of R 0 ≃ 40 ± 3 MHz for positive polarity, the error being due to non-perfect knowledge of G( f ).
At low threshold, and therefore at high counting rate, the effect of the dead time of the CAR-IOCA (∼ 55 ns for noise signal) must be considered. To evaluate this effect, the distribution of the time intervals between two consecutive threshold crossings was calculated with the MC. In figure 7 this distribution is reported for four threshold values. 5 At the lowest thresholds reached in the threshold scans (about 2−2.5σ , see section 4.1) the loss in couting rate due to the dead time is about 15-20%. This effect corresponds to a variation <2% on σ and was therefore neglected.

Threshold determination
The threshold scan of all the readout channels is performed regularly between two data taking periods. For each channel and for each threshold the noise is counted during 200 ms.
As an example, two threshold scans are shown in figure 8a and 8c, one for a readout channel belonging to region M3R3 (with a cathode readout and a pad capacitance of ∼ 91 pF) and the other to M5R4 (with an anode readout and a capacitance of ∼ 245 pF). The two arms of the experimental distributions being almost symmetrical, only the right-arms are considered 6 in the following. 5 The oscillating behaviour of these distributions is in agreement with the results reported in ref. [12]. 6 The left-arms can also be analized. In that case r 2 (figure 2) replace r 1 in all the equations. Taking into account the characteristics of the CARIOCA discriminator, the bias interval (V b ) and the threshold (V thr ) depend on the DAC register (figure 2) according to the relations: where α = 2.35 mV/r.u., r 0 is the interpolated DAC register corresponding to the threshold jump from positive to negative values and r 1 is the interpolated register corresponding to the zero threshold for the right arm of the threshold scan (figure 2). The experimental data, were represented on the plane ( (r.u. − r 1 ) 2 , ln R ) and fitted to a straight line given by the equation: where ln R ′ 0 and σ 2 are the parameters of the fit. The value of r 1 being a priori not known, the fit was repeated for different values of r 1 until the value of ln R ′ 0 obtained from the fit is as close as possible to the expected value of ln R 0 , where R 0 is given by equation (3.6).
It is worthwhile to note that in equation (4.3), σ is related to R ′ 0 through its logarithm. Therefore the effect of the detector capacitance on the noise spectrum and therefore on R ′ 0 has no significant consequence on the value of σ . In figure 8b and 8d the experimental points belonging to the right-arms of the threshold scans are reported with logarithmic-quadratic scales together with the results of the fitting procedure. The agreement is quite good up to ∼ 5 σ .
From equation (4.3) it turns out that the slope of the fitting line is inversely proportional to σ 2 i.e. to ENC 2 , For the two readout channels considered in figure 8 the results of the fits were for M3R3: σ = 4.36 r.u. = 10.2 mV; r 0 = 91.4 r.u.; r 1 = 80.3 r.u. and for M5R4:  1a and table 1), the values of σ correspond to an ENC = 0.80 fC for M3R3 and 1.89 fC for M5R4. In figure 9 the distribution of the bias voltage V b and of the ENC are reported for all the channels of the regions M3R3 and M5R4. In figure 10 the mean value of the bias (V b ) and of the ENC is reported as a function of the pad capacitance of all the different chamber types of the muon detector. As expected, V b is characteristic of the discriminator and is roughly independent of C det , while the increase of ENC with C det is approximately linear [13].
A summary of the measured characteristics of the readout channels of different regions is reported in table 1. The measured ENC values allow to set the working condition of each type of muon chamber for the LHCb data taking. In fact the thresholds should be sufficiently high to limit the counting rate due to electronic noise and sufficiently low to ensure the best time resolution and the maximum detection efficiency of the chambers. Taking into account all these conditions the thresholds were adjusted around 5-6 ENC for all chambers.

Malfunctionning channels and ageing effects
The method described allows to detect breakdown of some front-end or any possible ageing effects, by checking the stability of the ENC for all the readout channels. In figure 11a the ENC measured in the year 2012 is compared with that measured in 2009. Most of the channels are stable, and only few tens, out of 122k, show a significant change of their ENC value and need to be individually checked, repaired or replaced. In particular a series of channels (indicated by an arrow in figure 11a) appear to be aligned out of the scatter plot bisector which suggests a possible failure in the correct threshold setting by the DACs. Most of these channels belonged to the same boards, which were replaced. The distribution of the difference between the ENC measured in the years 2009 and 2012 is reported in figure 11b. The large peak around zero shows that most of the frontends are quite stable over many years and no ageing effects were observed up to 2 fb −1 , which corresponds to about one tenth of the total integrated luminosity expected in 10 years operation. Another signal of malfunctioning of a channel readout is an abnormal shape of the threshold scan. A typical example in shown in figure 12.

Conclusions
A new method has been introduced which allows to monitor the correct operation of the front-end channels of the LHCb muon detector and to set the optimal discriminator thresholds. The method consists in measuring the noise rate as a function of the discriminator thresholds. The resulting threshold scan distribution is fitted to a tail of a Gaussian as suggested by Rice theory and confirmed by a Monte Carlo simulation. The fitting procedure is greatly facilitated by the knowledge of the counting rate at zero threshold, which cannot be measured but can be calculated from the amplifier bandwidth using the Rice's formulas. For each threshold scan of a readout channel, the r.m.s. of the fitted Gaussian tail turns out to be equal to the equivalent noise charge (ENC) of that channel. The measurement of the ENC of all the channels allows to check for a possible malfunction or breakdown and to set the working values of the thresholds which satisfy the requirements of a low counting rate due to electronic noise and a high detection efficiency and time resolution of the chambers.