% section TOF-TRD

\subsection{TOF-TRD trigger bits}

The TOF detector has the same azimuthal subdivision into 18 
supermodules, hence to each TRD supermodule exists a corresponding
TOF supermodule. On the TOF side, 32 trigger bits are generated per
supermodule. The total number of trigger bits is therefore
18x32 = 576. Each trigger bit is updated at the 40 MHz  clock
rate and carries the information whether the TOF detector has 
registered a signal in the geometrical area represented by the bit. 
On the TRD side, the 576 bits are input into an FPGA
which is named Time-of-flight Multiplicity Logic Unit (TMLU). 
In the TMLU, trigger decisions based on topological considerations
(back-to-back)  and multiplicity conditions are calculated with
a latency of one cycle of the 40 MHz LHC clock.


\subsection{Bit labeling on TOF side}

The TOF supermodule is partitioned in z-direction into 5 segments. 
The segments 1 and 5 are named outer, the segments 2 and 4 are the 
middle and the segment 3 is the inner segment. Each TOF segment 
consists of parallel stripes in phi-direction which extend over 
the full azimuthal coverage of one supermodule. The numbering of 
the stripes within the segments is continuous from A-side to C-side. 
Each stripe consists of 96 pads. From either side of the stripe, 
48 pads are read out hence the two half-stripes define a subdivision
of the TOF supermodule into two azimuthal half-sectors. The outer, 
middle and inner  segments consist of 19, 20 and 15 stripes, 
respectively. In total there are 93 TOF stripes within each supermodule. 
The TOF electronics defines channels by the logical OR of two adjacent 
stripes. There are 48 channels within one supermodule with increasing
numbers from A-side to C-side. 
On each of the two readout sides of the stripes, the
OR-signal of three adjacent channels defines a  TOF-TRD trigger bit.


The TOF electronics is partitioned such that the TOF channels 1-24
are read out by modules in crates positioned on A-side whereas the channels
25-48 are read out on C-side. The 24 channels define 8 trigger bits,
the readout on both sides of the stripes hence defines 16 trigger bits
on both the A-side and the C-side. These trigger bits are generated in a
Local Trigger Module (LTM). The trigger bits are characterized 
by a hardware label which contains a letter and a three digit number. 
The letter indicates whether the bit is read out on A or C-side.

The tables \ref{tmlu1} and \ref{tmlu2} present the association of stripes and
channels on the TOF side with the hardware bit labels
within supermodule 0.  In the other supermodules, the  
association is done correspondingly.

\begin{table}[h]
\begin{minipage}[t]{7.cm}
\begin{tabular}{|c|c|c|}\hline
TOF  & TOF & TRD \\ 
segment-stripe & chan & bit label \\ \hline
outer-1,2 & 1 & A000,A008 \\ 
outer-3,4 & 2 & A000,A008 \\ 
outer-5,6 & 3 & A000,A008 \\ \hline
outer-7,8 & 4 & A001,A009 \\ 
outer-9,10 & 5 & A001,A009 \\ 
outer-11,12 & 6 & A001,A009 \\ \hline
outer-13,14 & 7 & A002,A010 \\ 
outer-15,16 & 8 & A002,A010 \\ 
outer-17,18 & 9 & A002,A010 \\ \hline
outer-19,middle-1 & 10 & A003,A011 \\ 
middle-2,3 & 11 & A003,A011 \\ 
middle-4,5 & 12 & A003,A011 \\ \hline
middle-6,7 & 13 & A004,A012 \\ 
middle-8,9 & 14 & A004,A012 \\ 
middle-10,11 & 15 & A004,A012 \\ \hline
middle-12,13 & 16 & A005,A013 \\ 
middle-14,15 & 17 & A005,A013 \\ 
middle-16,17 & 18 & A005,A013 \\ \hline
middle-18,19 & 19 & A006,A014 \\ 
middle-20,inner-1 & 20 & A006,A014 \\ 
inner-2,3 & 21 & A006,A014 \\ \hline
inner-4,5 & 22 & A007,A015 \\ 
inner-6 & 23 & A007,A015 \\
inner-7 & 24 & A007,A015 \\ \hline
\end{tabular}
\caption{The mapping of TOF stripes and channels to hardware bit
  labels on A-side}
\label{tmlu1}
\end{minipage}
\hspace{1cm}
\begin{minipage}[t]{7.cm}
\begin{tabular}{|c|c|c|}\hline
TOF  & TOF & TRD \\ 
segment-stripe & chan & bit label \\ \hline
inner-8 & 25 & C007,C015 \\
inner-9,10 & 26 & C007,C015 \\ 
inner-11,12 & 27 & C007,C015 \\ \hline
inner-13,14 & 28 & C006,C014 \\ 
inner-15,middle-1 & 29 & C006,C014 \\ 
middle-2,3 & 30 & C006,C014 \\ \hline
middle-4,5 & 31 & C005,C013 \\ 
middle-6,7 & 32 & C005,C013 \\ 
middle-8,9 & 33 & C005,C013 \\ \hline
middle-10,11 & 34 & C004,C012 \\ 
middle-12,13 & 35 & C004,C012 \\ 
middle-14,15 & 36 & C004,C012 \\ \hline
middle-16,17 & 37 & C003,C011 \\ 
middle-18,19 & 38 & C003,C011 \\ 
middle-20,outer-1 & 39 & C003,C011 \\ \hline
outer-2,3 & 40 & C002,C010 \\ 
outer-4,5 & 41 & C002,C010 \\ 
outer-6,7 & 42 & C002,C010 \\ \hline
outer-8,9 & 43 & C001,C009 \\ 
outer-10,11 & 44 & C001,C009 \\ 
outer-12,13 & 45 & C001,C009 \\ \hline
outer-14,15 & 46 & C000,C008 \\ 
outer-16,17 & 47 & C000,C008 \\
outer-18,19 & 48 & C000,C008 \\ \hline
\end{tabular}
\caption{The mapping of TOF stripes and channels to hardware bit labels on C-side}
\label{tmlu2}
\end{minipage}
\end{table}
       
