The CMS Drift Tube Trigger Track Finder

Muons are among the decay products of many new particles that may be discovered at the CERN Large Hadron Collider. At the first trigger level the identification of muons and the determination of their transverse momenta and location are performed by the Drift Tube Trigger Track Finder in the central region of the CMS (Compact Muon Solenoid) experiment, using track segments detected in the Drift Tube muon chambers. Track finding is performed both in pseudorapidity and azimuth. Track candidates are ranked and sorted, and the best four are delivered to the subsequent stage, the Global Muon Trigger, which combines them with candidates found in the two complementary muon systems of CMS, the Resistive Plate Chambers and the Cathode Strip Chambers. The concept, design, control and simulation software as well as tests and the expected performance of the Drift Tube Trigger Track Finder system are described.

The Barrel Regional Drift Tube Muon Trigger, also called Drift Tube Trigger Track Finder (DTTF), performs the Level-1 identification and selection of muons in the Drift Tube (DT) muon chambers [3] located in the central region of CMS. For each crossing of the LHC beams, which occurs every 25 ns for protons or every 125 ns for heavy ions, it assigns transverse momenta, location and quality information to found muon candidates. The latter reflects the level of confidence attributed to the parameter measurements, based on detailed knowledge of the detectors and trigger electronics and on the amount of information available. The candidates are sorted by rank, which is a function of transverse momentum and quality. The highest-ranked ones are transferred to the Global Muon Trigger (GMT) [4], which also receives muon candidates from the other two CMS muon detectors, the Resistive Plate Chambers (RPC) and the Cathode Strip Chambers (CSC) [3], and matches them with those from the DTTF. Like the DT chambers in the central part of CMS, the CSCs are precision muon chambers with triggering capability. They cover the forward region. The RPCs are dedicated trigger chambers in the central and forward regions. The GMT, using sophisticated algorithms, determines the four highest-ranked muon candidates in the entire CMS detector and transfers them to the Global Trigger [5], which takes the final Level-1 Trigger Accept (L1A) decision based on information from all trigger detectors.

