40 feds_(
pset.getUntrackedParameter<
std::vector<
int> >(
"feds",
std::vector<
int>())),
41 wheels_(
pset.getUntrackedParameter<
std::vector<
int> >(
"wheels",
std::vector<
int>())),
42 amcsecmap_(
pset.getUntrackedParameter<
std::vector<long long
int> >(
"amcsecmap",
std::vector<long long
int>()))
45 produces<L1MuDTChambPhContainer>(
"PhIn").setBranchAlias(
"PhIn");
46 produces<L1MuDTChambThContainer>(
"ThIn").setBranchAlias(
"ThIn");
47 produces<L1MuDTChambPhContainer>(
"PhOut").setBranchAlias(
"PhOut");
54 throw cms::Exception(
"TwinMux_unpacker") <<
"Configuration file error. Size of \'wheels\' and \'feds\' differs.\n";
58 <<
"Configuration file error. Size of \'wheels\' and \'amcsecmap\' differs.\n";
60 for (
size_t wh_i = 0; wh_i <
amcsecmap_.size(); ++wh_i) {
61 std::array<short, 12> whmap;
62 for (
size_t amc_i = 1; amc_i < 13; ++amc_i) {
63 short shift = (12 - amc_i) * 4;
84 TM7phi_product->setContainer(phi_data);
85 TM7the_product->setContainer(the_data);
86 TM7phi_out_product->setContainer(phi_out_data);
100 for (
size_t w_i = 0; w_i <
nfeds_; ++w_i) {
108 int bxNorm_ = bx_ - bxCnt_;
109 if (
abs(bxNorm_) < 3000)
113 return bxNorm_ - 3564;
115 return bxNorm_ + 3564;
122 return radAng_ - 4096;
129 return benAng_ - 1024;
136 std::array<short, 12>
const& twinMuxAmcSec,
141 const unsigned int fw_rev_with_zerosupression =
143 int previous_selector = -100;
145 std::vector<long> DTTM7WordContainer;
150 std::ostringstream
fname;
151 fname <<
"eventDump_" << twinMuxFed <<
".txt";
157 if (TM7data.
size() == 0)
161 unsigned char* lineFED = TM7data.
data();
167 lineFED =
readline(lineFED, nline, dataWord);
170 int TM7fedId = (dataWord >> 8) & 0xFFF;
175 int BOEevTy = (dataWord >> 60) & 0xF;
179 logfile <<
'[' << ++linecounter <<
"]\t" << std::hex << dataWord <<
std::dec <<
"\t|\t"
180 <<
"BOEevTy " << BOEevTy <<
'\t' <<
"TM7fedId " << TM7fedId <<
'\n';
182 if ((BOEevTy != 0x5) || (TM7fedId != twinMuxFed)) {
183 edm::LogWarning(
"TwinMux_unpacker") <<
"Not a TM7 of FED " << twinMuxFed <<
" header " << std::hex << dataWord;
188 lineFED =
readline(lineFED, nline, dataWord);
191 std::map<int, int> AMCsizes;
195 int nAMC = (dataWord >> 52) & 0xF;
198 logfile <<
'[' << ++linecounter <<
"]\t" << std::hex << dataWord <<
std::dec <<
"\t|\t"
199 <<
"nAMC " << nAMC <<
'\n';
202 for (
int j = 0;
j < nAMC; ++
j) {
203 lineFED =
readline(lineFED, nline, dataWord);
206 int AMCno = (dataWord >> 16) & 0xF;
211 if ((AMCno < 1) || (AMCno > 12)) {
216 AMCsizes[AMCno] = (dataWord >> 32) & 0xFFFFFF;
219 logfile <<
'[' << ++linecounter <<
"]\t" << std::hex << dataWord <<
std::dec <<
"\t|\t"
220 <<
"AMCsizes[" << AMCno <<
"] " << AMCsizes[AMCno] <<
std::dec <<
'\n';
224 std::map<int, int>::iterator AMCiterator = AMCsizes.begin();
225 std::map<int, int>::iterator AMCitend = AMCsizes.end();
226 for (; AMCiterator != AMCitend; ++AMCiterator) {
227 for (
int k = 0;
k < AMCiterator->second; ++
k) {
228 lineFED =
readline(lineFED, nline, dataWord);
231 DTTM7WordContainer.push_back(dataWord);
236 lineFED =
readline(lineFED, nline, dataWord);
241 lineFED =
readline(lineFED, nline, dataWord);
245 int chkEOE = (dataWord >> 60) & 0xF;
246 int CRC = (dataWord >> 16) & 0xFFFF;
247 int evtLgth = (dataWord >> 32) & 0xFFFFFF;
251 <<
" does not start with 0xA";
256 logfile <<
"\tevtLgth " << std::hex << evtLgth <<
"\tCRC " <<
CRC <<
std::dec <<
'\n';
258 if (nline != evtLgth) {
260 <<
std::dec << evtLgth <<
" differ ";
265 edm::LogWarning(
"TwinMux_unpacker") <<
"Calculated CRC " << std::hex << newCRC <<
" differs from CRC in trailer "
271 std::vector<long>::iterator DTTM7iterator = DTTM7WordContainer.begin();
272 std::vector<long>::iterator DTTM7itend = DTTM7WordContainer.end();
275 for (; DTTM7iterator != DTTM7itend; ++DTTM7iterator) {
276 dataWord = (*DTTM7iterator);
277 int dataLenght = (dataWord & 0xFFFFF);
278 int bxCounter = (dataWord >> 20) & 0xFFF;
279 int event = (dataWord >> 32) & 0xFFFFFF;
280 int AMC_ID = (dataWord >> 56) & 0xF;
281 int control = (dataWord >> 60) & 0xF;
282 int wheel = twinMuxWheel;
284 if ((AMC_ID < 1)
or (AMC_ID > 12)) {
286 <<
" TM7fedId " << TM7fedId <<
" AMC_ID " << AMC_ID;
290 int sector = twinMuxAmcSec[AMC_ID - 1];
292 if ((sector < 1)
or (sector > 12)) {
295 <<
"%%%%%% VALID AMC_ID POINTS TO SECTOR OUT OF RANGE \n"
296 <<
" TM7fedId " << TM7fedId <<
" AMC_ID " << AMC_ID <<
" wheel " <<
wheel <<
" sector " << sector;
301 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWord <<
std::dec <<
"\t|\t"
302 <<
"AMC_ID " << AMC_ID <<
'\t' <<
"control " << control <<
'\t' <<
"event " <<
event <<
'\t'
303 <<
"bxCounter " << bxCounter <<
'\t' <<
"dataLenght " << dataLenght <<
'\n';
306 if (DTTM7iterator == DTTM7itend) {
307 LogDebug(
"TwinMux_unpacker") <<
"TRAILING WORD AS A PAYLOAD END in FED " << std::hex << TM7fedId << std::hex
308 << dataWord <<
std::dec <<
" [it pos " <<
int(DTTM7iterator - DTTM7itend) <<
" ]";
312 dataWord = (*DTTM7iterator);
313 unsigned int firmware_rev = (dataWord >> 7) & 0x1FF;
314 int boardID = (dataWord & 0xFFFF);
315 int orbit = (dataWord >> 16) & 0xFFFF;
317 if (DTTM7iterator == DTTM7itend) {
319 <<
"%%%%%% AMC_ID " << AMC_ID <<
" control " << control <<
" event " <<
event <<
" bxCounter " << bxCounter
320 <<
" size " << dataLenght <<
" orbit " << orbit <<
" board " << boardID <<
" AMCsizes " << AMCsizes[AMC_ID]
321 <<
" it pos " <<
int(DTTM7iterator - DTTM7itend);
326 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWord <<
std::dec <<
"\t|\t"
327 <<
" orbit " << orbit <<
" board " << boardID <<
'\n';
329 int AMCsize = AMCsizes[AMC_ID] - 1;
335 for (
int tm7eventsize = 2; tm7eventsize < AMCsize; ++tm7eventsize) {
337 if (DTTM7iterator == DTTM7itend) {
338 edm::LogWarning(
"TwinMux_unpacker") <<
"UNEXPECTED END OF PAYLOAD INSIDE CHAMBER DESCRIPTION"
339 <<
" [it pos " <<
int(DTTM7iterator - DTTM7itend) <<
" ]";
343 long dataWordSub = (*DTTM7iterator);
344 int selector = (dataWordSub >> 60) & 0xF;
346 if (firmware_rev >= fw_rev_with_zerosupression) {
347 if (selector == 0xC) {
349 bc0 = (dataWordSub >> 59) & 0
x1;
353 int bxOffset = (dataWordSub >> 48) & 0x3F;
361 int posBTI[7], qualBTI[7];
363 int mb3_eta = (dataWordSub & 0xFF);
364 int mb3_eta_HQ = (dataWordSub >> 8) & 0xFF;
365 int mb2_eta = (dataWordSub >> 16) & 0xFF;
366 int mb2_eta_HQ = (dataWordSub >> 24) & 0xFF;
367 int mb1_eta = (dataWordSub >> 32) & 0xFF;
368 int mb1_eta_HQ = (dataWordSub >> 40) & 0xFF;
371 for (
int i = 0;
i <= 5;
i++) {
372 posBTI[
i] = (mb1_eta >>
i) & 0x01;
373 qualBTI[
i] = (mb1_eta_HQ >>
i) & 0x01;
375 posBTI[6] = (((mb1_eta >> 6) & 0x01) || ((mb1_eta >> 7) & 0x01));
376 qualBTI[6] = (((mb1_eta_HQ >> 6) & 0x01) || ((mb1_eta_HQ >> 7) & 0x01));
383 for (
int i = 0;
i <= 5;
i++) {
384 posBTI[
i] = (mb2_eta >>
i) & 0x01;
385 qualBTI[
i] = (mb2_eta_HQ >>
i) & 0x01;
387 posBTI[6] = ((mb2_eta >> 6) & 0x01) || ((mb2_eta >> 7) & 0x01);
388 qualBTI[6] = ((mb2_eta_HQ >> 6) & 0x01) || ((mb2_eta_HQ >> 7) & 0x01);
393 for (
int i = 0;
i <= 5;
i++) {
394 posBTI[
i] = (mb3_eta >>
i) & 0x01;
395 qualBTI[
i] = (mb3_eta_HQ >>
i) & 0x01;
397 posBTI[6] = ((mb3_eta >> 6) & 0x01) || ((mb3_eta >> 7) & 0x01);
398 qualBTI[6] = ((mb3_eta_HQ >> 6) & 0x01) || ((mb3_eta_HQ >> 7) & 0x01);
403 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWordSub <<
std::dec <<
"\t bx info word\t"
404 <<
"bxOffset " <<
bxOffset <<
'\t' <<
"bc0 " << bc0 <<
'\t' <<
"mb1_eta " << mb1_eta <<
'\t'
405 <<
"mb2_eta " << mb2_eta <<
'\t' <<
"mb3_eta " << mb3_eta <<
'\t' <<
"mb1_eta_HQ " << mb1_eta_HQ
406 <<
'\t' <<
"mb2_eta_HQ " << mb2_eta_HQ <<
'\t' <<
"mb3_eta_HQ " << mb3_eta_HQ <<
'\n';
410 else if (selector >= 1 && selector <= 4) {
412 int out_phi = (dataWordSub >> 0) & 0xFFF;
413 int out_phib = (dataWordSub >> 12) & 0x3FF;
414 int out_qual = (dataWordSub >> 22) & 0x7;
415 int out_q3 = (dataWordSub >> 25) & 0
x1;
416 int out_q4 = (dataWordSub >> 26) & 0
x1;
417 int out_updown = (dataWordSub >> 27) & 0
x1;
418 int out_ts2tag = (dataWordSub >> 28) & 0
x1;
422 int in_phi = (dataWordSub >> 30) & 0xFFF;
423 int in_phib = (dataWordSub >> 42) & 0x3FF;
424 int in_qual = (dataWordSub >> 52) & 0x7;
425 int in_updown = (dataWordSub >> 57) & 0
x1;
426 int in_ts2tag = (dataWordSub >> 58) & 0
x1;
436 if (previous_selector != selector) {
445 in_ts2tag + in_updown * 2,
456 out_ts2tag + out_updown * 2,
458 out_q3 + 2 * out_q4));
470 in_ts2tag + in_updown * 2,
482 out_ts2tag + out_updown * 2,
484 out_q3 + 2 * out_q4));
488 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWordSub <<
std::dec <<
"\t|\t"
489 <<
"in_ts2tag " << in_ts2tag <<
'\t' <<
"in_updown " << in_updown <<
'\t' <<
"in_qual " << in_qual
490 <<
'\t' <<
"in_phib " << in_phib_conv <<
'\t' <<
"in_phi " << in_phi_conv <<
'\t' <<
"out_ts2tag "
491 << out_ts2tag <<
'\t' <<
"out_updown " << out_updown <<
'\t' <<
"out_qual " << out_qual <<
'\t'
492 <<
"out_q3_out " << out_q3 <<
'\t' <<
"out_q4_out " << out_q4 <<
'\t' <<
"out_phib "
493 << out_phib_conv <<
'\t' <<
"out_phi " << out_phi_conv <<
'\t' <<
"2nd track "
494 << ((previous_selector == selector) ? 1 : 0) <<
'\n';
497 else if (selector == 0x9 || selector == 0xE) {
499 LogDebug(
"TwinMux_unpacker") <<
"RPC WORD [" <<
std::dec << tm7eventsize <<
"] : " << std::hex << dataWordSub
500 <<
std::dec <<
" it pos " <<
int(DTTM7iterator - DTTM7itend);
503 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWordSub <<
std::dec <<
"\t RPC WORD\n";
507 else if (selector == 0x6) {
509 LogDebug(
"TwinMux_unpacker") <<
"HO WORD [" <<
std::dec << tm7eventsize <<
"] : " << std::hex << dataWordSub
510 <<
std::dec <<
" it pos " <<
int(DTTM7iterator - DTTM7itend);
513 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWordSub <<
std::dec <<
"\t HO WORD\n";
517 else if (selector == 0xF) {
519 LogDebug(
"TwinMux_unpacker") <<
"ERROR WORD [" <<
std::dec << tm7eventsize <<
"] : " << std::hex
520 << dataWordSub <<
std::dec <<
" it pos " <<
int(DTTM7iterator - DTTM7itend);
523 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWordSub <<
std::dec <<
"\t ERROR WORD\n";
528 LogDebug(
"TwinMux_unpacker") <<
"UNKNOWN WORD received " << std::hex << dataWordSub <<
" in FED " << std::hex
532 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWordSub <<
std::dec <<
"\t UNKNOWN WORD\n";
534 previous_selector = selector;
537 if (selector == 0x4) {
539 bxID = (dataWordSub >> 48) & 0xFFF;
540 bc0 = (dataWordSub >> 22) & 0
x1;
541 bxNr =
normBx(bxID, bxCounter);
544 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWordSub <<
std::dec <<
"\t TSC WORD\t"
545 <<
"bxID " << bxID <<
'\t' <<
"bc0 " << bc0 <<
'\n';
549 else if (selector == 0
x1) {
551 int mb2_phi = (dataWordSub & 0xFFF);
552 int mb2_phib = (dataWordSub >> 12) & 0x3FF;
553 int mb2_qual = (dataWordSub >> 22) & 0x7;
554 int mb2_ts2tag = (dataWordSub >> 28) & 0
x1;
559 int mb1_phi = (dataWordSub >> 30) & 0xFFF;
560 int mb1_phib = (dataWordSub >> 42) & 0x3FF;
561 int mb1_qual = (dataWordSub >> 52) & 0x7;
562 int mb1_ts2tag = (dataWordSub >> 58) & 0
x1;
574 bxNr,
wheel, sector - 1, 1, mb1_phi_conv, mb1_phib_conv, mb1_qual, mb1_ts2tag, bxCounter, -1));
576 bxNr,
wheel, sector - 1, 2, mb2_phi_conv, mb2_phib_conv, mb2_qual, mb2_ts2tag, bxCounter, -1));
579 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWordSub <<
std::dec <<
"\t|\t"
580 <<
"mb1_ts2tag " << mb1_ts2tag <<
'\t' <<
"mb1_qual " << mb1_qual <<
'\t' <<
"mb1_phib "
581 << mb1_phib_conv <<
'\t' <<
"mb1_phi " << mb1_phi_conv <<
'\t' <<
"mb2_ts2tag " << mb2_ts2tag
582 <<
'\t' <<
"mb2_qual " << mb2_qual <<
'\t' <<
"mb2_phib " << mb2_phib_conv <<
'\t' <<
"mb2_phi "
583 << mb2_phi_conv <<
'\n';
586 else if (selector == 0
x2) {
587 int mb4_phi = (dataWordSub & 0xFFF);
588 int mb4_phib = (dataWordSub >> 12) & 0x3FF;
589 int mb4_qual = (dataWordSub >> 22) & 0x7;
590 int mb4_ts2tag = (dataWordSub >> 28) & 0
x1;
595 int mb3_phi = (dataWordSub >> 30) & 0xFFF;
596 int mb3_phib = (dataWordSub >> 42) & 0x3FF;
597 int mb3_qual = (dataWordSub >> 52) & 0x7;
598 int mb3_ts2tag = (dataWordSub >> 58) & 0
x1;
610 bxNr,
wheel, sector - 1, 3, mb3_phi_conv, mb3_phib_conv, mb3_qual, mb3_ts2tag, bxCounter, -1));
612 bxNr,
wheel, sector - 1, 4, mb4_phi_conv, mb4_phib_conv, mb4_qual, mb4_ts2tag, bxCounter, -1));
615 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWordSub <<
std::dec <<
"\t|\t"
616 <<
"mb3_ts2tag " << mb3_ts2tag <<
'\t' <<
"mb3_qual " << mb3_qual <<
'\t' <<
"mb3_phib "
617 << mb3_phib_conv <<
'\t' <<
"mb3_phi " << mb3_phi_conv <<
'\t' <<
"mb4_ts2tag " << mb4_ts2tag
618 <<
'\t' <<
"mb4_qual " << mb4_qual <<
'\t' <<
"mb4_phib " << mb4_phib_conv <<
'\t' <<
"mb4_phi "
619 << mb4_phi_conv <<
'\n';
623 else if (selector == 0x3) {
625 int posBTI[7], qualBTI[7];
627 int mb3_eta = (dataWordSub & 0xFF);
628 int mb2_eta = (dataWordSub >> 16) & 0xFF;
629 int mb1_eta = (dataWordSub >> 40) & 0xFF;
631 int mb3_eta_HQ = (dataWordSub >> 8) & 0xFF;
632 int mb2_eta_HQ = (dataWordSub >> 32) & 0xFF;
633 int mb1_eta_HQ = (dataWordSub >> 48) & 0xFF;
636 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWordSub <<
std::dec <<
"\t|\t"
637 <<
"mb1_eta " << mb1_eta <<
'\t' <<
"mb2_eta " << mb2_eta <<
'\t' <<
"mb3_eta " << mb3_eta <<
'\t'
638 <<
"mb1_eta_HQ " << mb1_eta_HQ <<
'\t' <<
"mb2_eta_HQ " << mb2_eta_HQ <<
'\t' <<
"mb3_eta_HQ "
639 << mb3_eta_HQ <<
'\n';
642 posBTI[0] = (mb1_eta & 0x01);
643 posBTI[1] = ((mb1_eta & 0x02) >> 1);
644 posBTI[2] = ((mb1_eta & 0x04) >> 2);
645 posBTI[3] = ((mb1_eta & 0x08) >> 3);
646 posBTI[4] = ((mb1_eta & 0x10) >> 4);
647 posBTI[5] = ((mb1_eta & 0x20) >> 5);
648 posBTI[6] = (((mb1_eta & 0x40) >> 6) || ((mb1_eta & 0x80) >> 7));
650 qualBTI[0] = (mb1_eta_HQ & 0x01);
651 qualBTI[1] = ((mb1_eta_HQ & 0x02) >> 1);
652 qualBTI[2] = ((mb1_eta_HQ & 0x04) >> 2);
653 qualBTI[3] = ((mb1_eta_HQ & 0x08) >> 3);
654 qualBTI[4] = ((mb1_eta_HQ & 0x10) >> 4);
655 qualBTI[5] = ((mb1_eta_HQ & 0x20) >> 5);
656 qualBTI[6] = (((mb1_eta_HQ & 0x40) >> 6) || ((mb1_eta_HQ & 0x80) >> 7));
661 posBTI[0] = (mb2_eta & 0x01);
662 posBTI[1] = ((mb2_eta & 0x02) >> 1);
663 posBTI[2] = ((mb2_eta & 0x04) >> 2);
664 posBTI[3] = ((mb2_eta & 0x08) >> 3);
665 posBTI[4] = ((mb2_eta & 0x10) >> 4);
666 posBTI[5] = ((mb2_eta & 0x20) >> 5);
667 posBTI[6] = (((mb2_eta & 0x40) >> 6) || ((mb2_eta & 0x80) >> 7));
669 qualBTI[0] = (mb2_eta_HQ & 0x01);
670 qualBTI[1] = ((mb2_eta_HQ & 0x02) >> 1);
671 qualBTI[2] = ((mb2_eta_HQ & 0x04) >> 2);
672 qualBTI[3] = ((mb2_eta_HQ & 0x08) >> 3);
673 qualBTI[4] = ((mb2_eta_HQ & 0x10) >> 4);
674 qualBTI[5] = ((mb2_eta_HQ & 0x20) >> 5);
675 qualBTI[6] = (((mb2_eta_HQ & 0x40) >> 6) || ((mb2_eta_HQ & 0x80) >> 7));
680 posBTI[0] = (mb3_eta & 0x01);
681 posBTI[1] = ((mb3_eta & 0x02) >> 1);
682 posBTI[2] = ((mb3_eta & 0x04) >> 2);
683 posBTI[3] = ((mb3_eta & 0x08) >> 3);
684 posBTI[4] = ((mb3_eta & 0x10) >> 4);
685 posBTI[5] = ((mb3_eta & 0x20) >> 5);
686 posBTI[6] = (((mb3_eta & 0x40) >> 6) || ((mb3_eta & 0x80) >> 7));
688 qualBTI[0] = (mb3_eta_HQ & 0x01);
689 qualBTI[1] = ((mb3_eta_HQ & 0x02) >> 1);
690 qualBTI[2] = ((mb3_eta_HQ & 0x04) >> 2);
691 qualBTI[3] = ((mb3_eta_HQ & 0x08) >> 3);
692 qualBTI[4] = ((mb3_eta_HQ & 0x10) >> 4);
693 qualBTI[5] = ((mb3_eta_HQ & 0x20) >> 5);
694 qualBTI[6] = (((mb3_eta_HQ & 0x40) >> 6) || ((mb3_eta_HQ & 0x80) >> 7));
700 else if (selector == 0xB) {
702 int mb2_phi = (dataWordSub & 0xFFF);
703 int mb2_phib = (dataWordSub >> 12) & 0x3FF;
704 int mb2_qual = (dataWordSub >> 22) & 0x7;
705 int mb2_q3 = (dataWordSub >> 25) & 0
x1;
706 int mb2_q4 = (dataWordSub >> 26) & 0
x1;
707 int mb2_ts2tag = (dataWordSub >> 28) & 0
x1;
712 int mb1_phi = (dataWordSub >> 30) & 0xFFF;
713 int mb1_phib = (dataWordSub >> 42) & 0x3FF;
714 int mb1_qual = (dataWordSub >> 52) & 0x7;
715 int mb1_q3 = (dataWordSub >> 55) & 0
x1;
716 int mb1_q4 = (dataWordSub >> 56) & 0
x1;
717 int mb1_ts2tag = (dataWordSub >> 58) & 0
x1;
737 mb1_q3 + 2 * mb1_q4));
747 mb2_q3 + 2 * mb2_q4));
750 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWordSub <<
std::dec <<
"\t|\t"
751 <<
"mb1_ts2tag_out " << mb1_ts2tag <<
'\t' <<
"mb1_qual_out " << mb1_qual <<
'\t' <<
"mb1_q3_out "
752 << mb1_q3 <<
'\t' <<
"mb1_q4_out " << mb1_q4 <<
'\t' <<
"mb1_phib_out " << mb1_phib_conv <<
'\t'
753 <<
"mb1_phi_out " << mb1_phi_conv <<
'\t' <<
"mb2_ts2tag_out " << mb2_ts2tag <<
'\t'
754 <<
"mb2_qual_out " << mb2_qual <<
'\t' <<
"mb2_q3_out " << mb2_q3 <<
'\t' <<
"mb2_q4_out " << mb2_q4
755 <<
'\t' <<
"mb2_phib_out " << mb2_phib_conv <<
'\t' <<
"mb2_phi_out " << mb2_phi_conv <<
'\n';
759 else if (selector == 0xC) {
761 int mb4_phi = (dataWordSub & 0xFFF);
762 int mb4_phib = (dataWordSub >> 12) & 0x3FF;
763 int mb4_qual = (dataWordSub >> 22) & 0x7;
764 int mb4_q3 = (dataWordSub >> 25) & 0
x1;
765 int mb4_q4 = (dataWordSub >> 26) & 0
x1;
766 int mb4_ts2tag = (dataWordSub >> 28) & 0
x1;
771 int mb3_phi = (dataWordSub >> 30) & 0xFFF;
772 int mb3_phib = (dataWordSub >> 42) & 0x3FF;
773 int mb3_qual = (dataWordSub >> 52) & 0x7;
774 int mb3_q3 = (dataWordSub >> 55) & 0
x1;
775 int mb3_q4 = (dataWordSub >> 56) & 0
x1;
776 int mb3_ts2tag = (dataWordSub >> 58) & 0
x1;
796 mb3_q3 + 2 * mb3_q4));
806 mb4_q3 + 2 * mb4_q4));
809 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWordSub <<
std::dec <<
"\t|\t"
810 <<
"mb3_ts2tag_out " << mb3_ts2tag <<
'\t' <<
"mb3_qual_out " << mb3_qual <<
'\t' <<
"mb3_q3_out "
811 << mb3_q3 <<
'\t' <<
"mb3_q4_out " << mb3_q4 <<
'\t' <<
"mb3_phib_out " << mb3_phib_conv <<
'\t'
812 <<
"mb3_phi_out " << mb3_phi_conv <<
'\t' <<
"mb4_ts2tag_out " << mb4_ts2tag <<
'\t'
813 <<
"mb4_qual_out " << mb4_qual <<
'\t' <<
"mb4_q3_out " << mb4_q3 <<
'\t' <<
"mb4_q4_out " << mb4_q4
814 <<
'\t' <<
"mb4_phib_out " << mb4_phib_conv <<
'\t' <<
"mb4_phi_out " << mb4_phi_conv <<
'\n';
818 else if (selector == 0xD) {
821 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWordSub <<
std::dec <<
"\t ETHA OUTPUT WORD\n";
825 else if (selector == 0x9 || selector == 0xE) {
827 LogDebug(
"TwinMux_unpacker") <<
"RPC WORD [" <<
std::dec << tm7eventsize <<
"] : " << std::hex << dataWordSub
828 <<
std::dec <<
" it pos " <<
int(DTTM7iterator - DTTM7itend);
831 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWordSub <<
std::dec <<
"\t RPC WORD\n";
835 else if (selector == 0x6) {
837 LogDebug(
"TwinMux_unpacker") <<
"HO WORD [" <<
std::dec << tm7eventsize <<
"] : " << std::hex << dataWordSub
838 <<
std::dec <<
" it pos " <<
int(DTTM7iterator - DTTM7itend);
841 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWordSub <<
std::dec <<
"\t HO WORD\n";
845 else if (selector == 0xF) {
847 LogDebug(
"TwinMux_unpacker") <<
"ERROR WORD [" <<
std::dec << tm7eventsize <<
"] : " << std::hex
848 << dataWordSub <<
std::dec <<
" it pos " <<
int(DTTM7iterator - DTTM7itend);
851 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWordSub <<
std::dec <<
"\t ERROR WORD\n";
856 LogDebug(
"TwinMux_unpacker") <<
"UNKNOWN WORD received " << std::hex << dataWordSub <<
" in FED " << std::hex
860 logfile <<
'[' << ++lcounter <<
"]\t" << std::hex << dataWordSub <<
std::dec <<
"\t UNKNOWN WORD\n";
863 if (DTTM7iterator == DTTM7itend)
871 if (DTTM7iterator == DTTM7itend)