\subsection{TOF read out}

The trigger bits are generated in local trigger moduls (LTM).
One LTM is placed on both of the readout sides of the stripes
such that there are two LTMs on A-side as well as on C-side.
Each LTM generates 8 trigger bits  such that the four LTMs
of one supermodule produce 32 trigger bits. The labeling of the 
bits on both A-side and C-side is such that going from the
outer towards the inner segment within one supermodule corresponds to 
increasing bit labels. In addition, there is an increase of bit labels
between azimuthal half-sectors in direction of increasing supermodule
numbering. Table \ref{tmlu3} shows the ordering of the bit labels and the
positioning  of the corresponding LTMs in SM0, SM1 and SM2.

\begin{table}[h]
\begin{tabular}{c|c|c|c|c|c|c|c|c||c|c|c|c|c|c|c|c|} \cline{2-2}\cline{17-17}
& LTM5 & \multicolumn{14}{|c|}{} & LTM41 \\ \cline{2-17} 
& A040 & A041 & . & . & . & . & A046 & A047 & C047 & C046 & . & . & . & .
& C041 & C040  \\ \cline{2-17} 
SM2 & A032 & A033 & . & . & . & . & A038 & A039 & C039 & C038 & . & . & . & . & 
C033 & C032  \\ \cline{2-17}
& LTM4 & \multicolumn{14}{|c|}{} & LTM40 \\ \cline{2-2}\cline{17-17} 
\end{tabular}
\vspace{0.1cm}

\begin{tabular}{c|c|c|c|c|c|c|c|c||c|c|c|c|c|c|c|c|} \cline{2-2}\cline{17-17}
& LTM3 & \multicolumn{14}{|c|}{} & LTM39 \\ \cline{2-17} 
& A024 & A025 & . & . & . & . & A030 & A031 & C031 & C030 & . & . & . & .
& C025 & C024  \\ \cline{2-17} 
SM1 & A016 & A017 & . & . & . & . & A022 & A023 & C023 & C022 & . & . & . & . & 
C017 & C016  \\ \cline{2-17}
& LTM2 & \multicolumn{14}{|c|}{} & LTM38 \\ \cline{2-2}\cline{17-17} 
\end{tabular}

\vspace{0.1cm}

\begin{tabular}{c|c|c|c|c|c|c|c|c||c|c|c|c|c|c|c|c|} \cline{2-2}\cline{17-17}
& LTM1 & \multicolumn{14}{|c|}{} & LTM37 \\ \cline{2-17} 
& A008 & A009 & . & . & . & . & A014 & A015 &
C015 & C014 & . & . & . & . & C009 & C008  \\ \cline{2-17}
SM0 & A000 & A001 & . & . & . & . & A006 & A007 & C007 & C006 & .
& . & . & . & C001 & C000  \\ \cline{2-17}
& LTM0 & \multicolumn{14}{|c|}{} & LTM36 \\ \cline{2-2}\cline{17-17} 
\end{tabular}
\caption{LTM numbering in SM0, SM1 and SM2}  
\label{tmlu3}
\end{table}

Four LTMs exist per supermodule, hence there are 72 LTMs for the 
18 supermodules. The numbering of the LTMs is done in
order of increasing supermodule numbers on A-side first with 
subsequent continuation on C-side.
Tables \ref{tmlu4} and \ref{tmlu5} show the mapping of
LTMs and hardware bit labels for all supermodules.


\begin{table}[h]
\begin{minipage}[t]{8.0cm}
\begin{tabular}{|c||r|r||r|r||} \hline 
SM & LTM & A-side & LTM & C-side \\ \hline
0 & 0 & A000-007 & 36 & C000-007 \\ \cline{2-5}
    & 1 & A008-015 & 37 & C008-015 \\ \hline 
1 & 2 & A016-023 & 38 & C016-023 \\ \cline{2-5}
    & 3  & A024-031 & 39 & C024-031 \\ \hline 
2 & 4 & A032-039 & 40 & C032-039 \\ \cline{2-5}
    & 5 & A040-047 & 41 & C040-047 \\ \hline 
3 & 6 & A048-055 & 42 & C048-055 \\ \cline{2-5}
    & 7 & A056-063 & 43 & C056-063 \\ \hline
4 & 8 & A064-071 & 44 & C064-071 \\ \cline{2-5}
    & 9 & A072-079 & 45 & C072-079 \\ \hline
5 & 10 & A080-087 & 46 & C080-087 \\ \cline{2-5}
    & 11 & A088-095 & 47 & C088-095 \\ \hline 
6 & 12 & A096-103 & 48 & C096-103 \\ \cline{2-5}
    & 13 & A104-111 & 49 & C104-111 \\ \hline
7 & 14 & A112-119 & 50 & C112-119 \\ \cline{2-5}
    & 15 & A120-127 & 51 & C120-127 \\ \hline
8 & 16 & A128-135 & 52 & C128-135 \\ \cline{2-5}
    & 17 & A136-143 & 53 & C136-143 \\ \hline
