Tests of the CMS-ECAL Trigger Primitive Generation

We describe the On-detector Level-1 Trigger Logic associated with the CMS electromagnetic calorimeter. The purpose of this system is to reduce the acquisition rate from 40 MHz — the LHC bunch crossing frequency — down to a maximum rate of (cid:0)(cid:2)(cid:1)(cid:4)(cid:3) Hz. In order to take its decisions, the Level-1 Trigger relies on trigger primitives , i.e. summary information sent by the calorimeters and the muon detectors. The trigger primitives delivered by the CMS electromagnetic calorimeter are computed on the detector by a dedicated radiation-hard electronics. In this paper, we describe the Trigger Primitive Generation pipeline, and we present the ﬁrst results obtained from the beam tests of the ﬁrst prototypes. Presented by N. Regnault at Calor 2004 , Perugia, March 2004


Introduction
The Compact Muon Solenoid (CMS)[1] is a general-purpose detector, which will be operated at the Large Hadron Collider (LHC). The LHC is a proton-proton collider under construction at the European Laboratory for Particle Physics (CERN), Geneva, Switzerland. It is expected to deliver p-p collisions at with a nominal luminosity of . The CMS detector was designed to be sensitive to a wide range of new physics up to energies of a few TeV.
The CMS electromagnetic calorimeter (ECAL) [2] is made up of about 75,000 lead-tungstate (1 3 2 5 4 7 6 ) crystals. It has been designed to meet very strict energy resolution performance requirements, notably a stochastic term of about 2.7% and a constant term of 0.5%. These requirements were set in order to maximize the Higgs discovery potential in the "golden" channels The CMS detector will be operated at the LHC bunch crossing frequency of 40 MHz. Each bunch crossing produces about 20 interactions, most of them being minimum bias events. This event rate must be reduced down to a maximum level of 100 Hz in order to be sustainable by the archiving system. The CMS Trigger System will analyze the data coming from the detector in real time, and select only the potentially interesting physics events.
ECAL data, in the form of trigger primitives is sent to the Level-1 (LV1) calorimeter trigger processor, for each bunch crossing. For events satisfying the LV1 trigger requirements, an accept signal is returned in about 3 Q ¡ . These selected events are read out through the data acquisition system to the Filter Farm where further rate reduction is performed using the full detector data. The LV1 Trigger reduces the event rate down to a maximum level of

¢ ¡ £
Hz. The Filter Farm processing further reduces this rate by a factor ¡ to reach the required 100 Hz.
The trigger primitive generation (TPG) is the starting point of the trigger pipeline. For the ECAL, the TPG is performed on the detector, in a hostile environment, by electronics circuits, which will not be accessible once the detector is in operation. Hence great care is taken in testing these systems.
In this paper, we describe the Trigger Primitives Generation strategy developed for the ECAL subdetector. Section 2 will give a quick overview of the ECAL On-detector electronics. Section 3 will describe the trigger primitives sent by the ECAL to the trigger system. Section 4 will present the TPG pipeline implemented on the Front-End boards. Finally, the last section will present the first results obtained at CERN, in real conditions, using test beam data.

The CMS-ECAL Trigger and Readout System
The CMS-ECAL LV1-trigger and readout system is made up of two subsystems. The On-detector electronics, composed of radiation resistant circuits is located just behind the crystals. The Off-detector electronics is housed in underground counting rooms close to the experimental area. Both systems communicate through 90-meter long high-speed optical links, operated at 800 Mb/s. The CMS-ECAL readout system is structured into sets of R T S U R crystals. For each of these, five Very-Front-End (VFE) cards process the analog signal coming from the crystals, each VFE being assigned to a subset of 5 crystals. The VFE first amplifies and reshapes the signal using 3-gain amplifiers. The amplified pulses coming from each of the three amplifier channels are then sampled every 25 ns, using 12 bits ADCs. Finally, a digital selection logic selects the first non-saturated sample found in the highest gain channel. The IDs of the selected gain channels are then transmitted to a Front-End (FE) board, along with the 12 bit samples.
The FE stores the data awaiting a LV1 trigger decision during at most 128 bunch crossings, and implements most of the TPG pipeline. In the barrel, each FE is served by three optical links: two dedicated fibers for sending the data and trigger primitives respectively, and a third link which transmits the clock, control and LV1 trigger signals.
In the barrel, these R U S 7 R crystal sets correspond to the trigger towers. Each trigger tower is divided into 5 V X W oriented strips, whose energy deposits are summed by the FE board trigger pipeline to give the total transverse energy of the tower -the main trigger primitive.
In the endcaps, the size of the trigger cells varies, in order to follow approximately a projective geometry. The R Y S R readout cells are called supercrystals. They are divided into five 5-crystal, variable shaped, pseudo-strips. The trigger towers are composed of several pseudo-strips and may extend over several supercrystals. Since the readout structure does not match the trigger structure, only the pseudo-strip summations are performed on the detector. The total transverse energy of the trigger tower is computed by the off-detector electronics. Hence, each endcap FE board is served by 7 optical links, 5 of them being used to transmit the trigger primitives.