Overview of the Drift Tube Muon Trigger System
The DTTF uses track segment information of candidate muons delivered by the local trigger electronics of the DT chambers [1,6] in the barrel region of CMS. The chambers are arranged in four muon stations (MB1, MB2, MB3, MB4 in increasing radius) embedded in the iron yoke surrounding the superconducting magnet coil. Similarly, in the endcap regions the CSCs are arranged in four stations, ME1, ME2, ME3 and ME4. ME1 is the innermost station seen from the interaction point. Each DT chamber consists of staggered planes of drift cells. Four planes are glued together and form a superlayer. The three innermost stations are made of chambers with three superlayers. The inner and outer superlayers measure the azimuthal coordinate ϕ in the bending plane transverse to the accelerator beams. The central superlayer measures η, the pseudorapidity coordinate along the beam direction. The fourth muon station has only ϕ-superlayers.
For triggering purposes, the DT chambers are organized in sectors and wedges. The layout is shown in figure 1. The CMS barrel iron yoke is made of five wheels along the detector axis in beam direction. Wheels are subdivided in twelve 30 • -sectors in azimuth. There are twelve horizontal wedges. Each wedge has five 30 • -sectors in ϕ. For track finding purposes, the sectors of the central wheel are logically split into two parts.
In the forward regions, the CSC Track Finder (CSCTF) [7,8] determines Level-1 muon candidates. The DTTF and the CSCTF exchange information from the overlap region between the barrel and the endcap muon chambers with each other. RPCs complement both DT and CSC chambers. Compared to these chambers, they have an excellent timing resolution, but an inferior resolution in momentum and position due to large pad sizes in azimuth. They provide their own muon candidates to the GMT, which tries to match them with DT and CSC candidates, thus improving resolution and increasing the geometrical acceptance.
The local trigger electronics of the DT chambers delivers track segments (TS) in the ϕprojection and hit patterns in the η-projection through optical links. It also identifies the bunch crossing (BX) to which these belong. A segment is reconstructed if at least three out of four planes of drift cells have been hit and if the hits can be aligned. Segments in ϕ are first reconstructed separately in each of the two ϕ-superlayers. A track correlator (TRACO) then tries to match them and outputs a single ϕ-segment if the correlation was successful. From each muon chamber at most two segments with the smallest bending angles or, in other words, the highest transverse momenta, are forwarded to the DTTF.
The tasks of the DTTF are to reconstruct complete muon track candidates starting from the track segments, and to assign transverse momenta, ϕ-and η-coordinates, as well as quality information. The transverse momentum is calculated from the track bending in the ϕ-projection caused by the magnetic field in the return yoke. Using the information from this projection alone also allows a coarse assignment of η by determining which chambers were crossed by the track. The information from the η-superlayers is used to determine the η-coordinate with even higher precision. The refined η-assignment relies on track finding performed in the non-bending plane and on matching the found tracks with those of the ϕ-projection. The track finding in ϕ is performed by sector processors, also called Phi Track Finders (PHTF), which use an extrapolation principle to join track segments. There are 72 PHTF boards. As explained above, the sectors of the central wheel are logically subdivided into two parts. There are hence 24 boards covering the twelve sectors of the central wheel, and 48 boards covering the twelve sectors of each of the four outer wheels. Since muon tracks can cross sector boundaries, information has to be exchanged between sector processors, and a cancellation scheme to avoid duplicated tracks has to be incorporated. Tracks starting in the central wheel can either remain in it or continue to the positive-side or negative-side wheels. The twelve central wheel processors for the positive side are assigned to find tracks that do not exit the central wheel or that exit it on the positive side only. The twelve central wheel processors for the negative side deal with the tracks that exit at the negative side. Splitting the central sectors in two in such a way leads to a reduction in the number of required electrical connections.  The track finding in η and the assignment of refined η-values are performed by twelve ηprocessors, also called Eta Track Finders (ETTF). Each ETTF covers one wedge. For each wedge, the combined output of the PHTFs and the ETTFs, which consists of the transverse momentum including the electric charge, the ϕ-and η-values and quality for at most twelve muon candidates corresponding to a maximum of two track candidates per 30 • -sector, is delivered to a first sorting stage, the Wedge Sorter (WS). There are twelve of these sorters. The two highest-rank muons found in each WS are then transmitted to the final Barrel Sorter (BS). The latter selects the best four candidates in the entire central region of CMS, which are then delivered to the Global Muon Trigger for matching with the RPC and CSC candidates. The DTTF data, which contain input and output trigger information as specified in section 6, are permanently recorded by the data acquisition system. A special readout unit, the DAQ Concentrator Card (DCC) has been developed. It gathers the data from each wedge, through six Data Link Interface Boards (DLI). Each DLI serves two wedges. A Fast Signal Interface Card (FSC) has also been developed in order to prevent buffer overflows in case of too high trigger rates. Its functionality is explained in section 6.
All electronic modules of the DTTF are built using field programmable gate arrays (FPGA). They are located in three racks in the counting room adjacent to the CMS experimental cavern. Two racks contain six track finder crates (figure 2, left), which each house the electronics for two wedges as well as a CAEN VN2738 Crate Controller [9]. There are 25 input optical fibres per wedge, corresponding to 300 fibres in total. In order to receive the global clock and timing signals, there is one Timing Module (TIM) in each of these crates. The third rack houses the central crate (figure 2, right) containing the BS, the DCC, the FSC, a TIM module, and electronics for interfacing with the LHC machine clock and the CMS Trigger Control System [10]. The crates are 9U × 400 mm Wiener 6023 crates, with 5V/3.3V/115A power supplies [11]. A 6U-crate for testing purposes, with a CAEN V2718 crate controller [12], is also located in this rack. For control purposes, three 2U-high Dell Power Edge 2850 PCs housed in a separate rack containing also PCs for other subsystems, are available. Each PC controls one rack.  On-line and off-line software to configure, operate and test the DTTF has been developed. Extrapolation and assignment look-up tables (LUT) for the PHTFs, and η-patterns for the ETTFs have initially been generated by Monte Carlo simulation. As soon as the LHC starts its operation, they will be tuned using real muon tracks. The configuration parameters are loaded into the FPGAs using the Trigger Supervisor framework [13], a software system that controls the CMS trigger components. General monitoring software for the DTTF is provided within the CMS monitoring framework. Detailed hardware monitoring is available through a spy program, which allows to collect data independently of the central data acquisition (DAQ) system. Pattern test programs are accessible through the Trigger Supervisor for routine checks during normal operation. Specific programs for the commissioning of all electronics modules have also been developed for local use. Some pre-production DTTF modules as well as software have been evaluated in a muon beam test at the CERN Super-Proton-Synchrotron [14,15], and with cosmic muons during the CMS "Magnet Test / Cosmic Challenge" (MTCC) [16].