\end{tabular}
\caption{Mapping of LTMs to bit labels in SM0-SM8} 
\label{tmlu4}
\end{minipage}
\hspace{.2cm}
\begin{minipage}[t]{8.0cm}
\begin{tabular}{|c||r|r||r|r||} \hline 
SM & LTM & A-side & LTM & C-side \\ \hline
9  & 18 & A144-151 & 54 & C144-151 \\ \cline{2-5} 
     & 19 & A152-159 & 55 & C152-159 \\ \hline 
10 & 20 & A160-167 & 56 & C160-167 \\ \cline{2-5} 
     & 21 & A168-175 & 57 & C168-175 \\ \hline 
11 & 22 & A176-183 & 58 & C176-183 \\ \cline{2-5} 
     & 23 & A184-191 & 59 & C184-191 \\ \hline 
12 & 24 & A192-199 & 60 & C192-199 \\ \cline{2-5}
     & 25 & A200-207 & 61 & C200-207 \\ \hline
13 & 26 & A208-215 & 62 & C208-215 \\ \cline{2-5} 
     & 27 & A216-223 & 63 & C216-223 \\ \hline 
14 & 28 & A224-231 & 64 & C224-231 \\ \cline{2-5} 
     & 29 & A232-239 & 65 & C232-239 \\ \hline 
15 & 30 & A240-247 & 66 & C240-247 \\ \cline{2-5} 
     & 31 & A248-255 & 67 & C248-255 \\ \hline 
16 & 32 & A256-263 & 68 & C256-263 \\ \cline{2-5} 
     & 33 & A264-271 & 69 & C264-271 \\ \hline 
17 & 34 & A272-279 & 70 & C272-279 \\ \cline{2-5} 
     & 35 & A280-287 & 71 & C280-287 \\ \hline 
\end{tabular}
\caption{Mapping of LTMs to bit labels in SM9-SM17} 
\label{tmlu5}
\end{minipage}
\end{table}

\subsection{Cable pin assignment}

High quality ethernet cables (Kerpen Megaline) with RJ45 connectors
are used for transfer of the LVDS bit signals from TOF electronics to TRD 
pretrigger system. The assignment of the 8 pins of the RJ45 connector 
to the four LVDS signals is non standard and is shown in table \ref{tmlu14}.

\begin{table}[h]
\begin{tabular}{|c|c|c|c|c|c|c|c|c|} \hline
RJ45 line & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\ \hline
Signal & 1+ & 1- & 2+ & 2- & 3+ & 3- & 4+ & 4- \\ \hline
\end{tabular}
\caption{Pin assignment of RJ45 connector}
\label{tmlu14}
\end{table}

\subsection{Bit numbering and cable numbering}

The bits with hardware labels A000 to A287 and C000 to C287 are
transmitted from the TOF electronics to the TRD pretrigger system 
by ethernet cables. These cables have been routed from the individual
LTMs to the CBTOF crate in the shortest possible way and hence
have all been cut at a length of 20.5 m.
Each cable carries four bits, hence four cables are needed on A-side
and C-side for each supermodule. There is a total of 144 cables 
for the 576 bits consisting of 72 cables on A-side and 72 cables 
on C-side. The cable numbering is defined such that numbers 1-72
represent the cables from A-side whereas numbers 73-144 represent 
the cables from C-side. Correspondingly, each of the 576 bits is mapped 
to a number such that the labels A000 to A287 correspond to bit numbers 
0 to 287 and the labels C000 to C287 correspond to bit numbers 288 to 575. 

The table \ref{tmlu6} shows the correspondence  of cable number to bit
numbers and  hardware bit labels on A-side.

\begin{table}[h]
\begin{minipage}[t]{5.1cm}
\begin{tabular}{|c|r|r|} \hline 
Cable & bit nr & bit label  \\ \hline
1 & 00-03 & A000-A003 \\ \hline 
2 & 04-07 & A004-A007 \\ \hline 
3 & 08-11 & A008-A011 \\ \hline
4 & 12-15 & A012-A015 \\ \hline 
5 & 16-19 & A016-A019 \\ \hline 
6 & 20-23 & A020-A023 \\ \hline 
7 & 24-27 & A024-A027 \\ \hline 
8 & 28-31 & A028-A031 \\ \hline 
9 & 32-35 & A032-A035 \\ \hline 
10 & 36-39 & A036-A039 \\ \hline 
11 & 40-43 & A040-A043 \\ \hline 
12 & 44-47 & A044-A047 \\ \hline 
13 & 48-51 & A048-A051 \\ \hline 
14 & 52-55 & A052-A055 \\ \hline 
15 & 56-59 & A056-A059 \\ \hline 
16 & 60-63 & A060-A063 \\ \hline 
17 & 64-67 & A064-A067 \\ \hline 
18 & 68-71 & A068-A071 \\ \hline 
19 & 72-75 & A072-A075 \\ \hline 
20 & 76-79 & A076-A079 \\ \hline 
21 & 80-83 & A080-A083 \\ \hline 
22 & 84-87 & A084-A087 \\ \hline 
23 & 88-91 & A088-A091 \\ \hline 
24 & 92-95 & A092-A095 \\ \hline 
\end{tabular}
\caption{|Mapping of cable numbers with bit numbers and hardwar labels
  on A-side}
