30 unsigned numberOfGctSamplesToUnpack,
31 unsigned numberOfRctSamplesToUnpack):
33 m_numberOfGctSamplesToUnpack(numberOfGctSamplesToUnpack),
34 m_numberOfRctSamplesToUnpack(numberOfRctSamplesToUnpack)
36 static bool initClass =
true;
209 m_blockName.insert(make_pair(0x580,
"ConcJet: Input TrigPathA (Jet Cands)"));
210 m_blockName.insert(make_pair(0x581,
"ConcJet: Input TrigPathB (HF Rings)"));
211 m_blockName.insert(make_pair(0x582,
"ConcJet: Input TrigPathC (MissHt)"));
212 m_blockName.insert(make_pair(0x583,
"ConcJet: Jet Cands and Counts Output to GT"));
213 m_blockName.insert(make_pair(0x587,
"ConcJet: BX & Orbit Info"));
215 m_blockName.insert(make_pair(0x680,
"ConcElec: Input TrigPathA (EM Cands)"));
216 m_blockName.insert(make_pair(0x681,
"ConcElec: Input TrigPathB (Et Sums)"));
217 m_blockName.insert(make_pair(0x682,
"ConcElec: Input TrigPathC (Ht Sums)"));
218 m_blockName.insert(make_pair(0x683,
"ConcElec: EM Cands and Energy Sums Output to GT"));
219 m_blockName.insert(make_pair(0x686,
"ConcElec: Test (GT Serdes Loopback)"));
220 m_blockName.insert(make_pair(0x687,
"ConcElec: BX & Orbit Info"));
222 m_blockName.insert(make_pair(0x800,
"Leaf0ElecPosEtaU1: Sort Input"));
223 m_blockName.insert(make_pair(0x803,
"Leaf0ElecPosEtaU1: Sort Output"));
224 m_blockName.insert(make_pair(0x804,
"Leaf0ElecPosEtaU1: Raw Input"));
225 m_blockName.insert(make_pair(0x880,
"Leaf0ElecPosEtaU2: Sort Input"));
226 m_blockName.insert(make_pair(0x883,
"Leaf0ElecPosEtaU2: Sort Output"));
227 m_blockName.insert(make_pair(0x884,
"Leaf0ElecPosEtaU2: Raw Input"));
228 m_blockName.insert(make_pair(0xc00,
"Leaf0ElecNegEtaU1: Sort Input"));
229 m_blockName.insert(make_pair(0xc03,
"Leaf0ElecNegEtaU1: Sort Output"));
230 m_blockName.insert(make_pair(0xc04,
"Leaf0ElecNegEtaU1: Raw Input"));
231 m_blockName.insert(make_pair(0xc80,
"Leaf0ElecNegEtaU2: Sort Input"));
232 m_blockName.insert(make_pair(0xc83,
"Leaf0ElecNegEtaU2: Sort Output"));
233 m_blockName.insert(make_pair(0xc84,
"Leaf0ElecNegEtaU2: Raw Input"));
235 m_blockName.insert(make_pair(0x300,
"WheelPosEtaJet: Input TrigPathA (Jet Sort)"));
236 m_blockName.insert(make_pair(0x301,
"WheelPosEtaJet: Input TrigPathB (MissHt)"));
237 m_blockName.insert(make_pair(0x303,
"WheelPosEtaJet: Output TrigPathA (Jet Sort)"));
238 m_blockName.insert(make_pair(0x305,
"WheelPosEtaJet: Output TrigPathB (MissHt)"));
239 m_blockName.insert(make_pair(0x306,
"WheelPosEtaJet: Test (deprecated)"));
240 m_blockName.insert(make_pair(0x307,
"WheelPosEtaJet: Info (deprecated)"));
242 m_blockName.insert(make_pair(0x380,
"WheelPosEtaEnergy: Input TrigPathA (Et)"));
243 m_blockName.insert(make_pair(0x381,
"WheelPosEtaEnergy: Input TrigPathB (Ht)"));
244 m_blockName.insert(make_pair(0x383,
"WheelPosEtaEnergy: Output TrigPathA (Et)"));
245 m_blockName.insert(make_pair(0x385,
"WheelPosEtaEnergy: Output TrigPathB (Ht)"));
246 m_blockName.insert(make_pair(0x386,
"WheelPosEtaEnergy: Test"));
247 m_blockName.insert(make_pair(0x387,
"WheelPosEtaEnergy: BX & Orbit Info"));
249 m_blockName.insert(make_pair(0x700,
"WheelNegEtaJet: Input TrigPathA (Jet Sort)"));
250 m_blockName.insert(make_pair(0x701,
"WheelNegEtaJet: Input TrigPathB (MissHt)"));
251 m_blockName.insert(make_pair(0x703,
"WheelNegEtaJet: Output TrigPathA (Jet Sort)"));
252 m_blockName.insert(make_pair(0x705,
"WheelNegEtaJet: Output TrigPathB (MissHt)"));
253 m_blockName.insert(make_pair(0x706,
"WheelNegEtaJet: Test (deprecated)"));
254 m_blockName.insert(make_pair(0x707,
"WheelNegEtaJet: Info (deprecated)"));
256 m_blockName.insert(make_pair(0x780,
"WheelNegEtaEnergy: Input TrigPathA (Et)"));
257 m_blockName.insert(make_pair(0x781,
"WheelNegEtaEnergy: Input TrigPathB (Ht)"));
258 m_blockName.insert(make_pair(0x783,
"WheelNegEtaEnergy: Output TrigPathA (Et)"));
259 m_blockName.insert(make_pair(0x785,
"WheelNegEtaEnergy: Output TrigPathB (Ht)"));
260 m_blockName.insert(make_pair(0x786,
"WheelNegEtaEnergy: Test"));
261 m_blockName.insert(make_pair(0x787,
"WheelNegEtaEnergy: BX & Orbit Info"));
263 m_blockName.insert(make_pair(0x900,
"Leaf1JetPosEtaU1: JF2 Input"));
264 m_blockName.insert(make_pair(0x901,
"Leaf1JetPosEtaU1: JF2 Shared Received"));
265 m_blockName.insert(make_pair(0x902,
"Leaf1JetPosEtaU1: JF2 Shared Sent"));
266 m_blockName.insert(make_pair(0x903,
"Leaf1JetPosEtaU1: JF2 Output"));
267 m_blockName.insert(make_pair(0x904,
"Leaf1JetPosEtaU1: JF2 Raw Input"));
268 m_blockName.insert(make_pair(0x908,
"Leaf1JetPosEtaU1: JF3 Input"));
269 m_blockName.insert(make_pair(0x909,
"Leaf1JetPosEtaU1: JF3 Shared Received"));
270 m_blockName.insert(make_pair(0x90a,
"Leaf1JetPosEtaU1: JF3 Shared Sent"));
271 m_blockName.insert(make_pair(0x90b,
"Leaf1JetPosEtaU1: JF3 Output"));
272 m_blockName.insert(make_pair(0x90c,
"Leaf1JetPosEtaU1: JF3 Raw Input"));
273 m_blockName.insert(make_pair(0x980,
"Leaf1JetPosEtaU2: Eta0 Input"));
274 m_blockName.insert(make_pair(0x984,
"Leaf1JetPosEtaU2: Eta0 Raw Input"));
275 m_blockName.insert(make_pair(0x988,
"Leaf1JetPosEtaU2: JF1 Input"));
276 m_blockName.insert(make_pair(0x989,
"Leaf1JetPosEtaU2: JF1 Shared Received"));
277 m_blockName.insert(make_pair(0x98a,
"Leaf1JetPosEtaU2: JF1 Shared Sent"));
278 m_blockName.insert(make_pair(0x98b,
"Leaf1JetPosEtaU2: JF1 Output"));
279 m_blockName.insert(make_pair(0x98c,
"Leaf1JetPosEtaU2: JF1 Raw Input"));
280 m_blockName.insert(make_pair(0xa00,
"Leaf2JetPosEtaU1: JF2 Input"));
281 m_blockName.insert(make_pair(0xa01,
"Leaf2JetPosEtaU1: JF2 Shared Received"));
282 m_blockName.insert(make_pair(0xa02,
"Leaf2JetPosEtaU1: JF2 Shared Sent"));
283 m_blockName.insert(make_pair(0xa03,
"Leaf2JetPosEtaU1: JF2 Output"));
284 m_blockName.insert(make_pair(0xa04,
"Leaf2JetPosEtaU1: JF2 Raw Input"));
285 m_blockName.insert(make_pair(0xa08,
"Leaf2JetPosEtaU1: JF3 Input"));
286 m_blockName.insert(make_pair(0xa09,
"Leaf2JetPosEtaU1: JF3 Shared Received"));
287 m_blockName.insert(make_pair(0xa0a,
"Leaf2JetPosEtaU1: JF3 Shared Sent"));
288 m_blockName.insert(make_pair(0xa0b,
"Leaf2JetPosEtaU1: JF3 Output"));
289 m_blockName.insert(make_pair(0xa0c,
"Leaf2JetPosEtaU1: JF3 Raw Input"));
290 m_blockName.insert(make_pair(0xa80,
"Leaf2JetPosEtaU2: Eta0 Input"));
291 m_blockName.insert(make_pair(0xa84,
"Leaf2JetPosEtaU2: Eta0 Raw Input"));
292 m_blockName.insert(make_pair(0xa88,
"Leaf2JetPosEtaU2: JF1 Input"));
293 m_blockName.insert(make_pair(0xa89,
"Leaf2JetPosEtaU2: JF1 Shared Received"));
294 m_blockName.insert(make_pair(0xa8a,
"Leaf2JetPosEtaU2: JF1 Shared Sent"));
295 m_blockName.insert(make_pair(0xa8b,
"Leaf2JetPosEtaU2: JF1 Output"));
296 m_blockName.insert(make_pair(0xa8c,
"Leaf2JetPosEtaU2: JF1 Raw Input"));
297 m_blockName.insert(make_pair(0xb00,
"Leaf3JetPosEtaU1: JF2 Input"));
298 m_blockName.insert(make_pair(0xb01,
"Leaf3JetPosEtaU1: JF2 Shared Received"));
299 m_blockName.insert(make_pair(0xb02,
"Leaf3JetPosEtaU1: JF2 Shared Sent"));
300 m_blockName.insert(make_pair(0xb03,
"Leaf3JetPosEtaU1: JF2 Output"));
301 m_blockName.insert(make_pair(0xb04,
"Leaf3JetPosEtaU1: JF2 Raw Input"));
302 m_blockName.insert(make_pair(0xb08,
"Leaf3JetPosEtaU1: JF3 Input"));
303 m_blockName.insert(make_pair(0xb09,
"Leaf3JetPosEtaU1: JF3 Shared Received"));
304 m_blockName.insert(make_pair(0xb0a,
"Leaf3JetPosEtaU1: JF3 Shared Sent"));
305 m_blockName.insert(make_pair(0xb0b,
"Leaf3JetPosEtaU1: JF3 Output"));
306 m_blockName.insert(make_pair(0xb0c,
"Leaf3JetPosEtaU1: JF3 Raw Input"));
307 m_blockName.insert(make_pair(0xb80,
"Leaf3JetPosEtaU2: Eta0 Input"));
308 m_blockName.insert(make_pair(0xb84,
"Leaf3JetPosEtaU2: Eta0 Raw Input"));
309 m_blockName.insert(make_pair(0xb88,
"Leaf3JetPosEtaU2: JF1 Input"));
310 m_blockName.insert(make_pair(0xb89,
"Leaf3JetPosEtaU2: JF1 Shared Received"));
311 m_blockName.insert(make_pair(0xb8a,
"Leaf3JetPosEtaU2: JF1 Shared Sent"));
312 m_blockName.insert(make_pair(0xb8b,
"Leaf3JetPosEtaU2: JF1 Output"));
313 m_blockName.insert(make_pair(0xb8c,
"Leaf3JetPosEtaU2: JF1 Raw Input"));
315 m_blockName.insert(make_pair(0xd00,
"Leaf1JetNegEtaU1: JF2 Input"));
316 m_blockName.insert(make_pair(0xd01,
"Leaf1JetNegEtaU1: JF2 Shared Received"));
317 m_blockName.insert(make_pair(0xd02,
"Leaf1JetNegEtaU1: JF2 Shared Sent"));
318 m_blockName.insert(make_pair(0xd03,
"Leaf1JetNegEtaU1: JF2 Output"));
319 m_blockName.insert(make_pair(0xd04,
"Leaf1JetNegEtaU1: JF2 Raw Input"));
320 m_blockName.insert(make_pair(0xd08,
"Leaf1JetNegEtaU1: JF3 Input"));
321 m_blockName.insert(make_pair(0xd09,
"Leaf1JetNegEtaU1: JF3 Shared Received"));
322 m_blockName.insert(make_pair(0xd0a,
"Leaf1JetNegEtaU1: JF3 Shared Sent"));
323 m_blockName.insert(make_pair(0xd0b,
"Leaf1JetNegEtaU1: JF3 Output"));
324 m_blockName.insert(make_pair(0xd0c,
"Leaf1JetNegEtaU1: JF3 Raw Input"));
325 m_blockName.insert(make_pair(0xd80,
"Leaf1JetNegEtaU2: Eta0 Input"));
326 m_blockName.insert(make_pair(0xd84,
"Leaf1JetNegEtaU2: Eta0 Raw Input"));
327 m_blockName.insert(make_pair(0xd88,
"Leaf1JetNegEtaU2: JF1 Input"));
328 m_blockName.insert(make_pair(0xd89,
"Leaf1JetNegEtaU2: JF1 Shared Received"));
329 m_blockName.insert(make_pair(0xd8a,
"Leaf1JetNegEtaU2: JF1 Shared Sent"));
330 m_blockName.insert(make_pair(0xd8b,
"Leaf1JetNegEtaU2: JF1 Output"));
331 m_blockName.insert(make_pair(0xd8c,
"Leaf1JetNegEtaU2: JF1 Raw Input"));
332 m_blockName.insert(make_pair(0xe00,
"Leaf2JetNegEtaU1: JF2 Input"));
333 m_blockName.insert(make_pair(0xe01,
"Leaf2JetNegEtaU1: JF2 Shared Received"));
334 m_blockName.insert(make_pair(0xe02,
"Leaf2JetNegEtaU1: JF2 Shared Sent"));
335 m_blockName.insert(make_pair(0xe03,
"Leaf2JetNegEtaU1: JF2 Output"));
336 m_blockName.insert(make_pair(0xe04,
"Leaf2JetNegEtaU1: JF2 Raw Input"));
337 m_blockName.insert(make_pair(0xe08,
"Leaf2JetNegEtaU1: JF3 Input"));
338 m_blockName.insert(make_pair(0xe09,
"Leaf2JetNegEtaU1: JF3 Shared Received"));
339 m_blockName.insert(make_pair(0xe0a,
"Leaf2JetNegEtaU1: JF3 Shared Sent"));
340 m_blockName.insert(make_pair(0xe0b,
"Leaf2JetNegEtaU1: JF3 Output"));
341 m_blockName.insert(make_pair(0xe0c,
"Leaf2JetNegEtaU1: JF3 Raw Input"));
342 m_blockName.insert(make_pair(0xe80,
"Leaf2JetNegEtaU2: Eta0 Input"));
343 m_blockName.insert(make_pair(0xe84,
"Leaf2JetNegEtaU2: Eta0 Raw Input"));
344 m_blockName.insert(make_pair(0xe88,
"Leaf2JetNegEtaU2: JF1 Input"));
345 m_blockName.insert(make_pair(0xe89,
"Leaf2JetNegEtaU2: JF1 Shared Received"));
346 m_blockName.insert(make_pair(0xe8a,
"Leaf2JetNegEtaU2: JF1 Shared Sent"));
347 m_blockName.insert(make_pair(0xe8b,
"Leaf2JetNegEtaU2: JF1 Output"));
348 m_blockName.insert(make_pair(0xe8c,
"Leaf2JetNegEtaU2: JF1 Raw Input"));
349 m_blockName.insert(make_pair(0xf00,
"Leaf3JetNegEtaU1: JF2 Input"));
350 m_blockName.insert(make_pair(0xf01,
"Leaf3JetNegEtaU1: JF2 Shared Received"));
351 m_blockName.insert(make_pair(0xf02,
"Leaf3JetNegEtaU1: JF2 Shared Sent"));
352 m_blockName.insert(make_pair(0xf03,
"Leaf3JetNegEtaU1: JF2 Output"));
353 m_blockName.insert(make_pair(0xf04,
"Leaf3JetNegEtaU1: JF2 Raw Input"));
354 m_blockName.insert(make_pair(0xf08,
"Leaf3JetNegEtaU1: JF3 Input"));
355 m_blockName.insert(make_pair(0xf09,
"Leaf3JetNegEtaU1: JF3 Shared Received"));
356 m_blockName.insert(make_pair(0xf0a,
"Leaf3JetNegEtaU1: JF3 Shared Sent"));
357 m_blockName.insert(make_pair(0xf0b,
"Leaf3JetNegEtaU1: JF3 Output"));
358 m_blockName.insert(make_pair(0xf0c,
"Leaf3JetNegEtaU1: JF3 Raw Input"));
359 m_blockName.insert(make_pair(0xf80,
"Leaf3JetNegEtaU2: Eta0 Input"));
360 m_blockName.insert(make_pair(0xf84,
"Leaf3JetNegEtaU2: Eta0 Raw Input"));
361 m_blockName.insert(make_pair(0xf88,
"Leaf3JetNegEtaU2: JF1 Input"));
362 m_blockName.insert(make_pair(0xf89,
"Leaf3JetNegEtaU2: JF1 Shared Received"));
363 m_blockName.insert(make_pair(0xf8a,
"Leaf3JetNegEtaU2: JF1 Shared Sent"));
364 m_blockName.insert(make_pair(0xf8b,
"Leaf3JetNegEtaU2: JF1 Output"));
365 m_blockName.insert(make_pair(0xf8c,
"Leaf3JetNegEtaU2: JF1 Raw Input"));
579 uint32_t hdr = data[0] + (data[1]<<8) + (data[2]<<16) + (data[3]<<24);
591 unsigned blockId = hdr & 0xfff;
592 unsigned blockLength = 0;
593 unsigned nSamples = (hdr>>16) & 0xf;
594 unsigned bxId = (hdr>>20) & 0xfff;
595 unsigned eventId = (hdr>>12) & 0xf;
598 if(valid) { blockLength =
blockLengthMap().find(blockId)->second; }
600 return GctBlockHeader(blockId, blockLength, nSamples, bxId, eventId, valid);
607 if ( hdr.
nSamples() < 1 ) {
return true; }
623 const uint32_t nSamples,
625 const uint32_t eventId)
const
637 return ((bxId & 0xfff) << 20) | ((nSamples & 0xf) << 16) | ((eventId & 0xf) << 12) | (blockId & 0xfff);
650 const unsigned int id = hdr.
blockId();
651 const unsigned int nSamples = hdr.
nSamples();
655 const uint16_t * p16 =
reinterpret_cast<const uint16_t *
>(d);
659 const unsigned int emCandCategoryOffset = nSamples * 4;
660 const unsigned int timeSampleOffset = nSamples * 2;
663 unsigned int centralSample = (unsigned)std::ceil((
double)nSamples/2.)-1;
664 unsigned int firstSample = centralSample-(unsigned)std::ceil((
double)samplesToUnpack/2.)+1;
665 unsigned int lastSample = centralSample+(unsigned)(samplesToUnpack/2);
667 LogDebug(
"GCT") <<
"Unpacking output EM. Central sample=" << centralSample <<
" first=" << firstSample <<
" last=" <<
lastSample;
669 for (
unsigned int iso=0; iso<2; ++iso)
671 bool isoFlag = (iso==1);
678 for (
unsigned int bx=firstSample; bx<=
lastSample; ++bx)
682 const unsigned int cand0Offset = iso*emCandCategoryOffset + bx*2;
684 em->push_back(
L1GctEmCand(p16[cand0Offset], isoFlag,
id, 0, (
int)bx-(
int)centralSample));
685 em->push_back(
L1GctEmCand(p16[cand0Offset + timeSampleOffset], isoFlag,
id, 1, (
int)bx-(
int)centralSample));
686 em->push_back(
L1GctEmCand(p16[cand0Offset + 1], isoFlag,
id, 2, (
int)bx-(
int)centralSample));
687 em->push_back(
L1GctEmCand(p16[cand0Offset + timeSampleOffset + 1], isoFlag,
id, 3, (
int)bx-(
int)centralSample));
689 LogDebug(
"GCT") <<
"Unpacked a bunch of EG. iso=" << iso <<
" bx=" << bx << std::endl;
693 p16 += emCandCategoryOffset * 2;
697 for (
unsigned int bx=firstSample; bx<=
lastSample; ++bx)
699 const unsigned int offset = bx*2;
707 const uint32_t * p32 =
reinterpret_cast<const uint32_t *
>(p16);
709 for (
unsigned int bx=firstSample; bx<=
lastSample; ++bx) {
711 LogDebug(
"GCT") <<
"Unpacked energy sums bx=" << bx << std::endl;
719 const unsigned int id = hdr.
blockId();
720 const unsigned int nSamples = hdr.
nSamples();
724 const uint16_t * p16 =
reinterpret_cast<const uint16_t *
>(d);
728 const unsigned int jetCandCategoryOffset = nSamples * 4;
729 const unsigned int timeSampleOffset = nSamples * 2;
732 unsigned int centralSample = (unsigned)std::ceil((
double)nSamples/2.)-1;
733 unsigned int firstSample = centralSample-(unsigned)std::ceil((
double)samplesToUnpack/2.)+1;
734 unsigned int lastSample = centralSample+(unsigned)(samplesToUnpack/2);
736 LogDebug(
"GCT") <<
"Unpacking output Jets. Samples to unpack=" << samplesToUnpack <<
" central=" << centralSample <<
" first=" << firstSample <<
" last=" <<
lastSample;
742 assert(jets->empty());
748 for(
unsigned int bx = firstSample ; bx <=
lastSample; ++bx)
751 const unsigned int cand0Offset = iCat*jetCandCategoryOffset + bx*2;
754 jets->push_back(
L1GctJetCand(p16[cand0Offset], tauflag, forwardFlag,
id, 0, (
int)bx-(
int)centralSample));
756 jets->push_back(
L1GctJetCand(p16[cand0Offset + timeSampleOffset], tauflag, forwardFlag,
id, 1, (
int)bx-(
int)centralSample));
758 jets->push_back(
L1GctJetCand(p16[cand0Offset + 1], tauflag, forwardFlag,
id, 2, (
int)bx-(
int)centralSample));
760 jets->push_back(
L1GctJetCand(p16[cand0Offset + timeSampleOffset + 1], tauflag, forwardFlag,
id, 3, (
int)bx-(
int)centralSample));
764 p16 += NUM_JET_CATEGORIES * jetCandCategoryOffset;
769 const uint32_t * p32 =
reinterpret_cast<const uint32_t *
>(p16);
771 for (
unsigned int bx=firstSample; bx<=
lastSample; ++bx)
786 if(
hltMode()) {
LogDebug(
"GCT") <<
"HLT mode - skipping unpack of internal EM Cands";
return; }
788 unsigned int id = hdr.
blockId();
789 unsigned int nSamples = hdr.
nSamples();
799 uint16_t *
p =
reinterpret_cast<uint16_t *
>(
const_cast<unsigned char *
>(d));
802 for(
unsigned int bx=0; bx < nSamples; ++bx)
805 for(
unsigned int candPair = 0 ; candPair < numCandPairs ; ++candPair)
808 bool iso = ((candPair>=lowerIsoPairBound) && (candPair<=upperIsoPairBound));
811 for(
unsigned int i = 0 ;
i < 2 ; ++
i)
813 unsigned offset = 2*(bx + candPair*nSamples) +
i;
814 uint16_t candRaw = p[
offset];
827 if(
hltMode()) {
LogDebug(
"GCT") <<
"HLT mode - skipping unpack of RCT EM Cands";
return; }
829 unsigned int id = hdr.
blockId();
830 unsigned int nSamples = hdr.
nSamples();
834 uint16_t *
p =
reinterpret_cast<uint16_t *
>(
const_cast<unsigned char *
>(d));
838 uint16_t eIsoRank[4];
839 uint16_t eIsoCard[4];
841 uint16_t eNonIsoRank[4];
842 uint16_t eNonIsoCard[4];
843 uint16_t eNonIsoRgn[4];
844 uint16_t MIPbits[7][2];
845 uint16_t QBits[7][2];
853 for (
unsigned short iSfp=0 ; iSfp<4 ; ++iSfp) {
854 for (
unsigned short cyc=0 ; cyc<2 ; ++cyc) {
855 if (iSfp==0) { sfp[cyc][iSfp] = 0; }
861 p = p + 2*(nSamples-1);
865 srcCardRouting().
SFPtoEMU(eIsoRank, eIsoCard, eIsoRgn, eNonIsoRank, eNonIsoCard, eNonIsoRgn, MIPbits, QBits, sfp);
868 for (
unsigned short int i=0;
i<4; ++
i) {
871 for (
unsigned short int i=0;
i<4; ++
i) {
872 colls()->
rctEm()->push_back(
L1CaloEmCand( eNonIsoRank[
i], eNonIsoRgn[i], eNonIsoCard[i], crate,
false, i, bx) );
881 if(
hltMode()) {
LogDebug(
"GCT") <<
"HLT mode - skipping unpack of RCT Regions";
return; }
883 unsigned int id = hdr.
blockId();
884 unsigned int nSamples = hdr.
nSamples();
894 uint16_t *
p =
reinterpret_cast<uint16_t *
>(
const_cast<unsigned char *
>(d));
900 for (
unsigned int i=0;
i<length; ++
i)
902 for (uint16_t bx=0; bx<nSamples; ++bx)
907 iphi = 2*((11-crate)%9);
911 iphi = 2*((20-crate)%9);
920 if (iphi>0) { iphi-=1; }
931 if (iphi>0) { iphi-=1; }
949 if(
hltMode()) {
LogDebug(
"GCT") <<
"HLT mode - skipping unpack of GCT Fibres";
return; }
951 unsigned int id = hdr.
blockId();
952 unsigned int nSamples = hdr.
nSamples();
956 uint32_t *
p =
reinterpret_cast<uint32_t *
>(
const_cast<unsigned char *
>(d));
958 for (
unsigned int i=0;
i<length; ++
i) {
959 for (
unsigned int bx=0; bx<nSamples; ++bx) {
976 if(
hltMode()) {
LogDebug(
"GCT") <<
"HLT mode - skipping unpack of internal Et Sums";
return; }
978 unsigned int id = hdr.
blockId();
979 unsigned int nSamples = hdr.
nSamples();
983 uint32_t *
p =
reinterpret_cast<uint32_t *
>(
const_cast<unsigned char *
>(d));
985 for (
unsigned int i=0;
i<length; ++
i) {
987 for (
unsigned int bx=0; bx<nSamples; ++bx) {
997 if(
hltMode()) {
LogDebug(
"GCT") <<
"HLT mode - skipping unpack of internal Jet Cands";
return; }
999 unsigned int id = hdr.
blockId();
1000 unsigned int nSamples = hdr.
nSamples();
1004 uint32_t *
p =
reinterpret_cast<uint32_t *
>(
const_cast<unsigned char *
>(d));
1006 for (
unsigned int i=0;
i<length; ++
i) {
1008 for (
unsigned int bx=0; bx<nSamples; ++bx) {
1023 if(
hltMode()) {
LogDebug(
"GCT") <<
"HLT mode - skipping unpack of internal Jet Cands";
return; }
1025 unsigned int id = hdr.
blockId();
1026 unsigned int nSamples = hdr.
nSamples();
1030 uint16_t *
p =
reinterpret_cast<uint16_t *
>(
const_cast<unsigned char *
>(d));
1032 for (
unsigned int i=0;
i<length; ++
i) {
1034 for (
unsigned int bx=0; bx<nSamples; ++bx) {
1046 if(
hltMode()) {
LogDebug(
"GCT") <<
"HLT mode - skipping unpack of internal Jet Cands";
return; }
1048 unsigned int id = hdr.
blockId();
1049 unsigned int nSamples = hdr.
nSamples();
1053 uint16_t *
p =
reinterpret_cast<uint16_t *
>(
const_cast<unsigned char *
>(d));
1055 for (
unsigned int i=0;
i<length; ++
i) {
1057 for (
unsigned int bx=0; bx<nSamples; ++bx) {
1069 if(
hltMode()) {
LogDebug(
"GCT") <<
"HLT mode - skipping unpack of internal Jet Cands";
return; }
1071 unsigned int id = hdr.
blockId();
1072 unsigned int nSamples = hdr.
nSamples();
1076 uint16_t *
p =
reinterpret_cast<uint16_t *
>(
const_cast<unsigned char *
>(d));
1078 for (
unsigned int i=0;
i<length; ++
i) {
1080 for (
unsigned int bx=0; bx<nSamples; ++bx) {
1092 if(
hltMode()) {
LogDebug(
"GCT") <<
"HLT mode - skipping unpack of internal HF ring data";
return; }
1094 unsigned int id = hdr.
blockId();
1095 unsigned int nSamples = hdr.
nSamples();
1099 uint32_t *
p =
reinterpret_cast<uint32_t *
>(
const_cast<unsigned char *
>(d));
1101 for (
unsigned int i=0;
i<length/2; ++
i) {
1103 for (
unsigned int bx=0; bx<nSamples; ++bx) {
1107 for (
unsigned int bx=0; bx<nSamples; ++bx) {
1117 if(
hltMode()) {
LogDebug(
"GCT") <<
"HLT mode - skipping unpack of wheel input internal Et sums and HF ring data";
return; }
1119 unsigned int id = hdr.
blockId();
1120 unsigned int nSamples = hdr.
nSamples();
1124 uint32_t *
p =
reinterpret_cast<uint32_t *
>(
const_cast<unsigned char *
>(d));
1126 for (
unsigned int i=0;
i<length; ++
i) {
1128 for (
unsigned int bx=0; bx<nSamples; ++bx) {
1131 }
else if (
i>2 &&
i<9) {
1133 }
else if (
i>8 &&
i<15) {
1146 if(
hltMode()) {
LogDebug(
"GCT") <<
"HLT mode - skipping unpack of wheel output internal Et sums and HF ring data";
return; }
1148 unsigned int id = hdr.
blockId();
1149 unsigned int nSamples = hdr.
nSamples();
1153 uint32_t *
p =
reinterpret_cast<uint32_t *
>(
const_cast<unsigned char *
>(d));
1155 for (
unsigned int i=0;
i<length; ++
i) {
1157 for (
unsigned int bx=0; bx<nSamples; ++bx) {
1160 }
else if (
i>0 &&
i<3) {
1162 }
else if (
i>2 &&
i<5) {
1175 if(
hltMode()) {
LogDebug(
"GCT") <<
"HLT mode - skipping unpack of pre-wheel internal Missing Ht data";
return; }
1177 unsigned int id = hdr.
blockId();
1178 unsigned int nSamples = hdr.
nSamples();
1182 uint32_t *
p =
reinterpret_cast<uint32_t *
>(
const_cast<unsigned char *
>(d));
1184 for (
unsigned int iLength=0; iLength < length; ++iLength)
1187 for (
unsigned int bx=0; bx<nSamples; ++bx)
1198 if(
hltMode()) {
LogDebug(
"GCT") <<
"HLT mode - skipping unpack of post-wheel internal Missing Ht data";
return; }
1200 unsigned int id = hdr.
blockId();
1201 unsigned int nSamples = hdr.
nSamples();
1205 uint32_t *
p =
reinterpret_cast<uint32_t *
>(
const_cast<unsigned char *
>(d));
1207 for (
unsigned int iLength=0; iLength < length; ++iLength)
1210 for (
unsigned int bx=0; bx<nSamples; ++bx)
static L1GctInternEtSum fromMissEtxOrEty(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
L1GctHFBitCountsCollection *const gctHfBitCounts() const
GCT output: Hadronic-Forward bit-counts collection.
static L1GctInternJetData fromJetPreCluster(L1CaloRegionDetId rgn, uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
construct from "jet_precluster"
L1GctEmCandCollection *const gctNonIsoEm() const
GCT output: Non-isolated EM candidate collection.
Global Calorimeter Trigger SC -> CC fibre data word.
L1CaloEmCollection *const rctEm() const
Input electrons from the RCT to the GCT.
L1GctHtMissCollection *const gctHtMiss() const
GCT output: Missing Ht collection.
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
Level-1 Trigger jet candidate.
Level-1 Region Calorimeter Trigger EM candidate.
Persistable copy of missing Et measured at Level-1.
static L1GctInternJetData fromJetClusterMinimal(L1CaloRegionDetId rgn, uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
construct from "jet_cluster_minimal"
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
static L1GctInternHFData fromConcBitCounts(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Level-1 Trigger EM candidate at output of GCT.
static L1GctInternEtSum fromTotalEtOrHt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
L1GctInternHFDataCollection *const gctInternHFData() const
Internal Hadronic-Forward bit-counts/ring-sums data collection.
U second(std::pair< T, U > const &p)
std::vector< L1GctJetCand > L1GctJetCandCollection
static L1GctInternHtMiss unpackerMissHtxHty(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Named ctor for making missing Ht x & y components object from unpacker raw data (wheel input)...
L1GctInternEtSumCollection *const gctInternEtSums() const
Internal Et Sum collection.
L1GctEtTotalCollection *const gctEtTot() const
GCT output: Total Et collection.
static L1GctInternHtMiss unpackerMissHty(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Named ctor for making missing Ht y-component object from unpacker raw data.
static L1GctInternHFData fromConcRingSums(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
L1GctInternHtMissCollection *const gctInternHtMiss() const
Internal missing Ht collection.
Persistable copy of total Et measured at Level-1.
L1GctEtMissCollection *const gctEtMiss() const
GCT output: Missing Et collection.
static L1GctInternEtSum fromJetMissEt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
unsigned int offset(bool)
static L1GctInternHFData fromWheelRingSums(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Persistable copy of total Ht measured at Level-1.
static L1GctHFRingEtSums fromConcRingSums(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
static L1GctInternJetData fromJetCluster(L1CaloRegionDetId rgn, uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
construct from "jet_cluster"
L1GctHFRingEtSumsCollection *const gctHfRingEtSums() const
GCT output: Hadronic-Forward ring-sums collection.
Persistable copy of missing Et measured at Level-1.
static L1GctInternJetData fromGctTrigObject(L1CaloRegionDetId rgn, uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
construct from "gct_trig_object"
L1GctFibreCollection *const gctFibres() const
Raw fibre input to the GCT.
L1GctEmCandCollection *const gctIsoEm() const
GCT output: Isolated EM candidate collection.
char data[epos_bytes_allocation]
L1GctInternJetDataCollection *const gctInternJets() const
Internal Jet candidate collection.
static L1GctInternHtMiss unpackerMissHtx(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Named ctor for making missing Ht x-component object from unpacker raw data.
L1GctEtHadCollection *const gctEtHad() const
GCT output: Hadronic transverse-energy (Ht) collection.
static L1GctHFBitCounts fromConcHFBitCounts(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
static L1GctInternHFData fromWheelBitCounts(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
L1GctInternEmCandCollection *const gctInternEm() const
Internal EM candidate collection.
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
static L1GctInternEtSum fromJetTotEt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
L1CaloRegionCollection *const rctCalo() const
Input calo regions from the RCT to the GCT.
std::vector< L1GctEmCand > L1GctEmCandCollection
static L1GctInternEtSum fromJetTotHt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)