Phi Track Finder
The tasks of the Phi Track Finder system are to join compatible track segments to complete muon tracks and to assign transverse momentum, charge, location and quality parameters. The individual PHTF sector processors receive the track segments from the local trigger of the DT chambers through approximately 60 m long optical links operated in Gbit-Ethernet mode with 8bit/10bit encoding and a gross transmission rate of 1.6 Gb/s [17,18]. The deserializers are embedded in Altera StratixGX devices [19]. Parity checking is automatic. All PHTF boards except the ones for the negative side of Wheel 0 receive four links. The DT local trigger delivers at most two TS per chamber in the ϕ-projection. The number of physical chambers is 250, but the trigger information for the top and bottom sectors, which are covered by two MB4 chambers in each wheel, is combined, so that there are only 240 logical chambers. A maximum of 480 TS may therefore be available. The TS information is composed of the relative position of a segment inside a sector (φ , 12 bits), its bending angle (φ b , 10 bits) and a quality code (3 bits) which indicates how many drift cells per superlayer have been used to generate the TS. The TS of muon station MB3 contain no φ b -information as the bending is always close to zero at this station due to the magnetic field configuration. If there are two TS present in a chamber, the second TS is not sent at the bunch crossing from which it originated but at the subsequent one, provided that in this next BX no other segment occurred, the probability of which is negligible. A tag bit to indicate this "second TS" status is therefore necessary. Furthermore, the BX number and a calibration bit are part of the TS information. The PHTF sector processors attempt to join track segments to form complete tracks. Starting from a source segment, they look for target segments that are compatible with respect to position and bending angle in the other muon stations. The parameters of all compatible segments are pre-calculated. Extrapolation windows, which are adjustable, are stored in LUTs. Muon tracks can cross sector boundaries, therefore data have to be exchanged between sector processors. Figure 5 explains the basic extrapolation scheme in ϕ.
Each PHTF is made of dedicated units, as shown in figure 6. The units operate in a pipelined mode. A total of 16 BX is needed to perform all steps of the track finding.
The Input Receiver and Deserializer Unit receives and synchronizes 110 bits of data per BX from each optical link. In a first step clock phase corrections are made by oversampling four times at 160 MHz. Then the correct BX is determined, thus compensating the differences in input fibre lengths. If two TS are present in a chamber, it is also necessary to deserialize them, since they are originally sent in subsequent crossings. The next step is the Extrapolator, which determines if TS pairs originate from the same muon track. From stations 1 and 2 extrapolations to all outer stations are performed (station 1 to stations 2, 3 and 4; station 2 to stations 3 and 4). It is not possible to start extrapolations from station 3 due to the too small bending angle φ b , for all possible transverse momenta. Nevertheless, a backward   extrapolation from station 4 to station 3 is performed. There is also an option to make an additional extrapolation from station 2 to station 1 if the first station has too many hits due to hadron punchthrough or noise. The PHTFs exchange TS information with neighbours since tracks can cross sector boundaries. Concerning the η-projection, the PHTFs get TS information only from the PHTFs of higher η-ranges, since tracks do not significantly bend or scatter in this projection. The processors of the outermost wheels exchange TS information with the sectors of the CSC ME1 chambers in both endcaps through cables connected to dedicated DT/CSC transition boards. Concerning the ϕprojection, a PHTF needs track segments from the neighbouring PHTFs of its own wheel and also from those of the next wheel at higher |η|. Figure 7 shows the pattern of neighbour connections for a group of PHTFs, which is repetitive across the DT system.
Every PHTF processor, except those in the central wheel (Wheel 0), forwards its input to five other PHTFs, one previous wheel neighbour at lower |η| in its own wedge, and two sideways neighbours in its own wheel and the previous wheel. Due to the large number of required neighbour connections the tasks of the central wheel are shared by two PHTFs per wedge. One of them  For each TS pair there is a LUT that contains the extrapolation window depending on the φ b angle (figure 5). The sizes of the extrapolation windows, which depend strongly on the source and target stations, can be tuned to physics requirements or experimental conditions. More details are given in section 8, and typical window sizes are shown in figure 15. An extrapolation is successful if the φ -position in the target station is inside the window predicted by the LUT. The extrapolation results are stored in 12-bit and 6-bit tables. A bit set to 1 indicates a valid extrapolation. The 12-bit tables are the results of the TS pairs that have the source in the reference wheel of the PHTF processor. The 6-bit tables belong to the TS that have the source in the next wheel. A source TS in the reference wheel can have twelve potential targets, 6 in the reference wheel and 6 in the next wheel. A source TS in the next wheel can, however, only have 6 targets in that next wheel, because a muon that left the reference wheel never returns. The total bit count of all extrapolation result tables per sector processor is 180 bits. The Extrapolator also has the possibility to filter out low quality TS, which can occur if the BX could not be correctly assigned by the local DT trigger electronics.
The next step after extrapolation is to determine which TS originate from a single muon track. It is performed by the Track Assembling Unit, which links compatible TS into complete tracks. It starts by searching for the longest possible track. All TS used for this track are then cancelled. The procedure is repeated with the remaining TS, until no more TS can be joined. Tracks are linked by combining AND-relations of extrapolation results according to a priority scheme. The output of the Track Assembling Unit contains the addresses of each TS participating in the found track. The track address, also called an index, indicates whether a TS is coming from the same wheel as the PHTF processor or from the next wheel. The output data are sent to the Pipe and Selection Unit. Subsets of output data are also sent to the Parameter Assignment Unit described below, the ETTF processors and the wedge sorters. The Pipe and Selection Unit keeps all input TS until the addresses of the two longest tracks are found. When the addresses are available, a multiplexer at the end of the pipeline selects the TS parameters of the found tracks and forwards them to the Parameter Assignment Units.  Based on the TS parameters belonging to a track, the Parameter Assignment Units attribute physical quantities to a track. In particular, the transverse momentum (5 bits), the sector local φvalue at muon station 2 (6 bits), the electric charge (1 bit) and the track quality (3 bits) are assigned. The p T -and the charge assignment are based on the φ -value difference in the two innermost stations participating in the track. The local φ -values are obtained using the six most significant bits of the input φ -values at station 2. If no TS is present at station 2, the φ -value is obtained through extrapolation from the innermost TS present. The quality parameter reflects the number and combination of muon stations participating in a track [1]. The maximum quality of 7 is assigned if a muon was reconstructed from TS in all four stations.

