CMS 3D CMS Logo

GctFormatTranslateV35.cc
Go to the documentation of this file.
2 
3 // C++ headers
4 #include <iostream>
5 #include <cassert>
6 
7 // Framework headers
9 
10 // Namespace resolution
11 using std::cout;
12 using std::endl;
13 using std::make_pair;
14 using std::pair;
15 
16 // INITIALISE STATIC VARIABLES
17 /*** Setup BlockID to BlockLength Map ***/
19  // Miscellaneous Blocks
20  {0x000, 0}, // NULL
21  // ConcJet FPGA
22  {0x580, 12}, // ConcJet: Input TrigPathA (Jet Cands)
23  {0x581, 2}, // ConcJet: Input TrigPathB (HF Rings)
24  {0x583, 8}, // ConcJet: Jet Cands and Counts Output to GT
25  {0x587, 4}, // ConcJet: BX & Orbit Info
26  // ConcElec FPGA
27  {0x680, 16}, // ConcElec: Input TrigPathA (EM Cands)
28  {0x681, 6}, // ConcElec: Input TrigPathB (Et Sums)
29  {0x682, 2}, // ConcElec: Input TrigPathC (Ht Sums)
30  {0x683, 6}, // ConcElec: EM Cands and Energy Sums Output to GT
31  {0x686, 2}, // ConcElec: Test (GT Serdes Loopback)
32  {0x687, 4}, // ConcElec: BX & Orbit Info
33  // Electron Leaf FPGAs
34  {0x800, 20}, // Leaf0ElecPosEtaU1: Sort Input
35  {0x803, 4}, // Leaf0ElecPosEtaU1: Sort Output
36  {0x804, 15}, // Leaf0ElecPosEtaU1: Raw Input
37  {0x880, 16}, // Leaf0ElecPosEtaU2: Sort Input
38  {0x883, 4}, // Leaf0ElecPosEtaU2: Sort Output
39  {0x884, 12}, // Leaf0ElecPosEtaU2: Raw Input
40  {0xc00, 20}, // Leaf0ElecNegEtaU1: Sort Input
41  {0xc03, 4}, // Leaf0ElecNegEtaU1: Sort Output
42  {0xc04, 15}, // Leaf0ElecNegEtaU1: Raw Input
43  {0xc80, 16}, // Leaf0ElecNegEtaU2: Sort Input
44  {0xc83, 4}, // Leaf0ElecNegEtaU2: Sort Output
45  {0xc84, 12}, // Leaf0ElecNegEtaU2: Raw Input
46  // Wheel Pos-eta Jet FPGA
47  {0x300, 27}, // WheelPosEtaJet: Input TrigPathA (Jet Sort)
48  {0x303, 6}, // WheelPosEtaJet: Output TrigPathA (Jet Sort)
49  {0x306,
50  32}, // WheelPosEtaJet: Test (deprecated) (Doesn't exist in V27.1 format, but does in V24 & V25, so keep for CRUZET2 data compatibility reasons)
51  {0x307,
52  4}, // WheelPosEtaJet: Info (deprecated) (Doesn't exist in V27.1 format, but does in V24 & V25, so keep for CRUZET2 data compatibility reasons)
53  // Wheel Pos-eta Energy FPGA
54  {0x380, 21}, // WheelPosEtaEnergy: Input TrigPathA (Et)
55  {0x381, 3}, // WheelPosEtaEnergy: Input TrigPathB (Ht)
56  {0x383, 7}, // WheelPosEtaEnergy: Output TrigPathA (Et)
57  {0x385, 2}, // WheelPosEtaEnergy: Output TrigPathB (Ht)
58  {0x386, 32}, // WheelPosEtaEnergy: Test
59  {0x387,
60  6}, // WheelPosEtaEnergy: BX & Orbit Info (Potential data incompatibility between V24/V25 where block length=4, and V27.1 where block length=6)
61  // Wheel Neg-eta Jet FPGA
62  {0x700, 27}, // WheelNegEtaJet: Input TrigPathA (Jet Sort)
63  {0x703, 6}, // WheelNegEtaJet: Output TrigPathA (Jet Sort)
64  {0x706,
65  32}, // WheelNegEtaJet: Test (deprecated) (Doesn't exist in V27.1 format, but does in V24 & V25, so keep for CRUZET2 data compatibility reasons)
66  {0x707,
67  4}, // WheelNegEtaJet: Info (deprecated) (Doesn't exist in V27.1 format, but does in V24 & V25, so keep for CRUZET2 data compatibility reasons)
68  // Wheel Neg-eta Energy FPGA
69  {0x780, 21}, // WheelNegEtaEnergy: Input TrigPathA (Et)
70  {0x781, 3}, // WheelNegEtaEnergy: Input TrigPathB (Ht)
71  {0x783, 7}, // WheelNegEtaEnergy: Output TrigPathA (Et)
72  {0x785, 2}, // WheelNegEtaEnergy: Output TrigPathB (Ht)
73  {0x786, 32}, // WheelNegEtaEnergy: Test
74  {0x787,
75  6}, // WheelNegEtaEnergy: BX & Orbit Info (Potential data incompatibility between V24/V25 where block length=4, and V27.1 where block length=6)
76  // Jet Leaf FPGAs - Positive Eta
77  {0x900, 12}, // Leaf1JetPosEtaU1: JF2 Input
78  {0x901, 3}, // Leaf1JetPosEtaU1: JF2 Shared Received
79  {0x902, 3}, // Leaf1JetPosEtaU1: JF2 Shared Sent
80  {0x903, 10}, // Leaf1JetPosEtaU1: JF2 Output
81  {0x904, 8}, // Leaf1JetPosEtaU1: JF2 Raw Input
82  {0x908, 12}, // Leaf1JetPosEtaU1: JF3 Input
83  {0x909, 3}, // Leaf1JetPosEtaU1: JF3 Shared Received
84  {0x90a, 3}, // Leaf1JetPosEtaU1: JF3 Shared Sent
85  {0x90b, 10}, // Leaf1JetPosEtaU1: JF3 Output
86  {0x90c, 8}, // Leaf1JetPosEtaU1: JF3 Raw Input
87  {0x980, 3}, // Leaf1JetPosEtaU2: Eta0 Input
88  {0x984, 6}, // Leaf1JetPosEtaU2: Eta0 Raw Input
89  {0x988, 12}, // Leaf1JetPosEtaU2: JF1 Input
90  {0x989, 3}, // Leaf1JetPosEtaU2: JF1 Shared Received
91  {0x98a, 3}, // Leaf1JetPosEtaU2: JF1 Shared Sent
92  {0x98b, 10}, // Leaf1JetPosEtaU2: JF1 Output
93  {0x98c, 8}, // Leaf1JetPosEtaU2: JF1 Raw Input
94  {0xa00, 12}, // Leaf2JetPosEtaU1: JF2 Input
95  {0xa01, 3}, // Leaf2JetPosEtaU1: JF2 Shared Received
96  {0xa02, 3}, // Leaf2JetPosEtaU1: JF2 Shared Sent
97  {0xa03, 10}, // Leaf2JetPosEtaU1: JF2 Output
98  {0xa04, 8}, // Leaf2JetPosEtaU1: JF2 Raw Input
99  {0xa08, 12}, // Leaf2JetPosEtaU1: JF3 Input
100  {0xa09, 3}, // Leaf2JetPosEtaU1: JF3 Shared Received
101  {0xa0a, 3}, // Leaf2JetPosEtaU1: JF3 Shared Sent
102  {0xa0b, 10}, // Leaf2JetPosEtaU1: JF3 Output
103  {0xa0c, 8}, // Leaf2JetPosEtaU1: JF3 Raw Input
104  {0xa80, 3}, // Leaf2JetPosEtaU2: Eta0 Input
105  {0xa84, 6}, // Leaf2JetPosEtaU2: Eta0 Raw Input
106  {0xa88, 12}, // Leaf2JetPosEtaU2: JF1 Input
107  {0xa89, 3}, // Leaf2JetPosEtaU2: JF1 Shared Received
108  {0xa8a, 3}, // Leaf2JetPosEtaU2: JF1 Shared Sent
109  {0xa8b, 10}, // Leaf2JetPosEtaU2: JF1 Output
110  {0xa8c, 8}, // Leaf2JetPosEtaU2: JF1 Raw Input
111  {0xb00, 12}, // Leaf3JetPosEtaU1: JF2 Input
112  {0xb01, 3}, // Leaf3JetPosEtaU1: JF2 Shared Received
113  {0xb02, 3}, // Leaf3JetPosEtaU1: JF2 Shared Sent
114  {0xb03, 10}, // Leaf3JetPosEtaU1: JF2 Output
115  {0xb04, 8}, // Leaf3JetPosEtaU1: JF2 Raw Input
116  {0xb08, 12}, // Leaf3JetPosEtaU1: JF3 Input
117  {0xb09, 3}, // Leaf3JetPosEtaU1: JF3 Shared Received
118  {0xb0a, 3}, // Leaf3JetPosEtaU1: JF3 Shared Sent
119  {0xb0b, 10}, // Leaf3JetPosEtaU1: JF3 Output
120  {0xb0c, 8}, // Leaf3JetPosEtaU1: JF3 Raw Input
121  {0xb80, 3}, // Leaf3JetPosEtaU2: Eta0 Input
122  {0xb84, 6}, // Leaf3JetPosEtaU2: Eta0 Raw Input
123  {0xb88, 12}, // Leaf3JetPosEtaU2: JF1 Input
124  {0xb89, 3}, // Leaf3JetPosEtaU2: JF1 Shared Received
125  {0xb8a, 3}, // Leaf3JetPosEtaU2: JF1 Shared Sent
126  {0xb8b, 10}, // Leaf3JetPosEtaU2: JF1 Output
127  {0xb8c, 8}, // Leaf3JetPosEtaU2: JF1 Raw Input
128  // Jet Leaf FPGAs - Negative Eta
129  {0xd00, 12}, // Leaf1JetNegEtaU1: JF2 Input
130  {0xd01, 3}, // Leaf1JetNegEtaU1: JF2 Shared Received
131  {0xd02, 3}, // Leaf1JetNegEtaU1: JF2 Shared Sent
132  {0xd03, 10}, // Leaf1JetNegEtaU1: JF2 Output
133  {0xd04, 8}, // Leaf1JetNegEtaU1: JF2 Raw Input
134  {0xd08, 12}, // Leaf1JetNegEtaU1: JF3 Input
135  {0xd09, 3}, // Leaf1JetNegEtaU1: JF3 Shared Received
136  {0xd0a, 3}, // Leaf1JetNegEtaU1: JF3 Shared Sent
137  {0xd0b, 10}, // Leaf1JetNegEtaU1: JF3 Output
138  {0xd0c, 8}, // Leaf1JetNegEtaU1: JF3 Raw Input
139  {0xd80, 3}, // Leaf1JetNegEtaU2: Eta0 Input
140  {0xd84, 6}, // Leaf1JetNegEtaU2: Eta0 Raw Input
141  {0xd88, 12}, // Leaf1JetNegEtaU2: JF1 Input
142  {0xd89, 3}, // Leaf1JetNegEtaU2: JF1 Shared Received
143  {0xd8a, 3}, // Leaf1JetNegEtaU2: JF1 Shared Sent
144  {0xd8b, 10}, // Leaf1JetNegEtaU2: JF1 Output
145  {0xd8c, 8}, // Leaf1JetNegEtaU2: JF1 Raw Input
146  {0xe00, 12}, // Leaf2JetNegEtaU1: JF2 Input
147  {0xe01, 3}, // Leaf2JetNegEtaU1: JF2 Shared Received
148  {0xe02, 3}, // Leaf2JetNegEtaU1: JF2 Shared Sent
149  {0xe03, 10}, // Leaf2JetNegEtaU1: JF2 Output
150  {0xe04, 8}, // Leaf2JetNegEtaU1: JF2 Raw Input
151  {0xe08, 12}, // Leaf2JetNegEtaU1: JF3 Input
152  {0xe09, 3}, // Leaf2JetNegEtaU1: JF3 Shared Received
153  {0xe0a, 3}, // Leaf2JetNegEtaU1: JF3 Shared Sent
154  {0xe0b, 10}, // Leaf2JetNegEtaU1: JF3 Output
155  {0xe0c, 8}, // Leaf2JetNegEtaU1: JF3 Raw Input
156  {0xe80, 3}, // Leaf2JetNegEtaU2: Eta0 Input
157  {0xe84, 6}, // Leaf2JetNegEtaU2: Eta0 Raw Input
158  {0xe88, 12}, // Leaf2JetNegEtaU2: JF1 Input
159  {0xe89, 3}, // Leaf2JetNegEtaU2: JF1 Shared Received
160  {0xe8a, 3}, // Leaf2JetNegEtaU2: JF1 Shared Sent
161  {0xe8b, 10}, // Leaf2JetNegEtaU2: JF1 Output
162  {0xe8c, 8}, // Leaf2JetNegEtaU2: JF1 Raw Input
163  {0xf00, 12}, // Leaf3JetNegEtaU1: JF2 Input
164  {0xf01, 3}, // Leaf3JetNegEtaU1: JF2 Shared Received
165  {0xf02, 3}, // Leaf3JetNegEtaU1: JF2 Shared Sent
166  {0xf03, 10}, // Leaf3JetNegEtaU1: JF2 Output
167  {0xf04, 8}, // Leaf3JetNegEtaU1: JF2 Raw Input
168  {0xf08, 12}, // Leaf3JetNegEtaU1: JF3 Input
169  {0xf09, 3}, // Leaf3JetNegEtaU1: JF3 Shared Received
170  {0xf0a, 3}, // Leaf3JetNegEtaU1: JF3 Shared Sent
171  {0xf0b, 10}, // Leaf3JetNegEtaU1: JF3 Output
172  {0xf0c, 8}, // Leaf3JetNegEtaU1: JF3 Raw Input
173  {0xf80, 3}, // Leaf3JetNegEtaU2: Eta0 Input
174  {0xf84, 6}, // Leaf3JetNegEtaU2: Eta0 Raw Input
175  {0xf88, 12}, // Leaf3JetNegEtaU2: JF1 Input
176  {0xf89, 3}, // Leaf3JetNegEtaU2: JF1 Shared Received
177  {0xf8a, 3}, // Leaf3JetNegEtaU2: JF1 Shared Sent
178  {0xf8b, 10}, // Leaf3JetNegEtaU2: JF1 Output
179  {0xf8c, 8} // Leaf3JetNegEtaU2: JF1 Raw Input
180 };
181 
182 /*** Setup BlockID to BlockName Map ***/
184  // Miscellaneous Blocks
185  {0x000, "NULL"},
186  // ConcJet FPGA
187  {0x580, "ConcJet: Input TrigPathA (Jet Cands)"},
188  {0x581, "ConcJet: Input TrigPathB (HF Rings)"},
189  {0x583, "ConcJet: Jet Cands and Counts Output to GT"},
190  {0x587, "ConcJet: BX & Orbit Info"},
191  // ConcElec FPGA
192  {0x680, "ConcElec: Input TrigPathA (EM Cands)"},
193  {0x681, "ConcElec: Input TrigPathB (Et Sums)"},
194  {0x682, "ConcElec: Input TrigPathC (Ht Sums)"},
195  {0x683, "ConcElec: EM Cands and Energy Sums Output to GT"},
196  {0x686, "ConcElec: Test (GT Serdes Loopback)"},
197  {0x687, "ConcElec: BX & Orbit Info"},
198  // Electron Leaf FPGAs
199  {0x800, "Leaf0ElecPosEtaU1: Sort Input"},
200  {0x803, "Leaf0ElecPosEtaU1: Sort Output"},
201  {0x804, "Leaf0ElecPosEtaU1: Raw Input"},
202  {0x880, "Leaf0ElecPosEtaU2: Sort Input"},
203  {0x883, "Leaf0ElecPosEtaU2: Sort Output"},
204  {0x884, "Leaf0ElecPosEtaU2: Raw Input"},
205  {0xc00, "Leaf0ElecNegEtaU1: Sort Input"},
206  {0xc03, "Leaf0ElecNegEtaU1: Sort Output"},
207  {0xc04, "Leaf0ElecNegEtaU1: Raw Input"},
208  {0xc80, "Leaf0ElecNegEtaU2: Sort Input"},
209  {0xc83, "Leaf0ElecNegEtaU2: Sort Output"},
210  {0xc84, "Leaf0ElecNegEtaU2: Raw Input"},
211  // Wheel Pos-eta Jet FPGA
212  {0x300, "WheelPosEtaJet: Input TrigPathA (Jet Sort)"},
213  {0x303, "WheelPosEtaJet: Output TrigPathA (Jet Sort)"},
214  {0x306,
215  "WheelPosEtaJet: Test (deprecated)"}, // (Doesn't exist in V27.1 format, but does in V24 & V25, so keep for CRUZET2 data compatibility reasons)
216  {0x307,
217  "WheelPosEtaJet: Info (deprecated)"}, // (Doesn't exist in V27.1 format, but does in V24 & V25, so keep for CRUZET2 data compatibility reasons)
218  // Wheel Pos-eta Energy FPGA
219  {0x380, "WheelPosEtaEnergy: Input TrigPathA (Et)"},
220  {0x381, "WheelPosEtaEnergy: Input TrigPathB (Ht)"},
221  {0x383, "WheelPosEtaEnergy: Output TrigPathA (Et)"},
222  {0x385, "WheelPosEtaEnergy: Output TrigPathB (Ht)"},
223  {0x386, "WheelPosEtaEnergy: Test"},
224  {0x387, "WheelPosEtaEnergy: BX & Orbit Info"},
225  // Wheel Neg-eta Jet FPGA
226  {0x700, "WheelNegEtaJet: Input TrigPathA (Jet Sort)"},
227  {0x703, "WheelNegEtaJet: Output TrigPathA (Jet Sort)"},
228  {0x706,
229  "WheelNegEtaJet: Test (deprecated)"}, // (Doesn't exist in V27.1 format, but does in V24 & V25, so keep for CRUZET2 data compatibility reasons)
230  {0x707,
231  "WheelNegEtaJet: Info (deprecated)"}, // (Doesn't exist in V27.1 format, but does in V24 & V25, so keep for CRUZET2 data compatibility reasons)
232  // Wheel Neg-eta Energy FPGA
233  {0x780, "WheelNegEtaEnergy: Input TrigPathA (Et)"},
234  {0x781, "WheelNegEtaEnergy: Input TrigPathB (Ht)"},
235  {0x783, "WheelNegEtaEnergy: Output TrigPathA (Et)"},
236  {0x785, "WheelNegEtaEnergy: Output TrigPathB (Ht)"},
237  {0x786, "WheelNegEtaEnergy: Test"},
238  {0x787, "WheelNegEtaEnergy: BX & Orbit Info"},
239  // Jet Leaf FPGAs - Positive Eta
240  {0x900, "Leaf1JetPosEtaU1: JF2 Input"},
241  {0x901, "Leaf1JetPosEtaU1: JF2 Shared Received"},
242  {0x902, "Leaf1JetPosEtaU1: JF2 Shared Sent"},
243  {0x903, "Leaf1JetPosEtaU1: JF2 Output"},
244  {0x904, "Leaf1JetPosEtaU1: JF2 Raw Input"},
245  {0x908, "Leaf1JetPosEtaU1: JF3 Input"},
246  {0x909, "Leaf1JetPosEtaU1: JF3 Shared Received"},
247  {0x90a, "Leaf1JetPosEtaU1: JF3 Shared Sent"},
248  {0x90b, "Leaf1JetPosEtaU1: JF3 Output"},
249  {0x90c, "Leaf1JetPosEtaU1: JF3 Raw Input"},
250  {0x980, "Leaf1JetPosEtaU2: Eta0 Input"}, // Next Leaf Start
251  {0x984, "Leaf1JetPosEtaU2: Eta0 Raw Input"},
252  {0x988, "Leaf1JetPosEtaU2: JF1 Input"},
253  {0x989, "Leaf1JetPosEtaU2: JF1 Shared Received"},
254  {0x98a, "Leaf1JetPosEtaU2: JF1 Shared Sent"},
255  {0x98b, "Leaf1JetPosEtaU2: JF1 Output"},
256  {0x98c, "Leaf1JetPosEtaU2: JF1 Raw Input"},
257  {0xa00, "Leaf2JetPosEtaU1: JF2 Input"}, // Next Leaf Start
258  {0xa01, "Leaf2JetPosEtaU1: JF2 Shared Received"},
259  {0xa02, "Leaf2JetPosEtaU1: JF2 Shared Sent"},
260  {0xa03, "Leaf2JetPosEtaU1: JF2 Output"},
261  {0xa04, "Leaf2JetPosEtaU1: JF2 Raw Input"},
262  {0xa08, "Leaf2JetPosEtaU1: JF3 Input"},
263  {0xa09, "Leaf2JetPosEtaU1: JF3 Shared Received"},
264  {0xa0a, "Leaf2JetPosEtaU1: JF3 Shared Sent"},
265  {0xa0b, "Leaf2JetPosEtaU1: JF3 Output"},
266  {0xa0c, "Leaf2JetPosEtaU1: JF3 Raw Input"},
267  {0xa80, "Leaf2JetPosEtaU2: Eta0 Input"}, // Next Leaf Start
268  {0xa84, "Leaf2JetPosEtaU2: Eta0 Raw Input"},
269  {0xa88, "Leaf2JetPosEtaU2: JF1 Input"},
270  {0xa89, "Leaf2JetPosEtaU2: JF1 Shared Received"},
271  {0xa8a, "Leaf2JetPosEtaU2: JF1 Shared Sent"},
272  {0xa8b, "Leaf2JetPosEtaU2: JF1 Output"},
273  {0xa8c, "Leaf2JetPosEtaU2: JF1 Raw Input"},
274  {0xb00, "Leaf3JetPosEtaU1: JF2 Input"}, // Next Leaf Start
275  {0xb01, "Leaf3JetPosEtaU1: JF2 Shared Received"},
276  {0xb02, "Leaf3JetPosEtaU1: JF2 Shared Sent"},
277  {0xb03, "Leaf3JetPosEtaU1: JF2 Output"},
278  {0xb04, "Leaf3JetPosEtaU1: JF2 Raw Input"},
279  {0xb08, "Leaf3JetPosEtaU1: JF3 Input"},
280  {0xb09, "Leaf3JetPosEtaU1: JF3 Shared Received"},
281  {0xb0a, "Leaf3JetPosEtaU1: JF3 Shared Sent"},
282  {0xb0b, "Leaf3JetPosEtaU1: JF3 Output"},
283  {0xb0c, "Leaf3JetPosEtaU1: JF3 Raw Input"},
284  {0xb80, "Leaf3JetPosEtaU2: Eta0 Input"}, // Next Leaf Start
285  {0xb84, "Leaf3JetPosEtaU2: Eta0 Raw Input"},
286  {0xb88, "Leaf3JetPosEtaU2: JF1 Input"},
287  {0xb89, "Leaf3JetPosEtaU2: JF1 Shared Received"},
288  {0xb8a, "Leaf3JetPosEtaU2: JF1 Shared Sent"},
289  {0xb8b, "Leaf3JetPosEtaU2: JF1 Output"},
290  {0xb8c, "Leaf3JetPosEtaU2: JF1 Raw Input"},
291  // Jet Leaf FPGAs - Negative Eta
292  {0xd00, "Leaf1JetNegEtaU1: JF2 Input"}, // START OF NEG ETA JET LEAVES
293  {0xd01, "Leaf1JetNegEtaU1: JF2 Shared Received"},
294  {0xd02, "Leaf1JetNegEtaU1: JF2 Shared Sent"},
295  {0xd03, "Leaf1JetNegEtaU1: JF2 Output"},
296  {0xd04, "Leaf1JetNegEtaU1: JF2 Raw Input"},
297  {0xd08, "Leaf1JetNegEtaU1: JF3 Input"},
298  {0xd09, "Leaf1JetNegEtaU1: JF3 Shared Received"},
299  {0xd0a, "Leaf1JetNegEtaU1: JF3 Shared Sent"},
300  {0xd0b, "Leaf1JetNegEtaU1: JF3 Output"},
301  {0xd0c, "Leaf1JetNegEtaU1: JF3 Raw Input"},
302  {0xd80, "Leaf1JetNegEtaU2: Eta0 Input"}, // Next Leaf Start
303  {0xd84, "Leaf1JetNegEtaU2: Eta0 Raw Input"},
304  {0xd88, "Leaf1JetNegEtaU2: JF1 Input"},
305  {0xd89, "Leaf1JetNegEtaU2: JF1 Shared Received"},
306  {0xd8a, "Leaf1JetNegEtaU2: JF1 Shared Sent"},
307  {0xd8b, "Leaf1JetNegEtaU2: JF1 Output"},
308  {0xd8c, "Leaf1JetNegEtaU2: JF1 Raw Input"},
309  {0xe00, "Leaf2JetNegEtaU1: JF2 Input"}, // Next Leaf Start
310  {0xe01, "Leaf2JetNegEtaU1: JF2 Shared Received"},
311  {0xe02, "Leaf2JetNegEtaU1: JF2 Shared Sent"},
312  {0xe03, "Leaf2JetNegEtaU1: JF2 Output"},
313  {0xe04, "Leaf2JetNegEtaU1: JF2 Raw Input"},
314  {0xe08, "Leaf2JetNegEtaU1: JF3 Input"},
315  {0xe09, "Leaf2JetNegEtaU1: JF3 Shared Received"},
316  {0xe0a, "Leaf2JetNegEtaU1: JF3 Shared Sent"},
317  {0xe0b, "Leaf2JetNegEtaU1: JF3 Output"},
318  {0xe0c, "Leaf2JetNegEtaU1: JF3 Raw Input"},
319  {0xe80, "Leaf2JetNegEtaU2: Eta0 Input"}, // Next Leaf Start
320  {0xe84, "Leaf2JetNegEtaU2: Eta0 Raw Input"},
321  {0xe88, "Leaf2JetNegEtaU2: JF1 Input"},
322  {0xe89, "Leaf2JetNegEtaU2: JF1 Shared Received"},
323  {0xe8a, "Leaf2JetNegEtaU2: JF1 Shared Sent"},
324  {0xe8b, "Leaf2JetNegEtaU2: JF1 Output"},
325  {0xe8c, "Leaf2JetNegEtaU2: JF1 Raw Input"},
326  {0xf00, "Leaf3JetNegEtaU1: JF2 Input"}, // Next Leaf Start
327  {0xf01, "Leaf3JetNegEtaU1: JF2 Shared Received"},
328  {0xf02, "Leaf3JetNegEtaU1: JF2 Shared Sent"},
329  {0xf03, "Leaf3JetNegEtaU1: JF2 Output"},
330  {0xf04, "Leaf3JetNegEtaU1: JF2 Raw Input"},
331  {0xf08, "Leaf3JetNegEtaU1: JF3 Input"},
332  {0xf09, "Leaf3JetNegEtaU1: JF3 Shared Received"},
333  {0xf0a, "Leaf3JetNegEtaU1: JF3 Shared Sent"},
334  {0xf0b, "Leaf3JetNegEtaU1: JF3 Output"},
335  {0xf0c, "Leaf3JetNegEtaU1: JF3 Raw Input"},
336  {0xf80, "Leaf3JetNegEtaU2: Eta0 Input"}, // Next Leaf Start
337  {0xf84, "Leaf3JetNegEtaU2: Eta0 Raw Input"},
338  {0xf88, "Leaf3JetNegEtaU2: JF1 Input"},
339  {0xf89, "Leaf3JetNegEtaU2: JF1 Shared Received"},
340  {0xf8a, "Leaf3JetNegEtaU2: JF1 Shared Sent"},
341  {0xf8b, "Leaf3JetNegEtaU2: JF1 Output"},
342  {0xf8c, "Leaf3JetNegEtaU2: JF1 Raw Input"}};
343 
344 /*** Setup BlockID to Unpack-Function Map ***/
346  // Miscellaneous Blocks
347  {0x000, &GctFormatTranslateV35::blockDoNothing}, // NULL
348  // ConcJet FPGA
349  {0x580, &GctFormatTranslateV35::blockToGctTrigObjects}, // ConcJet: Input TrigPathA (Jet Cands)
350  {0x581, &GctFormatTranslateV35::blockToGctInternRingSums}, // ConcJet: Input TrigPathB (HF Rings)
351  {0x583, &GctFormatTranslateV35::blockToGctJetCandsAndCounts}, // ConcJet: Jet Cands and Counts Output to GT
352  {0x587, &GctFormatTranslateV35::blockDoNothing}, // ConcJet: BX & Orbit Info
353  // ConcElec FPGA
354  {0x680, &GctFormatTranslateV35::blockToGctInternEmCand}, // ConcElec: Input TrigPathA (EM Cands)
355  {0x681, &GctFormatTranslateV35::blockToGctInternEtSums}, // ConcElec: Input TrigPathB (Et Sums)
356  {0x682, &GctFormatTranslateV35::blockToGctInternEtSums}, // ConcElec: Input TrigPathC (Ht Sums)
357  {0x683, &GctFormatTranslateV35::blockToGctEmCandsAndEnergySums}, // ConcElec: EM Cands and Energy Sums Output to GT
358  {0x686, &GctFormatTranslateV35::blockDoNothing}, // ConcElec: Test (GT Serdes Loopback)
359  {0x687, &GctFormatTranslateV35::blockDoNothing}, // ConcElec: BX & Orbit Info
360  // Electron Leaf FPGAs
361  {0x800, &GctFormatTranslateV35::blockToGctInternEmCand}, // Leaf0ElecPosEtaU1: Sort Input
362  {0x803, &GctFormatTranslateV35::blockToGctInternEmCand}, // Leaf0ElecPosEtaU1: Sort Output
363  {0x804, &GctFormatTranslateV35::blockToFibresAndToRctEmCand}, // Leaf0ElecPosEtaU1: Raw Input
364  {0x880, &GctFormatTranslateV35::blockToGctInternEmCand}, // Leaf0ElecPosEtaU2: Sort Input
365  {0x883, &GctFormatTranslateV35::blockToGctInternEmCand}, // Leaf0ElecPosEtaU2: Sort Output
366  {0x884, &GctFormatTranslateV35::blockToFibresAndToRctEmCand}, // Leaf0ElecPosEtaU2: Raw Input
367  {0xc00, &GctFormatTranslateV35::blockToGctInternEmCand}, // Leaf0ElecNegEtaU1: Sort Input
368  {0xc03, &GctFormatTranslateV35::blockToGctInternEmCand}, // Leaf0ElecNegEtaU1: Sort Output
369  {0xc04, &GctFormatTranslateV35::blockToFibresAndToRctEmCand}, // Leaf0ElecNegEtaU1: Raw Input
370  {0xc80, &GctFormatTranslateV35::blockToGctInternEmCand}, // Leaf0ElecNegEtaU2: Sort Input
371  {0xc83, &GctFormatTranslateV35::blockToGctInternEmCand}, // Leaf0ElecNegEtaU2: Sort Output
372  {0xc84, &GctFormatTranslateV35::blockToFibresAndToRctEmCand}, // Leaf0ElecNegEtaU2: Raw Input
373  // Wheel Pos-eta Jet FPGA
374  {0x300, &GctFormatTranslateV35::blockToGctJetClusterMinimal}, // WheelPosEtaJet: Input TrigPathA (Jet Sort)
375  {0x303, &GctFormatTranslateV35::blockToGctTrigObjects}, // WheelPosEtaJet: Output TrigPathA (Jet Sort)
376  {0x306,
377  &GctFormatTranslateV35::
378  blockDoNothing}, // WheelPosEtaJet: Test (deprecated) (Doesn't exist in V27.1 format, but does in V24 & V25, so keep for CRUZET2 data compatibility reasons)
379  {0x307,
380  &GctFormatTranslateV35::
381  blockDoNothing}, // WheelPosEtaJet: Info (deprecated) (Doesn't exist in V27.1 format, but does in V24 & V25, so keep for CRUZET2 data compatibility reasons)
382  // Wheel Pos-eta Energy FPGA
383  {0x380,
384  &GctFormatTranslateV35::blockToGctWheelInputInternEtAndRingSums}, // WheelPosEtaEnergy: Input TrigPathA (Et)
385  {0x381, &GctFormatTranslateV35::blockToGctInternEtSums}, // WheelPosEtaEnergy: Input TrigPathB (Ht)
386  {0x383,
387  &GctFormatTranslateV35::blockToGctWheelOutputInternEtAndRingSums}, // WheelPosEtaEnergy: Output TrigPathA (Et)
388  {0x385, &GctFormatTranslateV35::blockToGctInternEtSums}, // WheelPosEtaEnergy: Output TrigPathB (Ht)
389  {0x386, &GctFormatTranslateV35::blockDoNothing}, // WheelPosEtaEnergy: Test
390  {0x387,
391  &GctFormatTranslateV35::
392  blockDoNothing}, // WheelPosEtaEnergy: BX & Orbit Info (Potential data incompatibility between V24/V25 where block length=4, and V27.1 where block length=6)
393  // Wheel Neg-eta Jet FPGA
394  {0x700, &GctFormatTranslateV35::blockToGctJetClusterMinimal}, // WheelNegEtaJet: Input TrigPathA (Jet Sort)
395  {0x703, &GctFormatTranslateV35::blockToGctTrigObjects}, // WheelNegEtaJet: Output TrigPathA (Jet Sort)
396  {0x706,
397  &GctFormatTranslateV35::
398  blockDoNothing}, // WheelNegEtaJet: Test (deprecated) (Doesn't exist in V27.1 format, but does in V24 & V25, so keep for CRUZET2 data compatibility reasons)
399  {0x707,
400  &GctFormatTranslateV35::
401  blockDoNothing}, // WheelNegEtaJet: Info (deprecated) (Doesn't exist in V27.1 format, but does in V24 & V25, so keep for CRUZET2 data compatibility reasons)
402  // Wheel Neg-eta Energy FPGA
403  {0x780,
404  &GctFormatTranslateV35::blockToGctWheelInputInternEtAndRingSums}, // WheelNegEtaEnergy: Input TrigPathA (Et)
405  {0x781, &GctFormatTranslateV35::blockToGctInternEtSums}, // WheelNegEtaEnergy: Input TrigPathB (Ht)
406  {0x783,
407  &GctFormatTranslateV35::blockToGctWheelOutputInternEtAndRingSums}, // WheelNegEtaEnergy: Output TrigPathA (Et)
408  {0x785, &GctFormatTranslateV35::blockToGctInternEtSums}, // WheelNegEtaEnergy: Output TrigPathB (Ht)
409  {0x786, &GctFormatTranslateV35::blockDoNothing}, // WheelNegEtaEnergy: Test
410  {0x787,
411  &GctFormatTranslateV35::
412  blockDoNothing}, // WheelNegEtaEnergy: BX & Orbit Info (Potential data incompatibility between V24/V25 where block length=4, and V27.1 where block length=6)
413  // Jet Leaf FPGAs - Positive Eta
414  {0x900, &GctFormatTranslateV35::blockToRctCaloRegions}, // Leaf1JetPosEtaU1: JF2 Input
415  {0x901, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf1JetPosEtaU1: JF2 Shared Received
416  {0x902, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf1JetPosEtaU1: JF2 Shared Sent
417  {0x903, &GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster}, // Leaf1JetPosEtaU1: JF2 Output
418  {0x904, &GctFormatTranslateV35::blockToFibres}, // Leaf1JetPosEtaU1: JF2 Raw Input
419  {0x908, &GctFormatTranslateV35::blockToRctCaloRegions}, // Leaf1JetPosEtaU1: JF3 Input
420  {0x909, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf1JetPosEtaU1: JF3 Shared Received
421  {0x90a, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf1JetPosEtaU1: JF3 Shared Sent
422  {0x90b, &GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster}, // Leaf1JetPosEtaU1: JF3 Output
423  {0x90c, &GctFormatTranslateV35::blockToFibres}, // Leaf1JetPosEtaU1: JF3 Raw Input
424  {0x980, &GctFormatTranslateV35::blockDoNothing}, // Leaf1JetPosEtaU2: Eta0 Input
425  {0x984, &GctFormatTranslateV35::blockToFibres}, // Leaf1JetPosEtaU2: Eta0 Raw Input
426  {0x988, &GctFormatTranslateV35::blockToRctCaloRegions}, // Leaf1JetPosEtaU2: JF1 Input
427  {0x989, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf1JetPosEtaU2: JF1 Shared Received
428  {0x98a, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf1JetPosEtaU2: JF1 Shared Sent
429  {0x98b, &GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster}, // Leaf1JetPosEtaU2: JF1 Output
430  {0x98c, &GctFormatTranslateV35::blockToFibres}, // Leaf1JetPosEtaU2: JF1 Raw Input
431  {0xa00, &GctFormatTranslateV35::blockToRctCaloRegions}, // Leaf2JetPosEtaU1: JF2 Input
432  {0xa01, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf2JetPosEtaU1: JF2 Shared Received
433  {0xa02, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf2JetPosEtaU1: JF2 Shared Sent
434  {0xa03, &GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster}, // Leaf2JetPosEtaU1: JF2 Output
435  {0xa04, &GctFormatTranslateV35::blockToFibres}, // Leaf2JetPosEtaU1: JF2 Raw Input
436  {0xa08, &GctFormatTranslateV35::blockToRctCaloRegions}, // Leaf2JetPosEtaU1: JF3 Input
437  {0xa09, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf2JetPosEtaU1: JF3 Shared Received
438  {0xa0a, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf2JetPosEtaU1: JF3 Shared Sent
439  {0xa0b, &GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster}, // Leaf2JetPosEtaU1: JF3 Output
440  {0xa0c, &GctFormatTranslateV35::blockToFibres}, // Leaf2JetPosEtaU1: JF3 Raw Input
441  {0xa80, &GctFormatTranslateV35::blockDoNothing}, // Leaf2JetPosEtaU2: Eta0 Input
442  {0xa84, &GctFormatTranslateV35::blockToFibres}, // Leaf2JetPosEtaU2: Eta0 Raw Input
443  {0xa88, &GctFormatTranslateV35::blockToRctCaloRegions}, // Leaf2JetPosEtaU2: JF1 Input
444  {0xa89, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf2JetPosEtaU2: JF1 Shared Received
445  {0xa8a, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf2JetPosEtaU2: JF1 Shared Sent
446  {0xa8b, &GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster}, // Leaf2JetPosEtaU2: JF1 Output
447  {0xa8c, &GctFormatTranslateV35::blockToFibres}, // Leaf2JetPosEtaU2: JF1 Raw Input
448  {0xb00, &GctFormatTranslateV35::blockToRctCaloRegions}, // Leaf3JetPosEtaU1: JF2 Input
449  {0xb01, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf3JetPosEtaU1: JF2 Shared Received
450  {0xb02, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf3JetPosEtaU1: JF2 Shared Sent
451  {0xb03, &GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster}, // Leaf3JetPosEtaU1: JF2 Output
452  {0xb04, &GctFormatTranslateV35::blockToFibres}, // Leaf3JetPosEtaU1: JF2 Raw Input
453  {0xb08, &GctFormatTranslateV35::blockToRctCaloRegions}, // Leaf3JetPosEtaU1: JF3 Input
454  {0xb09, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf3JetPosEtaU1: JF3 Shared Received
455  {0xb0a, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf3JetPosEtaU1: JF3 Shared Sent
456  {0xb0b, &GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster}, // Leaf3JetPosEtaU1: JF3 Output
457  {0xb0c, &GctFormatTranslateV35::blockToFibres}, // Leaf3JetPosEtaU1: JF3 Raw Input
458  {0xb80, &GctFormatTranslateV35::blockDoNothing}, // Leaf3JetPosEtaU2: Eta0 Input
459  {0xb84, &GctFormatTranslateV35::blockToFibres}, // Leaf3JetPosEtaU2: Eta0 Raw Input
460  {0xb88, &GctFormatTranslateV35::blockToRctCaloRegions}, // Leaf3JetPosEtaU2: JF1 Input
461  {0xb89, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf3JetPosEtaU2: JF1 Shared Received
462  {0xb8a, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf3JetPosEtaU2: JF1 Shared Sent
463  {0xb8b, &GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster}, // Leaf3JetPosEtaU2: JF1 Output
464  {0xb8c, &GctFormatTranslateV35::blockToFibres}, // Leaf3JetPosEtaU2: JF1 Raw Input
465  // Jet Leaf FPGAs - Negative Eta
466  {0xd00, &GctFormatTranslateV35::blockToRctCaloRegions}, // Leaf1JetNegEtaU1: JF2 Input
467  {0xd01, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf1JetNegEtaU1: JF2 Shared Received
468  {0xd02, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf1JetNegEtaU1: JF2 Shared Sent
469  {0xd03, &GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster}, // Leaf1JetNegEtaU1: JF2 Output
470  {0xd04, &GctFormatTranslateV35::blockToFibres}, // Leaf1JetNegEtaU1: JF2 Raw Input
471  {0xd08, &GctFormatTranslateV35::blockToRctCaloRegions}, // Leaf1JetNegEtaU1: JF3 Input
472  {0xd09, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf1JetNegEtaU1: JF3 Shared Received
473  {0xd0a, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf1JetNegEtaU1: JF3 Shared Sent
474  {0xd0b, &GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster}, // Leaf1JetNegEtaU1: JF3 Output
475  {0xd0c, &GctFormatTranslateV35::blockToFibres}, // Leaf1JetNegEtaU1: JF3 Raw Input
476  {0xd80, &GctFormatTranslateV35::blockDoNothing}, // Leaf1JetNegEtaU2: Eta0 Input
477  {0xd84, &GctFormatTranslateV35::blockToFibres}, // Leaf1JetNegEtaU2: Eta0 Raw Input
478  {0xd88, &GctFormatTranslateV35::blockToRctCaloRegions}, // Leaf1JetNegEtaU2: JF1 Input
479  {0xd89, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf1JetNegEtaU2: JF1 Shared Received
480  {0xd8a, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf1JetNegEtaU2: JF1 Shared Sent
481  {0xd8b, &GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster}, // Leaf1JetNegEtaU2: JF1 Output
482  {0xd8c, &GctFormatTranslateV35::blockToFibres}, // Leaf1JetNegEtaU2: JF1 Raw Input
483  {0xe00, &GctFormatTranslateV35::blockToRctCaloRegions}, // Leaf2JetNegEtaU1: JF2 Input
484  {0xe01, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf2JetNegEtaU1: JF2 Shared Received
485  {0xe02, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf2JetNegEtaU1: JF2 Shared Sent
486  {0xe03, &GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster}, // Leaf2JetNegEtaU1: JF2 Output
487  {0xe04, &GctFormatTranslateV35::blockToFibres}, // Leaf2JetNegEtaU1: JF2 Raw Input
488  {0xe08, &GctFormatTranslateV35::blockToRctCaloRegions}, // Leaf2JetNegEtaU1: JF3 Input
489  {0xe09, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf2JetNegEtaU1: JF3 Shared Received
490  {0xe0a, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf2JetNegEtaU1: JF3 Shared Sent
491  {0xe0b, &GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster}, // Leaf2JetNegEtaU1: JF3 Output
492  {0xe0c, &GctFormatTranslateV35::blockToFibres}, // Leaf2JetNegEtaU1: JF3 Raw Input
493  {0xe80, &GctFormatTranslateV35::blockDoNothing}, // Leaf2JetNegEtaU2: Eta0 Input
494  {0xe84, &GctFormatTranslateV35::blockToFibres}, // Leaf2JetNegEtaU2: Eta0 Raw Input
495  {0xe88, &GctFormatTranslateV35::blockToRctCaloRegions}, // Leaf2JetNegEtaU2: JF1 Input
496  {0xe89, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf2JetNegEtaU2: JF1 Shared Received
497  {0xe8a, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf2JetNegEtaU2: JF1 Shared Sent
498  {0xe8b, &GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster}, // Leaf2JetNegEtaU2: JF1 Output
499  {0xe8c, &GctFormatTranslateV35::blockToFibres}, // Leaf2JetNegEtaU2: JF1 Raw Input
500  {0xf00, &GctFormatTranslateV35::blockToRctCaloRegions}, // Leaf3JetNegEtaU1: JF2 Input
501  {0xf01, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf3JetNegEtaU1: JF2 Shared Received
502  {0xf02, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf3JetNegEtaU1: JF2 Shared Sent
503  {0xf03, &GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster}, // Leaf3JetNegEtaU1: JF2 Output
504  {0xf04, &GctFormatTranslateV35::blockToFibres}, // Leaf3JetNegEtaU1: JF2 Raw Input
505  {0xf08, &GctFormatTranslateV35::blockToRctCaloRegions}, // Leaf3JetNegEtaU1: JF3 Input
506  {0xf09, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf3JetNegEtaU1: JF3 Shared Received
507  {0xf0a, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf3JetNegEtaU1: JF3 Shared Sent
508  {0xf0b, &GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster}, // Leaf3JetNegEtaU1: JF3 Output
509  {0xf0c, &GctFormatTranslateV35::blockToFibres}, // Leaf3JetNegEtaU1: JF3 Raw Input
510  {0xf80, &GctFormatTranslateV35::blockDoNothing}, // Leaf3JetNegEtaU2: Eta0 Input
511  {0xf84, &GctFormatTranslateV35::blockToFibres}, // Leaf3JetNegEtaU2: Eta0 Raw Input
512  {0xf88, &GctFormatTranslateV35::blockToRctCaloRegions}, // Leaf3JetNegEtaU2: JF1 Input
513  {0xf89, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf3JetNegEtaU2: JF1 Shared Received
514  {0xf8a, &GctFormatTranslateV35::blockToGctJetPreCluster}, // Leaf3JetNegEtaU2: JF1 Shared Sent
515  {0xf8b, &GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster}, // Leaf3JetNegEtaU2: JF1 Output
516  {0xf8c, &GctFormatTranslateV35::blockToFibres} // Leaf3JetNegEtaU2: JF1 Raw Input
517 };
518 
519 /*** Setup RCT Em Crate Map ***/
521  {0x804, 13}, {0x884, 9}, {0xc04, 4}, {0xc84, 0}};
522 
523 /*** Setup RCT jet crate map. ***/
525  {0x900, 9}, // PosEta Leaf 1 JF2
526  {0x908, 10}, // PosEta Leaf 1 JF3
527  {0x988, 17}, // PosEta Leaf 1 JF1
528  {0xa00, 12}, // PosEta Leaf 2 JF2
529  {0xa08, 13}, // PosEta Leaf 2 JF3
530  {0xa88, 11}, // PosEta Leaf 2 JF1
531  {0xb00, 15}, // PosEta Leaf 3 JF2
532  {0xb08, 16}, // PosEta Leaf 3 JF3
533  {0xb88, 14}, // PosEta Leaf 3 JF1
534  {0xd00, 0}, // NegEta Leaf 1 JF2
535  {0xd08, 1}, // NegEta Leaf 1 JF3
536  {0xd88, 8}, // NegEta Leaf 1 JF1
537  {0xe00, 3}, // NegEta Leaf 2 JF2
538  {0xe08, 4}, // NegEta Leaf 2 JF3
539  {0xe88, 2}, // NegEta Leaf 2 JF1
540  {0xf00, 6}, // NegEta Leaf 3 JF2
541  {0xf08, 7}, // NegEta Leaf 3 JF3
542  {0xf88, 5} // NegEta Leaf 3 JF1
543 };
544 
545 /*** Setup Block ID map for pipeline payload positions of isolated Internal EM Cands. ***/
547  {0x680, IsoBoundaryPair(8, 15)},
548  {0x800, IsoBoundaryPair(0, 9)},
549  {0x803, IsoBoundaryPair(0, 1)},
550  {0x880, IsoBoundaryPair(0, 7)},
551  {0x883, IsoBoundaryPair(0, 1)},
552  {0xc00, IsoBoundaryPair(0, 9)},
553  {0xc03, IsoBoundaryPair(0, 1)},
554  {0xc80, IsoBoundaryPair(0, 7)},
555  {0xc83, IsoBoundaryPair(0, 1)}};
556 
557 // PUBLIC METHODS
558 
561 
563 
565  // Turn the four 8-bit header words into the full 32-bit header.
566  uint32_t hdr = data[0] + (data[1] << 8) + (data[2] << 16) + (data[3] << 24);
567 
568  // Bit mapping of V35 header:
569  // --------------------------
570  // 11:0 => block_id Unique pipeline identifier.
571  // - 3:0 =>> pipe_id There can be up to 16 different pipelines per FPGA.
572  // - 6:4 =>> reserved Do not use yet. Set to zero.
573  // - 11:7 =>> fpga geograpical add The VME geographical address of the FPGA.
574  // 15:12 => event_id Determined locally. Not reset by Resync.
575  // 19:16 => number_of_time_samples If time samples 15 or more then value = 15.
576  // 31:20 => event_bcid The bunch crossing the data was recorded.
577 
578  unsigned blockId = hdr & 0xfff;
579  unsigned blockLength = 0; // Set to zero until we know it's a valid block
580  unsigned nSamples = (hdr >> 16) & 0xf;
581  unsigned bxId = (hdr >> 20) & 0xfff;
582  unsigned eventId = (hdr >> 12) & 0xf;
583  bool valid = (blockLengthMap().find(blockId) != blockLengthMap().end());
584 
585  if (valid) {
586  blockLength = blockLengthMap().find(blockId)->second;
587  }
588 
589  return GctBlockHeader(blockId, blockLength, nSamples, bxId, eventId, valid);
590 }
591 
592 // conversion
593 bool GctFormatTranslateV35::convertBlock(const unsigned char* data, const GctBlockHeader& hdr) {
594  // if the block has no time samples, don't bother with it.
595  if (hdr.nSamples() < 1) {
596  return true;
597  }
598 
599  if (!checkBlock(hdr)) {
600  return false;
601  } // Check the block to see if it's possible to unpack.
602 
603  // The header validity check above will protect against
604  // the map::find() method returning the end of the map,
605  // assuming the block header definitions are up-to-date.
606  (this->*m_blockUnpackFn.find(hdr.blockId())->second)(data,
607  hdr); // Calls the correct unpack function, based on block ID.
608 
609  return true;
610 }
611 
612 // PROTECTED METHODS
613 
614 uint32_t GctFormatTranslateV35::generateRawHeader(const uint32_t blockId,
615  const uint32_t nSamples,
616  const uint32_t bxId,
617  const uint32_t eventId) const {
618  // Bit mapping of V35 header:
619  // --------------------------
620  // 11:0 => block_id Unique pipeline identifier.
621  // - 3:0 =>> pipe_id There can be up to 16 different pipelines per FPGA.
622  // - 6:4 =>> reserved Do not use yet. Set to zero.
623  // - 11:7 =>> fpga geograpical add The VME geographical address of the FPGA.
624  // 15:12 => event_id Determined locally. Not reset by Resync.
625  // 19:16 => number_of_time_samples If time samples 15 or more then value = 15.
626  // 31:20 => event_bxId The bunch crossing the data was recorded.
627 
628  return ((bxId & 0xfff) << 20) | ((nSamples & 0xf) << 16) | ((eventId & 0xf) << 12) | (blockId & 0xfff);
629 }
630 
631 // PRIVATE METHODS
632 
633 // Output EM Candidates unpacking
635  const unsigned int id = hdr.blockId();
636  const unsigned int nSamples = hdr.nSamples();
637 
638  // Re-interpret pointer. p16 will be pointing at the 16 bit word that
639  // contains the rank0 non-isolated electron of the zeroth time-sample.
640  const uint16_t* p16 = reinterpret_cast<const uint16_t*>(d);
641 
642  // UNPACK EM CANDS
643 
644  const unsigned int emCandCategoryOffset =
645  nSamples * 4; // Offset to jump from the non-iso electrons to the isolated ones.
646  const unsigned int timeSampleOffset = nSamples * 2; // Offset to jump to next candidate pair in the same time-sample.
647 
648  unsigned int samplesToUnpack = 1;
649  if (!hltMode()) {
650  samplesToUnpack = nSamples;
651  } // Only if not running in HLT mode do we want more than 1 timesample.
652 
653  for (unsigned int iso = 0; iso < 2; ++iso) // loop over non-iso/iso candidate pairs
654  {
655  bool isoFlag = (iso == 1);
656 
657  // Get the correct collection to put them in.
659  if (isoFlag) {
660  em = colls()->gctIsoEm();
661  } else {
662  em = colls()->gctNonIsoEm();
663  }
664 
665  for (unsigned int bx = 0; bx < samplesToUnpack; ++bx) // loop over time samples
666  {
667  // cand0Offset will give the offset on p16 to get the rank 0 candidate
668  // of the correct category and timesample.
669  const unsigned int cand0Offset = iso * emCandCategoryOffset + bx * 2;
670 
671  em->push_back(L1GctEmCand(p16[cand0Offset], isoFlag, id, 0, bx)); // rank0 electron
672  em->push_back(L1GctEmCand(p16[cand0Offset + timeSampleOffset], isoFlag, id, 1, bx)); // rank1 electron
673  em->push_back(L1GctEmCand(p16[cand0Offset + 1], isoFlag, id, 2, bx)); // rank2 electron
674  em->push_back(L1GctEmCand(p16[cand0Offset + timeSampleOffset + 1], isoFlag, id, 3, bx)); // rank3 electron
675  }
676  }
677 
678  p16 += emCandCategoryOffset * 2; // Move the pointer over the data we've already unpacked.
679 
680  // UNPACK ENERGY SUMS
681  // NOTE: we are only unpacking one timesample of these currently!
682 
683  colls()->gctEtTot()->push_back(L1GctEtTotal(p16[0])); // Et total (timesample 0).
684  colls()->gctEtHad()->push_back(L1GctEtHad(p16[1])); // Et hadronic (timesample 0).
685 
686  // 32-bit pointer for getting Missing Et.
687  const uint32_t* p32 = reinterpret_cast<const uint32_t*>(p16);
688 
689  colls()->gctEtMiss()->push_back(L1GctEtMiss(p32[nSamples])); // Et Miss (timesample 0).
690 }
691 
693  const unsigned int id = hdr.blockId(); // Capture block ID.
694  const unsigned int nSamples = hdr.nSamples(); // Number of time-samples.
695 
696  // Re-interpret block payload pointer to 16 bits so it sees one candidate at a time.
697  // p16 points to the start of the block payload, at the rank0 tau jet candidate.
698  const uint16_t* p16 = reinterpret_cast<const uint16_t*>(d);
699 
700  // UNPACK JET CANDS
701 
702  const unsigned int jetCandCategoryOffset = nSamples * 4; // Offset to jump from one jet category to the next.
703  const unsigned int timeSampleOffset = nSamples * 2; // Offset to jump to next candidate pair in the same time-sample.
704 
705  unsigned int samplesToUnpack = 1;
706  if (!hltMode()) {
707  samplesToUnpack = nSamples;
708  } // Only if not running in HLT mode do we want more than 1 timesample.
709 
710  // Loop over the different catagories of jets
711  for (unsigned int iCat = 0; iCat < NUM_JET_CATEGORIES; ++iCat) {
712  L1GctJetCandCollection* const jets = gctJets(iCat);
713  assert(jets->empty()); // The supplied vector should be empty.
714 
715  bool tauflag = (iCat == TAU_JETS);
716  bool forwardFlag = (iCat == FORWARD_JETS);
717 
718  // Loop over the different timesamples (bunch crossings).
719  for (unsigned int bx = 0; bx < samplesToUnpack; ++bx) {
720  // cand0Offset will give the offset on p16 to get the rank 0 Jet Cand of the correct category and timesample.
721  const unsigned int cand0Offset = iCat * jetCandCategoryOffset + bx * 2;
722 
723  // Rank 0 Jet.
724  jets->push_back(L1GctJetCand(p16[cand0Offset], tauflag, forwardFlag, id, 0, bx));
725  // Rank 1 Jet.
726  jets->push_back(L1GctJetCand(p16[cand0Offset + timeSampleOffset], tauflag, forwardFlag, id, 1, bx));
727  // Rank 2 Jet.
728  jets->push_back(L1GctJetCand(p16[cand0Offset + 1], tauflag, forwardFlag, id, 2, bx));
729  // Rank 3 Jet.
730  jets->push_back(L1GctJetCand(p16[cand0Offset + timeSampleOffset + 1], tauflag, forwardFlag, id, 3, bx));
731  }
732  }
733 
734  p16 += NUM_JET_CATEGORIES * jetCandCategoryOffset; // Move the pointer over the data we've already unpacked.
735 
736  // NOW UNPACK: HFBitCounts, HFRingEtSums (no Missing Ht yet)
737  // NOTE: we are only unpacking one timesample of these currently!
738 
739  // Re-interpret block payload pointer to 32 bits so it sees six jet counts at a time.
740  const uint32_t* p32 = reinterpret_cast<const uint32_t*>(p16);
741 
742  // Channel 0 carries both HF counts and sums
743  colls()->gctHfBitCounts()->push_back(L1GctHFBitCounts::fromConcHFBitCounts(id, 6, 0, p32[0]));
744  colls()->gctHfRingEtSums()->push_back(L1GctHFRingEtSums::fromConcRingSums(id, 6, 0, p32[0]));
745  // Skip channel 1 for now. Later this may carry MHT would be accessed as p32[nSamples]
746 }
747 
748 // Internal EM Candidates unpacking
749 void GctFormatTranslateV35::blockToGctInternEmCand(const unsigned char* d, const GctBlockHeader& hdr) {
750  // Don't want to do this in HLT optimisation mode!
751  if (hltMode()) {
752  LogDebug("GCT") << "HLT mode - skipping unpack of internal EM Cands";
753  return;
754  }
755 
756  unsigned int id = hdr.blockId();
757  unsigned int nSamples = hdr.nSamples();
758  unsigned int numCandPairs = hdr.blockLength();
759 
760  // Debug assertion to prevent problems if definitions not up to date.
761  auto found = internEmIsoBounds().find(id);
763 
764  unsigned int lowerIsoPairBound = found->second.first;
765  unsigned int upperIsoPairBound = found->second.second;
766 
767  // Re-interpret pointer to 16 bits so it sees one candidate at a time.
768  const uint16_t* p = reinterpret_cast<const uint16_t*>(d);
769 
770  // Loop over timesamples (i.e. bunch crossings)
771  for (unsigned int bx = 0; bx < nSamples; ++bx) {
772  // Loop over candidate pairs (i.e. each iteration unpacks a pair of candidates)
773  for (unsigned int candPair = 0; candPair < numCandPairs; ++candPair) {
774  // Is the candidate electron pair an isolated pair or not?
775  bool iso = ((candPair >= lowerIsoPairBound) && (candPair <= upperIsoPairBound));
776 
777  // Loop over the two electron candidates in each pair
778  for (unsigned int i = 0; i < 2; ++i) {
779  unsigned offset = 2 * (bx + candPair * nSamples) + i;
780  uint16_t candRaw = p[offset];
781  colls()->gctInternEm()->push_back(L1GctInternEmCand(candRaw, iso, id, candPair * 2 + i, bx));
782  }
783  }
784  }
785 }
786 
787 // Input EM Candidates unpacking
788 // this is the last time I deal the RCT bit assignment travesty!!!
789 void GctFormatTranslateV35::blockToRctEmCand(const unsigned char* d, const GctBlockHeader& hdr) {
790  // Don't want to do this in HLT optimisation mode!
791  if (hltMode()) {
792  LogDebug("GCT") << "HLT mode - skipping unpack of RCT EM Cands";
793  return;
794  }
795 
796  unsigned int id = hdr.blockId();
797  unsigned int nSamples = hdr.nSamples();
798  unsigned int length = hdr.blockLength();
799 
800  // re-interpret pointer
801  const uint16_t* p = reinterpret_cast<const uint16_t*>(d);
802 
803  // arrays of source card data
804  uint16_t sfp[2][4]; // [ cycle ] [ SFP ]
805  uint16_t eIsoRank[4];
806  uint16_t eIsoCard[4];
807  uint16_t eIsoRgn[4];
808  uint16_t eNonIsoRank[4];
809  uint16_t eNonIsoCard[4];
810  uint16_t eNonIsoRgn[4];
811  uint16_t MIPbits[7][2];
812  uint16_t QBits[7][2];
813 
814  unsigned int bx = 0;
815 
816  // loop over crates
817  auto found = rctEmCrateMap().find(id);
818  assert(found != rctEmCrateMap().end());
819  for (unsigned int crate = found->second; crate < found->second + length / 3; ++crate) {
820  // read SC SFP words
821  for (unsigned short iSfp = 0; iSfp < 4; ++iSfp) {
822  for (unsigned short cyc = 0; cyc < 2; ++cyc) {
823  if (iSfp == 0) {
824  sfp[cyc][iSfp] = 0;
825  } // muon bits
826  else { // EM candidate
827  sfp[cyc][iSfp] = *p;
828  ++p;
829  }
830  }
831  p = p + 2 * (nSamples - 1);
832  }
833 
834  // fill SC arrays
835  srcCardRouting().SFPtoEMU(eIsoRank, eIsoCard, eIsoRgn, eNonIsoRank, eNonIsoCard, eNonIsoRgn, MIPbits, QBits, sfp);
836 
837  // create EM cands
838  for (unsigned short int i = 0; i < 4; ++i) {
839  colls()->rctEm()->push_back(L1CaloEmCand(eIsoRank[i], eIsoRgn[i], eIsoCard[i], crate, true, i, bx));
840  }
841  for (unsigned short int i = 0; i < 4; ++i) {
842  colls()->rctEm()->push_back(L1CaloEmCand(eNonIsoRank[i], eNonIsoRgn[i], eNonIsoCard[i], crate, false, i, bx));
843  }
844  }
845 }
846 
847 // Input RCT region unpacking
848 void GctFormatTranslateV35::blockToRctCaloRegions(const unsigned char* d, const GctBlockHeader& hdr) {
849  // Don't want to do this in HLT optimisation mode!
850  if (hltMode()) {
851  LogDebug("GCT") << "HLT mode - skipping unpack of RCT Regions";
852  return;
853  }
854 
855  unsigned int id = hdr.blockId();
856  unsigned int nSamples = hdr.nSamples();
857  unsigned int length = hdr.blockLength();
858 
859  // Debug assertion to prevent problems if definitions not up to date.
860  auto found = rctJetCrateMap().find(id);
861  assert(found != rctJetCrateMap().end());
862 
863  // get crate (need this to get ieta and iphi)
864  unsigned int crate = found->second;
865 
866  // re-interpret pointer
867  const uint16_t* p = reinterpret_cast<const uint16_t*>(d);
868 
869  // eta and phi
870  unsigned int ieta;
871  unsigned int iphi;
872 
873  for (unsigned int i = 0; i < length; ++i) {
874  for (uint16_t bx = 0; bx < nSamples; ++bx) {
875  if (i > 0) {
876  if (crate < 9) { // negative eta
877  ieta = 11 - i;
878  iphi = 2 * ((11 - crate) % 9);
879  } else { // positive eta
880  ieta = 10 + i;
881  iphi = 2 * ((20 - crate) % 9);
882  }
883  // First region is phi=0
884  colls()->rctCalo()->push_back(L1CaloRegion::makeRegionFromUnpacker(*p, ieta, iphi, id, i, bx));
885  ++p;
886  // Second region is phi=1
887  if (iphi > 0) {
888  iphi -= 1;
889  } else {
890  iphi = 17;
891  }
892  colls()->rctCalo()->push_back(L1CaloRegion::makeRegionFromUnpacker(*p, ieta, iphi, id, i, bx));
893  ++p;
894  } else { // Skip the first two regions which are duplicates.
895  ++p;
896  ++p;
897  }
898  }
899  }
900 }
901 
902 // Fibre unpacking
903 void GctFormatTranslateV35::blockToFibres(const unsigned char* d, const GctBlockHeader& hdr) {
904  // Don't want to do this in HLT optimisation mode!
905  if (hltMode()) {
906  LogDebug("GCT") << "HLT mode - skipping unpack of GCT Fibres";
907  return;
908  }
909 
910  unsigned int id = hdr.blockId();
911  unsigned int nSamples = hdr.nSamples();
912  unsigned int length = hdr.blockLength();
913 
914  // re-interpret pointer
915  const uint32_t* p = reinterpret_cast<const uint32_t*>(d);
916 
917  for (unsigned int i = 0; i < length; ++i) {
918  for (unsigned int bx = 0; bx < nSamples; ++bx) {
919  colls()->gctFibres()->push_back(L1GctFibreWord(*p, id, i, bx));
920  ++p;
921  }
922  }
923 }
924 
926  this->blockToRctEmCand(d, hdr);
927  this->blockToFibres(d, hdr);
928 }
929 
930 void GctFormatTranslateV35::blockToGctInternEtSums(const unsigned char* d, const GctBlockHeader& hdr) {
931  // Don't want to do this in HLT optimisation mode!
932 
933  if (hltMode()) {
934  LogDebug("GCT") << "HLT mode - skipping unpack of internal Et Sums";
935  return;
936  }
937 
938  unsigned int id = hdr.blockId();
939  unsigned int nSamples = hdr.nSamples();
940  unsigned int length = hdr.blockLength();
941 
942  // Re-interpret pointer to 32 bits
943  const uint32_t* p = reinterpret_cast<const uint32_t*>(d);
944 
945  for (unsigned int i = 0; i < length; ++i) {
946  // Loop over timesamples (i.e. bunch crossings)
947  for (unsigned int bx = 0; bx < nSamples; ++bx) {
948  colls()->gctInternEtSums()->push_back(L1GctInternEtSum::fromTotalEtOrHt(id, i, bx, *p));
949  ++p;
950  }
951  }
952 }
953 
955  // Don't want to do this in HLT optimisation mode!
956  if (hltMode()) {
957  LogDebug("GCT") << "HLT mode - skipping unpack of internal Jet Cands";
958  return;
959  }
960 
961  unsigned int id = hdr.blockId();
962  unsigned int nSamples = hdr.nSamples();
963  unsigned int length = hdr.blockLength();
964 
965  // Re-interpret pointer to 32 bits
966  const uint32_t* p = reinterpret_cast<const uint32_t*>(d);
967 
968  for (unsigned int i = 0; i < length; ++i) {
969  // Loop over timesamples (i.e. bunch crossings)
970  for (unsigned int bx = 0; bx < nSamples; ++bx) {
971  if (i < 2)
972  colls()->gctInternEtSums()->push_back(L1GctInternEtSum::fromJetMissEt(id, i, bx, *p));
973  if (i == 3) {
974  colls()->gctInternEtSums()->push_back(L1GctInternEtSum::fromJetTotEt(id, i, bx, *p));
975  colls()->gctInternEtSums()->push_back(L1GctInternEtSum::fromJetTotHt(id, i, bx, *p));
976  }
977  if (i > 4)
979  ++p;
980  }
981  }
982 }
983 
984 void GctFormatTranslateV35::blockToGctTrigObjects(const unsigned char* d, const GctBlockHeader& hdr) {
985  // Don't want to do this in HLT optimisation mode!
986  if (hltMode()) {
987  LogDebug("GCT") << "HLT mode - skipping unpack of internal Jet Cands";
988  return;
989  }
990 
991  unsigned int id = hdr.blockId();
992  unsigned int nSamples = hdr.nSamples();
993  unsigned int length = hdr.blockLength();
994 
995  // Re-interpret pointer to 16 bits so it sees one candidate at a time.
996  const uint16_t* p = reinterpret_cast<const uint16_t*>(d);
997 
998  for (unsigned int i = 0; i < length; ++i) {
999  // Loop over timesamples (i.e. bunch crossings)
1000  for (unsigned int bx = 0; bx < nSamples; ++bx) {
1001  colls()->gctInternJets()->push_back(
1003  ++p;
1004  colls()->gctInternJets()->push_back(
1006  ++p;
1007  }
1008  }
1009 }
1010 
1012  // Don't want to do this in HLT optimisation mode!
1013  if (hltMode()) {
1014  LogDebug("GCT") << "HLT mode - skipping unpack of internal Jet Cands";
1015  return;
1016  }
1017 
1018  unsigned int id = hdr.blockId();
1019  unsigned int nSamples = hdr.nSamples();
1020  unsigned int length = hdr.blockLength();
1021 
1022  // Re-interpret pointer to 16 bits so it sees one candidate at a time.
1023  const uint16_t* p = reinterpret_cast<const uint16_t*>(d);
1024 
1025  for (unsigned int i = 0; i < length; ++i) {
1026  // Loop over timesamples (i.e. bunch crossings)
1027  for (unsigned int bx = 0; bx < nSamples; ++bx) {
1028  colls()->gctInternJets()->push_back(
1030  ++p;
1031  colls()->gctInternJets()->push_back(
1033  ++p;
1034  }
1035  }
1036 }
1037 
1038 void GctFormatTranslateV35::blockToGctJetPreCluster(const unsigned char* d, const GctBlockHeader& hdr) {
1039  // Don't want to do this in HLT optimisation mode!
1040  if (hltMode()) {
1041  LogDebug("GCT") << "HLT mode - skipping unpack of internal Jet Cands";
1042  return;
1043  }
1044 
1045  unsigned int id = hdr.blockId();
1046  unsigned int nSamples = hdr.nSamples();
1047  unsigned int length = hdr.blockLength();
1048 
1049  // Re-interpret pointer to 16 bits so it sees one candidate at a time.
1050  const uint16_t* p = reinterpret_cast<const uint16_t*>(d);
1051 
1052  for (unsigned int i = 0; i < length; ++i) {
1053  // Loop over timesamples (i.e. bunch crossings)
1054  for (unsigned int bx = 0; bx < nSamples; ++bx) {
1055  colls()->gctInternJets()->push_back(
1057  ++p;
1058  colls()->gctInternJets()->push_back(
1060  ++p;
1061  }
1062  }
1063 }
1064 
1065 void GctFormatTranslateV35::blockToGctInternRingSums(const unsigned char* d, const GctBlockHeader& hdr) {
1066  // Don't want to do this in HLT optimisation mode!
1067  if (hltMode()) {
1068  LogDebug("GCT") << "HLT mode - skipping unpack of internal HF ring data";
1069  return;
1070  }
1071 
1072  unsigned int id = hdr.blockId();
1073  unsigned int nSamples = hdr.nSamples();
1074  unsigned int length = hdr.blockLength();
1075 
1076  // Re-interpret pointer to 32 bits
1077  const uint32_t* p = reinterpret_cast<const uint32_t*>(d);
1078 
1079  for (unsigned int i = 0; i < length / 2; ++i) {
1080  // Loop over timesamples (i.e. bunch crossings)
1081  for (unsigned int bx = 0; bx < nSamples; ++bx) {
1083  ++p;
1084  }
1085  for (unsigned int bx = 0; bx < nSamples; ++bx) {
1087  ++p;
1088  }
1089  }
1090 }
1091 
1093  // Don't want to do this in HLT optimisation mode!
1094  if (hltMode()) {
1095  LogDebug("GCT") << "HLT mode - skipping unpack of wheel input internal Et sums and HF ring data";
1096  return;
1097  }
1098 
1099  unsigned int id = hdr.blockId();
1100  unsigned int nSamples = hdr.nSamples();
1101  unsigned int length = hdr.blockLength();
1102 
1103  // Re-interpret pointer to 32 bits
1104  const uint32_t* p = reinterpret_cast<const uint32_t*>(d);
1105 
1106  for (unsigned int i = 0; i < length; ++i) {
1107  // Loop over timesamples (i.e. bunch crossings)
1108  for (unsigned int bx = 0; bx < nSamples; ++bx) {
1109  if (i < 3) {
1110  colls()->gctInternEtSums()->push_back(L1GctInternEtSum::fromTotalEtOrHt(id, i, bx, *p));
1111  } else if (i > 2 && i < 9) {
1112  colls()->gctInternEtSums()->push_back(L1GctInternEtSum::fromMissEtxOrEty(id, i, bx, *p));
1113  } else if (i > 8 && i < 15) {
1115  } else if (i > 14) {
1117  }
1118  ++p;
1119  }
1120  }
1121 }
1122 
1124  const GctBlockHeader& hdr) {
1125  // Don't want to do this in HLT optimisation mode!
1126  if (hltMode()) {
1127  LogDebug("GCT") << "HLT mode - skipping unpack of wheel output internal Et sums and HF ring data";
1128  return;
1129  }
1130 
1131  unsigned int id = hdr.blockId();
1132  unsigned int nSamples = hdr.nSamples();
1133  unsigned int length = hdr.blockLength();
1134 
1135  // Re-interpret pointer to 32 bits
1136  const uint32_t* p = reinterpret_cast<const uint32_t*>(d);
1137 
1138  for (unsigned int i = 0; i < length; ++i) {
1139  // Loop over timesamples (i.e. bunch crossings)
1140  for (unsigned int bx = 0; bx < nSamples; ++bx) {
1141  if (i < 1) {
1142  colls()->gctInternEtSums()->push_back(L1GctInternEtSum::fromTotalEtOrHt(id, i, bx, *p));
1143  } else if (i > 0 && i < 3) {
1144  colls()->gctInternEtSums()->push_back(L1GctInternEtSum::fromMissEtxOrEty(id, i, bx, *p));
1145  } else if (i > 2 && i < 5) {
1147  } else if (i > 4) {
1149  }
1150  ++p;
1151  }
1152  }
1153 }
L1GctInternJetData::fromJetClusterMinimal
static L1GctInternJetData fromJetClusterMinimal(L1CaloRegionDetId rgn, uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
construct from "jet_cluster_minimal"
Definition: L1GctInternJetData.cc:67
GctBlockHeader
Simple class for holding the basic attributes of an 32-bit block header.
Definition: GctBlockHeader.h:15
L1GctInternEtSum::fromJetTotHt
static L1GctInternEtSum fromJetTotHt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
Definition: L1GctInternEtSum.cc:30
GctFormatTranslateBase::FORWARD_JETS
Definition: GctFormatTranslateBase.h:61
mps_fire.i
i
Definition: mps_fire.py:355
L1GctJetCand
Level-1 Trigger jet candidate.
Definition: L1GctJetCand.h:17
MessageLogger.h
L1GctHFBitCounts::fromConcHFBitCounts
static L1GctHFBitCounts fromConcHFBitCounts(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Definition: L1GctHFBitCounts.cc:14
GctUnpackCollections::rctEm
L1CaloEmCollection *const rctEm() const
Input electrons from the RCT to the GCT.
Definition: GctUnpackCollections.h:31
GctFormatTranslateV35::blockToFibresAndToRctEmCand
void blockToFibresAndToRctEmCand(const unsigned char *d, const GctBlockHeader &hdr)
unpack Fibres and RCT EM Candidates
Definition: GctFormatTranslateV35.cc:925
GctFormatTranslateBase::NUM_JET_CATEGORIES
Definition: GctFormatTranslateBase.h:61
GctFormatTranslateV35::m_blockName
static const BlockNameMap m_blockName
Map to hold a description for each block number.
Definition: GctFormatTranslateV35.h:83
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
GctUnpackCollections::gctInternEm
L1GctInternEmCandCollection *const gctInternEm() const
Internal EM candidate collection.
Definition: GctUnpackCollections.h:37
L1GctJetCandCollection
std::vector< L1GctJetCand > L1GctJetCandCollection
Definition: L1GctCollections.h:31
gather_cfg.cout
cout
Definition: gather_cfg.py:144
GctFormatTranslateV35::BlockIdToUnpackFnMap
std::map< unsigned int, PtrToUnpackFn > BlockIdToUnpackFnMap
Typedef for a block ID to unpack function map.
Definition: GctFormatTranslateV35.h:75
GctFormatTranslateV35::blockToGctInternEmCand
void blockToGctInternEmCand(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal EM Candidates
Definition: GctFormatTranslateV35.cc:749
GctFormatTranslateV35::blockToGctEmCandsAndEnergySums
void blockToGctEmCandsAndEnergySums(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT EM Candidates and energy sums.
Definition: GctFormatTranslateV35.cc:634
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
GctFormatTranslateV35::blockToGctJetClusterMinimal
void blockToGctJetClusterMinimal(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal input to wheel jet sort
Definition: GctFormatTranslateV35.cc:1011
L1GctEmCand
Level-1 Trigger EM candidate at output of GCT.
Definition: L1GctEmCand.h:21
GctFormatTranslateV35::m_blockLength
static const BlockLengthMap m_blockLength
Map to translate block number to fundamental size of a block (i.e. for 1 time-sample).
Definition: GctFormatTranslateV35.h:80
cms::cuda::assert
assert(be >=bs)
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
GctFormatTranslateV35::convertBlock
bool convertBlock(const unsigned char *d, const GctBlockHeader &hdr) override
Get digis from the block - will return true if it succeeds, false otherwise.
Definition: GctFormatTranslateV35.cc:593
GctUnpackCollections::gctHfBitCounts
L1GctHFBitCountsCollection *const gctHfBitCounts() const
GCT output: Hadronic-Forward bit-counts collection.
Definition: GctUnpackCollections.h:67
GctUnpackCollections::gctHfRingEtSums
L1GctHFRingEtSumsCollection *const gctHfRingEtSums() const
GCT output: Hadronic-Forward ring-sums collection.
Definition: GctUnpackCollections.h:70
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
GctFormatTranslateBase::blockDoNothing
void blockDoNothing(const unsigned char *d, const GctBlockHeader &hdr)
The null unpack function - obviously common to all formats.
Definition: GctFormatTranslateBase.h:128
GctFormatTranslateV35::blockToGctWheelInputInternEtAndRingSums
void blockToGctWheelInputInternEtAndRingSums(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal input to wheel
Definition: GctFormatTranslateV35.cc:1092
L1GctInternHFData::fromConcBitCounts
static L1GctInternHFData fromConcBitCounts(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Definition: L1GctInternHFData.cc:22
GctFormatTranslateV35::blockToGctWheelOutputInternEtAndRingSums
void blockToGctWheelOutputInternEtAndRingSums(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal output of wheel
Definition: GctFormatTranslateV35.cc:1123
GctBlockHeader::blockId
uint32_t blockId() const
Get the block ID.
Definition: GctBlockHeader.h:27
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
GctFormatTranslateV35::blockToGctInternEtSumsAndJetCluster
void blockToGctInternEtSumsAndJetCluster(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal output of leaf jet finder
Definition: GctFormatTranslateV35.cc:954
L1GctInternJetData::fromJetPreCluster
static L1GctInternJetData fromJetPreCluster(L1CaloRegionDetId rgn, uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
construct from "jet_precluster"
Definition: L1GctInternJetData.cc:52
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
PresampleTask_cfi.nSamples
nSamples
Definition: PresampleTask_cfi.py:7
GctUnpackCollections::gctNonIsoEm
L1GctEmCandCollection *const gctNonIsoEm() const
GCT output: Non-isolated EM candidate collection.
Definition: GctUnpackCollections.h:57
GctFormatTranslateBase
Abstract interface for RawToDigi/DigiToRaw conversions of GCT data.
Definition: GctFormatTranslateBase.h:25
validateGeometry_cfg.valid
valid
Definition: validateGeometry_cfg.py:21
end
#define end
Definition: vmac.h:39
GctFormatTranslateV35::blockToRctEmCand
void blockToRctEmCand(const unsigned char *d, const GctBlockHeader &hdr)
unpack RCT EM Candidates
Definition: GctFormatTranslateV35.cc:789
GctFormatTranslateV35::GctFormatTranslateV35
GctFormatTranslateV35(bool hltMode=false, bool unpackSharedRegions=false)
Constructor.
Definition: GctFormatTranslateV35.cc:559
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
L1GctInternJetData::fromGctTrigObject
static L1GctInternJetData fromGctTrigObject(L1CaloRegionDetId rgn, uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
construct from "gct_trig_object"
Definition: L1GctInternJetData.cc:82
L1GctEtMiss
Persistable copy of missing Et measured at Level-1.
Definition: L1GctEtMiss.h:17
GctFormatTranslateV35::generateRawHeader
uint32_t generateRawHeader(const uint32_t blockId, const uint32_t nSamples, const uint32_t bxId, const uint32_t eventId) const override
Returns a raw 32-bit header word generated from the blockId, number of time samples,...
Definition: GctFormatTranslateV35.cc:614
L1CaloRegionDetId
Definition: L1CaloRegionDetId.h:18
L1GctInternJetData::fromJetCluster
static L1GctInternJetData fromJetCluster(L1CaloRegionDetId rgn, uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
construct from "jet_cluster"
Definition: L1GctInternJetData.cc:37
GctUnpackCollections::gctInternJets
L1GctInternJetDataCollection *const gctInternJets() const
Internal Jet candidate collection.
Definition: GctUnpackCollections.h:40
GctFormatTranslateV35::internEmIsoBounds
const BlockIdToEmCandIsoBoundMap & internEmIsoBounds() const final
get the static intern EM cand isolated boundary map.
Definition: GctFormatTranslateV35.h:58
GctFormatTranslateV35::rctJetCrateMap
const BlkToRctCrateMap & rctJetCrateMap() const final
get the static block ID to RCT crate map for jets
Definition: GctFormatTranslateV35.h:54
GctFormatTranslateV35::generateBlockHeader
GctBlockHeader generateBlockHeader(const unsigned char *data) const override
Generate a block header from four 8-bit values.
Definition: GctFormatTranslateV35.cc:564
GctFormatTranslateV35::blockToGctTrigObjects
void blockToGctTrigObjects(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal wheel and conc jets
Definition: GctFormatTranslateV35.cc:984
GctFormatTranslateV35::~GctFormatTranslateV35
~GctFormatTranslateV35() override
Destructor.
Definition: GctFormatTranslateV35.cc:562
L1CaloRegion::makeRegionFromUnpacker
static L1CaloRegion makeRegionFromUnpacker(const uint16_t data, const unsigned ieta, const unsigned iphi, const uint16_t block, const uint16_t index, const int16_t bx)
constructor from raw data and GCT indices for unpacking
Definition: L1CaloRegion.cc:78
L1GctInternEmCand
Definition: L1GctInternEmCand.h:18
L1GctEtTotal
Persistable copy of total Et measured at Level-1.
Definition: L1GctEtTotal.h:17
GctUnpackCollections::gctInternHFData
L1GctInternHFDataCollection *const gctInternHFData() const
Internal Hadronic-Forward bit-counts/ring-sums data collection.
Definition: GctUnpackCollections.h:46
GctFormatTranslateV35.h
L1GctInternHFData::fromConcRingSums
static L1GctInternHFData fromConcRingSums(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Definition: L1GctInternHFData.cc:9
GctFormatTranslateBase::hltMode
bool hltMode() const
Protected interface to get HLT optimisation mode flag.
Definition: GctFormatTranslateBase.h:100
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
GctFormatTranslateV35::blockToGctJetPreCluster
void blockToGctJetPreCluster(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal shared jet finder info
Definition: GctFormatTranslateV35.cc:1038
L1GctHFRingEtSums::fromConcRingSums
static L1GctHFRingEtSums fromConcRingSums(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Definition: L1GctHFRingEtSums.cc:14
GctUnpackCollections::rctCalo
L1CaloRegionCollection *const rctCalo() const
Input calo regions from the RCT to the GCT.
Definition: GctUnpackCollections.h:32
GctFormatTranslateV35::blockToFibres
void blockToFibres(const unsigned char *d, const GctBlockHeader &hdr)
unpack Fibres
Definition: GctFormatTranslateV35.cc:903
GctFormatTranslateV35::blockToRctCaloRegions
void blockToRctCaloRegions(const unsigned char *d, const GctBlockHeader &hdr)
Unpack RCT Calo Regions.
Definition: GctFormatTranslateV35.cc:848
GctFormatTranslateBase::colls
GctUnpackCollections *const colls() const
Protected access to the GCT Unpack Collections.
Definition: GctFormatTranslateBase.h:97
GctFormatTranslateBase::BlockIdToEmCandIsoBoundMap
std::map< unsigned int, IsoBoundaryPair > BlockIdToEmCandIsoBoundMap
A typdef for mapping Block IDs to IsoBoundaryPairs.
Definition: GctFormatTranslateBase.h:79
L1GctInternHFData::fromWheelRingSums
static L1GctInternHFData fromWheelRingSums(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Definition: L1GctInternHFData.cc:37
GctBlockHeader::blockLength
uint32_t blockLength() const
Get the fundamental block length (for 1 time sample)
Definition: GctBlockHeader.h:30
SourceCardRouting::SFPtoEMU
void SFPtoEMU(unsigned short(&eIsoRank)[4], unsigned short(&eIsoCardId)[4], unsigned short(&eIsoRegionId)[4], unsigned short(&eNonIsoRank)[4], unsigned short(&eNonIsoCardId)[4], unsigned short(&eNonIsoRegionId)[4], unsigned short(&MIPbits)[7][2], unsigned short(&Qbits)[7][2], unsigned short(&SFP)[2][4]) const
Definition: SourceCardRouting.cc:68
L1GctInternEtSum::fromTotalEtOrHt
static L1GctInternEtSum fromTotalEtOrHt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
Definition: L1GctInternEtSum.cc:59
GctFormatTranslateV35::blockLengthMap
const BlockLengthMap & blockLengthMap() const final
get the static block ID to block-length map.
Definition: GctFormatTranslateV35.h:44
GctUnpackCollections::gctIsoEm
L1GctEmCandCollection *const gctIsoEm() const
GCT output: Isolated EM candidate collection.
Definition: GctUnpackCollections.h:54
GctFormatTranslateBase::gctJets
L1GctJetCandCollection *const gctJets(const unsigned cat) const
Get a specific jet candandiate collection using the JetCandCategory enumeration.
Definition: GctFormatTranslateBase.cc:30
GctFormatTranslateBase::TAU_JETS
Definition: GctFormatTranslateBase.h:61
l1GctHwDigis_cfi.unpackSharedRegions
unpackSharedRegions
Definition: l1GctHwDigis_cfi.py:10
GctBlockHeader::nSamples
uint32_t nSamples() const
Get the number of time samples.
Definition: GctBlockHeader.h:33
L1GctEtHad
Persistable copy of total Ht measured at Level-1.
Definition: L1GctEtHad.h:17
GctFormatTranslateV35::blockToGctInternEtSums
void blockToGctInternEtSums(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal Et sums
Definition: GctFormatTranslateV35.cc:930
L1GctEmCandCollection
std::vector< L1GctEmCand > L1GctEmCandCollection
Definition: L1GctCollections.h:30
GctFormatTranslateV35::m_internEmIsoBounds
static const BlockIdToEmCandIsoBoundMap m_internEmIsoBounds
Definition: GctFormatTranslateV35.h:93
l1GctHwDigis_cfi.hltMode
hltMode
Definition: l1GctHwDigis_cfi.py:7
L1GctInternHFData::fromWheelBitCounts
static L1GctInternHFData fromWheelBitCounts(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Definition: L1GctInternHFData.cc:50
GctUnpackCollections::gctEtHad
L1GctEtHadCollection *const gctEtHad() const
GCT output: Hadronic transverse-energy (Ht) collection.
Definition: GctUnpackCollections.h:74
GctFormatTranslateBase::BlockLengthMap
std::map< unsigned int, unsigned int > BlockLengthMap
Block ID to Block Length map.
Definition: GctFormatTranslateBase.h:63
GctFormatTranslateV35::blockToGctJetCandsAndCounts
void blockToGctJetCandsAndCounts(const unsigned char *d, const GctBlockHeader &hdr)
Unpack GCT Jet Candidates and jet counts.
Definition: GctFormatTranslateV35.cc:692
L1GctInternEtSum::fromMissEtxOrEty
static L1GctInternEtSum fromMissEtxOrEty(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
Definition: L1GctInternEtSum.cc:73
GctFormatTranslateV35::rctEmCrateMap
const BlkToRctCrateMap & rctEmCrateMap() const final
get static the block ID to RCT crate map for electrons.
Definition: GctFormatTranslateV35.h:50
GctUnpackCollections::gctEtMiss
L1GctEtMissCollection *const gctEtMiss() const
GCT output: Missing Et collection.
Definition: GctUnpackCollections.h:77
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
GctFormatTranslateBase::BlockNameMap
std::map< unsigned int, std::string > BlockNameMap
Block ID to Block Description map.
Definition: GctFormatTranslateBase.h:65
L1GctFibreWord
Global Calorimeter Trigger SC -> CC fibre data word.
Definition: L1GctFibreWord.h:17
ztail.d
d
Definition: ztail.py:151
GctUnpackCollections::gctEtTot
L1GctEtTotalCollection *const gctEtTot() const
GCT output: Total Et collection.
Definition: GctUnpackCollections.h:73
GctFormatTranslateBase::srcCardRouting
const SourceCardRouting & srcCardRouting() const
Protected interface to the unpackSharedRegions commissioning option.
Definition: GctFormatTranslateBase.h:104
GctFormatTranslateV35::m_rctJetCrate
static const BlkToRctCrateMap m_rctJetCrate
Map to relate capture block ID to the RCT crate the data originated from (for jets).
Definition: GctFormatTranslateV35.h:89
GctFormatTranslateBase::checkBlock
bool checkBlock(const GctBlockHeader &hdr) const
Performs checks on the block header to see if the block is possible to unpack or not.
Definition: GctFormatTranslateBase.cc:47
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:78
L1GctInternEtSum::fromJetMissEt
static L1GctInternEtSum fromJetMissEt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
Definition: L1GctInternEtSum.cc:45
L1CaloEmCand
Level-1 Region Calorimeter Trigger EM candidate.
Definition: L1CaloEmCand.h:17
GctFormatTranslateV35::m_rctEmCrate
static const BlkToRctCrateMap m_rctEmCrate
Map to relate capture block ID to the RCT crate the data originated from (for electrons).
Definition: GctFormatTranslateV35.h:86
GctUnpackCollections::gctFibres
L1GctFibreCollection *const gctFibres() const
Raw fibre input to the GCT.
Definition: GctUnpackCollections.h:30
GctFormatTranslateBase::BlkToRctCrateMap
std::map< unsigned int, unsigned int > BlkToRctCrateMap
Typedef for mapping block ID to RCT crate.
Definition: GctFormatTranslateBase.h:69
GctUnpackCollections::gctInternEtSums
L1GctInternEtSumCollection *const gctInternEtSums() const
Internal Et Sum collection.
Definition: GctUnpackCollections.h:43
L1GctInternEtSum::fromJetTotEt
static L1GctInternEtSum fromJetTotEt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
Definition: L1GctInternEtSum.cc:16
GctFormatTranslateV35::blockToGctInternRingSums
void blockToGctInternRingSums(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal HF ring sums
Definition: GctFormatTranslateV35.cc:1065
GctFormatTranslateV35::m_blockUnpackFn
static const BlockIdToUnpackFnMap m_blockUnpackFn
Block ID to unpack function map.
Definition: GctFormatTranslateV35.h:96