\label{tmlu6}
\end{minipage}
\hspace{.0cm}
\begin{minipage}[t]{5.1cm}
\begin{tabular}{|c|r|r|} \hline 
Cable & bit nr & bit label  \\ \hline
25 & 96-99 & A096-A099 \\ \hline 
26 & 100-103 & A100-A103 \\ \hline 
27 & 104-107 & A104-A107 \\ \hline 
28 & 108-111 & A108-A111 \\ \hline 
29 & 112-115 & A112-A115 \\ \hline
30 & 116-119 & A116-A119 \\ \hline 
31 & 120-123 & A120-A123 \\ \hline 
32 & 124-127 & A124-A127 \\ \hline 
33 & 128-131 & A128-A131 \\ \hline 
34 & 132-135 & A132-A135 \\ \hline 
35 & 136-139 & A136-A139 \\ \hline 
36 & 140-143 & A140-A143 \\ \hline 
37 & 144-147 & A144-A147 \\ \hline 
38 & 148-151 & A148-A151 \\ \hline 
39 & 152-155 & A152-A155 \\ \hline 
40 & 156-159 & A156-A159 \\ \hline 
41 & 160-163 & A160-A163 \\ \hline
42 & 164-167 & A164-A167 \\ \hline 
43 & 168-171 & A168-A171 \\ \hline 
44 & 172-175 & A172-A175 \\ \hline 
45 & 176-179 & A176-A179 \\ \hline 
46 & 180-183 & A180-A183 \\ \hline 
47 & 184-187 & A184-A187 \\ \hline 
48 & 188-191 & A188-A191 \\ \hline 
\end{tabular}
\end{minipage}
\hspace{.0cm}
\begin{minipage}[t]{5.1cm}
\begin{tabular}{|c|r|r|} \hline 
Cable & bit nr & bit label  \\ \hline
49 & 192-195 & A192-A195 \\ \hline 
50 & 196-199 & A196-A199 \\ \hline 
51 & 200-203 & A200-A203 \\ \hline 
52 & 204-207 & A204-A207 \\ \hline 
53 & 208-211 & A208-A211 \\ \hline 
54 & 212-215 & A212-A215 \\ \hline 
55 & 216-219 & A216-A219 \\ \hline 
56 & 220-223 & A220-A223 \\ \hline 
57 & 224-227 & A224-A227 \\ \hline 
58 & 228-231 & A228-A231 \\ \hline 
59 & 232-235 & A232-A235 \\ \hline 
60 & 236-239 & A236-A239 \\ \hline 
61 & 240-243 & A240-A243 \\ \hline 
62 & 244-247 & A244-A247 \\ \hline 
63 & 248-251 & A248-A251 \\ \hline 
64 & 252-255 & A252-A255 \\ \hline 
65 & 256-259 & A256-A259 \\ \hline 
66 & 260-263 & A260-A263 \\ \hline 
67 & 264-267 & A264-A267 \\ \hline 
68 & 268-271 & A268-A271 \\ \hline 
69 & 272-275 & A272-A275 \\ \hline 
70 & 276-279 & A276-A279 \\ \hline 
71 & 280-283 & A280-A283 \\ \hline 
72 & 284-287 & A284-A287 \\ \hline 
\end{tabular}
\end{minipage}
\end{table}

The table \ref{tmlu7} shows the correspondence  of cable number to bit
numbers and  hardware bit labels on C-side.

\begin{table}[h]
\begin{minipage}[t]{5.1cm}
\begin{tabular}{|c|r|r|} \hline 
Cable & bit nr & bit label  \\ \hline
73 & 288-291 & C000-C003 \\ \hline 
74 & 292-295 & C004-C007 \\ \hline 
75 & 296-299 & C008-C011 \\ \hline
76 & 300-303 & C012-C015 \\ \hline 
77 & 304-307 & C016-C019 \\ \hline 
78 & 308-311 & C020-C023 \\ \hline 
79 & 312-315 & C024-C027 \\ \hline 
80 & 316-319 & C028-C031 \\ \hline 
81 & 320-323 & C032-C035 \\ \hline 
82 & 324-327 & C036-C039 \\ \hline 
83 & 328-331 & C040-C043 \\ \hline 
84 & 332-335 & C044-C047 \\ \hline 
85 & 336-339 & C048-C051 \\ \hline 
86 & 340-343 & C052-C055 \\ \hline 
87 & 344-347 & C056-C059 \\ \hline 
88 & 348-351 & C060-C063 \\ \hline 
89 & 352-355 & C064-C067 \\ \hline 
90 & 356-359 & C068-C071 \\ \hline 
91 & 360-363 & C072-C075 \\ \hline 
92 & 364-367 & C076-C079 \\ \hline 
93 & 368-371 & C080-C083 \\ \hline 
94 & 372-375 & C084-C087 \\ \hline 
95 & 376-379 & C088-C091 \\ \hline 
96 & 380-383 & C092-C095 \\ \hline 
\end{tabular}
\caption{|Mapping of cable numbers with bit numbers and hardwar labels
  on C-side}