Eta Track Finder
The geometry and the magnetic field configuration method make it impossible to derive from the η-information the physical parameters of a muon track in a standalone way. A pattern matching rather than an extrapolation method was chosen [20], since for muon stations 1, 2 and 3 the ηinformation coming from the DT local trigger through 60 optical links [17] is delivered as a 14-bit pattern, containing two bits for each of seven adjacent chamber areas. The first bit indicates whether there was a hit in the area, the second one defines a quality. If all four planes of an η-superlayer are hit, a quality bit of 1 is assigned. If only three out of four planes are hit, the quality bit is set to 0. If fewer than three planes are hit, no η-segment is considered to be found and the corresponding pattern bit is set to 0. Predefined track patterns -basically straight-line patterns, but taking into account multiple scattering and the actual magnetic field configuration -are compared with the actual hit pattern (figure 8). If a track in the η-projection is found, a matching with the information from the ϕ-projection is attempted. The latter is a coded number, the η-category, which indicates if and where a track crossed wheels. If a matching is possible, the rough η-value deduced from the track finding in ϕ is replaced by the more precise value found in η.
The patterns of possible tracks are grouped according to the geometrical features determined by the output η-values. A group contains all possible patterns belonging to the same output ηvalue, ordered by quality. The patterns of muons crossing more stations have higher priority. To create the patterns the ETTF hardware sets up AND-conditions for the corresponding hit and quali-ty bits. The combinations with the same priority are ORed afterwards. The highest priority pattern for a muon in each group is selected by a priority encoder. The outputs of this first level priority selection are also grouped by their positions in the η-category delivered by the PHTF units. Inside each category a new priority list is generated using the same principles as in the previous priority setup. The result of this selection is used for matching if one of the PHTFs of a wedge also found a muon in the corresponding category group. If a matching is possible, a high-precision or "fine" global η-value is assigned to the muon. It is defined at station 2 if a hit in that station belongs to the used pattern. If not, stations 3 or 1 are used, in preferential ordering. If the ETTF does not find any muon in the group where the PHTF found one, it assigns a rough global η-value and sends a "rough" tag in the output to indicate how the η of the muon was generated. If the PHTF delivers more than one muon inside one group, no matching is performed and the rough η-value is delivered. The ETTF delivers the η-values at the same time as the PHTF delivers the physical parameters of the found tracks to the Wedge Sorter. The WS can therefore handle them as a single entity.

Sorting
The task of the muon sorting stage is to select the four highest-rank barrel muon candidates among the up to 144 tracks received from the PHTF sector processors and to forward them to the Global Muon Trigger. Suppression of duplicate candidates found by adjacent sector processors is also performed by the sorters. Due to the partitioning of the system it is possible that more than one PHTF reconstructs the same muon candidate, which would lead to a fake increase in the rate of dimuon events. This background has to be suppressed at least to below the real dimuon rate, which amounts to about 1% of the single muon rate. The sorting and the fake track cancellation is performed in two stages: twelve Wedge Sorter boards select up to two muons out of the at most twelve candidates collected from a wedge of the barrel. One single Barrel Sorter board performs the final selection of four tracks out of the up to 24 candidates collected from the WS boards.

Wedge Sorter
As it is shown in figure 9, if a muon track crosses the boundaries between wheels, two neighbouring PHTFs can build the same track, since they operate independently within their own sectors. Thus, a single muon can be reconstructed twice and two muons could be forwarded to the subsequent stages of the trigger.
The Wedge Sorter receives encoded information about the position of local track segments used by the PHTF to build the tracks. Moreover, each track has a reconstruction quality attached. If two muons from consecutive sectors are found to be built with common segments, the Wedge Sorter cancels the member of the pair with the lower reconstruction quality. After the suppression of fake tracks the WS has to sort out the best two tracks among the received sample. This is done according to 8-bit ranking words, made of reconstruction quality (3 bits) and transverse momentum values (5 bits). A fully parallel one-step sorting algorithm is used.
As it is illustrated in figure 10, the WS receives, through a custom backplane, two muon candidates from each of the six PHTFs with their parameters coded as 24-bit words. The corresponding η-information for each candidate is received from the ETTF coded as 7-bit words through a front panel connector. The fake track suppression and the sorting are performed in two BX or 50 ns, after which the two highest-rank muon candidates are sent to the Barrel Sorter, through two low-voltage differential signaling (LVDS) links. The alghorithms used for the fake suppression and the sorting can be configured in different modes through internal registers. The WS operates at 40 MHz.

Barrel Sorter
The Barrel Sorter has to suppress fake tracks and select the best four candidates over the full barrel region and forward them to the Global Muon Trigger. It receives up to two muon candidates from each of the twelve Wedge Sorters. The muon tracks delivered by the Wedge Sorters to the Barrel Sorter still contain the information about the track segments used in the reconstruction by the PHTF. Just like in the Wedge Sorter along a wedge, each of two adjacent PHTFs can build a candidate if a muon track crosses the boundaries between wheels or neighbouring sectors in ϕ.
From the local φ -positions and the sector position of the PHTF output a CMS global ϕ-value (8 bits) is calculated. The Barrel Sorter cancels the track with the lower reconstruction quality if two muons from adjacent sectors in a wheel are found to be built with common segments. Simulations of single muon events show that the combined fake track cancellation algorithms performed by the WS and the BS allow to limit the fake dimuon rate to a level of 0.3%, as is shown in table 1.
After suppression of fake tracks the BS has to sort the four highest-rank tracks out of the possible 24 candidates received from the twelve Wedge Sorters. This is again done according to 8-bit ranking words made of reconstruction quality and transverse momentum values. Per muon candidate, the input track data consist of 31 bits, while the output track data are 32-bit words. The full algorithm input/output bit count is 872, corresponding to 744 bits from 24 input muons and 128 bits from four output muons. The latency for duplicate track cancellation, sorting and multiplexing operations is limited to 3 BX or 75 ns by running at 80 MHz internally. The best four candidates are then sent through LVDS links to the Global Muon Trigger. Different modes of operation are configurable through internal registers, and the data flow inside the BS can be monitored through spy registers. For test purposes, a standalone trigger signal can be delivered by the BS, according to trigger conditions that can be set through configuration registers.

