10 #include "DQM/SiStripMonitorHardware/interface/HistogramBase.hh" 11 #include "DQM/SiStripMonitorHardware/interface/FEDErrors.hh" 15 FEDErrors::FEDErrors()
21 FEDErrors::~FEDErrors()
26 void FEDErrors::initialiseLumiBlock() {
27 lumiErr_.nTotal.clear();
28 lumiErr_.nErrors.clear();
31 lumiErr_.nTotal.resize(6,0);
32 lumiErr_.nErrors.resize(6,0);
35 void FEDErrors::initialiseEvent() {
37 failUnpackerFEDCheck_ =
false;
45 lFedCounter_.nFEDErrors = 0;
46 lFedCounter_.nDAQProblems = 0;
47 lFedCounter_.nFEDsWithFEProblems = 0;
48 lFedCounter_.nCorruptBuffers = 0;
49 lFedCounter_.nBadChannels = 0;
50 lFedCounter_.nBadActiveChannels = 0;
51 lFedCounter_.nFEDsWithFEOverflows = 0;
52 lFedCounter_.nFEDsWithFEBadMajorityAddresses = 0;
53 lFedCounter_.nFEDsWithMissingFEs = 0;
54 lFedCounter_.nTotalBadChannels = 0;
55 lFedCounter_.nTotalBadActiveChannels = 0;
57 lChCounter_.nNotConnected = 0;
58 lChCounter_.nUnlocked = 0;
59 lChCounter_.nOutOfSync = 0;
60 lChCounter_.nAPVStatusBit = 0;
61 lChCounter_.nAPVError = 0;
62 lChCounter_.nAPVAddressError = 0;
64 feCounter_.nFEOverflows = 0;
65 feCounter_.nFEBadMajorityAddresses = 0;
66 feCounter_.nFEMissing = 0;
68 fedErrors_.HasCabledChannels =
false;
69 fedErrors_.DataPresent =
false;
70 fedErrors_.DataMissing =
false;
71 fedErrors_.InvalidBuffers =
false;
72 fedErrors_.BadFEDCRCs =
false;
73 fedErrors_.BadDAQCRCs =
false;
74 fedErrors_.BadIDs =
false;
75 fedErrors_.BadDAQPacket =
false;
76 fedErrors_.CorruptBuffer =
false;
77 fedErrors_.FEsOverflow =
false;
78 fedErrors_.FEsMissing =
false;
79 fedErrors_.FEsBadMajorityAddress =
false;
80 fedErrors_.BadChannelStatusBit =
false;
81 fedErrors_.BadActiveChannelStatusBit =
false;
85 chErrorsDetailed_.clear();
96 void FEDErrors::initialiseFED(
const unsigned int aFedID,
102 failUnpackerFEDCheck_ =
false;
116 for (
unsigned int iCh = 0;
122 detid_[iCh] = lConnection.
detId();
123 nChInModule_[iCh] = lConnection.
nApvPairs();
126 unsigned int lDetid = detid_[iCh];
129 unsigned int lSubid = 6;
139 if (tTopo->
tidSide(lDetid) == 2) lSubid = 4;
151 if (tTopo->
tecSide(lDetid) == 2) lSubid = 1;
161 subDetId_[lFeNumber] = lSubid;
168 feCounter_.nFEOverflows = 0;
169 feCounter_.nFEBadMajorityAddresses = 0;
170 feCounter_.nFEMissing = 0;
172 fedErrors_.HasCabledChannels =
false;
173 fedErrors_.DataPresent =
false;
174 fedErrors_.DataMissing =
false;
175 fedErrors_.InvalidBuffers =
false;
176 fedErrors_.BadFEDCRCs =
false;
177 fedErrors_.BadDAQCRCs =
false;
178 fedErrors_.BadIDs =
false;
179 fedErrors_.BadDAQPacket =
false;
180 fedErrors_.CorruptBuffer =
false;
181 fedErrors_.FEsOverflow =
false;
182 fedErrors_.FEsMissing =
false;
183 fedErrors_.FEsBadMajorityAddress =
false;
184 fedErrors_.BadChannelStatusBit =
false;
185 fedErrors_.BadActiveChannelStatusBit =
false;
189 chErrorsDetailed_.clear();
197 bool FEDErrors::checkDataPresent(
const FEDRawData& aFedData)
200 if (!aFedData.
size() || !aFedData.
data()) {
201 for (
unsigned int iCh = 0;
204 if (connected_[iCh]){
205 fedErrors_.HasCabledChannels =
true;
206 fedErrors_.DataMissing =
true;
210 fedErrors_.DataMissing =
true;
211 fedErrors_.HasCabledChannels =
false;
214 fedErrors_.DataPresent =
true;
215 for (
unsigned int iCh = 0;
218 if (connected_[iCh]){
219 fedErrors_.HasCabledChannels =
true;
228 bool FEDErrors::failUnpackerFEDCheck()
230 return failUnpackerFEDCheck_;
234 bool FEDErrors::fillFatalFEDErrors(
const FEDRawData& aFedData,
235 const unsigned int aPrintDebug)
238 std::unique_ptr<const sistrip::FEDBufferBase> bufferBase;
242 fedErrors_.InvalidBuffers =
true;
243 failUnpackerFEDCheck_ =
true;
250 if (!bufferBase->checkNoSlinkCRCError()) {
251 fedErrors_.BadFEDCRCs =
true;
253 }
else if (!bufferBase->checkCRC()) {
254 failUnpackerFEDCheck_ =
true;
255 fedErrors_.BadDAQCRCs =
true;
260 if (!bufferBase->checkSourceIDs() || !bufferBase->checkNoUnexpectedSourceID()) {
261 fedErrors_.BadIDs =
true;
266 else if (!bufferBase->doDAQHeaderAndTrailerChecks()) {
267 failUnpackerFEDCheck_ =
true;
268 fedErrors_.BadDAQPacket =
true;
274 if ( !(bufferBase->checkBufferFormat() &&
275 bufferBase->checkHeaderType() &&
276 bufferBase->checkReadoutMode()) ) {
277 failUnpackerFEDCheck_ =
true;
278 fedErrors_.InvalidBuffers =
true;
280 if (!printDebug() || aPrintDebug<3 )
return false;
284 if (!bufferBase->checkNoFEOverflows()) {
285 failUnpackerFEDCheck_ =
true;
286 fedErrors_.FEsOverflow =
true;
288 if (!printDebug() || aPrintDebug<3 )
return false;
301 fedErrors_.CorruptBuffer =
true;
313 unsigned int lBadChans = 0;
314 unsigned int lTotChans = 0;
316 bool lIsConnected =
false;
321 else lIsConnected = connected_[iCh];
323 if (!lIsConnected)
continue;
328 return static_cast<float>(lBadChans*1.0/lTotChans);
332 bool FEDErrors::fillFEDErrors(
const FEDRawData& aFedData,
334 const unsigned int aPrintDebug,
335 unsigned int & aCounterMonitoring,
336 unsigned int & aCounterUnpacker,
341 std::vector<std::vector<std::pair<unsigned int,unsigned int> > > & aFeMajFrac
347 if (!fillFatalFEDErrors(aFedData,aPrintDebug))
return false;
350 std::unique_ptr<const sistrip::FEDBuffer>
buffer;
354 if (!buffer->checkChannelLengths()) failUnpackerFEDCheck_=
true;
357 if (!this->anyFEDErrors()) {
359 bool lCorruptCheck = fillCorruptBuffer(buffer.get());
360 if (aPrintDebug>1 && !lCorruptCheck) {
362 <<
"CorruptBuffer check failed for FED " << fedID_
364 <<
" -- buffer->checkChannelLengthsMatchBufferLength() = " << buffer->checkChannelLengthsMatchBufferLength()
366 <<
" -- buffer->checkChannelPacketCodes() = " << buffer->checkChannelPacketCodes()
368 <<
" -- buffer->checkFEUnitLengths() = " << buffer->checkFEUnitLengths()
376 fillFEErrors(buffer.get(),aDoFEMaj,aFeMajFrac);
379 fillChannelErrors(buffer.get(),
392 if (printDebug() && aPrintDebug>2) {
395 if (buffer.get()) debugBuffer = buffer.get();
398 std::vector<FEDErrors::APVLevelErrors> & lChVec = getAPVLevelErrors();
399 std::ostringstream debugStream;
400 if (!lChVec.empty()) {
402 debugStream <<
"[FEDErrors] Cabled channels which had errors: ";
404 for (
unsigned int iBadCh(0); iBadCh < lChVec.size(); iBadCh++) {
405 print(lChVec[iBadCh],debugStream);
407 debugStream << std::endl;
408 debugStream <<
"[FEDErrors] Active (have been locked in at least one event) cabled channels which had errors: ";
409 for (
unsigned int iBadCh(0); iBadCh < lChVec.size(); iBadCh++) {
410 if ((lChVec[iBadCh]).IsActive)
print(lChVec[iBadCh],debugStream);
414 debugStream << (*debugBuffer) << std::endl;
415 debugBuffer->
dump(debugStream);
416 debugStream << std::endl;
417 edm::LogInfo(
"SiStripMonitorHardware") <<
"[FEDErrors] Errors found in FED " << fedID_;
422 return !(anyFEDErrors());
427 std::vector<std::vector<std::pair<unsigned int,unsigned int> > > & aFeMajFrac)
429 bool foundOverflow =
false;
430 bool foundBadMajority =
false;
431 bool foundMissing =
false;
434 FEDErrors::FELevelErrors lFeErr;
436 lFeErr.SubDetID = subDetId_[iFE];
437 lFeErr.Overflow =
false;
438 lFeErr.Missing =
false;
439 lFeErr.BadMajorityAddress =
false;
440 lFeErr.TimeDifference = 0;
444 bool hasCabledChannels =
false;
446 if (connected_[iFE*sistrip::FEDCH_PER_FEUNIT+feUnitCh]) {
447 hasCabledChannels =
true;
452 if (!hasCabledChannels)
continue;
455 lFeErr.Overflow =
true;
456 foundOverflow =
true;
466 lFeErr.Missing =
true;
478 lFeErr.BadMajorityAddress =
true;
479 foundBadMajority =
true;
522 if (lFeErr.SubDetID == 2 || lFeErr.SubDetID == 3 || lFeErr.SubDetID == 4)
523 aFeMajFrac[0].push_back(std::pair<unsigned int, unsigned int>(fedID_,lFeErr.FeMaj));
524 else if (lFeErr.SubDetID == 5)
525 aFeMajFrac[1].push_back(std::pair<unsigned int, unsigned int>(fedID_,lFeErr.FeMaj));
526 else if (lFeErr.SubDetID == 0)
527 aFeMajFrac[2].push_back(std::pair<unsigned int, unsigned int>(fedID_,lFeErr.FeMaj));
528 else if (lFeErr.SubDetID == 1)
529 aFeMajFrac[3].push_back(std::pair<unsigned int, unsigned int>(fedID_,lFeErr.FeMaj));
534 lFeErr.TimeDifference =
541 if (foundBadMajority || lFeErr.TimeDifference != 0){
564 return !(foundOverflow || foundMissing || foundBadMajority);
569 const unsigned int aPrintDebug,
570 unsigned int & aCounterMonitoring,
571 unsigned int & aCounterUnpacker,
577 bool foundError =
false;
582 aFullDebug = debugHeader;
588 bool lPassedMonitoringFEDcheck = !fedErrors_.CorruptBuffer;
592 bool lFailUnpackerChannelCheck = (!aBuffer->
channelGood(iCh,
true) && connected_[iCh]) || failUnpackerFEDCheck_;
593 bool lFailMonitoringChannelCheck = !lPassedMonitoringFEDcheck && connected_[iCh];
596 FEDErrors::ChannelLevelErrors lChErr;
597 lChErr.ChannelID = iCh;
598 lChErr.Connected = connected_[iCh];
599 lChErr.IsActive =
false;
600 lChErr.Unlocked =
false;
601 lChErr.OutOfSync =
false;
603 if (!connected_[iCh]) {
605 addBadChannel(lChErr);
609 if (!aBuffer->
feGood(static_cast<unsigned int>(iCh/sistrip::FEDCH_PER_FEUNIT))) {
610 lFailMonitoringChannelCheck =
true;
615 bool apvBad[2] = {
false,
false};
634 !(lStatus & sistrip::CHANNEL_STATUS_IN_SYNC) ||
639 lChErr.IsActive =
true;
642 if (!(lStatus & sistrip::CHANNEL_STATUS_IN_SYNC)) {
643 lChErr.OutOfSync =
true;
647 lChErr.Unlocked =
true;
653 if (!apvBad[0] && !apvBad[1]) {
654 lChErr.IsActive =
true;
659 if (lChErr.Unlocked || lChErr.OutOfSync) addBadChannel(lChErr);
666 for (
unsigned int iAPV = 0; iAPV < 2; iAPV++) {
668 FEDErrors::APVLevelErrors lAPVErr;
669 lAPVErr.APVID = 2*iCh+iAPV;
670 lAPVErr.ChannelID = iCh;
671 lAPVErr.Connected = connected_[iCh];
672 lAPVErr.IsActive = lChErr.IsActive;
673 lAPVErr.APVStatusBit =
false;
674 lAPVErr.APVError =
false;
675 lAPVErr.APVAddressError =
false;
679 lFailMonitoringChannelCheck =
true;
680 lAPVErr.APVStatusBit =
true;
684 if (debugHeader && !lChErr.Unlocked && !lChErr.OutOfSync) {
686 if ( (iAPV==0 && !(lStatus & sistrip::CHANNEL_STATUS_APV0_NO_ERROR_BIT)) ||
687 (iAPV==1 && !(lStatus & sistrip::CHANNEL_STATUS_APV1_NO_ERROR_BIT))) {
688 lAPVErr.APVError =
true;
693 lAPVErr.APVAddressError =
true;
697 if ( lAPVErr.APVStatusBit ||
699 lAPVErr.APVAddressError
700 ) addBadAPV(lAPVErr, lFirst);
707 if (lFailUnpackerChannelCheck != lFailMonitoringChannelCheck && connected_[iCh]){
709 std::ostringstream debugStream;
710 debugStream <<
"[FEDErrors] ------ WARNING: FED " << fedID_ <<
", channel " << iCh
711 <<
", isConnected = " << connected_[iCh] << std::endl
712 <<
"[FEDErrors] --------- Monitoring Channel check " ;
713 if (lFailMonitoringChannelCheck) debugStream <<
"failed." << std::endl;
714 else debugStream <<
"passed." << std::endl ;
715 debugStream <<
"[FEDErrors] --------- Unpacker Channel check " ;
716 if (lFailUnpackerChannelCheck) debugStream <<
"failed." << std::endl;
717 else debugStream <<
"passed." << std::endl;
718 debugStream <<
"[FEDErrors] --------- fegood = " 719 << aBuffer->
feGood(static_cast<unsigned int>(iCh/sistrip::FEDCH_PER_FEUNIT))
721 <<
"[FEDErrors] --------- unpacker FED check = " << failUnpackerFEDCheck_ << std::endl;
722 edm::LogError(
"SiStripMonitorHardware") << debugStream.str();
725 if (lFailMonitoringChannelCheck) aCounterMonitoring++;
726 if (lFailUnpackerChannelCheck) aCounterUnpacker++;
729 if (lMedValid && !foundError && lPassedMonitoringFEDcheck && aDoMeds) {
733 HistogramBase::fillHistogram(aMedianHist0,
735 HistogramBase::fillHistogram(aMedianHist1,
745 void FEDErrors::fillBadChannelList(
const bool doTkHistoMap,
748 unsigned int & aNBadChannels,
749 unsigned int & aNBadActiveChannels,
750 unsigned int & aNBadChannels_perFEDID)
753 uint32_t lPrevId = 0;
755 uint16_t lPrevTot = 0;
756 bool hasBeenProcessed =
false;
757 bool lFailFED = failMonitoringFEDCheck();
759 for (
unsigned int iCh = 0;
763 if (!connected_[iCh])
continue;
767 lPrevId = detid_[iCh];
768 lPrevTot = nChInModule_[iCh];
773 bool isBadFE =
false;
774 bool isMissingFE =
false;
776 for (
unsigned int badfe(0); badfe<feErrors_.size(); badfe++) {
777 if ((feErrors_[badfe]).FeID == feNumber) {
779 if ((feErrors_[badfe]).Missing) isMissingFE =
true;
784 bool isBadChan =
false;
785 bool isActiveChan =
false;
796 bool isBadApv1 =
false;
797 bool isBadApv2 =
false;
798 for (
unsigned int badApv(0); badApv<apvErrors_.size(); badApv++) {
799 if ((apvErrors_[badApv]).ChannelID == iCh) {
801 if (apvErrors_[badApv].IsActive) isActiveChan =
true;
803 if (apvErrors_[badApv].APVID == 2 * iCh ) isBadApv1 =
true;
804 if (apvErrors_[badApv].APVID == 2 * iCh + 1 )
812 if (detid_[iCh] == lPrevId){
813 if (hasBeenProcessed) hasBeenProcessed =
false;
816 if (detid_[iCh] != lPrevId){
823 lPrevId = detid_[iCh];
824 lPrevTot = nChInModule_[iCh];
825 hasBeenProcessed =
true;
828 bool lHasErr = lFailFED || isBadFE || isBadChan;
829 incrementLumiErrors(lHasErr,subDetId_[feNumber]);
834 aNBadChannels_perFEDID = aNBadChannels_perFEDID+1;
836 if ((isBadChan && isActiveChan) || lFailFED || (isBadFE && !isMissingFE)) aNBadActiveChannels++;
837 if ( isBadApv1 || lFailFED || isBadFE ) HistogramBase::fillHistogram ( aFedIdVsApvId , 2 * iCh , fedID_ ) ;
838 if ( isBadApv2 || lFailFED || isBadFE ) HistogramBase::fillHistogram ( aFedIdVsApvId , 2 * iCh + 1 , fedID_ ) ;
845 if (!hasBeenProcessed){
857 void FEDErrors::fillEventProperties(
long long dbx) {
858 eventProp_.deltaBX = dbx;
861 void FEDErrors::incrementLumiErrors(
const bool hasError,
862 const unsigned int aSubDet){
863 if (lumiErr_.nTotal.empty())
return;
864 if (aSubDet >= lumiErr_.nTotal.size()) {
865 edm::LogError(
"SiStripMonitorHardware") <<
" -- FED " << fedID_
866 <<
", invalid subdetid : " << aSubDet
867 <<
", size of lumiErr : " 868 << lumiErr_.nTotal.size()
872 if (hasError) lumiErr_.nErrors[aSubDet]++;
873 lumiErr_.nTotal[aSubDet]++;
877 void FEDErrors::processDet(
const uint32_t aPrevId,
878 const uint16_t aPrevTot,
879 const bool doTkHistoMap,
884 if (aPrevTot < nBad){
885 edm::LogError(
"SiStripMonitorHardware") <<
" -- Number of bad channels in det " << aPrevId
887 <<
", total number of pairs for this det = " << aPrevTot
892 uint32_t lDetid = aPrevId;
893 if (aPrevTot != 0 && doTkHistoMap && aTkMapPointer)
894 HistogramBase::fillTkHistoMap(aTkMapPointer,lDetid,static_cast<float>(nBad)/aPrevTot);
900 const bool FEDErrors::failMonitoringFEDCheck()
902 return ( anyFEDErrors() ||
903 fedErrors_.CorruptBuffer
907 const bool FEDErrors::anyDAQProblems()
909 return ( fedErrors_.DataMissing ||
910 fedErrors_.InvalidBuffers ||
911 fedErrors_.BadFEDCRCs ||
912 fedErrors_.BadDAQCRCs ||
914 fedErrors_.BadDAQPacket
918 const bool FEDErrors::anyFEDErrors()
920 return ( fedErrors_.InvalidBuffers ||
921 fedErrors_.BadFEDCRCs ||
922 fedErrors_.BadDAQCRCs ||
924 fedErrors_.BadDAQPacket ||
925 fedErrors_.FEsOverflow
929 const bool FEDErrors::anyFEProblems()
931 return ( fedErrors_.FEsOverflow ||
932 fedErrors_.FEsMissing ||
933 fedErrors_.FEsBadMajorityAddress
937 const bool FEDErrors::printDebug()
939 return ( anyFEDErrors() ||
941 fedErrors_.CorruptBuffer ||
942 fedErrors_.BadChannelStatusBit
947 const unsigned int FEDErrors::fedID(){
952 FEDErrors::FEDCounters & FEDErrors::getFEDErrorsCounters()
957 FEDErrors::ChannelCounters & FEDErrors::getChannelErrorsCounters()
962 FEDErrors::FECounters & FEDErrors::getFEErrorsCounters()
967 FEDErrors::FEDLevelErrors & FEDErrors::getFEDLevelErrors()
972 FEDErrors::EventProperties & FEDErrors::getEventProperties()
977 std::vector<FEDErrors::FELevelErrors> & FEDErrors::getFELevelErrors()
982 std::vector<FEDErrors::ChannelLevelErrors> & FEDErrors::getChannelLevelErrors()
984 return chErrorsDetailed_;
987 std::vector<FEDErrors::APVLevelErrors> & FEDErrors::getAPVLevelErrors()
992 std::vector<std::pair<unsigned int,bool> > & FEDErrors::getBadChannels()
997 const FEDErrors::LumiErrors & FEDErrors::getLumiErrors(){
1001 void FEDErrors::addBadFE(
const FEDErrors::FELevelErrors & aFE)
1004 fedErrors_.FEsOverflow =
true;
1005 (feCounter_.nFEOverflows)++;
1007 else if (aFE.Missing) {
1008 fedErrors_.FEsMissing =
true;
1009 (feCounter_.nFEMissing)++;
1010 feErrors_.push_back(aFE);
1012 else if (aFE.BadMajorityAddress) {
1013 fedErrors_.FEsBadMajorityAddress =
true;
1014 (feCounter_.nFEBadMajorityAddresses)++;
1015 feErrors_.push_back(aFE);
1017 else if (aFE.TimeDifference != 0) {
1018 feErrors_.push_back(aFE);
1022 void FEDErrors::addBadChannel(
const FEDErrors::ChannelLevelErrors & aChannel)
1024 if (aChannel.Connected) chErrorsDetailed_.push_back(aChannel);
1025 incrementChannelCounters(aChannel);
1028 void FEDErrors::addBadAPV(
const FEDErrors::APVLevelErrors & aAPV,
bool & aFirst)
1030 apvErrors_.push_back(aAPV);
1031 incrementAPVCounters(aAPV);
1032 if (aAPV.APVStatusBit && aFirst) {
1033 fedErrors_.BadChannelStatusBit =
true;
1034 lFedCounter_.nBadChannels++;
1035 chErrors_.push_back(std::pair<unsigned int, bool>(aAPV.ChannelID,aAPV.IsActive));
1036 if (aAPV.IsActive) {
1038 fedErrors_.BadActiveChannelStatusBit =
true;
1039 lFedCounter_.nBadActiveChannels++;
1047 void FEDErrors::incrementFEDCounters()
1049 if (fedErrors_.InvalidBuffers ||
1050 fedErrors_.BadFEDCRCs ||
1051 fedErrors_.BadDAQCRCs ||
1052 fedErrors_.BadIDs ||
1053 fedErrors_.BadDAQPacket
1055 lFedCounter_.nDAQProblems++;
1056 lFedCounter_.nFEDErrors++;
1060 if (fedErrors_.FEsOverflow){
1061 lFedCounter_.nFEDsWithFEOverflows++;
1063 else if (fedErrors_.FEsMissing){
1064 lFedCounter_.nFEDsWithMissingFEs++;
1066 else if (fedErrors_.FEsBadMajorityAddress){
1067 lFedCounter_.nFEDsWithFEBadMajorityAddresses++;
1070 if (fedErrors_.FEsOverflow ||
1071 fedErrors_.FEsBadMajorityAddress ||
1072 fedErrors_.FEsMissing
1074 lFedCounter_.nFEDsWithFEProblems++;
1075 lFedCounter_.nFEDErrors++;
1077 else if (fedErrors_.CorruptBuffer) {
1078 lFedCounter_.nCorruptBuffers++;
1079 lFedCounter_.nFEDErrors++;
1086 void FEDErrors::incrementChannelCounters(
const FEDErrors::ChannelLevelErrors & aChannel)
1088 if (aChannel.Unlocked && aChannel.Connected) lChCounter_.nUnlocked++;
1089 if (aChannel.OutOfSync && aChannel.Connected) lChCounter_.nOutOfSync++;
1090 if (!aChannel.Connected) lChCounter_.nNotConnected++;
1093 void FEDErrors::incrementAPVCounters(
const FEDErrors::APVLevelErrors & aAPV)
1095 if (aAPV.Connected && aAPV.IsActive){
1096 if (aAPV.APVStatusBit) lChCounter_.nAPVStatusBit++;
1097 if (aAPV.APVAddressError) lChCounter_.nAPVAddressError++;
1098 if (aAPV.APVError) lChCounter_.nAPVError++;
1104 if (this->ChannelID < aErr.ChannelID)
return true;
1111 if (this->ChannelID < aErr.ChannelID)
return true;
1116 void FEDErrors::print(
const FEDErrors::FEDCounters & aFEDCounter, std::ostream & aOs)
1120 aOs <<
"[FEDErrors]============================================" << std::endl
1121 <<
"[FEDErrors]==== Printing FEDCounters information : ====" << std::endl
1122 <<
"[FEDErrors]============================================" << std::endl
1123 <<
"[FEDErrors]======== nFEDErrors = " << aFEDCounter.nFEDErrors << std::endl
1124 <<
"[FEDErrors]======== nDAQProblems = " << aFEDCounter.nDAQProblems << std::endl
1125 <<
"[FEDErrors]======== nFEDsWithFEProblems = " << aFEDCounter.nFEDsWithFEProblems << std::endl
1126 <<
"[FEDErrors]======== nCorruptBuffers = " << aFEDCounter.nCorruptBuffers << std::endl
1127 <<
"[FEDErrors]======== nBadChannels = " << aFEDCounter.nBadChannels << std::endl
1128 <<
"[FEDErrors]======== nBadActiveChannels = " << aFEDCounter.nBadActiveChannels << std::endl
1129 <<
"[FEDErrors]======== nFEDsWithFEOverflows = " << aFEDCounter.nFEDsWithFEOverflows << std::endl
1130 <<
"[FEDErrors]======== nFEDsWithFEBadMajorityAddresses = " << aFEDCounter.nFEDsWithFEBadMajorityAddresses << std::endl
1131 <<
"[FEDErrors]======== nFEDsWithMissingFEs = " << aFEDCounter.nFEDsWithMissingFEs << std::endl
1132 <<
"[FEDErrors]======== nTotalBadChannels = " << aFEDCounter.nTotalBadChannels << std::endl
1133 <<
"[FEDErrors]======== nTotalBadActiveChannels = " << aFEDCounter.nTotalBadActiveChannels << std::endl
1134 <<
"[FEDErrors]============================================" << std::endl;
1139 void FEDErrors::print(
const FEDErrors::FECounters & aFECounter, std::ostream & aOs)
1143 aOs <<
"[FEDErrors]============================================" << std::endl
1144 <<
"[FEDErrors]==== Printing FECounters information : ====" << std::endl
1145 <<
"[FEDErrors]============================================" << std::endl
1146 <<
"[FEDErrors]======== nFEOverflows = " << aFECounter.nFEOverflows << std::endl
1147 <<
"[FEDErrors]======== nFEBadMajorityAddresses = " << aFECounter.nFEBadMajorityAddresses << std::endl
1148 <<
"[FEDErrors]======== nFEMissing = " << aFECounter.nFEMissing << std::endl
1149 <<
"[FEDErrors]============================================" << std::endl;
1154 void FEDErrors::print(
const FEDErrors::FEDLevelErrors & aFEDErr, std::ostream & aOs)
1158 aOs <<
"[FEDErrors]============================================" << std::endl
1159 <<
"[FEDErrors]==== Printing FED errors information : ====" << std::endl
1160 <<
"[FEDErrors]============================================" << std::endl
1161 <<
"[FEDErrors]======== HasCabledChannels = " << aFEDErr.HasCabledChannels << std::endl
1162 <<
"[FEDErrors]======== DataPresent = " << aFEDErr.DataPresent << std::endl
1163 <<
"[FEDErrors]======== DataMissing = " << aFEDErr.DataMissing << std::endl
1164 <<
"[FEDErrors]======== InvalidBuffers = " << aFEDErr.InvalidBuffers << std::endl
1165 <<
"[FEDErrors]======== BadFEDCRCs = " << aFEDErr.BadFEDCRCs << std::endl
1166 <<
"[FEDErrors]======== BadDAQCRCs = " << aFEDErr.BadDAQCRCs << std::endl
1167 <<
"[FEDErrors]======== BadIDs = " << aFEDErr.BadIDs << std::endl
1168 <<
"[FEDErrors]======== BadDAQPacket = " << aFEDErr.BadDAQPacket << std::endl
1169 <<
"[FEDErrors]======== CorruptBuffer = " << aFEDErr.CorruptBuffer << std::endl
1170 <<
"[FEDErrors]======== FEOverflows = " << aFEDErr.FEsOverflow << std::endl
1171 <<
"[FEDErrors]======== FEMissing = " << aFEDErr.FEsMissing << std::endl
1172 <<
"[FEDErrors]======== BadMajorityAddresses = " << aFEDErr.FEsBadMajorityAddress << std::endl
1173 <<
"[FEDErrors]============================================" << std::endl;
1177 void FEDErrors::print(
const FEDErrors::FELevelErrors & aErr, std::ostream & aOs)
1181 aOs <<
"[FEDErrors]============================================" << std::endl
1182 <<
"[FEDErrors]==== Printing FE errors information : ====" << std::endl
1183 <<
"[FEDErrors]============================================" << std::endl
1184 <<
"[FEDErrors]======== FE #" << aErr.FeID << std::endl
1185 <<
"[FEDErrors]======== subdet " << aErr.SubDetID << std::endl
1186 <<
"[FEDErrors]======== FEOverflow = " << aErr.Overflow << std::endl
1187 <<
"[FEDErrors]======== FEMissing = " << aErr.Missing << std::endl
1188 <<
"[FEDErrors]======== BadMajorityAddresses = " << aErr.BadMajorityAddress << std::endl
1189 <<
"[FEDErrors]======== TimeDifference = " << aErr.TimeDifference << std::endl
1190 <<
"[FEDErrors]============================================" << std::endl;
1194 void FEDErrors::print(
const FEDErrors::ChannelLevelErrors & aErr, std::ostream & aOs)
1197 aOs <<
"[FEDErrors]=================================================" << std::endl
1198 <<
"[FEDErrors]==== Printing channel errors information : ====" << std::endl
1199 <<
"[FEDErrors]=================================================" << std::endl
1200 <<
"[FEDErrors]============ Channel #" << aErr.ChannelID << std::endl
1201 <<
"[FEDErrors]============ connected = " << aErr.Connected << std::endl
1202 <<
"[FEDErrors]============ isActive = " << aErr.IsActive << std::endl
1203 <<
"[FEDErrors]============ Unlocked = " << aErr.Unlocked << std::endl
1204 <<
"[FEDErrors]============ OutOfSync = " << aErr.OutOfSync << std::endl
1205 <<
"[FEDErrors]=================================================" << std::endl;
1209 void FEDErrors::print(
const FEDErrors::APVLevelErrors & aErr, std::ostream & aOs)
1212 aOs <<
"[FEDErrors]=================================================" << std::endl
1213 <<
"[FEDErrors]==== Printing APV errors information : ====" << std::endl
1214 <<
"[FEDErrors]=================================================" << std::endl
1215 <<
"[FEDErrors]============ APV #" << aErr.APVID << std::endl
1216 <<
"[FEDErrors]============ Channel #" << aErr.ChannelID << std::endl
1217 <<
"[FEDErrors]============ connected = " << aErr.Connected << std::endl
1218 <<
"[FEDErrors]============ isActive = " << aErr.IsActive << std::endl
1219 <<
"[FEDErrors]============ APVStatusBit = " << aErr.APVStatusBit << std::endl
1220 <<
"[FEDErrors]============ APVError = " << aErr.APVError << std::endl
1221 <<
"[FEDErrors]============ APVAddressError = " << aErr.APVAddressError << std::endl
1222 <<
"[FEDErrors]=================================================" << std::endl;
bool checkFEUnitLengths() const
uint8_t apveAddress() const
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
static const uint32_t invalid32_
FEDReadoutMode readoutMode() const
S & print(S &os, JobReport::InputFile const &f)
const FEDFEHeader * feHeader() const
virtual bool channelGood(const uint8_t internalFEDannelNum, const bool doAPVeCheck=true) const
size_t size() const
Lenght of the data buffer in bytes.
uint16_t cmMedian(const uint8_t apvIndex) const
bool fePresent(uint8_t internalFEUnitNum) const
unsigned int tidSide(const DetId &id) const
bool majorityAddressErrorForFEUnit(const uint8_t internalFEUnitNum) const
const uint32_t & detId() const
Class containning control, module, detector and connection information, at the level of a FED channel...
static const uint16_t FEUNITS_PER_FED
bool feEnabled(const uint8_t internalFEUnitNum) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
void dump(std::ostream &os) const
const FEDChannel & channel(const uint8_t internalFEDChannelNum) const
bool checkChannelPacketCodes() const
static const uint8_t timeLocation(const uint8_t aPipelineAddress)
static const uint16_t FEDCH_PER_FEUNIT
const uint16_t & nApvPairs() const
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
bool operator<(DTCELinkId const &lhs, DTCELinkId const &rhs)
bool checkChannelLengthsMatchBufferLength() const
static const uint16_t FEDCH_PER_FED
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
bool feGood(const uint8_t internalFEUnitNum) const
bool feOverflow(const uint8_t internalFEUnitNum) const
unsigned int tecSide(const DetId &id) const