The CMS-ECAL Trigger Primitives
The trigger primitive generation logic implemented on the FE boards combines the digitized samples delivered by the VFE boards to determine (1) the total transverse energy ¢ ¡ deposited in the trigger tower (2) a compacity bit, which characterizes the lateral extension of the electromagnetic shower, and (3) the bunch crossing to which the event should be assigned. Indeed, since the sampled pulse coming from each crystal extends over several bunch crosses (£ § ), the trigger primitive generation logic must also deconvolve the signal from the time evolution of the pulse.
In the barrel, the trigger primitive generation logic is implemented as a 17 clock deep pipeline ) ¥ ¤ , operated at the LHC bunch crossing frequency. Ideally, its output should be a stream of zeroes, unless something hit the tower exactly 17 bunch crossings before, in which case the output is a word encoding the total transverse energy of the tower along with the compacity bit. The endcap pipeline is split between the on-detector and off-detector electronics and implements very similar algorithms. In the next section, we will briefly describe the internals of the barrel TPG logic.

The Trigger Primitive Generation Pipeline
The TPG pipeline which runs on each Front-End board is implemented by six radiation-hard ASICs called FENIX. The FENIX chip can be configured to operate in three different modes, two of these being used within the trigger pipeline.
Five of these chips are operated in a mode called STRIP. The inputs of each FENIX-STRIP are the samples coming from a VFE board. The chip computes the total transverse energy of the corresponding strip and performs the bunch-crossing assignment described in the previous section.
A simplified view of the FENIX-STRIP pipeline is presented on figure 1. Each input is first processed by a block called linearizer reconstructing the original pulse from the compressed samples delivered by the VFE. The linearizer also applies calibration constants and multiplies the signal by a factor ' § ¦ © in order to determine the transverse energy of the tower. The next block adds-up the five linearizer outputs. The amplitude of the resulting pulse is proportional to the total transverse energy deposited in the strip. The following block fits a pulse model on the samples, in order to determine the pulse amplitude. This block is implemented as a 5-sample deep linear filter , whose weights ) # are determined using a pulse model. Finally, the last block performs the bunch crossing assignment, by zeroing all its input samples, unless they correspond to a local maximum.
The outputs of the five FENIX-STRIP are then sent to a FENIX chip, operated in Trigger Cell Processor-mode (TCP). This last chip adds-up its inputs in order to compute the total energy of the tower,