Timing and synchronization
The LHC machine broadcasts its 40.08 MHz bunch-crossing clock and 11.246 kHz orbit signals through the TTC (Timing, Trigger and Control) network [21] with high-power laser transmitters over single-mode optical fibres to the experiments. Each of the DTTF crates has a timing module to distribute the clock to the individual DTTF boards, which are equipped with clock receivers and a multichannel clock distribution system. The core of this system is a sophisticated phase-locked loop (PLL) clock chip (Cypress RoboClockII TM CY7B994V [22]) with several grouped clock outputs. The sub-units of the boards are individually clocked by these clock output lines. The PLL clock chip allows to determine different clock phase and delay values for each group, which makes it possible to choose optimal values for the input links and also for the data transmission between system sub-units. The clock chip output groups are controlled by the clock control lines of the Controller FPGA, driven by the clock control registers. Their delay and phase values are programmable.
In addition to the clock, the TIM modules also send the bunch crossing zero (BC0) signal, the bunch counter reset (BCRes) signal and the Level-1 Trigger Accept decision to the DCC board and to the DAQ and spy modules contained in many of the blocks of the DTTF. In order to check that muon tracks are correctly assigned to the bunch crossing from which they originated, the BC0 signal is sent together with the track data. The orbit gap position is compared to the BC0 signal contained in the data. In the Barrel Sorter it is also possible to detect any synchronization misalignment among the twelve Wedge Sorters. A VME error register can be read out.
The overall latency of the DTTF system, from the input to the optical receivers to the output of the BS is 29 BX. An additional 3 BX are needed to transfer the data from the BS to the Global Muon Trigger. Changes in latency should not occur due to the rigid pipelining. However, such a change would be immediately discovered from the data themselves, through the monitoring.

Readout
The DTTF sends data to the CMS DAQ system for readout. The DTTF readout scheme is shown in figure 11. Each PHTF and ETTF FPGA contains local DAQ blocks. The PHTFs have three local DAQ blocks, which contain the input track segments, the track addresses, and the output track parameters, respectively. The ETTFs have only two local DAQ blocks, which contain the input pattern bits and the output η-values. From the local DAQ blocks the data are sent as a TTL serial bit stream through an LVDS interface to the Data Link Interface board of each track finder crate, and then forwarded to the DTTF readout board, the DAQ Concentrator Card, via Channel Link TM connections [23]. This board houses an interface, from which the data are sent to the central DAQ system. The interface, link and transmission protocol S-link64 have been developed at CERN [24].
The DTTF data record is composed of all input and output signals from the triggered BX, its predecessor and its successor. Headers and trailers, including a cyclic redundancy code to detect data transmission errors and the record length, are added. Each triggered event contains 53244 bits of input and output data, composed of 3 × 214 bits per PHTF and 3 × 195 bits per ETTF. At the maximally allowed Level-1 trigger rate of 100 kHz this would amount to a data rate of 5.32 Gbit/s or 665 MByte/s. The DAQ system only allows 2 kByte of data for each DTTF Level-1 event on average, which is equivalent to a bandwidth of 200 MByte/s. Therefore a data compression has to be performed. Simulations have confirmed that a simple zero suppression scheme is adequate. The input data blocks are split into data words according to the contents of the local DAQ blocks explained above. If the input and output data in both Track Finders contain zero quality, the data word is considered as null data and is suppressed. If the PHTF track address word has all bits set to one it will also be considered as a null track. The ETTF input hit pattern data words are treated as null data if no hit appears, which is equivalent to all bits set to zero. The DCC compresses the data blocks in real time. The final event size per triggering muon ranges between 512 and 640 bits.
A mechanism has been developed in order to prevent buffer overflows in case of too high trigger rates. The derandomizer buffer depths of the local DAQ blocks are dimensioned such that on average an overflow would occur not more often than once every 27 hours. The DCC board emulates the status of these buffers. If it finds that 75% of buffer space is filled, a warning signal is issued to the Fast Signal Interface Card, which in turn sends it to the central Trigger Control System. The latter then initiates the execution of predefined trigger throttling rules, such as applying prescale factors, to avoid the loss of events.

