73 : id_(
id), ncols_(
ncols), nrows_(nrows) {
91 std::map<std::string, MonitorElement **> *meMapFEDs,
100 unsigned int numberOfSeriousErrors = 0;
104 if (isearch !=
input.end()) {
107 for (di = isearch->data.
begin(); di != isearch->data.
end(); di++) {
108 int FedId = di->getFedId();
110 int errorType = di->getType();
116 bool notReset =
true;
122 if (errorType == 32 || errorType == 33 || errorType == 34) {
123 long long errorWord = di->getWord64();
128 uint32_t errorWord = di->getWord32();
143 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
147 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
151 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
155 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
159 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
163 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
167 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
180 uint32_t BLOCK_mask = ~(~uint32_t(0) << BLOCK_bits);
181 int BLOCK = (errorWord >> BLOCK_shift) & BLOCK_mask;
182 int localCH = 1 * CH1 + 2 * CH2 + 3 * CH3 + 4 * CH4 + 5 * CH5;
184 chanNmbr = (BLOCK / 2) * 9 + localCH;
186 chanNmbr = ((BLOCK - 1) / 2) * 9 + 4 + localCH;
187 if ((chanNmbr < 1) || (chanNmbr > 36))
216 if (TBMMessage == 5 || TBMMessage == 6)
218 int StateMach_bits = 4;
219 int StateMach_shift = 8;
220 uint32_t StateMach_mask = ~(~uint32_t(0) << StateMach_bits);
221 int StateMach = (errorWord >> StateMach_shift) & StateMach_mask;
271 if (errorType == 32 || errorType == 33 || errorType == 34) {
272 long long errorWord = di->getWord64();
277 uint32_t errorWord = di->getWord32();
291 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
295 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
299 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
303 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
307 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
311 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
315 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
328 uint32_t BLOCK_mask = ~(~uint32_t(0) << BLOCK_bits);
329 int BLOCK = (errorWord >> BLOCK_shift) & BLOCK_mask;
330 int localCH = 1 * CH1 + 2 * CH2 + 3 * CH3 + 4 * CH4 + 5 * CH5;
332 chanNmbr = (BLOCK / 2) * 9 + localCH;
334 chanNmbr = ((BLOCK - 1) / 2) * 9 + 4 + localCH;
335 if ((chanNmbr < 1) || (chanNmbr > 36))
364 int StateMach_bits = 4;
365 int StateMach_shift = 8;
366 uint32_t StateMach_mask = ~(~uint32_t(0) << StateMach_bits);
367 int StateMach = (errorWord >> StateMach_shift) & StateMach_mask;
417 if (errorType == 32 || errorType == 33 || errorType == 34) {
418 long long errorWord = di->getWord64();
423 uint32_t errorWord = di->getWord32();
437 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
441 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
445 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
449 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
453 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
457 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
461 ((*meMapFEDs)[
"meFullType_"][
FedId])->
Fill((
int)fullType);
474 uint32_t BLOCK_mask = ~(~uint32_t(0) << BLOCK_bits);
475 int BLOCK = (errorWord >> BLOCK_shift) & BLOCK_mask;
476 int localCH = 1 * CH1 + 2 * CH2 + 3 * CH3 + 4 * CH4 + 5 * CH5;
478 chanNmbr = (BLOCK / 2) * 9 + localCH;
480 chanNmbr = ((BLOCK - 1) / 2) * 9 + 4 + localCH;
481 if ((chanNmbr < 1) || (chanNmbr > 36))
510 int StateMach_bits = 4;
511 int StateMach_shift = 8;
512 uint32_t StateMach_mask = ~(~uint32_t(0) << StateMach_bits);
513 int StateMach = (errorWord >> StateMach_shift) & StateMach_mask;
564 if (!(errorType == 30) || notReset) {
566 static const char chNfmt[] =
"Pixel/AdditionalPixelErrors/FED_%d/FedChNErr_%d";
567 char chNbuf[
sizeof(chNfmt) + 2 * 32];
568 sprintf(chNbuf, chNfmt,
FedId, chanNmbr);
570 if ((*meMapFEDs)[
"meFedChNErr_"][
FedId])
571 (*meMapFEDs)[
"meFedChNErr_"][
FedId]->Fill(chanNmbr);
573 static const char chLfmt[] =
"Pixel/AdditionalPixelErrors/FED_%d/FedChLErr_%d";
574 char chLbuf[
sizeof(chLfmt) + 2 * 32];
575 sprintf(chLbuf, chLfmt,
FedId, chanNmbr);
577 if ((*meMapFEDs)[
"meFedChLErr_"][
FedId])
578 (*meMapFEDs)[
"meFedChLErr_"][
FedId]->setBinContent(chanNmbr + 1, errorType);
580 numberOfSeriousErrors++;
581 int messageType = 99;
583 messageType = errorType - 25;
584 else if (errorType > 30)
585 messageType = errorType - 19;
586 else if (errorType == 30 && TBMMessage == 0)
587 messageType = errorType - 25;
588 else if (errorType == 30 && TBMMessage == 1)
589 messageType = errorType - 24;
590 else if (errorType == 30 && (TBMMessage == 2 || TBMMessage == 3 || TBMMessage == 4))
591 messageType = errorType - 23;
592 else if (errorType == 30 && TBMMessage == 7)
593 messageType = errorType - 22;
594 else if (errorType == 30 && TBMType == 1)
595 messageType = errorType - 21;
596 else if (errorType == 30 && TBMType == 2)
597 messageType = errorType - 20;
598 else if (errorType == 30 && TBMType == 3)
599 messageType = errorType - 19;
600 if (messageType <= 20) {
601 static const char fmt[] =
"Pixel/AdditionalPixelErrors/FED_%d/FedETypeNErr_%d";
602 char buf[
sizeof(fmt) + 2 * 32];
603 sprintf(
buf, fmt,
FedId, messageType);
605 if ((*meMapFEDs)[
"meFedETypeNErr_"][
FedId])
606 (*meMapFEDs)[
"meFedETypeNErr_"][
FedId]->Fill(messageType);
610 (*meMapFEDs)[
"meNErrors_"][
FedId]->Fill((
int)numberOfSeriousErrors);
611 (*meMapFEDs)[
"meTBMMessage_"][
FedId]->Fill((
int)TBMMessage);
612 (*meMapFEDs)[
"meTBMType_"][
FedId]->Fill((
int)TBMType);
613 (*meMapFEDs)[
"meErrorType_"][
FedId]->Fill((
int)errorType);
614 (*meMapFEDs)[
"meFullType_"][
FedId]->Fill((
int)fullType);
615 (*meMapFEDs)[
"meEvtNbr_"][
FedId]->setBinContent(1, (
int)evtNbr);
616 (*meMapFEDs)[
"meEvtSize_"][
FedId]->setBinContent(1, (
int)evtSize);
619 return numberOfSeriousErrors;
623 std::map<std::string, MonitorElement **> *meMapFEDs) {
624 unsigned int numberOfSeriousErrors = 0;
627 if (isearch !=
input.end()) {
630 for (di = isearch->data.
begin(); di != isearch->data.
end(); di++) {
631 int FedId = di->getFedId();
634 if (
FedId == static_cast<int>(
id_)) {
635 errorType = di->getType();
636 ((*meMapFEDs)[
"meErrorType_"][
id_])->
Fill((
int)errorType);
637 bool notReset =
true;
645 if ((errorType == 32) || (errorType == 33) || (errorType == 34)) {
646 long long errorWord = di->getWord64();
658 ((*meMapFEDs)[
"meEvtSize_"][
id_])->setBinContent(1, (
int)evtSize);
665 uint32_t errorWord = di->getWord32();
683 ((*meMapFEDs)[
"meFullType_"][
id_])->
Fill((
int)fullType);
687 ((*meMapFEDs)[
"meFullType_"][
id_])->
Fill((
int)fullType);
691 ((*meMapFEDs)[
"meFullType_"][
id_])->
Fill((
int)fullType);
695 ((*meMapFEDs)[
"meFullType_"][
id_])->
Fill((
int)fullType);
699 ((*meMapFEDs)[
"meFullType_"][
id_])->
Fill((
int)fullType);
703 ((*meMapFEDs)[
"meFullType_"][
id_])->
Fill((
int)fullType);
707 ((*meMapFEDs)[
"meFullType_"][
id_])->
Fill((
int)fullType);
720 uint32_t BLOCK_mask = ~(~uint32_t(0) << BLOCK_bits);
721 int BLOCK = (errorWord >> BLOCK_shift) & BLOCK_mask;
722 int localCH = 1 * CH1 + 2 * CH2 + 3 * CH3 + 4 * CH4 + 5 * CH5;
724 chanNmbr = (BLOCK / 2) * 9 + localCH;
726 chanNmbr = ((BLOCK - 1) / 2) * 9 + 4 + localCH;
727 if ((chanNmbr < 1) || (chanNmbr > 36))
740 if (!(
FedId == 38 && chanNmbr == 7)) {
743 ((*meMapFEDs)[
"meTBMMessage_"][
id_])->
Fill((
int)TBMMessage);
747 ((*meMapFEDs)[
"meTBMMessage_"][
id_])->
Fill((
int)TBMMessage);
751 ((*meMapFEDs)[
"meTBMMessage_"][
id_])->
Fill((
int)TBMMessage);
755 ((*meMapFEDs)[
"meTBMMessage_"][
id_])->
Fill((
int)TBMMessage);
759 ((*meMapFEDs)[
"meTBMMessage_"][
id_])->
Fill((
int)TBMMessage);
763 ((*meMapFEDs)[
"meTBMMessage_"][
id_])->
Fill((
int)TBMMessage);
767 ((*meMapFEDs)[
"meTBMMessage_"][
id_])->
Fill((
int)TBMMessage);
771 ((*meMapFEDs)[
"meTBMMessage_"][
id_])->
Fill((
int)TBMMessage);
774 if (TBMMessage == 5 || TBMMessage == 6)
776 int StateMach_bits = 4;
777 int StateMach_shift = 8;
778 uint32_t StateMach_mask = ~(~uint32_t(0) << StateMach_bits);
779 int StateMach = (errorWord >> StateMach_shift) & StateMach_mask;
803 if (!(
FedId == 38 && chanNmbr == 7))
804 ((*meMapFEDs)[
"meTBMType_"][
id_])->
Fill((
int)TBMType);
810 if (!(
FedId == 38 && chanNmbr == 7))
811 ((*meMapFEDs)[
"meEvtNbr_"][
id_])->setBinContent(1, (
int)evtNbr);
827 if (!(errorType == 30) || notReset) {
829 static const char chNfmt[] =
"Pixel/AdditionalPixelErrors/FED_%d/FedChNErr_%d";
830 char chNbuf[
sizeof(chNfmt) + 2 * 32];
831 sprintf(chNbuf, chNfmt,
FedId, chanNmbr);
833 if ((*meMapFEDs)[
"meFedChNErr_"][
id_])
834 (*meMapFEDs)[
"meFedChNErr_"][
id_]->Fill(chanNmbr);
836 static const char chLfmt[] =
"Pixel/AdditionalPixelErrors/FED_%d/FedChLErr_%d";
837 char chLbuf[
sizeof(chLfmt) + 2 * 32];
838 sprintf(chLbuf, chLfmt,
FedId, chanNmbr);
840 if ((*meMapFEDs)[
"meFedChLErr_"][
id_])
841 (*meMapFEDs)[
"meFedChLErr_"][
id_]->setBinContent(chanNmbr + 1, errorType);
843 numberOfSeriousErrors++;
844 int messageType = 99;
846 messageType = errorType - 25;
847 else if (errorType > 30)
848 messageType = errorType - 19;
849 else if (errorType == 30 && TBMMessage == 0)
850 messageType = errorType - 25;
851 else if (errorType == 30 && TBMMessage == 1)
852 messageType = errorType - 24;
853 else if (errorType == 30 && (TBMMessage == 2 || TBMMessage == 3 || TBMMessage == 4))
854 messageType = errorType - 23;
855 else if (errorType == 30 && TBMMessage == 7)
856 messageType = errorType - 22;
857 else if (errorType == 30 && TBMType == 1)
858 messageType = errorType - 21;
859 else if (errorType == 30 && TBMType == 2)
860 messageType = errorType - 20;
861 else if (errorType == 30 && TBMType == 3)
862 messageType = errorType - 19;
863 if (messageType <= 20) {
864 static const char fmt[] =
"Pixel/AdditionalPixelErrors/FED_%d/FedETypeNErr_%d";
865 char buf[
sizeof(fmt) + 2 * 32];
866 sprintf(
buf, fmt,
FedId, messageType);
868 if ((*meMapFEDs)[
"meFedETypeNErr_"][
id_])
869 (*meMapFEDs)[
"meFedETypeNErr_"][
id_]->Fill(messageType);
874 if (numberOfSeriousErrors > 0)
875 ((*meMapFEDs)[
"meNErrors_"][
id_])->
Fill((
float)numberOfSeriousErrors);
877 return numberOfSeriousErrors;