\label{tmlu7}
\end{minipage}
\hspace{.0cm}
\begin{minipage}[t]{5.1cm}
\begin{tabular}{|c|r|r|} \hline 
Cable & bit nr & bit label  \\ \hline
97 & 384-387 & C096-C099 \\ \hline 
98 & 388-391 & C100-C103 \\ \hline 
99 & 392-395 & C104-C107 \\ \hline 
100 & 396-399 & C108-C111 \\ \hline 
101 & 400-403 & C112-C115 \\ \hline 
102 & 404-407 & C116-C119 \\ \hline 
103 & 408-411 & C120-C123 \\ \hline 
104 & 412-415 & C124-C127 \\ \hline 
105 & 416-419 & C128-C131 \\ \hline 
106 & 420-423 & C132-C135 \\ \hline 
107 & 424-427 & C136-C139 \\ \hline 
108 & 428-431 & C140-C143 \\ \hline 
109 & 432-435 & C144-C147 \\ \hline 
110 & 436-439 & C148-C151 \\ \hline 
111 & 440-443 & C152-C155 \\ \hline 
112 & 444-447 & C156-C159 \\ \hline 
113 & 448-451 & C160-C163 \\ \hline 
114 & 452-455 & C164-C167 \\ \hline 
115 & 456-459 & C168-C171 \\ \hline 
116 & 460-463 & C172-C175 \\ \hline 
117 & 464-467 & C176-C179 \\ \hline 
118 & 468-471 & C180-C183 \\ \hline 
119 & 472-475 & C184-C187 \\ \hline 
120 & 476-479 & C188-C191 \\ \hline 
\end{tabular}
\end{minipage}
\hspace{.0cm}
\begin{minipage}[t]{5.1cm}
\begin{tabular}{|c|r|r|} \hline 
Cable & bit nr & bit label  \\ \hline
121 & 480-483 & C192-C195 \\ \hline 
122 & 484-487 & C196-C199 \\ \hline 
123 & 488-491 & C200-C203 \\ \hline 
124 & 492-495 & C204-C207 \\ \hline 
125 & 496-499 & C208-C211 \\ \hline 
126 & 500-503 & C212-C215 \\ \hline 
127 & 504-507 & C216-C219 \\ \hline 
128 & 508-511 & C220-C223 \\ \hline 
129 & 512-515 & C224-C227 \\ \hline 
130 & 516-519 & C228-C231 \\ \hline 
131 & 520-523 & C232-C235 \\ \hline 
132 & 524-527 & C236-C239 \\ \hline 
133 & 528-531 & C240-C243 \\ \hline 
134 & 532-535 & C244-C247 \\ \hline 
135 & 536-539 & C248-C251 \\ \hline 
136 & 540-543 & C252-C255 \\ \hline 
137 & 544-547 & C256-C259 \\ \hline 
138 & 548-551 & C260-C263 \\ \hline 
139 & 552-555 & C264-C267 \\ \hline 
140 & 556-559 & C268-C271 \\ \hline 
141 & 560-563 & C272-C275 \\ \hline 
142 & 564-567 & C276-C279 \\ \hline 
143 & 568-571 & C280-C283 \\ \hline 
144 & 572-575 & C284-C287 \\ \hline 
\end{tabular}
\end{minipage}
\end{table}


\subsection{Spare cables}

There are four cables used in each TOF supermodule on both the A-side  and
the C-side. This group of four cables has one spare cable in place
in case  one of the four used cables needs to be replaced. These four 
cables as well as the extra cable are labeled by a
color code taped near the RJ45 connector. The table \ref{tmlu13}
shows the color coding scheme on the TOF and the CBTOF side.

\begin{table}[h]
\begin{tabular}{|c|c|c|} \hline
& TOF-side & CBTOF-side \\ \hline
cable 1 & black & 1xnarrow black \\ \hline
cable 2 & white & 2xnarrow black \\ \hline
cable 3 & red & 3xnarrow black \\ \hline
cable 4 & blue & wide black \\ \hline
spare & yellow/black & ?? \\ \hline
\end{tabular}
\caption{Color coding within group of cables}
\label{tmlu13}
\end{table}


\subsection{Software bit labels and bit masking}

The TOF-TRD trigger bits are counted in the TRD pretrigger system
and used for defining coincidence conditions. Bits which carry
noise are masked out and hence are not used in the coincidence 
conditions. The 32 trigger bits of one supermodule define a 32 bit
mask. The bits in the masks of the 18 supermodules 
are characterized by a software label.
The labeling  of bits in the mask is such
that going from least to most significant bit position in the mask 
corresponds to increasing software labels. 

The tables \ref{tmlu8} and \ref{tmlu9} show the mapping of 
supermodules to masks and software bit labels. 


\begin{table}[h]
\begin{minipage}[t]{5.0cm}
\begin{tabular}{|c|r|r|r|r|r|} \hline 
SM0 & mask(0) & S031-S000 \\ \hline
SM1 & mask(1) & S063-S032 \\ \hline
SM2 & mask(2) & S095-S064 \\ \hline
SM3 & mask(3) & S127-S096 \\ \hline
SM4 & mask(4) & S159-S128 \\ \hline
SM5 & mask(5) & S191-S160 \\ \hline
\end{tabular}
\caption{Mapping of mask to software bit labels} 
\label{tmlu8}
\end{minipage}
\hspace{0cm}
\begin{minipage}[t]{5.1cm}
\begin{tabular}{|c|r|r|r|r|r|} \hline 
SM6 & mask(6) & S223-S192 \\ \hline
SM7 & mask(7) & S255-S224 \\ \hline
SM8 & mask(8) & S287-S256 \\ \hline
SM9 & mask(9) & S319-S288 \\ \hline
SM10 & mask(10) & S351-S320 \\ \hline
SM11 & mask(11) & S383-S352 \\ \hline
\end{tabular}
\end{minipage}
\hspace{0cm}
\begin{minipage}[t]{5.1cm}
\begin{tabular}{|c|r|r|r|r|r|} \hline 
SM12 & mask(12) & S415-S384 \\ \hline
SM13 & mask(13) & S447-S416 \\ \hline
SM14 & mask(14) & S479-S448 \\ \hline
SM15 & mask(15) & S511-S480 \\ \hline
SM16 & mask(16) & S543-S512 \\ \hline
SM17 & mask(17) & S575-S544 \\ \hline
\end{tabular}
\end{minipage}
\end{table}