Tests
In October 2004 the DTTF behavior was studied in a test beam at CERN. All PHTF features, except track assembling, were validated. The experimental configuration consisted of two DT chambers (one MB1 and one MB3), equipped with readout and trigger electronics, one PHTF, one TIM, and one WS prototype board. Input and output PHTF information were recorded at 40 BX slots around the trigger using two Pattern Units [26]. Full information about all steps of the PHTF track finding process in 10 BX slots around the trigger was accessed using Spy DAQ (section 9.1). A full account of the results of the 2004 beam test analysis may be found in [14,15]. The most important results are outlined below.
In figure 12 the black histogram and triangles show the PHTF input occupancy as a function of BX for the MB1 and MB3 chambers, respectively. The correct trigger BX number is 24. One can observe high efficiency at the right BX number, at the cost of a significant (order 10-15%) component of ghost TS at the wrong BX number. The red or light-grey distribution shows the effect of a conventional coincidence analysis; the level of ghost coincidences at the wrong BX numbers has been reduced by about a factor 2.5 with respect to the MB1 and MB3 single chamber occupancies. The difference between the red or light-grey and the solid blue or dark-grey histograms illustrates the importance of the original PHTF extrapolation approach. The ghost component is reduced by an additional factor 6, to below the 1% occupancy level. The flat input component at the level of 0.2% corresponds to real out-of-time test beam muons. Figure 13 (left) illustrates the PHTF extrapolation principle in the φ b − ∆φ plane for test beam muons. The reconstructed PHTF tracks (red or light-grey points) lie in the narrow window allowed by the extrapolation LUTs (blue or dark-grey lines). The black points are wrong associa-  tions and are not reconstructed by the PHTF extrapolation algorithm. Figure 13 (right) illustrates the PHTF p T -assignment technique in the p T − ∆φ plane. The black points are test beam muon events. The green or light-grey (red or dark-grey) segments represent the high-p T (low-p T ) p Tassignment LUT values, for which the scales differ in granularity. Units of p T are CMS trigger p T -bins. The switch-over between the two regions is at about p T = 17 GeV/c, corresponding to a physical p T = 20 GeV/c.
The data analysis results showed in all cases excellent agreement with the design performance requirements, in particular 98% efficiency to reconstruct tracks at the right BX, and the expected ghost rejection power at the wrong BX [14,15].
In August 2006, the DT Trigger, including the DTTF, has provided a 3-sector cosmic trigger for CMS at the MTCC. The DTTF hardware included 3 PHTFs, one TIM, one WS, and one BS production board. The BS TTL output line defined the CMS L1A signal. The software setup included Spy DAQ, on-line monitoring, and a C++ bit level emulator program (section 9). Figure 14 (left) shows an oscilloscope screenshot of one DTTF triggered cosmic event at the MTCC. Pulses in Tracks #1, #2, and, #3 represent synchronized PHTF input TS at stations 1, 2, and 3, respectively, in Wheel 2 Sector 10. The pulse in Track #4 represents the BS L1A signal, after 29 BX (from the PHTF input to the BS output). At the MTCC, a total of 25 million events, at 0 T and 4 T magnetic field, with the electromagnetic and hadronic calorimeters and the tracker in the readout, were recorded. Also, integration tests of the DTTF with the CSCTF and the GMT, at the electronics and physics levels, were performed successfully.
From the DTTF point of view, the MTCC was the first opportunity to validate triggers coming from long tracks (track assembling), tracks changing wheels and/or sectors, and dimuons. For this purpose a sample of 2.5 million events was accumulated using Spy DAQ. Figure 14 (right) shows the extrapolation correlation for cosmic muons in stations 1 and 2 of Wheel 2 Sector 10. The analysis of the data has shown perfect agreement of the hardware performance with the expected behavior in all cases.

