10 #include "DQM/SiStripMonitorHardware/interface/HistogramBase.hh" 11 #include "DQM/SiStripMonitorHardware/interface/FEDErrors.hh" 14 FEDErrors::FEDErrors() {
19 FEDErrors::~FEDErrors() {}
21 void FEDErrors::initialiseLumiBlock() {}
23 void FEDErrors::initialiseEvent() {
25 failUnpackerFEDCheck_ =
false;
33 lFedCounter_.nFEDErrors = 0;
34 lFedCounter_.nDAQProblems = 0;
35 lFedCounter_.nFEDsWithFEProblems = 0;
36 lFedCounter_.nCorruptBuffers = 0;
37 lFedCounter_.nBadChannels = 0;
38 lFedCounter_.nBadActiveChannels = 0;
39 lFedCounter_.nFEDsWithFEOverflows = 0;
40 lFedCounter_.nFEDsWithFEBadMajorityAddresses = 0;
41 lFedCounter_.nFEDsWithMissingFEs = 0;
42 lFedCounter_.nTotalBadChannels = 0;
43 lFedCounter_.nTotalBadActiveChannels = 0;
45 lChCounter_.nNotConnected = 0;
46 lChCounter_.nUnlocked = 0;
47 lChCounter_.nOutOfSync = 0;
48 lChCounter_.nAPVStatusBit = 0;
49 lChCounter_.nAPVError = 0;
50 lChCounter_.nAPVAddressError = 0;
52 feCounter_.nFEOverflows = 0;
53 feCounter_.nFEBadMajorityAddresses = 0;
54 feCounter_.nFEMissing = 0;
56 fedErrors_.HasCabledChannels =
false;
57 fedErrors_.DataPresent =
false;
58 fedErrors_.DataMissing =
false;
59 fedErrors_.InvalidBuffers =
false;
60 fedErrors_.BadFEDCRCs =
false;
61 fedErrors_.BadDAQCRCs =
false;
62 fedErrors_.BadIDs =
false;
63 fedErrors_.BadDAQPacket =
false;
64 fedErrors_.CorruptBuffer =
false;
65 fedErrors_.FEsOverflow =
false;
66 fedErrors_.FEsMissing =
false;
67 fedErrors_.FEsBadMajorityAddress =
false;
68 fedErrors_.BadChannelStatusBit =
false;
69 fedErrors_.BadActiveChannelStatusBit =
false;
73 chErrorsDetailed_.clear();
79 eventProp_.deltaBX = 0;
82 void FEDErrors::initialiseFED(
const unsigned int aFedID,
85 const bool initVars) {
87 failUnpackerFEDCheck_ =
false;
103 detid_[iCh] = lConnection.
detId();
104 nChInModule_[iCh] = lConnection.
nApvPairs();
107 unsigned int lDetid = detid_[iCh];
110 unsigned int lSubid = 6;
118 if (tTopo->
tidSide(lDetid) == 2)
130 if (tTopo->
tecSide(lDetid) == 2)
141 subDetId_[lFeNumber] = lSubid;
146 feCounter_.nFEOverflows = 0;
147 feCounter_.nFEBadMajorityAddresses = 0;
148 feCounter_.nFEMissing = 0;
150 fedErrors_.HasCabledChannels =
false;
151 fedErrors_.DataPresent =
false;
152 fedErrors_.DataMissing =
false;
153 fedErrors_.InvalidBuffers =
false;
154 fedErrors_.BadFEDCRCs =
false;
155 fedErrors_.BadDAQCRCs =
false;
156 fedErrors_.BadIDs =
false;
157 fedErrors_.BadDAQPacket =
false;
158 fedErrors_.CorruptBuffer =
false;
159 fedErrors_.FEsOverflow =
false;
160 fedErrors_.FEsMissing =
false;
161 fedErrors_.FEsBadMajorityAddress =
false;
162 fedErrors_.BadChannelStatusBit =
false;
163 fedErrors_.BadActiveChannelStatusBit =
false;
167 chErrorsDetailed_.clear();
175 bool FEDErrors::checkDataPresent(
const FEDRawData& aFedData) {
176 if (!aFedData.
size() || !aFedData.
data()) {
178 if (connected_[iCh]) {
179 fedErrors_.HasCabledChannels =
true;
180 fedErrors_.DataMissing =
true;
184 fedErrors_.DataMissing =
true;
185 fedErrors_.HasCabledChannels =
false;
188 fedErrors_.DataPresent =
true;
190 if (connected_[iCh]) {
191 fedErrors_.HasCabledChannels =
true;
199 bool FEDErrors::failUnpackerFEDCheck() {
return failUnpackerFEDCheck_; }
201 bool FEDErrors::fillFatalFEDErrors(
const FEDRawData& aFedData,
const unsigned int aPrintDebug) {
204 fedErrors_.InvalidBuffers =
true;
205 failUnpackerFEDCheck_ =
true;
213 if (!
buffer.checkNoSlinkCRCError()) {
214 fedErrors_.BadFEDCRCs =
true;
216 }
else if (!
buffer.checkCRC()) {
217 failUnpackerFEDCheck_ =
true;
218 fedErrors_.BadDAQCRCs =
true;
223 if (!
buffer.checkSourceIDs() || !
buffer.checkNoUnexpectedSourceID()) {
224 fedErrors_.BadIDs =
true;
229 else if (!
buffer.doDAQHeaderAndTrailerChecks()) {
230 failUnpackerFEDCheck_ =
true;
231 fedErrors_.BadDAQPacket =
true;
237 if (!(
buffer.checkBufferFormat() &&
buffer.checkHeaderType() &&
buffer.checkReadoutMode())) {
238 failUnpackerFEDCheck_ =
true;
239 fedErrors_.InvalidBuffers =
true;
246 if (!
buffer.checkNoFEOverflows()) {
247 failUnpackerFEDCheck_ =
true;
248 fedErrors_.FEsOverflow =
true;
261 fedErrors_.CorruptBuffer =
true;
270 unsigned int lBadChans = 0;
271 unsigned int lTotChans = 0;
273 bool lIsConnected =
false;
278 lIsConnected = connected_[iCh];
287 return static_cast<float>(lBadChans * 1.0 / lTotChans);
290 bool FEDErrors::fillFEDErrors(
const FEDRawData& aFedData,
292 const unsigned int aPrintDebug,
293 unsigned int& aCounterMonitoring,
294 unsigned int& aCounterUnpacker,
303 if (!fillFatalFEDErrors(aFedData, aPrintDebug))
309 throw cms::Exception(
"FEDBuffer") << st_buffer <<
" (check debug output for more details)";
315 if (!
buffer.checkChannelLengths())
316 failUnpackerFEDCheck_ =
true;
319 if (!this->anyFEDErrors()) {
320 bool lCorruptCheck = fillCorruptBuffer(
buffer);
321 if (aPrintDebug > 1 && !lCorruptCheck) {
323 <<
"CorruptBuffer check failed for FED " << fedID_ << std::endl
324 <<
" -- buffer->checkChannelLengthsMatchBufferLength() = " <<
buffer.checkChannelLengthsMatchBufferLength()
326 <<
" -- buffer->checkChannelPacketCodes() = " <<
buffer.checkChannelPacketCodes() << std::endl
327 <<
" -- buffer->checkFEUnitLengths() = " <<
buffer.checkFEUnitLengths() << std::endl;
334 fillFEErrors(
buffer, aDoFEMaj, aFeMajFrac);
338 buffer, aFullDebug, aPrintDebug, aCounterMonitoring, aCounterUnpacker, aDoMeds, aMedianHist0, aMedianHist1);
344 std::vector<FEDErrors::APVLevelErrors>& lChVec = getAPVLevelErrors();
345 std::ostringstream debugStream;
346 if (!lChVec.empty()) {
348 debugStream <<
"[FEDErrors] Cabled channels which had errors: ";
350 for (
unsigned int iBadCh(0); iBadCh < lChVec.size(); iBadCh++) {
351 print(lChVec[iBadCh], debugStream);
353 debugStream << std::endl;
354 debugStream <<
"[FEDErrors] Active (have been locked in at least one event) cabled channels which had errors: ";
355 for (
unsigned int iBadCh(0); iBadCh < lChVec.size(); iBadCh++) {
356 if ((lChVec[iBadCh]).IsActive)
357 print(lChVec[iBadCh], debugStream);
360 debugStream << debugBuffer << std::endl;
361 debugBuffer.
dump(debugStream);
362 debugStream << std::endl;
363 edm::LogInfo(
"SiStripMonitorHardware") <<
"[FEDErrors] Errors found in FED " << fedID_;
367 return !(anyFEDErrors());
373 bool foundOverflow =
false;
374 bool foundBadMajority =
false;
375 bool foundMissing =
false;
377 FEDErrors::FELevelErrors lFeErr;
379 lFeErr.SubDetID = subDetId_[iFE];
380 lFeErr.Overflow =
false;
381 lFeErr.Missing =
false;
382 lFeErr.BadMajorityAddress =
false;
383 lFeErr.TimeDifference = 0;
387 bool hasCabledChannels =
false;
390 hasCabledChannels =
true;
395 if (!hasCabledChannels)
399 lFeErr.Overflow =
true;
400 foundOverflow =
true;
411 lFeErr.Missing =
true;
423 lFeErr.BadMajorityAddress =
true;
424 foundBadMajority =
true;
466 if (lFeErr.SubDetID == 2 || lFeErr.SubDetID == 3 || lFeErr.SubDetID == 4)
467 aFeMajFrac[0].push_back(std::pair<unsigned int, unsigned int>(fedID_, lFeErr.FeMaj));
468 else if (lFeErr.SubDetID == 5)
469 aFeMajFrac[1].push_back(std::pair<unsigned int, unsigned int>(fedID_, lFeErr.FeMaj));
470 else if (lFeErr.SubDetID == 0)
471 aFeMajFrac[2].push_back(std::pair<unsigned int, unsigned int>(fedID_, lFeErr.FeMaj));
472 else if (lFeErr.SubDetID == 1)
473 aFeMajFrac[3].push_back(std::pair<unsigned int, unsigned int>(fedID_, lFeErr.FeMaj));
477 lFeErr.TimeDifference =
478 static_cast<unsigned int>(
486 if (foundBadMajority || lFeErr.TimeDifference != 0) {
505 return !(foundOverflow || foundMissing || foundBadMajority);
510 const unsigned int aPrintDebug,
511 unsigned int& aCounterMonitoring,
512 unsigned int& aCounterUnpacker,
516 bool foundError =
false;
521 aFullDebug = debugHeader;
527 bool lPassedMonitoringFEDcheck = !fedErrors_.CorruptBuffer;
531 bool lFailUnpackerChannelCheck = (!aBuffer.
channelGood(iCh,
true) && connected_[iCh]) || failUnpackerFEDCheck_;
532 bool lFailMonitoringChannelCheck = !lPassedMonitoringFEDcheck && connected_[iCh];
534 FEDErrors::ChannelLevelErrors lChErr;
535 lChErr.ChannelID = iCh;
536 lChErr.Connected = connected_[iCh];
537 lChErr.IsActive =
false;
538 lChErr.Unlocked =
false;
539 lChErr.OutOfSync =
false;
541 if (!connected_[iCh]) {
543 addBadChannel(lChErr);
547 lFailMonitoringChannelCheck =
true;
551 bool apvBad[2] = {
false,
false};
571 lChErr.IsActive =
true;
576 lChErr.OutOfSync =
true;
579 lChErr.Unlocked =
true;
583 apvBad[0] = !
header->checkStatusBits(iCh, 0);
584 apvBad[1] = !
header->checkStatusBits(iCh, 1);
585 if (!apvBad[0] && !apvBad[1]) {
586 lChErr.IsActive =
true;
591 if (lChErr.Unlocked || lChErr.OutOfSync)
592 addBadChannel(lChErr);
599 for (
unsigned int iAPV = 0; iAPV < 2; iAPV++) {
601 FEDErrors::APVLevelErrors lAPVErr;
602 lAPVErr.APVID = 2 * iCh + iAPV;
603 lAPVErr.ChannelID = iCh;
604 lAPVErr.Connected = connected_[iCh];
605 lAPVErr.IsActive = lChErr.IsActive;
606 lAPVErr.APVStatusBit =
false;
607 lAPVErr.APVError =
false;
608 lAPVErr.APVAddressError =
false;
612 lFailMonitoringChannelCheck =
true;
613 lAPVErr.APVStatusBit =
true;
617 if (debugHeader && !lChErr.Unlocked && !lChErr.OutOfSync) {
621 lAPVErr.APVError =
true;
626 lAPVErr.APVAddressError =
true;
630 if (lAPVErr.APVStatusBit || lAPVErr.APVError || lAPVErr.APVAddressError)
631 addBadAPV(lAPVErr, lFirst);
637 if (lFailUnpackerChannelCheck != lFailMonitoringChannelCheck && connected_[iCh]) {
638 if (aPrintDebug > 1) {
639 std::ostringstream debugStream;
640 debugStream <<
"[FEDErrors] ------ WARNING: FED " << fedID_ <<
", channel " << iCh
641 <<
", isConnected = " << connected_[iCh] << std::endl
642 <<
"[FEDErrors] --------- Monitoring Channel check ";
643 if (lFailMonitoringChannelCheck)
644 debugStream <<
"failed." << std::endl;
646 debugStream <<
"passed." << std::endl;
647 debugStream <<
"[FEDErrors] --------- Unpacker Channel check ";
648 if (lFailUnpackerChannelCheck)
649 debugStream <<
"failed." << std::endl;
651 debugStream <<
"passed." << std::endl;
652 debugStream <<
"[FEDErrors] --------- fegood = " 654 <<
"[FEDErrors] --------- unpacker FED check = " << failUnpackerFEDCheck_ << std::endl;
655 edm::LogError(
"SiStripMonitorHardware") << debugStream.str();
658 if (lFailMonitoringChannelCheck)
659 aCounterMonitoring++;
660 if (lFailUnpackerChannelCheck)
664 if (lMedValid && !foundError && lPassedMonitoringFEDcheck && aDoMeds) {
668 HistogramBase::fillHistogram(aMedianHist0, lChannel.
cmMedian(0));
669 HistogramBase::fillHistogram(aMedianHist1, lChannel.
cmMedian(1));
677 void FEDErrors::fillBadChannelList(
const bool doTkHistoMap,
680 unsigned int& aNBadChannels,
681 unsigned int& aNBadActiveChannels,
682 unsigned int& aNBadChannels_perFEDID,
683 std::vector<unsigned int>& nTotal,
684 std::vector<unsigned int>& nErrors) {
685 uint32_t lPrevId = 0;
687 uint16_t lPrevTot = 0;
688 bool hasBeenProcessed =
false;
689 bool lFailFED = failMonitoringFEDCheck();
693 if (!connected_[iCh])
699 lPrevId = detid_[iCh];
700 lPrevTot = nChInModule_[iCh];
705 bool isBadFE =
false;
706 bool isMissingFE =
false;
708 for (
unsigned int badfe(0); badfe < feErrors_.size(); badfe++) {
709 if ((feErrors_[badfe]).FeID == feNumber) {
711 if ((feErrors_[badfe]).Missing)
717 bool isBadChan =
false;
718 bool isActiveChan =
false;
729 bool isBadApv1 =
false;
730 bool isBadApv2 =
false;
731 for (
unsigned int badApv(0); badApv < apvErrors_.size(); badApv++) {
732 if ((apvErrors_[badApv]).ChannelID == iCh) {
734 if (apvErrors_[badApv].IsActive)
737 if (apvErrors_[badApv].APVID == 2 * iCh)
739 if (apvErrors_[badApv].APVID == 2 * iCh + 1) {
745 if (detid_[iCh] == lPrevId) {
746 if (hasBeenProcessed)
747 hasBeenProcessed =
false;
750 if (detid_[iCh] != lPrevId) {
751 processDet(lPrevId, lPrevTot, doTkHistoMap, nBad, aTkMapPointer);
752 lPrevId = detid_[iCh];
753 lPrevTot = nChInModule_[iCh];
754 hasBeenProcessed =
true;
757 bool lHasErr = lFailFED || isBadFE || isBadChan;
758 incrementLumiErrors(lHasErr, subDetId_[feNumber], nTotal, nErrors);
763 aNBadChannels_perFEDID = aNBadChannels_perFEDID + 1;
765 if ((isBadChan && isActiveChan) || lFailFED || (isBadFE && !isMissingFE))
766 aNBadActiveChannels++;
767 if (isBadApv1 || lFailFED || isBadFE)
768 HistogramBase::fillHistogram(aFedIdVsApvId, 2 * iCh, fedID_);
769 if (isBadApv2 || lFailFED || isBadFE)
770 HistogramBase::fillHistogram(aFedIdVsApvId, 2 * iCh + 1, fedID_);
775 if (!hasBeenProcessed) {
776 processDet(lPrevId, lPrevTot, doTkHistoMap, nBad, aTkMapPointer);
780 void FEDErrors::fillEventProperties(
long long dbx) { eventProp_.deltaBX = dbx; }
782 void FEDErrors::incrementLumiErrors(
const bool hasError,
783 const unsigned int aSubDet,
784 std::vector<unsigned int>& nTotal,
785 std::vector<unsigned int>& nErrors) {
788 if (aSubDet >= nTotal.size()) {
789 edm::LogError(
"SiStripMonitorHardware") <<
" -- FED " << fedID_ <<
", invalid subdetid : " << aSubDet
790 <<
", size of lumiErr : " << nTotal.size() << std::endl;
798 void FEDErrors::processDet(
const uint32_t aPrevId,
799 const uint16_t aPrevTot,
800 const bool doTkHistoMap,
803 if (aPrevTot < nBad) {
804 edm::LogError(
"SiStripMonitorHardware") <<
" -- Number of bad channels in det " << aPrevId <<
" = " << nBad
805 <<
", total number of pairs for this det = " << aPrevTot << std::endl;
809 uint32_t lDetid = aPrevId;
810 if (aPrevTot != 0 && doTkHistoMap && aTkMapPointer)
811 HistogramBase::fillTkHistoMap(aTkMapPointer, lDetid, static_cast<float>(nBad) / aPrevTot);
816 const bool FEDErrors::failMonitoringFEDCheck() {
return (anyFEDErrors() || fedErrors_.CorruptBuffer); }
818 const bool FEDErrors::anyDAQProblems() {
819 return (fedErrors_.DataMissing || fedErrors_.InvalidBuffers || fedErrors_.BadFEDCRCs || fedErrors_.BadDAQCRCs ||
820 fedErrors_.BadIDs || fedErrors_.BadDAQPacket);
823 const bool FEDErrors::anyFEDErrors() {
824 return (fedErrors_.InvalidBuffers || fedErrors_.BadFEDCRCs || fedErrors_.BadDAQCRCs || fedErrors_.BadIDs ||
825 fedErrors_.BadDAQPacket || fedErrors_.FEsOverflow);
828 const bool FEDErrors::anyFEProblems() {
829 return (fedErrors_.FEsOverflow || fedErrors_.FEsMissing || fedErrors_.FEsBadMajorityAddress);
833 return (anyFEDErrors() || anyFEProblems() || fedErrors_.CorruptBuffer || fedErrors_.BadChannelStatusBit);
836 const unsigned int FEDErrors::fedID() {
return fedID_; }
838 FEDErrors::FEDCounters& FEDErrors::getFEDErrorsCounters() {
return lFedCounter_; }
840 FEDErrors::ChannelCounters& FEDErrors::getChannelErrorsCounters() {
return lChCounter_; }
842 FEDErrors::FECounters& FEDErrors::getFEErrorsCounters() {
return feCounter_; }
844 FEDErrors::FEDLevelErrors& FEDErrors::getFEDLevelErrors() {
return fedErrors_; }
846 FEDErrors::EventProperties& FEDErrors::getEventProperties() {
return eventProp_; }
848 std::vector<FEDErrors::FELevelErrors>& FEDErrors::getFELevelErrors() {
return feErrors_; }
850 std::vector<FEDErrors::ChannelLevelErrors>& FEDErrors::getChannelLevelErrors() {
return chErrorsDetailed_; }
852 std::vector<FEDErrors::APVLevelErrors>& FEDErrors::getAPVLevelErrors() {
return apvErrors_; }
854 std::vector<std::pair<unsigned int, bool> >& FEDErrors::getBadChannels() {
return chErrors_; }
856 void FEDErrors::addBadFE(
const FEDErrors::FELevelErrors& aFE) {
858 fedErrors_.FEsOverflow =
true;
859 (feCounter_.nFEOverflows)++;
860 }
else if (aFE.Missing) {
861 fedErrors_.FEsMissing =
true;
862 (feCounter_.nFEMissing)++;
863 feErrors_.push_back(aFE);
864 }
else if (aFE.BadMajorityAddress) {
865 fedErrors_.FEsBadMajorityAddress =
true;
866 (feCounter_.nFEBadMajorityAddresses)++;
867 feErrors_.push_back(aFE);
868 }
else if (aFE.TimeDifference != 0) {
869 feErrors_.push_back(aFE);
873 void FEDErrors::addBadChannel(
const FEDErrors::ChannelLevelErrors& aChannel) {
874 if (aChannel.Connected)
875 chErrorsDetailed_.push_back(aChannel);
876 incrementChannelCounters(aChannel);
879 void FEDErrors::addBadAPV(
const FEDErrors::APVLevelErrors& aAPV,
bool& aFirst) {
880 apvErrors_.push_back(aAPV);
881 incrementAPVCounters(aAPV);
882 if (aAPV.APVStatusBit && aFirst) {
883 fedErrors_.BadChannelStatusBit =
true;
884 lFedCounter_.nBadChannels++;
885 chErrors_.push_back(std::pair<unsigned int, bool>(aAPV.ChannelID, aAPV.IsActive));
888 fedErrors_.BadActiveChannelStatusBit =
true;
889 lFedCounter_.nBadActiveChannels++;
896 void FEDErrors::incrementFEDCounters() {
897 if (fedErrors_.InvalidBuffers || fedErrors_.BadFEDCRCs || fedErrors_.BadDAQCRCs || fedErrors_.BadIDs ||
898 fedErrors_.BadDAQPacket) {
899 lFedCounter_.nDAQProblems++;
900 lFedCounter_.nFEDErrors++;
904 if (fedErrors_.FEsOverflow) {
905 lFedCounter_.nFEDsWithFEOverflows++;
906 }
else if (fedErrors_.FEsMissing) {
907 lFedCounter_.nFEDsWithMissingFEs++;
908 }
else if (fedErrors_.FEsBadMajorityAddress) {
909 lFedCounter_.nFEDsWithFEBadMajorityAddresses++;
912 if (fedErrors_.FEsOverflow || fedErrors_.FEsBadMajorityAddress || fedErrors_.FEsMissing) {
913 lFedCounter_.nFEDsWithFEProblems++;
914 lFedCounter_.nFEDErrors++;
915 }
else if (fedErrors_.CorruptBuffer) {
916 lFedCounter_.nCorruptBuffers++;
917 lFedCounter_.nFEDErrors++;
921 void FEDErrors::incrementChannelCounters(
const FEDErrors::ChannelLevelErrors& aChannel) {
922 if (aChannel.Unlocked && aChannel.Connected)
923 lChCounter_.nUnlocked++;
924 if (aChannel.OutOfSync && aChannel.Connected)
925 lChCounter_.nOutOfSync++;
926 if (!aChannel.Connected)
927 lChCounter_.nNotConnected++;
930 void FEDErrors::incrementAPVCounters(
const FEDErrors::APVLevelErrors& aAPV) {
931 if (aAPV.Connected && aAPV.IsActive) {
932 if (aAPV.APVStatusBit)
933 lChCounter_.nAPVStatusBit++;
934 if (aAPV.APVAddressError)
935 lChCounter_.nAPVAddressError++;
937 lChCounter_.nAPVError++;
942 if (this->ChannelID < aErr.ChannelID)
948 if (this->ChannelID < aErr.ChannelID)
953 void FEDErrors::print(
const FEDErrors::FEDCounters& aFEDCounter, std::ostream& aOs) {
955 aOs <<
"[FEDErrors]============================================" << std::endl
956 <<
"[FEDErrors]==== Printing FEDCounters information : ====" << std::endl
957 <<
"[FEDErrors]============================================" << std::endl
958 <<
"[FEDErrors]======== nFEDErrors = " << aFEDCounter.nFEDErrors << std::endl
959 <<
"[FEDErrors]======== nDAQProblems = " << aFEDCounter.nDAQProblems << std::endl
960 <<
"[FEDErrors]======== nFEDsWithFEProblems = " << aFEDCounter.nFEDsWithFEProblems << std::endl
961 <<
"[FEDErrors]======== nCorruptBuffers = " << aFEDCounter.nCorruptBuffers << std::endl
962 <<
"[FEDErrors]======== nBadChannels = " << aFEDCounter.nBadChannels << std::endl
963 <<
"[FEDErrors]======== nBadActiveChannels = " << aFEDCounter.nBadActiveChannels << std::endl
964 <<
"[FEDErrors]======== nFEDsWithFEOverflows = " << aFEDCounter.nFEDsWithFEOverflows << std::endl
965 <<
"[FEDErrors]======== nFEDsWithFEBadMajorityAddresses = " << aFEDCounter.nFEDsWithFEBadMajorityAddresses
967 <<
"[FEDErrors]======== nFEDsWithMissingFEs = " << aFEDCounter.nFEDsWithMissingFEs << std::endl
968 <<
"[FEDErrors]======== nTotalBadChannels = " << aFEDCounter.nTotalBadChannels << std::endl
969 <<
"[FEDErrors]======== nTotalBadActiveChannels = " << aFEDCounter.nTotalBadActiveChannels << std::endl
970 <<
"[FEDErrors]============================================" << std::endl;
973 void FEDErrors::print(
const FEDErrors::FECounters& aFECounter, std::ostream& aOs) {
975 aOs <<
"[FEDErrors]============================================" << std::endl
976 <<
"[FEDErrors]==== Printing FECounters information : ====" << std::endl
977 <<
"[FEDErrors]============================================" << std::endl
978 <<
"[FEDErrors]======== nFEOverflows = " << aFECounter.nFEOverflows << std::endl
979 <<
"[FEDErrors]======== nFEBadMajorityAddresses = " << aFECounter.nFEBadMajorityAddresses << std::endl
980 <<
"[FEDErrors]======== nFEMissing = " << aFECounter.nFEMissing << std::endl
981 <<
"[FEDErrors]============================================" << std::endl;
984 void FEDErrors::print(
const FEDErrors::FEDLevelErrors& aFEDErr, std::ostream& aOs) {
986 aOs <<
"[FEDErrors]============================================" << std::endl
987 <<
"[FEDErrors]==== Printing FED errors information : ====" << std::endl
988 <<
"[FEDErrors]============================================" << std::endl
989 <<
"[FEDErrors]======== HasCabledChannels = " << aFEDErr.HasCabledChannels << std::endl
990 <<
"[FEDErrors]======== DataPresent = " << aFEDErr.DataPresent << std::endl
991 <<
"[FEDErrors]======== DataMissing = " << aFEDErr.DataMissing << std::endl
992 <<
"[FEDErrors]======== InvalidBuffers = " << aFEDErr.InvalidBuffers << std::endl
993 <<
"[FEDErrors]======== BadFEDCRCs = " << aFEDErr.BadFEDCRCs << std::endl
994 <<
"[FEDErrors]======== BadDAQCRCs = " << aFEDErr.BadDAQCRCs << std::endl
995 <<
"[FEDErrors]======== BadIDs = " << aFEDErr.BadIDs << std::endl
996 <<
"[FEDErrors]======== BadDAQPacket = " << aFEDErr.BadDAQPacket << std::endl
997 <<
"[FEDErrors]======== CorruptBuffer = " << aFEDErr.CorruptBuffer << std::endl
998 <<
"[FEDErrors]======== FEOverflows = " << aFEDErr.FEsOverflow << std::endl
999 <<
"[FEDErrors]======== FEMissing = " << aFEDErr.FEsMissing << std::endl
1000 <<
"[FEDErrors]======== BadMajorityAddresses = " << aFEDErr.FEsBadMajorityAddress << std::endl
1001 <<
"[FEDErrors]============================================" << std::endl;
1004 void FEDErrors::print(
const FEDErrors::FELevelErrors& aErr, std::ostream& aOs) {
1006 aOs <<
"[FEDErrors]============================================" << std::endl
1007 <<
"[FEDErrors]==== Printing FE errors information : ====" << std::endl
1008 <<
"[FEDErrors]============================================" << std::endl
1009 <<
"[FEDErrors]======== FE #" << aErr.FeID << std::endl
1010 <<
"[FEDErrors]======== subdet " << aErr.SubDetID << std::endl
1011 <<
"[FEDErrors]======== FEOverflow = " << aErr.Overflow << std::endl
1012 <<
"[FEDErrors]======== FEMissing = " << aErr.Missing << std::endl
1013 <<
"[FEDErrors]======== BadMajorityAddresses = " << aErr.BadMajorityAddress << std::endl
1014 <<
"[FEDErrors]======== TimeDifference = " << aErr.TimeDifference << std::endl
1015 <<
"[FEDErrors]============================================" << std::endl;
1018 void FEDErrors::print(
const FEDErrors::ChannelLevelErrors& aErr, std::ostream& aOs) {
1020 aOs <<
"[FEDErrors]=================================================" << std::endl
1021 <<
"[FEDErrors]==== Printing channel errors information : ====" << std::endl
1022 <<
"[FEDErrors]=================================================" << std::endl
1023 <<
"[FEDErrors]============ Channel #" << aErr.ChannelID << std::endl
1024 <<
"[FEDErrors]============ connected = " << aErr.Connected << std::endl
1025 <<
"[FEDErrors]============ isActive = " << aErr.IsActive << std::endl
1026 <<
"[FEDErrors]============ Unlocked = " << aErr.Unlocked << std::endl
1027 <<
"[FEDErrors]============ OutOfSync = " << aErr.OutOfSync << std::endl
1028 <<
"[FEDErrors]=================================================" << std::endl;
1031 void FEDErrors::print(
const FEDErrors::APVLevelErrors& aErr, std::ostream& aOs) {
1033 aOs <<
"[FEDErrors]=================================================" << std::endl
1034 <<
"[FEDErrors]==== Printing APV errors information : ====" << std::endl
1035 <<
"[FEDErrors]=================================================" << std::endl
1036 <<
"[FEDErrors]============ APV #" << aErr.APVID << std::endl
1037 <<
"[FEDErrors]============ Channel #" << aErr.ChannelID << std::endl
1038 <<
"[FEDErrors]============ connected = " << aErr.Connected << std::endl
1039 <<
"[FEDErrors]============ isActive = " << aErr.IsActive << std::endl
1040 <<
"[FEDErrors]============ APVStatusBit = " << aErr.APVStatusBit << std::endl
1041 <<
"[FEDErrors]============ APVError = " << aErr.APVError << std::endl
1042 <<
"[FEDErrors]============ APVAddressError = " << aErr.APVAddressError << std::endl
1043 <<
"[FEDErrors]=================================================" << std::endl;
FEDReadoutMode readoutMode() const
bool checkChannelLengthsMatchBufferLength() const
Log< level::Info, true > LogVerbatim
bool feOverflow(const uint8_t internalFEUnitNum) const
bool operator<(IOVSyncValue const &iLHS, IOVSyncValue const &iRHS)
static const uint32_t invalid32_
unsigned int tidSide(const DetId &id) const
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
const FEDFEHeader * feHeader() const
size_t size() const
Lenght of the data buffer in bytes.
Log< level::Error, false > LogError
bool checkFEUnitLengths() const
bool majorityAddressErrorForFEUnit(const uint8_t internalFEUnitNum) const
bool feEnabled(const uint8_t internalFEUnitNum) const
bool checkChannelPacketCodes() const
unsigned int tecSide(const DetId &id) const
Class containning control, module, detector and connection information, at the level of a FED channel...
static const uint16_t FEUNITS_PER_FED
void dump(std::ostream &os) const
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
const uint32_t & detId() const
static const uint8_t timeLocation(const uint8_t aPipelineAddress)
uint16_t cmMedian(const uint8_t apvIndex) const
Log< level::Info, false > LogInfo
bool channelGood(const uint8_t internalFEDannelNum, const bool doAPVeCheck) const
static const uint16_t FEDCH_PER_FEUNIT
const FEDChannel & channel(const uint8_t internalFEDChannelNum) const
const uint16_t & nApvPairs() const
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
static const uint16_t FEDCH_PER_FED
bool feGood(const uint8_t internalFEUnitNum) const
FEDBufferStatusCode preconstructCheckFEDBuffer(const FEDRawData &fedBuffer, bool allowBadBuffer=false)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
FEDBufferStatusCode preconstructCheckFEDBufferBase(const FEDRawData &fedBuffer, bool checkRecognizedFormat=true)
Log< level::Warning, false > LogWarning
bool fePresent(uint8_t internalFEUnitNum) const
uint8_t apveAddress() const