11 #include "DQM/SiStripMonitorHardware/interface/HistogramBase.hh"
12 #include "DQM/SiStripMonitorHardware/interface/FEDErrors.hh"
16 FEDErrors::FEDErrors()
22 FEDErrors::~FEDErrors()
27 void FEDErrors::initialiseLumiBlock() {
28 lumiErr_.nTotal.clear();
29 lumiErr_.nErrors.clear();
32 lumiErr_.nTotal.resize(6,0);
33 lumiErr_.nErrors.resize(6,0);
36 void FEDErrors::initialiseEvent() {
38 failUnpackerFEDCheck_ =
false;
46 FEDCounters & lFedCounter = FEDErrors::getFEDErrorsCounters();
47 lFedCounter.nFEDErrors = 0;
48 lFedCounter.nDAQProblems = 0;
49 lFedCounter.nFEDsWithFEProblems = 0;
50 lFedCounter.nCorruptBuffers = 0;
51 lFedCounter.nBadChannels = 0;
52 lFedCounter.nBadActiveChannels = 0;
53 lFedCounter.nFEDsWithFEOverflows = 0;
54 lFedCounter.nFEDsWithFEBadMajorityAddresses = 0;
55 lFedCounter.nFEDsWithMissingFEs = 0;
56 lFedCounter.nTotalBadChannels = 0;
57 lFedCounter.nTotalBadActiveChannels = 0;
59 ChannelCounters & lChCounter = FEDErrors::getChannelErrorsCounters();
60 lChCounter.nNotConnected = 0;
61 lChCounter.nUnlocked = 0;
62 lChCounter.nOutOfSync = 0;
63 lChCounter.nAPVStatusBit = 0;
64 lChCounter.nAPVError = 0;
65 lChCounter.nAPVAddressError = 0;
67 feCounter_.nFEOverflows = 0;
68 feCounter_.nFEBadMajorityAddresses = 0;
69 feCounter_.nFEMissing = 0;
71 fedErrors_.HasCabledChannels =
false;
72 fedErrors_.DataPresent =
false;
73 fedErrors_.DataMissing =
false;
74 fedErrors_.InvalidBuffers =
false;
75 fedErrors_.BadFEDCRCs =
false;
76 fedErrors_.BadDAQCRCs =
false;
77 fedErrors_.BadIDs =
false;
78 fedErrors_.BadDAQPacket =
false;
79 fedErrors_.CorruptBuffer =
false;
80 fedErrors_.FEsOverflow =
false;
81 fedErrors_.FEsMissing =
false;
82 fedErrors_.FEsBadMajorityAddress =
false;
83 fedErrors_.BadChannelStatusBit =
false;
84 fedErrors_.BadActiveChannelStatusBit =
false;
88 chErrorsDetailed_.clear();
99 void FEDErrors::initialiseFED(
const unsigned int aFedID,
104 failUnpackerFEDCheck_ =
false;
118 for (
unsigned int iCh = 0;
124 detid_[iCh] = lConnection.
detId();
125 nChInModule_[iCh] = lConnection.
nApvPairs();
128 unsigned int lDetid = detid_[iCh];
131 unsigned int lSubid = 6;
141 if (lTidId.side() == 2) lSubid = 4;
153 if (lTecId.side() == 2) lSubid = 1;
163 subDetId_[lFeNumber] = lSubid;
170 feCounter_.nFEOverflows = 0;
171 feCounter_.nFEBadMajorityAddresses = 0;
172 feCounter_.nFEMissing = 0;
174 fedErrors_.HasCabledChannels =
false;
175 fedErrors_.DataPresent =
false;
176 fedErrors_.DataMissing =
false;
177 fedErrors_.InvalidBuffers =
false;
178 fedErrors_.BadFEDCRCs =
false;
179 fedErrors_.BadDAQCRCs =
false;
180 fedErrors_.BadIDs =
false;
181 fedErrors_.BadDAQPacket =
false;
182 fedErrors_.CorruptBuffer =
false;
183 fedErrors_.FEsOverflow =
false;
184 fedErrors_.FEsMissing =
false;
185 fedErrors_.FEsBadMajorityAddress =
false;
186 fedErrors_.BadChannelStatusBit =
false;
187 fedErrors_.BadActiveChannelStatusBit =
false;
191 chErrorsDetailed_.clear();
199 bool FEDErrors::checkDataPresent(
const FEDRawData& aFedData)
202 if (!aFedData.
size() || !aFedData.
data()) {
203 for (
unsigned int iCh = 0;
206 if (connected_[iCh]){
207 fedErrors_.HasCabledChannels =
true;
208 fedErrors_.DataMissing =
true;
212 fedErrors_.DataMissing =
true;
213 fedErrors_.HasCabledChannels =
false;
216 fedErrors_.DataPresent =
true;
217 for (
unsigned int iCh = 0;
220 if (connected_[iCh]){
221 fedErrors_.HasCabledChannels =
true;
230 bool FEDErrors::failUnpackerFEDCheck()
232 return failUnpackerFEDCheck_;
236 bool FEDErrors::fillFatalFEDErrors(
const FEDRawData& aFedData,
237 const unsigned int aPrintDebug)
240 std::auto_ptr<const sistrip::FEDBufferBase> bufferBase;
244 fedErrors_.InvalidBuffers =
true;
245 failUnpackerFEDCheck_ =
true;
252 if (!bufferBase->checkNoSlinkCRCError()) {
253 fedErrors_.BadFEDCRCs =
true;
255 }
else if (!bufferBase->checkCRC()) {
256 failUnpackerFEDCheck_ =
true;
257 fedErrors_.BadDAQCRCs =
true;
262 if (!bufferBase->checkSourceIDs() || !bufferBase->checkNoUnexpectedSourceID()) {
263 fedErrors_.BadIDs =
true;
268 else if (!bufferBase->doDAQHeaderAndTrailerChecks()) {
269 failUnpackerFEDCheck_ =
true;
270 fedErrors_.BadDAQPacket =
true;
276 if ( !(bufferBase->checkBufferFormat() &&
277 bufferBase->checkHeaderType() &&
278 bufferBase->checkReadoutMode()) ) {
279 failUnpackerFEDCheck_ =
true;
280 fedErrors_.InvalidBuffers =
true;
282 if (!
printDebug() || aPrintDebug<3 )
return false;
286 if (!bufferBase->checkNoFEOverflows()) {
287 failUnpackerFEDCheck_ =
true;
288 fedErrors_.FEsOverflow =
true;
290 if (!
printDebug() || aPrintDebug<3 )
return false;
303 fedErrors_.CorruptBuffer =
true;
315 unsigned int lBadChans = 0;
316 unsigned int lTotChans = 0;
318 bool lIsConnected =
false;
323 else lIsConnected = connected_[iCh];
325 if (!lIsConnected)
continue;
330 return static_cast<float>(lBadChans*1.0/lTotChans);
334 bool FEDErrors::fillFEDErrors(
const FEDRawData& aFedData,
336 const unsigned int aPrintDebug,
337 unsigned int & aCounterMonitoring,
338 unsigned int & aCounterUnpacker,
343 std::vector<std::vector<std::pair<unsigned int,unsigned int> > > & aFeMajFrac
349 if (!fillFatalFEDErrors(aFedData,aPrintDebug))
return false;
352 std::auto_ptr<const sistrip::FEDBuffer> buffer;
356 if (!buffer->checkChannelLengths()) failUnpackerFEDCheck_=
true;
359 if (!this->anyFEDErrors()) {
361 bool lCorruptCheck = fillCorruptBuffer(buffer.get());
362 if (aPrintDebug>1 && !lCorruptCheck) {
364 <<
"CorruptBuffer check failed for FED " << fedID_
366 <<
" -- buffer->checkChannelLengthsMatchBufferLength() = " << buffer->checkChannelLengthsMatchBufferLength()
368 <<
" -- buffer->checkChannelPacketCodes() = " << buffer->checkChannelPacketCodes()
370 <<
" -- buffer->checkFEUnitLengths() = " << buffer->checkFEUnitLengths()
378 fillFEErrors(buffer.get(),aDoFEMaj,aFeMajFrac);
381 fillChannelErrors(buffer.get(),
397 if (buffer.get()) debugBuffer = buffer.get();
400 std::vector<FEDErrors::APVLevelErrors> & lChVec = getAPVLevelErrors();
401 std::ostringstream debugStream;
404 debugStream <<
"[FEDErrors] Cabled channels which had errors: ";
406 for (
unsigned int iBadCh(0); iBadCh < lChVec.size(); iBadCh++) {
407 print(lChVec[iBadCh],debugStream);
409 debugStream << std::endl;
410 debugStream <<
"[FEDErrors] Active (have been locked in at least one event) cabled channels which had errors: ";
411 for (
unsigned int iBadCh(0); iBadCh < lChVec.size(); iBadCh++) {
412 if ((lChVec[iBadCh]).IsActive)
print(lChVec[iBadCh],debugStream);
416 debugStream << (*debugBuffer) << std::endl;
417 debugBuffer->
dump(debugStream);
418 debugStream << std::endl;
419 edm::LogInfo(
"SiStripMonitorHardware") <<
"[FEDErrors] Errors found in FED " << fedID_;
424 return !(anyFEDErrors());
429 std::vector<std::vector<std::pair<unsigned int,unsigned int> > > & aFeMajFrac)
431 bool foundOverflow =
false;
432 bool foundBadMajority =
false;
433 bool foundMissing =
false;
436 FEDErrors::FELevelErrors lFeErr;
438 lFeErr.SubDetID = subDetId_[iFE];
439 lFeErr.Overflow =
false;
440 lFeErr.Missing =
false;
441 lFeErr.BadMajorityAddress =
false;
442 lFeErr.TimeDifference = 0;
446 bool hasCabledChannels =
false;
448 if (connected_[iFE*sistrip::FEDCH_PER_FEUNIT+feUnitCh]) {
449 hasCabledChannels =
true;
454 if (!hasCabledChannels)
continue;
457 lFeErr.Overflow =
true;
458 foundOverflow =
true;
468 lFeErr.Missing =
true;
480 lFeErr.BadMajorityAddress =
true;
481 foundBadMajority =
true;
524 if (lFeErr.SubDetID == 2 || lFeErr.SubDetID == 3 || lFeErr.SubDetID == 4)
525 aFeMajFrac[0].push_back(std::pair<unsigned int, unsigned int>(fedID_,lFeErr.FeMaj));
526 else if (lFeErr.SubDetID == 5)
527 aFeMajFrac[1].push_back(std::pair<unsigned int, unsigned int>(fedID_,lFeErr.FeMaj));
528 else if (lFeErr.SubDetID == 0)
529 aFeMajFrac[2].push_back(std::pair<unsigned int, unsigned int>(fedID_,lFeErr.FeMaj));
530 else if (lFeErr.SubDetID == 1)
531 aFeMajFrac[3].push_back(std::pair<unsigned int, unsigned int>(fedID_,lFeErr.FeMaj));
536 lFeErr.TimeDifference =
543 if (foundBadMajority || lFeErr.TimeDifference != 0){
566 return !(foundOverflow || foundMissing || foundBadMajority);
571 const unsigned int aPrintDebug,
572 unsigned int & aCounterMonitoring,
573 unsigned int & aCounterUnpacker,
579 bool foundError =
false;
584 aFullDebug = debugHeader;
590 bool lPassedMonitoringFEDcheck = !fedErrors_.CorruptBuffer;
594 bool lFailUnpackerChannelCheck = (!aBuffer->
channelGood(iCh) && connected_[iCh]) || failUnpackerFEDCheck_;
595 bool lFailMonitoringChannelCheck = !lPassedMonitoringFEDcheck && connected_[iCh];
598 FEDErrors::ChannelLevelErrors lChErr;
599 lChErr.ChannelID = iCh;
600 lChErr.Connected = connected_[iCh];
601 lChErr.IsActive =
false;
602 lChErr.Unlocked =
false;
603 lChErr.OutOfSync =
false;
605 if (!connected_[iCh]) {
607 addBadChannel(lChErr);
611 if (!aBuffer->
feGood(static_cast<unsigned int>(iCh/sistrip::FEDCH_PER_FEUNIT))) {
612 lFailMonitoringChannelCheck =
true;
617 bool apvBad[2] = {
false,
false};
636 !(lStatus & sistrip::CHANNEL_STATUS_IN_SYNC) ||
641 lChErr.IsActive =
true;
644 if (!(lStatus & sistrip::CHANNEL_STATUS_IN_SYNC)) {
645 lChErr.OutOfSync =
true;
649 lChErr.Unlocked =
true;
655 if (!apvBad[0] && !apvBad[1]) {
656 lChErr.IsActive =
true;
661 if (lChErr.Unlocked || lChErr.OutOfSync) addBadChannel(lChErr);
668 for (
unsigned int iAPV = 0; iAPV < 2; iAPV++) {
670 FEDErrors::APVLevelErrors lAPVErr;
671 lAPVErr.APVID = 2*iCh+iAPV;
672 lAPVErr.ChannelID = iCh;
673 lAPVErr.Connected = connected_[iCh];
674 lAPVErr.IsActive = lChErr.IsActive;
675 lAPVErr.APVStatusBit =
false;
676 lAPVErr.APVError =
false;
677 lAPVErr.APVAddressError =
false;
681 lFailMonitoringChannelCheck =
true;
682 lAPVErr.APVStatusBit =
true;
686 if (debugHeader && !lChErr.Unlocked && !lChErr.OutOfSync) {
688 if ( (iAPV==0 && !(lStatus & sistrip::CHANNEL_STATUS_APV0_NO_ERROR_BIT)) ||
689 (iAPV==1 && !(lStatus & sistrip::CHANNEL_STATUS_APV1_NO_ERROR_BIT))) {
690 lAPVErr.APVError =
true;
695 lAPVErr.APVAddressError =
true;
699 if ( lAPVErr.APVStatusBit ||
701 lAPVErr.APVAddressError
702 ) addBadAPV(lAPVErr, lFirst);
709 if (lFailUnpackerChannelCheck != lFailMonitoringChannelCheck && connected_[iCh]){
711 std::ostringstream debugStream;
712 debugStream <<
"[FEDErrors] ------ WARNING: FED " << fedID_ <<
", channel " << iCh
713 <<
", isConnected = " << connected_[iCh] << std::endl
714 <<
"[FEDErrors] --------- Monitoring Channel check " ;
715 if (lFailMonitoringChannelCheck) debugStream <<
"failed." << std::endl;
716 else debugStream <<
"passed." << std::endl ;
717 debugStream <<
"[FEDErrors] --------- Unpacker Channel check " ;
718 if (lFailUnpackerChannelCheck) debugStream <<
"failed." << std::endl;
719 else debugStream <<
"passed." << std::endl;
720 debugStream <<
"[FEDErrors] --------- fegood = "
721 << aBuffer->
feGood(static_cast<unsigned int>(iCh/sistrip::FEDCH_PER_FEUNIT))
723 <<
"[FEDErrors] --------- unpacker FED check = " << failUnpackerFEDCheck_ << std::endl;
724 edm::LogError(
"SiStripMonitorHardware") << debugStream.str();
727 if (lFailMonitoringChannelCheck) aCounterMonitoring++;
728 if (lFailUnpackerChannelCheck) aCounterUnpacker++;
731 if (lMedValid && !foundError && lPassedMonitoringFEDcheck && aDoMeds) {
735 HistogramBase::fillHistogram(aMedianHist0,
737 HistogramBase::fillHistogram(aMedianHist1,
747 void FEDErrors::fillBadChannelList(
const bool doTkHistoMap,
750 unsigned int & aNBadChannels,
751 unsigned int & aNBadActiveChannels)
754 uint32_t lPrevId = 0;
756 uint16_t lPrevTot = 0;
757 bool hasBeenProcessed =
false;
758 bool lFailFED = failMonitoringFEDCheck();
760 for (
unsigned int iCh = 0;
764 if (!connected_[iCh])
continue;
768 lPrevId = detid_[iCh];
769 lPrevTot = nChInModule_[iCh];
774 bool isBadFE =
false;
775 bool isMissingFE =
false;
777 for (
unsigned int badfe(0); badfe<feErrors_.size(); badfe++) {
778 if ((feErrors_[badfe]).FeID == feNumber) {
780 if ((feErrors_[badfe]).Missing) isMissingFE =
true;
785 bool isBadChan =
false;
786 bool isActiveChan =
false;
797 bool isBadApv1 =
false;
798 bool isBadApv2 =
false;
799 for (
unsigned int badApv(0); badApv<apvErrors_.size(); badApv++) {
800 if ((apvErrors_[badApv]).ChannelID == iCh) {
802 if (apvErrors_[badApv].IsActive) isActiveChan =
true;
804 if (apvErrors_[badApv].APVID == 2 * iCh ) isBadApv1 =
true;
805 if (apvErrors_[badApv].APVID == 2 * iCh + 1 )
813 if (detid_[iCh] == lPrevId){
814 if (hasBeenProcessed) hasBeenProcessed =
false;
817 if (detid_[iCh] != lPrevId){
824 lPrevId = detid_[iCh];
825 lPrevTot = nChInModule_[iCh];
826 hasBeenProcessed =
true;
829 bool lHasErr = lFailFED || isBadFE || isBadChan;
830 incrementLumiErrors(lHasErr,subDetId_[feNumber]);
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.size())
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
939 return ( anyFEDErrors() ||
941 fedErrors_.CorruptBuffer ||
942 fedErrors_.BadChannelStatusBit
947 const unsigned int FEDErrors::fedID(){
952 FEDErrors::FEDCounters & FEDErrors::getFEDErrorsCounters()
954 static FEDCounters lFedCounter;
958 FEDErrors::ChannelCounters & FEDErrors::getChannelErrorsCounters()
960 static ChannelCounters lChCounter;
964 FEDErrors::FECounters & FEDErrors::getFEErrorsCounters()
969 FEDErrors::FEDLevelErrors & FEDErrors::getFEDLevelErrors()
974 FEDErrors::EventProperties & FEDErrors::getEventProperties()
979 std::vector<FEDErrors::FELevelErrors> & FEDErrors::getFELevelErrors()
984 std::vector<FEDErrors::ChannelLevelErrors> & FEDErrors::getChannelLevelErrors()
986 return chErrorsDetailed_;
989 std::vector<FEDErrors::APVLevelErrors> & FEDErrors::getAPVLevelErrors()
994 std::vector<std::pair<unsigned int,bool> > & FEDErrors::getBadChannels()
999 const FEDErrors::LumiErrors & FEDErrors::getLumiErrors(){
1003 void FEDErrors::addBadFE(
const FEDErrors::FELevelErrors & aFE)
1006 fedErrors_.FEsOverflow =
true;
1007 (feCounter_.nFEOverflows)++;
1009 else if (aFE.Missing) {
1010 fedErrors_.FEsMissing =
true;
1011 (feCounter_.nFEMissing)++;
1012 feErrors_.push_back(aFE);
1014 else if (aFE.BadMajorityAddress) {
1015 fedErrors_.FEsBadMajorityAddress =
true;
1016 (feCounter_.nFEBadMajorityAddresses)++;
1017 feErrors_.push_back(aFE);
1019 else if (aFE.TimeDifference != 0) {
1020 feErrors_.push_back(aFE);
1024 void FEDErrors::addBadChannel(
const FEDErrors::ChannelLevelErrors & aChannel)
1026 if (aChannel.Connected) chErrorsDetailed_.push_back(aChannel);
1027 incrementChannelCounters(aChannel);
1030 void FEDErrors::addBadAPV(
const FEDErrors::APVLevelErrors & aAPV,
bool & aFirst)
1032 apvErrors_.push_back(aAPV);
1033 incrementAPVCounters(aAPV);
1034 if (aAPV.APVStatusBit && aFirst) {
1035 fedErrors_.BadChannelStatusBit =
true;
1036 (FEDErrors::getFEDErrorsCounters().nBadChannels)++;
1037 chErrors_.push_back(std::pair<unsigned int, bool>(aAPV.ChannelID,aAPV.IsActive));
1038 if (aAPV.IsActive) {
1040 fedErrors_.BadActiveChannelStatusBit =
true;
1041 (FEDErrors::getFEDErrorsCounters().nBadActiveChannels)++;
1049 void FEDErrors::incrementFEDCounters()
1051 if (fedErrors_.InvalidBuffers ||
1052 fedErrors_.BadFEDCRCs ||
1053 fedErrors_.BadDAQCRCs ||
1054 fedErrors_.BadIDs ||
1055 fedErrors_.BadDAQPacket
1057 (FEDErrors::getFEDErrorsCounters().nDAQProblems)++;
1058 (FEDErrors::getFEDErrorsCounters().nFEDErrors)++;
1062 if (fedErrors_.FEsOverflow){
1063 (FEDErrors::getFEDErrorsCounters().nFEDsWithFEOverflows)++;
1065 else if (fedErrors_.FEsMissing){
1066 (FEDErrors::getFEDErrorsCounters().nFEDsWithMissingFEs)++;
1068 else if (fedErrors_.FEsBadMajorityAddress){
1069 (FEDErrors::getFEDErrorsCounters().nFEDsWithFEBadMajorityAddresses)++;
1072 if (fedErrors_.FEsOverflow ||
1073 fedErrors_.FEsBadMajorityAddress ||
1074 fedErrors_.FEsMissing
1076 (FEDErrors::getFEDErrorsCounters().nFEDsWithFEProblems)++;
1077 (FEDErrors::getFEDErrorsCounters().nFEDErrors)++;
1079 else if (fedErrors_.CorruptBuffer) {
1080 (FEDErrors::getFEDErrorsCounters().nCorruptBuffers)++;
1081 (FEDErrors::getFEDErrorsCounters().nFEDErrors)++;
1088 void FEDErrors::incrementChannelCounters(
const FEDErrors::ChannelLevelErrors & aChannel)
1090 if (aChannel.Unlocked && aChannel.Connected) (FEDErrors::getChannelErrorsCounters().nUnlocked)++;
1091 if (aChannel.OutOfSync && aChannel.Connected) (FEDErrors::getChannelErrorsCounters().nOutOfSync)++;
1092 if (!aChannel.Connected) (FEDErrors::getChannelErrorsCounters().nNotConnected)++;
1095 void FEDErrors::incrementAPVCounters(
const FEDErrors::APVLevelErrors & aAPV)
1097 if (aAPV.Connected && aAPV.IsActive){
1098 if (aAPV.APVStatusBit) (FEDErrors::getChannelErrorsCounters().nAPVStatusBit)++;
1099 if (aAPV.APVAddressError) (FEDErrors::getChannelErrorsCounters().nAPVAddressError)++;
1100 if (aAPV.APVError) (FEDErrors::getChannelErrorsCounters().nAPVError)++;
1106 if (this->ChannelID < aErr.ChannelID)
return true;
1113 if (this->ChannelID < aErr.ChannelID)
return true;
1118 void FEDErrors::print(
const FEDErrors::FEDCounters & aFEDCounter, std::ostream & aOs)
1122 aOs <<
"[FEDErrors]============================================" << std::endl
1123 <<
"[FEDErrors]==== Printing FEDCounters information : ====" << std::endl
1124 <<
"[FEDErrors]============================================" << std::endl
1125 <<
"[FEDErrors]======== nFEDErrors = " << aFEDCounter.nFEDErrors << std::endl
1126 <<
"[FEDErrors]======== nDAQProblems = " << aFEDCounter.nDAQProblems << std::endl
1127 <<
"[FEDErrors]======== nFEDsWithFEProblems = " << aFEDCounter.nFEDsWithFEProblems << std::endl
1128 <<
"[FEDErrors]======== nCorruptBuffers = " << aFEDCounter.nCorruptBuffers << std::endl
1129 <<
"[FEDErrors]======== nBadChannels = " << aFEDCounter.nBadChannels << std::endl
1130 <<
"[FEDErrors]======== nBadActiveChannels = " << aFEDCounter.nBadActiveChannels << std::endl
1131 <<
"[FEDErrors]======== nFEDsWithFEOverflows = " << aFEDCounter.nFEDsWithFEOverflows << std::endl
1132 <<
"[FEDErrors]======== nFEDsWithFEBadMajorityAddresses = " << aFEDCounter.nFEDsWithFEBadMajorityAddresses << std::endl
1133 <<
"[FEDErrors]======== nFEDsWithMissingFEs = " << aFEDCounter.nFEDsWithMissingFEs << std::endl
1134 <<
"[FEDErrors]======== nTotalBadChannels = " << aFEDCounter.nTotalBadChannels << std::endl
1135 <<
"[FEDErrors]======== nTotalBadActiveChannels = " << aFEDCounter.nTotalBadActiveChannels << std::endl
1136 <<
"[FEDErrors]============================================" << std::endl;
1141 void FEDErrors::print(
const FEDErrors::FECounters & aFECounter, std::ostream & aOs)
1145 aOs <<
"[FEDErrors]============================================" << std::endl
1146 <<
"[FEDErrors]==== Printing FECounters information : ====" << std::endl
1147 <<
"[FEDErrors]============================================" << std::endl
1148 <<
"[FEDErrors]======== nFEOverflows = " << aFECounter.nFEOverflows << std::endl
1149 <<
"[FEDErrors]======== nFEBadMajorityAddresses = " << aFECounter.nFEBadMajorityAddresses << std::endl
1150 <<
"[FEDErrors]======== nFEMissing = " << aFECounter.nFEMissing << std::endl
1151 <<
"[FEDErrors]============================================" << std::endl;
1156 void FEDErrors::print(
const FEDErrors::FEDLevelErrors & aFEDErr, std::ostream & aOs)
1160 aOs <<
"[FEDErrors]============================================" << std::endl
1161 <<
"[FEDErrors]==== Printing FED errors information : ====" << std::endl
1162 <<
"[FEDErrors]============================================" << std::endl
1163 <<
"[FEDErrors]======== HasCabledChannels = " << aFEDErr.HasCabledChannels << std::endl
1164 <<
"[FEDErrors]======== DataPresent = " << aFEDErr.DataPresent << std::endl
1165 <<
"[FEDErrors]======== DataMissing = " << aFEDErr.DataMissing << std::endl
1166 <<
"[FEDErrors]======== InvalidBuffers = " << aFEDErr.InvalidBuffers << std::endl
1167 <<
"[FEDErrors]======== BadFEDCRCs = " << aFEDErr.BadFEDCRCs << std::endl
1168 <<
"[FEDErrors]======== BadDAQCRCs = " << aFEDErr.BadDAQCRCs << std::endl
1169 <<
"[FEDErrors]======== BadIDs = " << aFEDErr.BadIDs << std::endl
1170 <<
"[FEDErrors]======== BadDAQPacket = " << aFEDErr.BadDAQPacket << std::endl
1171 <<
"[FEDErrors]======== CorruptBuffer = " << aFEDErr.CorruptBuffer << std::endl
1172 <<
"[FEDErrors]======== FEOverflows = " << aFEDErr.FEsOverflow << std::endl
1173 <<
"[FEDErrors]======== FEMissing = " << aFEDErr.FEsMissing << std::endl
1174 <<
"[FEDErrors]======== BadMajorityAddresses = " << aFEDErr.FEsBadMajorityAddress << std::endl
1175 <<
"[FEDErrors]============================================" << std::endl;
1179 void FEDErrors::print(
const FEDErrors::FELevelErrors & aErr, std::ostream & aOs)
1183 aOs <<
"[FEDErrors]============================================" << std::endl
1184 <<
"[FEDErrors]==== Printing FE errors information : ====" << std::endl
1185 <<
"[FEDErrors]============================================" << std::endl
1186 <<
"[FEDErrors]======== FE #" << aErr.FeID << std::endl
1187 <<
"[FEDErrors]======== subdet " << aErr.SubDetID << std::endl
1188 <<
"[FEDErrors]======== FEOverflow = " << aErr.Overflow << std::endl
1189 <<
"[FEDErrors]======== FEMissing = " << aErr.Missing << std::endl
1190 <<
"[FEDErrors]======== BadMajorityAddresses = " << aErr.BadMajorityAddress << std::endl
1191 <<
"[FEDErrors]======== TimeDifference = " << aErr.TimeDifference << std::endl
1192 <<
"[FEDErrors]============================================" << std::endl;
1196 void FEDErrors::print(
const FEDErrors::ChannelLevelErrors & aErr, std::ostream & aOs)
1199 aOs <<
"[FEDErrors]=================================================" << std::endl
1200 <<
"[FEDErrors]==== Printing channel errors information : ====" << std::endl
1201 <<
"[FEDErrors]=================================================" << std::endl
1202 <<
"[FEDErrors]============ Channel #" << aErr.ChannelID << std::endl
1203 <<
"[FEDErrors]============ connected = " << aErr.Connected << std::endl
1204 <<
"[FEDErrors]============ isActive = " << aErr.IsActive << std::endl
1205 <<
"[FEDErrors]============ Unlocked = " << aErr.Unlocked << std::endl
1206 <<
"[FEDErrors]============ OutOfSync = " << aErr.OutOfSync << std::endl
1207 <<
"[FEDErrors]=================================================" << std::endl;
1211 void FEDErrors::print(
const FEDErrors::APVLevelErrors & aErr, std::ostream & aOs)
1214 aOs <<
"[FEDErrors]=================================================" << std::endl
1215 <<
"[FEDErrors]==== Printing APV errors information : ====" << std::endl
1216 <<
"[FEDErrors]=================================================" << std::endl
1217 <<
"[FEDErrors]============ APV #" << aErr.APVID << std::endl
1218 <<
"[FEDErrors]============ Channel #" << aErr.ChannelID << std::endl
1219 <<
"[FEDErrors]============ connected = " << aErr.Connected << std::endl
1220 <<
"[FEDErrors]============ isActive = " << aErr.IsActive << std::endl
1221 <<
"[FEDErrors]============ APVStatusBit = " << aErr.APVStatusBit << std::endl
1222 <<
"[FEDErrors]============ APVError = " << aErr.APVError << std::endl
1223 <<
"[FEDErrors]============ APVAddressError = " << aErr.APVAddressError << std::endl
1224 <<
"[FEDErrors]=================================================" << std::endl;
bool checkFEUnitLengths() const
uint8_t apveAddress() const
static const uint32_t invalid32_
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
FEDReadoutMode readoutMode() const
const FedChannelConnection & connection(uint16_t fed_id, uint16_t fed_ch) const
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 operator<(const FedChannelConnection &, const FedChannelConnection &)
bool fePresent(uint8_t internalFEUnitNum) 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
void dump(std::ostream &os) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
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 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