\subsection{Mapping of software bit labels}

The table \ref{tmlu10} shows the mapping of software bit labels
to hardware bit labels and bit numbers in the supermodules SM0-SM6.

\begin{table}[t]
\begin{tabular}{|p{1.8cm}|p{3.0cm}|p{2.cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
  \hline 
SM0 & software labels & S031-S024 & S023-S016 & S015-S008 & S007-S000 \\ \cline{2-6}
mask(0) & hardware labels & C015-C008 & C007-C000 & A015-A008 & A007-A000 \\ \cline{2-6}
& bit numbers & 303-296 & 295-288 & 15-8 & 7-0 \\ \hline
\end{tabular}
\begin{tabular}{|p{1.8cm}|p{3.0cm}|p{2.cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
  \hline 
SM1 & software labels & S063-S056 & S055-S048 & S047-S040 & S039-S032 \\ \cline{2-6}
mask(1) & hardware labels & C031-C024 & C023-C016 & A031-A024 & A023-A016 \\ \cline{2-6}
& bit numbers & 319-312 & 311-304 & 31-24 & 23-16 \\ \hline
\end{tabular}
\begin{tabular}{|p{1.8cm}|p{3.0cm}|p{2.cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
  \hline 
SM2 & software labels & S095-S088 & S087-S080 & S079-S072 & S071-S064 \\ \cline{2-6}
mask(2) & hardware labels & C047-C040 & C039-C032 & A047-A040 & A039-A032 \\ \cline{2-6}
& bit numbers & 335-328 & 327-320 & 47-40 & 39-32 \\ \hline
\end{tabular}
\begin{tabular}{|p{1.8cm}|p{3.0cm}|p{2.cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
  \hline 
SM3 & software labels & S127-S120 & S119-S112 & S111-S104 & S103-S096 \\ \cline{2-6}
mask(3) & hardware labels & C063-C056 & C055-C048 & A063-A056 & A055-A048 \\ \cline{2-6}
& bit numbers & 351-344 & 343-336 & 63-56 & 55-48 \\ \hline
\end{tabular}
\begin{tabular}{|p{1.8cm}|p{3.0cm}|p{2.cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
  \hline 
SM4 & software labels & S159-S152 & S151-S144 & S143-S136 & S135-S128 \\ \cline{2-6}
mask(4) & hardware labels & C079-C072 & C071-C064 & A079-A072 & A071-A064 \\ \cline{2-6}
& bit numbers & 367-360 & 359-352 & 79-72 & 71-64 \\ \hline
\end{tabular}
\begin{tabular}{|p{1.8cm}|p{3.0cm}|p{2.cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
  \hline 
SM5 & software labels & S191-S184 & S183-S176 & S175-S168 & S167-S160 \\ \cline{2-6}
mask(5) & hardware labels & C095-C088 & C087-C080 & A095-A088 & A087-A080 \\ \cline{2-6}
& bit numbers & 383-376 & 375-368 & 95-88 & 87-80 \\ \hline
\end{tabular}
\begin{tabular}{|p{1.8cm}|p{3.0cm}|p{2.cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
  \hline 
SM6 & software labels & S223-S216 & S215-S208 & S207-S200 & S199-S192 \\ \cline{2-6}
mask(6) & hardware labels & C111-C104 & C103-C096 & A111-A104 & A103-A096 \\ \cline{2-6}
& bit numbers & 399-392 & 391-384 & 111-104 & 103-96 \\ \hline
\end{tabular}
\caption{Mapping of software labels to hardware labels and bit numbers 
in SM0-SM6}
\label{tmlu10}
\end{table}

The table \ref{tmlu11} shows the mapping of software bit labels
to hardware bit labels and bit numbers in the supermodules SM7-SM17.

\begin{table}[h]
\begin{tabular}{|p{1.8cm}|p{3.0cm}|p{2.cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
  \hline 
SM7 & software labels & S255-S248 & S247-S240 & S239-S232 & S231-S224 \\ \cline{2-6}
mask(7) & hardware labels & C127-C120 & C119-C112 & A127-A120 & A119-A112 \\ \cline{2-6}
& bit numbers & 415-408 & 407-400 & 127-120 & 119-112 \\ \hline
\end{tabular}
\begin{tabular}{|p{1.8cm}|p{3.0cm}|p{2.cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
  \hline 
SM8 & software labels & S287-S280 & S279-S272 & S271-S264 & S263-S256 \\ \cline{2-6}
mask(8) & hardware labels & C143-C136 & C135-C128 & A143-A136 & A135-A128 \\ \cline{2-6}
& bit numbers & 431-424 & 423-416 & 143-136 & 135-128 \\ \hline
\end{tabular}
\begin{tabular}{|p{1.8cm}|p{3.0cm}|p{2.cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
  \hline 
SM9 & software labels & S319-S312 & S311-S304 & S303-S296 & S295-S288 \\ \cline{2-6}
mask(9) & hardware labels & C159-C152 & C151-C144 & A159-A152 & A151-A144 \\ \cline{2-6}
& bit numbers & 447-440 & 439-432 & 159-152 & 151-144 \\ \hline
\end{tabular}
\begin{tabular}{|p{1.8cm}|p{3.0cm}|p{2.cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
  \hline 
SM10 & software labels & S351-S344 & S343-S336 & S335-S328 & S327-S320 \\ \cline{2-6}
mask(10) & hardware labels & C175-C168 & C167-C160 & A175-A168 & A167-A160 \\ \cline{2-6}
& bit numbers & 463-456 & 455-448 & 175-168 & 167-160 \\ \hline
\end{tabular}
\begin{tabular}{|p{1.8cm}|p{3.0cm}|p{2.cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
  \hline 
SM11 & software labels & S383-S376 & S375-S368 & S367-S360 & S359-S352 \\ \cline{2-6}
mask(11) & hardware labels & C191-C184 & C183-C176 & A191-A184 & A183-A176 \\ \cline{2-6}
& bit numbers & 479-472 & 471-464 & 191-184 & 183-176 \\ \hline
\end{tabular}
\begin{tabular}{|p{1.8cm}|p{3.0cm}|p{2.cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
  \hline 
SM12 & software labels & S415-S408 & S407-S400 & S399-S392 & S391-S384 \\ \cline{2-6}
mask(12) & hardware labels & C207-C200 & C199-C192 & A207-A200 & A199-A192 \\ \cline{2-6}
& bit numbers & 495-488 & 487-480 & 207-200 & 199-192 \\ \hline
\end{tabular}
\begin{tabular}{|p{1.8cm}|p{3.0cm}|p{2.cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
  \hline 
SM13 & software labels & S447-S440 & S439-S432 & S431-S424 & S423-S416 \\ \cline{2-6}
mask(13) & hardware labels & C223-C216 & C215-C208 & A223-A216 & A215-A208 \\ \cline{2-6}
& bit numbers & 511-504 & 503-496 & 223-216 & 215-208 \\ \hline
\end{tabular}
\begin{tabular}{|p{1.8cm}|p{3.0cm}|p{2.cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
  \hline 
SM14 & software labels & S479-S472 & S471-S464 & S463-S456 & S455-S448 \\ \cline{2-6}
mask(14) & hardware labels & C239-C232 & C231-C224 & A239-A232 & A231-A224 \\ \cline{2-6}
& bit numbers & 527-520 & 519-512 & 239-232 & 231-224 \\ \hline
\end{tabular}
\begin{tabular}{|p{1.8cm}|p{3.0cm}|p{2.cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
  \hline 
SM15 & software labels & S511-S504 & S503-S496 & S495-S488 & S487-S480 \\ \cline{2-6}
mask(15) & hardware labels & C255-C248 & C247-C240 & A255-A248 & A247-A240 \\ \cline{2-6}
& bit numbers & 543-536 & 535-528 & 255-248 & 247-240 \\ \hline
\end{tabular}
\begin{tabular}{|p{1.8cm}|p{3.0cm}|p{2.cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
  \hline 
SM16 & software labels & S543-S536 & S535-S528 & S527-S520 & S519-S512 \\ \cline{2-6}
mask(16) & hardware labels & C271-C264 & C263-C256 & A271-A264 & A263-A256 \\ \cline{2-6}
& bit numbers & 559-552 & 551-544 & 271-264 & 263-256 \\ \hline
\end{tabular}
\begin{tabular}{|p{1.8cm}|p{3.0cm}|p{2.cm}|p{2.cm}|p{2.cm}|p{2.cm}|}
  \hline 
SM17 & software labels & S575-S568 & S567-S560 & S559-S552 & S551-S544 \\ \cline{2-6}
mask(17) & hardware labels & C287-C280 & C279-C272 & A287-A280 & A279-A272 \\ \cline{2-6}
& bit numbers & 575-568 & 567-560 & 287-280 & 279-272 \\ \hline
\end{tabular}
\caption{Mapping of software labels to hardware labels and bit numbers 
in SM7-SM17}
\label{tmlu11}
\end{table}

\subsection{Cable input to CBTOF crate}

The CBTOF crate on the TRD side takes the 144 Ethernet cables 
as input. One input card takes 24 cables, hence six input cards
are needed in total. The three cards for the A-side are placed
on the left, the three cards for the C-side are on the right
with one output card in the center. Table \ref{tmlu12}
shows the arrangement of the I/O cards with the positioning 
of cable numbers.


\begin{table}[h]
\begin{tabular}{||c||c||c||c||c||c||c||} \hline
A-side & A-side & A-side &  output & C-side & C-side & C-side \\ \hline
card 1 & card 2 & card 3 &  & card 4 & card 5 & card 6 \\ \hline 
& & & & & & \\ \hline
1,2 & 25,26 & 49,50 & & 73,74 & 97,98 & 121,122 \\ \hline
3,4 & 27,28 & 51,52 & & 75,76 & 99,100 & 123,124 \\ \hline
5,6 & 29,30 & 53,54 & & 77,78 & 101,102 & 125,126 \\ \hline
7,8 & 31,32 & 55,56 & & 79,80 & 103,104 & 127,128 \\ \hline
9,10 & 33,34 & 57,58 & & 81,82 & 105,106 & 129,130 \\ \hline
11,12 & 35,36 & 59,60 & & 83,84 & 107,108 & 131,132 \\ \hline 
& & & & & & \\ \hline
13,14 & 37,38 & 61,62 & & 85,86 & 109,110 & 133,134 \\ \hline
15,16 & 39,40 & 63,64 & & 87,88 & 111,112 & 135,136 \\ \hline
17,18 & 41,42 & 65,66 & & 89,90 & 113,114 & 137,138 \\ \hline
19,20 & 43,44 & 67,68 & & 91,92 & 115,116 & 139,140 \\ \hline
21,22 & 45,46 & 69,70 & & 93,94 & 117,118 & 141,142 \\ \hline
23,24 & 46,48 & 71,72 & & 95,96 & 119,120 & 143,144 \\ \hline

\end{tabular}
\caption{CBTOF crate layout of input cards 1-6 with connector
association to cable numbers}
\label{tmlu12}
\end{table}


 


\subsection{Mapping LTM with cable numbers}

The table \ref{tmlu15} shows the mapping of SMs with LTMs, cable
numbers and bit labels.

\begin{table}[h]
\begin{tabular}{|c|c|c|c|c|c|c|} \hline
& \multicolumn{3}{c|}{A-side} & \multicolumn{3}{c|}{C-side} \\ \cline{2-7} 
& LTM & cable & bit labels & LTM & cable & bit labels \\ \hline
SM0 & 0 & 1,2 & A000-003, A004-007 & 36 & 73,74 & C000-003, C004-007 \\ \cline{2-7}
    & 1 & 3,4 & A008-011, A012-015 & 37 & 75,76 & C008-011, C012-015 \\ \hline
SM1 & 2 & 5,6 & A016-019, A020-023 & 38 & 77,78 & C016-019, C020-023 \\ \cline{2-7}
    & 3 & 7,8 & A024-027, A028-031 & 39 & 79,80 & C024-027, C028-031 \\ \hline
SM2 & 4 & 9,10 & A032-035, A036-039 & 40 & 81,82 & C032-035, C036-039 \\ \cline{2-7}
    & 5 & 11,12 & A040-043, A044-047 & 41 & 83,84 & C040-043, C044-047 \\ \hline
SM3 & 6 & 13,14 & A048-051, A052-055 & 42 & 85,86 & C048-051, C052-055 \\ \cline{2-7}
    & 7 & 15,16 & A056-059, A060-063 & 43 & 87,88 & C056-059, C060-063 \\ \hline
SM4 & 8 & 17,18 & A064-067, A068-071 & 44 & 89,90 & C064-067, C068-071 \\ \cline{2-7}
    & 9 & 19,20 & A072-075, A076-079 & 45 & 91,92 & C072-075, C076-079 \\ \hline
SM5 & 10 & 21,22 & A080-083, A084-087 & 46 & 93,94 & C080-083, C084-087 \\ \cline{2-7}
    & 11 & 23,24 & A088-091, A092-095 & 47 & 95,96 & C088-091, C092-095 \\ \hline
SM6 & 12 & 25,26 & A096-099, A100-103 & 48 & 97,98 & C096-099, C100-103 \\ \cline{2-7}
    & 13 & 27,28 & A104-107, A108-111 & 49 & 99,100 & C104-107, C108-111 \\ \hline
SM7 & 14 & 29,30 & A112-115, A116-119 & 50 & 101,102 & C112-115, C116-119 \\ \cline{2-7}
    & 15 & 31,32 & A120-123, A124-127 & 51 & 103,104 & C120-123, C124-127 \\ \hline
SM8 & 16 & 33,34 & A128-131, A132-135 & 52 & 105,106 & C128-131, C132-135 \\ \cline{2-7}
    & 17 & 35,36 & A136-139, A140-143 & 53 & 107,108 & C136-139, C140-143 \\ \hline
SM9 & 18 & 37,38 & A144-147, A148-151 & 54 & 109,110 & C144-147, C148-151 \\ \cline{2-7}
    & 19 & 39,40 & A152-155, A156-159 & 55 & 111,112 & C152-155, C156-159 \\ \hline
SM10 & 20 & 41,42 & A160-163, A164-167 & 56 & 113,114 & C160-163, C164-167 \\ \cline{2-7}
     & 21 & 43,44 & A168-171, A172-175 & 57 & 115,116 & C168-171, C172-175 \\ \hline
SM11 & 22 & 45,46 & A176-179, A180-183 & 58 & 117,118 & C176-179, C180-183 \\ \cline{2-7}
     & 23 & 47,48 & A184-187, A188-191 & 59 & 119,120 & C184-187, C188-191 \\ \hline
SM12 & 24 & 49,50 & A192-195, A196-199 & 60 & 121,122 & C192-195, C196-199 \\ \cline{2-7}
     & 25 & 51,52 & A200-203, A204-207 & 61 & 123,124 & C200-203, C204-207 \\ \hline
SM13 & 26 & 53,54 & A208-211, A212-215 & 62 & 125,126 & C208-211, C212-215 \\ \cline{2-7}
     & 27 & 55,56 & A216-219, A220-223 & 63 & 127,128 & C216-219, C220-223 \\ \hline
SM14 & 28 & 57,58 & A224-227, A228-231 & 64 & 129,130 & C224-227, C228-231 \\ \cline{2-7}
     & 29 & 59,60 & A232-235, A236-239 & 65 & 131,132 & C232-235, C236-239 \\ \hline
SM15 & 30 & 61,62 & A240-243, A244-247 & 66 & 133,134 & C240-243, C244-247 \\ \cline{2-7}
     & 31 & 63,64 & A248-251, A252-255 & 67 & 135,136 & C248-251, C252-255 \\ \hline
SM16 & 32 & 65,66 & A255-259, A260-263 & 68 & 137,138 & C256-259, C260-263 \\ \cline{2-7}
     & 33 & 67,68 & A264-267, A268-271 & 69 & 139,140 & C264-267, C268-271 \\ \hline
SM17 & 34 & 69,70 & A272-275, A276-279 & 70 & 141,142 & C272-275, C276-279 \\ \cline{2-7}
     & 35 & 71,72 & A280-283, A284-287 & 71 & 143,144 & C280-283, C284-287 \\ \hline
\end{tabular}
\caption{Association of SMs with LTMs and cable numbers and bit labels}
\label{tmlu15}
\end{table}

%{\it R.Schicker, sep 1, 2009}                                                                