¡ ¢ ¡
. It also generates the compacity bit, which estimates the lateral extension of the electromagnetic shower. The compacity bit is determined in the barrel by (1) computing the energy deposited in sets of two consecutive strips (2) determining the maximum of these four values ( , the compacity bit is set to 1.
The FENIX-TCP chip is also responsible for encoding the trigger primitives in 14-bit words and sending them to the off detector electronics over one of the two dedicated optical fibers which connect each FE board to the off-detector electronics.

Test Beam Preliminary Results
In the Fall of 2003, the CMS-ECAL collaboration exposed 100 crystals -4 trigger towers-equipped with the final prototypes of the On-detector electronics to the CERN SPS H4 beam. Electron beams at energies ranging from 15 to 200 GeV were used, as well as pion beams. Most of the data was taken using a first prototype of the VFE boards, containing a first version of the preamplifiers, as well as analog gain selection circuits. A second version of the VFE boards, with another version of the preamplifiers together with a digital gain selection logic and an improved shielding was used during the last days of the test period. Noise levels as low as 40 MeV / channel, meeting the CMS requirements were observed using this second setup. The results presented here were produced using the first dataset.
In the test beam experiment, electrons hit the detector at random times with respect to the 40 MHz clock used for sampling. Whenever an interaction was detected, 14 raw samples per crystal, plus 30 trigger primitive samples per tower were read out and stored for offline analysis. It was therefore possible to use the raw data samples to simulate the expected trigger primitives and compare them to the recorded primitives.

A full simulation of the Trigger Primitive Generation pipeline was written and integrated into the C++/ROOT[3]
test beam data analysis framework. The TPG simulation software was written in C++ using SystemC[4], a new digital hardware design and simulation framework, very similar to VHDL. SystemC proved to be fast, extremely flexible, simple to use, and easy to interface with ROOT. This simulation was used to analyze the trigger output of the FE prototypes and to assess the quality of the trigger primitives generated for the first time in real conditions.

Testing the TPG Pipeline
The trigger primitives are generated using the raw samples delivered by the VFEs. These raw samples are the same that are sent by the FE boards through the data stream. The simulation was fed with the raw samples coming from the data stream and used to predict the trigger primitives. More than ¡ ¡ patterns were sent through the simulation pipeline, and then compared to the recorded trigger stream. A perfect bit to bit match was observed for all the events. These tests allowed one to make sure that the TPG implementation was in full accordance with the specifications.
In order to work properly, the TPG pipeline must be configured -intercalibration constants and amplitude filter weights must be loaded into the FENIX chips. Many different hardware configurations were tried and successfully reproduced in the simulation. Especially, it was possible to deactivate selected blocks in order to study directly the output of the linearizers, amplitude filters or peak finders. This way all the internal blocks of the TPG pipeline could be tested.

Assessing the Quality of the Trigger Primitives
The TPG simulation was then used to study the quality of the trigger primitives. The linearity of the energy determination as a function of the beam energy was found to be excellent. Two other quantities were carefully studied: the bunch crossing assignment efficiency (as a function of the beam energy), and the trigger primitive energy resolution.
It was found that above 15 GeV -the lowest beam energy used to take data, the bunch crossing efficiency is about 100%. However, for CMS in-situ, energy deposits of a few GeV will be used to perform active isolation of electromagnetic showers in the LV1 trigger system. They also will be used to monitor the timing of the different channels within the TPG pipeline. Monte-Carlo data were generated in order to extrapolate the results down to energies of a few GeV, at which the efficiency starts dropping. Geant4[5] was used to simulate the energy deposits in the test beam setup. Then, simulated electronic signals were generated using pulse shapes previously determined from the dataset and electronics noise. Finally, the generated patterns were used as an input of the simulation to generate trigger primitives. At higher energies (above 15 GeV), an excellent consistency between the real and monte-carlo data were observed. Figure 2 presents the bunch crossing assignment efficiency obtained using monte-carlo data down to 1 GeV. At low energies, the efficiency is slightly lower than was required for CMS in-situ. This is due to the higher level of noise experienced with this setup. A much better result is expected with the dataset taken with an improved shielding of the electronics.
The trigger primitive energy resolution was also studied using real data, as well as monte-carlo data. Figure 3 shows the resolution curve obtained using monte-carlo data. The lower curve shows the intrinsic fluctuation of the energy deposited in the crystals. The middle curve corresponds to the fluctuations of the tower energy estimated using an optimized offline algorithm. The difference between the two curves is due to the electronics noise which can be studied that way. Finally, the upper curve shows the trigger primitive energy resolution. It is about 3 percent higher than what we obtain using an offline method. This deterioration comes from the fact that all the tower crystals are used to compute the energy, and also from the finite precision computations within the TPG pipeline.

Conclusions
The CMS-ECAL trigger primitive generation logic is implemented on the detector Front-End boards. This crucial part of the LV1 trigger pipeline was successfully tested in real conditions using the CERN SPS H4 beam, in the fall of 2003. The linearity of the trigger primitive energy determination was found to be excellent. The bunch crossing assignment efficiency could not yet be proven to fully meet the requirements at energies below 5 GeV, but it is expected to improve dramatically, as the noise level in the detector is reduced. First resolution curves were produced and are being compared with the optimal resolution curves derived from the offline analysis, in order to check the TPG uncertainty budget. In the summer of 2004, a supermodule -1700 crystals-fully equipped with the final electronics will be tested at CERN. The TPG stream will be fully characterized using this new dataset.