Configuration
In order to fulfill the requirements, the DTTF boards have to be configured appropriately. The connection between the DTTF electronic model and physics is implemented via look-up tables in the PHTF boards, and via η-patterns in the ETTF boards.
There are two instances of LUTs in the PHTF boards: extrapolation LUTs and assignment LUTs. The PHTF extrapolation LUTs implement the PHTF extrapolation scheme discussed in section 3.1. Extrapolations between the following station pairs are performed: MB1 to MB2, MB3, MB4, and ME1; MB2 to MB1, MB3, MB4, and ME1; and MB4 to MB3. The φ b and φ resolution is 8 bits, corresponding to the 8 most significant bits of the 12-bit ϕ-values. For every extrapolation there are two LUT files, one containing the upper limit of the extrapolation window, and the second the lower limit. The total size of a one extrapolation LUT file is 1.5 kB. The total size of the extrapolation LUTs stored in one PHTF is 27 kB.
Two kinds of extrapolation windows have been generated and used up to now. The first set was generated using ORCA [27] simulated single muon events with a transverse momentum distribu-tion between 3 and 100 GeV/c, and flat distributions in azimuth and pseudorapidity. LUT windows were calculated at fixed extrapolation (99%) efficiency for events with a TRACO-correlated TS in the source station. Since the size of the extrapolation window should represent a balance between muon trigger efficiency and background rejection, it was found convenient to explicitly link the calculation to a meaningful physics parameter such as efficiency. Figure 15 (left) shows a typical extrapolation LUT in the φ b − ∆φ plane (MB1 to MB2). Points are ORCA simulated muons, the white (blue) area is the allowed (forbidden, respectively) extrapolation region. At CMS, also TRACO-uncorrelated TS will be used. The overall extrapolation efficiency design goal was targeted at 94%. The ghost background rejection power should be of the order of 10.
Simulated LUTs downloaded into the hardware have been used at all instances of prototype testing and production quality control, checking the hardware performance with large samples of single-and di-muon simulated events. In addition, the same LUT windows were used at the 2004 beam test.
A second set of LUTs with maximally opened extrapolation windows has been produced and used to test special configurations of the DTTF system. The open LUTs are important in order to accumulate unbiased samples of muon and background data. A first important example has been the CMS DT cosmic trigger at the MTCC. Even more important will be the ability to accumulate unbiased samples of confirmed muon data, from J/ψ, W , and Z decays, during the first months of CMS data taking. The first DTTF trigger configuration is expected to be "trigger on every muon", implemented via open LUTs. Using these unbiased samples and given the size of the measured background levels, one of the first tasks will be to compute the physics extrapolation LUTs.
The PHTF boards use LUTs for muon output ϕ position and p T assignment. The p T LUTs assign transverse momentum at fixed trigger transverse momentum cut efficiency (90%). For p Tassignment, six extrapolations are used in preferential ordering (MB1 to MB2, MB3, MB4; MB2 to MB3, MB4; MB4 to MB3). For every extrapolation, two p T -assignment LUT files are calculated: one for low-p T muons and the other for high-p T muons. The separation between the two is decided according to the value of φ b at the source station. The p T -granularity is reported on a 5-bit nonlinear scale. The size of one p T -assignment LUT file is 6 kB. The total size of the p T -assignment LUT files stored in a PHTF is 72 kB.
The ϕ-assignment LUTs map the individual PHTF local φ -coordinate at station MB2 into the CMS global ϕ-coordinate. For PHTF muon candidates with a TS in station MB2, the mapping is direct using 10-bit φ resolution. For muon candidates with no actual TS in station MB2, extrapolation from stations MB1 or MB4 (in preferential ordering) has to be performed first. The size of one file is 6 kB. The total size of the three PHTF ϕ-assignment LUT files is 18 kB. Figure 15 (right) shows a typical high-p T -assignment LUT in the p T − ∆φ plane (MB1 to MB2). Simulated p T LUTs are expected to be used during the first months of CMS running. The DTTF is not cutting directly using the assigned p T -values. In CMS, all trigger cuts are implemented at the Global Trigger. Using unbiased samples of reconstructed muons and the p T -values measured at the CMS Tracker, the actual physics LUTs will be calculated.
In principle, the PHTF granularity implies that different extrapolation and assignment LUTs can be used for every different DT wheel and sector. Simulation studies have shown that the effect of a misaligned muon detector will be negligible at the DT trigger level [28], therefore it is not expected that the sector degree of freedom will have to be used. Use of different sets of extrapolation and, especially, p T -assignment LUTs as a function of the wheel number is not excluded, as effects of backgrounds, dead material, and magnetic field depend mostly on pseudorapidity. The final need of this will be evaluated using the data.
The ETTF boards use η-patterns to find tracks in the CMS non-bending plane. The ETTF η-patterns are not stored in LUTs, but directly embedded in the VHDL η-pattern finding logic. The total number of possible η-patterns in the hardware is 2346. The assigned η-granularity is 6 bits, in the pseudorapidity region -1.2 to 1.2. If no η-pattern is found, the DTTF muons are still assigned a rough value of η, based on the position where the muon crossed wheels. There are twelve such cases per wheel. The rough value of η in each case is at the center of the corresponding pseudorapidity window. Simulation results show that the probability that an actual η-pattern does not appear in the list is smaller than 0.1%. This number is negligible compared to the fraction of muons with rough η-assignment due to DT inefficiencies (intrinsic or geometrical), which is 10%. The effect on the allowed set of η-patterns from muon detector misalignment is also negligible.

On-line software
The DTTF on-line software provides applications to control, monitor and test all modules of the system. The software is developed in the CMS XDAQ on-line software framework [2], which features a client-server architecture. Besides other things the XDAQ framework provides applications with services to communicate amongst each other in a distributed environment. Control of the applications is provided via a SOAP server embedded in the framework. On reception of SOAP control messages the server invokes specific callback methods in the applications, which then execute the code necessary to control and operate the hardware. In CMS VME hardware is generally accessed from Linux PCs via a PCI to VME bridge. The XDAQ framework contains libraries providing high level access to VME hardware. These libraries make the XDAQ applications independent of the specific hardware used to access the VME modules. On the DTTF client side, the software has evolved from customized Java/XML Graphical User Interfaces to integration in the CMS Trigger Supervisor framework [13], along with all the other CMS trigger subsystems.
Access to all input, output, and intermediate DTTF signals is mandatory. At the hardware level, the solution adopted was serial (JTAG) access. The PHTF and ETTF boards contain three JTAG chains. The first two chains are the standard built-in ones, for FPGA programming and Boundary Scan purposes, respectively. In addition, a third JTAG chain implements the more sophisticated spy system. Spying allows synchronous and triggerable access to the data. After triggering, sequential access to VME registers allows reading the data stored in every spy block. From the software point of view, the spy system provides the basis of the dynamic functionality tests, and, ultimately, of SpyDAQ, the local DAQ system of the DTTF.

Simulation software
A full C++ simulation of the DTTF system has been produced, using object-oriented programming.
The goal of the simulation is twofold. First, it allows event-by-event comparison of the hardware results versus the C++ simulated ones. In this mode, the simulation works as a DTTF emulator. The C++ emulator performance was validated at the DTTF design phase against the VHDL Figure 16. Comparison of several characteristics of the actual and emulated PHTF output at the MTCC: output quality of the first track (left) and its assigned p T (right). simulation, allowing debugging and matching of both descriptions of the system. During the prototyping and production phases, thorough testing and quality control of the produced hardware were based on C++-simulated events. Further debugging at a finer level of the C++ emulator has been performed using real data at the 2004 beam test and MTCC. At CMS, the emulator will be used as a most useful monitoring tool, checking on an event-by-event basis the decision of the DTTF trigger against the emulated one, based on real DT Local Trigger input data. At least at the beginning of the experiment, the goal is to check a sizable fraction of L1-accepted triggers as part of the data quality monitoring. Figure 16 shows a comparison of several characteristics of the actual and emulated PHTF output at the MTCC: output quality of the first track (left) and its assigned p T (right). The comparison agreement in the variables of the first output track is 100%. For the second track, the agreement found is 99.98%.
Second, the C++ description has been used to generate first versions of the DTTF extrapolation and assignment LUTs; to compute the expected performance of the DTTF trigger for generic single-and di-muon events [29], and in feasibility studies of the most relevant physics channels at the LHC [30]. Last but not least, the simulation will be an important part of the CMS physics analysis at the LHC.
The DTTF C++ simulation has been integrated in the CMS simulation and reconstruction packages ORCA [27] and CMSSW [31].

Muon Trigger performance
In this section, the expected DTTF performance highlights, computed using simulated events, are presented [15]: • Efficiencies: The track finding efficiencies as a function of the generated pseudorapidity and azimuth are depicted in figure 17. As can be seen from the left-hand plot, the efficiency in η is slightly degraded in the boundary regions between wheels. Beyond |η| ≈ 1 the CSC Track Finder takes over from the DTTF. The right-hand plot shows the efficiency in ϕ, integrated over an interval of |η| < 1. As expected, the efficiency is slightly lower in the small regions at ϕ Figure 17. The DTTF trigger efficiencies as a function of pseudorapidity (left) and azimuth (right).
ϕ Figure 18. The DTTF trigger efficiencies as a function of pseudorapidity (left) and azimuth (right), broken down into the different DTTF quality parameters.
the sector boundaries. Similar efficiency plots, broken down into the different DTTF quality parameters, are shown in figure 18.
• Turn-on curves: The combined effects of efficiency and transverse momentum resolution are summarized in the "turn-on" curves in figure 19, where the DTTF single muon trigger efficiency is represented as a function of the muon transverse momentum, for different transverse momentum thresholds. The plateau efficiency is 95%, only limited by the DT detector geometrical acceptance.
• Momentum resolution: From the turn-on curves an overall transverse momentum resolution of 14% is obtained, dominated by dead material effects in the barrel iron yoke. The DT chamber intrinsic resolution contribution, measured at the 2004 beam test, is 5%.
• Position resolution in ϕ: Resolution in ϕ is dominated by the PHTF output bin size (0.02 rad).
The dimuon resolving power is limited by the TS position resolution. Figure 19. The DTTF trigger efficiency as a function of the muon transverse momentum, for different p T -thresholds.
• Trigger rate: The accumulated inclusive muon DTTF trigger rate at nominal LHC luminosity, as a function of the transverse momentum threshold, is shown in figure 20.
The black curve shows the p T -spectrum for muons in the pseudorapidity region |η| < 1.04, generated in PYTHIA [32] minimum bias events; the red (dark-grey) curve shows the rate at the DTTF input. Muons with p T = 0 GeV/c correspond to calorimeter punch-through events and represent about 30% of the total rate at the DTTF input. Almost all muons with p T < 4 GeV/c are stopped before reaching the MB2 station of the DT detector, and muons with only MB1 hits cannot be reconstructed as DTTF segments. For p T > 5 GeV/c the size of the ghost component is similar to the one for real muons. The green (light-grey) points represent the DTTF output rate as a function of the real muon p T . The trigger is fully efficient for muons with p T > 5 GeV/c. The punch-through and ghost components have been reduced to negligible levels. Finally, the blue (dashed) curve shows the DTTF output rate as a function of the DTTF assigned p T . Output transverse momenta are assigned for 90% cut efficiency. At low-, intermediate-, and high-p T the rate is dominated by real muons (decays in-flight, heavy quark and vector boson decays, respectively). For a transverse momentum threshold of 15 (25) GeV/c the expected rate is about 6 (2) kHz.

Conclusions
The CMS Drift Tube Trigger Track Finder has been presented. Its rationale, modus operandi, hardware implementation and software tools have been described. Finally, the system performance has been summarized -the actual one achieved at beam tests and at the MTCC, and the one expected at the LHC. Production of the full DTTF system electronics is complete. Installation at the CMS underground Counting Room, commissioning with cosmic muons, and integration with the rest of the CMS L1 Trigger are well advanced, to be ready for the first LHC data.