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,
105 failUnpackerFEDCheck_ =
false;
119 for (
unsigned int iCh = 0;
125 detid_[iCh] = lConnection.
detId();
126 nChInModule_[iCh] = lConnection.
nApvPairs();
129 unsigned int lDetid = detid_[iCh];
132 unsigned int lSubid = 6;
142 if (tTopo->
tidSide(lDetid) == 2) lSubid = 4;
154 if (tTopo->
tecSide(lDetid) == 2) lSubid = 1;
164 subDetId_[lFeNumber] = lSubid;
171 feCounter_.nFEOverflows = 0;
172 feCounter_.nFEBadMajorityAddresses = 0;
173 feCounter_.nFEMissing = 0;
175 fedErrors_.HasCabledChannels =
false;
176 fedErrors_.DataPresent =
false;
177 fedErrors_.DataMissing =
false;
178 fedErrors_.InvalidBuffers =
false;
179 fedErrors_.BadFEDCRCs =
false;
180 fedErrors_.BadDAQCRCs =
false;
181 fedErrors_.BadIDs =
false;
182 fedErrors_.BadDAQPacket =
false;
183 fedErrors_.CorruptBuffer =
false;
184 fedErrors_.FEsOverflow =
false;
185 fedErrors_.FEsMissing =
false;
186 fedErrors_.FEsBadMajorityAddress =
false;
187 fedErrors_.BadChannelStatusBit =
false;
188 fedErrors_.BadActiveChannelStatusBit =
false;
192 chErrorsDetailed_.clear();
200 bool FEDErrors::checkDataPresent(
const FEDRawData& aFedData)
203 if (!aFedData.
size() || !aFedData.
data()) {
204 for (
unsigned int iCh = 0;
207 if (connected_[iCh]){
208 fedErrors_.HasCabledChannels =
true;
209 fedErrors_.DataMissing =
true;
213 fedErrors_.DataMissing =
true;
214 fedErrors_.HasCabledChannels =
false;
217 fedErrors_.DataPresent =
true;
218 for (
unsigned int iCh = 0;
221 if (connected_[iCh]){
222 fedErrors_.HasCabledChannels =
true;
231 bool FEDErrors::failUnpackerFEDCheck()
233 return failUnpackerFEDCheck_;
237 bool FEDErrors::fillFatalFEDErrors(
const FEDRawData& aFedData,
238 const unsigned int aPrintDebug)
241 std::auto_ptr<const sistrip::FEDBufferBase> bufferBase;
245 fedErrors_.InvalidBuffers =
true;
246 failUnpackerFEDCheck_ =
true;
253 if (!bufferBase->checkNoSlinkCRCError()) {
254 fedErrors_.BadFEDCRCs =
true;
256 }
else if (!bufferBase->checkCRC()) {
257 failUnpackerFEDCheck_ =
true;
258 fedErrors_.BadDAQCRCs =
true;
263 if (!bufferBase->checkSourceIDs() || !bufferBase->checkNoUnexpectedSourceID()) {
264 fedErrors_.BadIDs =
true;
269 else if (!bufferBase->doDAQHeaderAndTrailerChecks()) {
270 failUnpackerFEDCheck_ =
true;
271 fedErrors_.BadDAQPacket =
true;
277 if ( !(bufferBase->checkBufferFormat() &&
278 bufferBase->checkHeaderType() &&
279 bufferBase->checkReadoutMode()) ) {
280 failUnpackerFEDCheck_ =
true;
281 fedErrors_.InvalidBuffers =
true;
283 if (!
printDebug() || aPrintDebug<3 )
return false;
287 if (!bufferBase->checkNoFEOverflows()) {
288 failUnpackerFEDCheck_ =
true;
289 fedErrors_.FEsOverflow =
true;
291 if (!
printDebug() || aPrintDebug<3 )
return false;
304 fedErrors_.CorruptBuffer =
true;
316 unsigned int lBadChans = 0;
317 unsigned int lTotChans = 0;
319 bool lIsConnected =
false;
324 else lIsConnected = connected_[iCh];
326 if (!lIsConnected)
continue;
331 return static_cast<float>(lBadChans*1.0/lTotChans);
335 bool FEDErrors::fillFEDErrors(
const FEDRawData& aFedData,
337 const unsigned int aPrintDebug,
338 unsigned int & aCounterMonitoring,
339 unsigned int & aCounterUnpacker,
344 std::vector<std::vector<std::pair<unsigned int,unsigned int> > > & aFeMajFrac
350 if (!fillFatalFEDErrors(aFedData,aPrintDebug))
return false;
353 std::auto_ptr<const sistrip::FEDBuffer> buffer;
357 if (!buffer->checkChannelLengths()) failUnpackerFEDCheck_=
true;
360 if (!this->anyFEDErrors()) {
362 bool lCorruptCheck = fillCorruptBuffer(buffer.get());
363 if (aPrintDebug>1 && !lCorruptCheck) {
365 <<
"CorruptBuffer check failed for FED " << fedID_
367 <<
" -- buffer->checkChannelLengthsMatchBufferLength() = " << buffer->checkChannelLengthsMatchBufferLength()
369 <<
" -- buffer->checkChannelPacketCodes() = " << buffer->checkChannelPacketCodes()
371 <<
" -- buffer->checkFEUnitLengths() = " << buffer->checkFEUnitLengths()
379 fillFEErrors(buffer.get(),aDoFEMaj,aFeMajFrac);
382 fillChannelErrors(buffer.get(),
398 if (buffer.get()) debugBuffer = buffer.get();
401 std::vector<FEDErrors::APVLevelErrors> & lChVec = getAPVLevelErrors();
402 std::ostringstream debugStream;
405 debugStream <<
"[FEDErrors] Cabled channels which had errors: ";
407 for (
unsigned int iBadCh(0); iBadCh < lChVec.size(); iBadCh++) {
408 print(lChVec[iBadCh],debugStream);
410 debugStream << std::endl;
411 debugStream <<
"[FEDErrors] Active (have been locked in at least one event) cabled channels which had errors: ";
412 for (
unsigned int iBadCh(0); iBadCh < lChVec.size(); iBadCh++) {
413 if ((lChVec[iBadCh]).IsActive)
print(lChVec[iBadCh],debugStream);
417 debugStream << (*debugBuffer) << std::endl;
418 debugBuffer->
dump(debugStream);
419 debugStream << std::endl;
420 edm::LogInfo(
"SiStripMonitorHardware") <<
"[FEDErrors] Errors found in FED " << fedID_;
425 return !(anyFEDErrors());
430 std::vector<std::vector<std::pair<unsigned int,unsigned int> > > & aFeMajFrac)
432 bool foundOverflow =
false;
433 bool foundBadMajority =
false;
434 bool foundMissing =
false;
437 FEDErrors::FELevelErrors lFeErr;
439 lFeErr.SubDetID = subDetId_[iFE];
440 lFeErr.Overflow =
false;
441 lFeErr.Missing =
false;
442 lFeErr.BadMajorityAddress =
false;
443 lFeErr.TimeDifference = 0;
447 bool hasCabledChannels =
false;
449 if (connected_[iFE*sistrip::FEDCH_PER_FEUNIT+feUnitCh]) {
450 hasCabledChannels =
true;
455 if (!hasCabledChannels)
continue;
458 lFeErr.Overflow =
true;
459 foundOverflow =
true;
469 lFeErr.Missing =
true;
481 lFeErr.BadMajorityAddress =
true;
482 foundBadMajority =
true;
525 if (lFeErr.SubDetID == 2 || lFeErr.SubDetID == 3 || lFeErr.SubDetID == 4)
526 aFeMajFrac[0].push_back(std::pair<unsigned int, unsigned int>(fedID_,lFeErr.FeMaj));
527 else if (lFeErr.SubDetID == 5)
528 aFeMajFrac[1].push_back(std::pair<unsigned int, unsigned int>(fedID_,lFeErr.FeMaj));
529 else if (lFeErr.SubDetID == 0)
530 aFeMajFrac[2].push_back(std::pair<unsigned int, unsigned int>(fedID_,lFeErr.FeMaj));
531 else if (lFeErr.SubDetID == 1)
532 aFeMajFrac[3].push_back(std::pair<unsigned int, unsigned int>(fedID_,lFeErr.FeMaj));
537 lFeErr.TimeDifference =
544 if (foundBadMajority || lFeErr.TimeDifference != 0){
567 return !(foundOverflow || foundMissing || foundBadMajority);
572 const unsigned int aPrintDebug,
573 unsigned int & aCounterMonitoring,
574 unsigned int & aCounterUnpacker,
580 bool foundError =
false;
585 aFullDebug = debugHeader;
591 bool lPassedMonitoringFEDcheck = !fedErrors_.CorruptBuffer;
595 bool lFailUnpackerChannelCheck = (!aBuffer->
channelGood(iCh) && connected_[iCh]) || failUnpackerFEDCheck_;
596 bool lFailMonitoringChannelCheck = !lPassedMonitoringFEDcheck && connected_[iCh];
599 FEDErrors::ChannelLevelErrors lChErr;
600 lChErr.ChannelID = iCh;
601 lChErr.Connected = connected_[iCh];
602 lChErr.IsActive =
false;
603 lChErr.Unlocked =
false;
604 lChErr.OutOfSync =
false;
606 if (!connected_[iCh]) {
608 addBadChannel(lChErr);
612 if (!aBuffer->
feGood(static_cast<unsigned int>(iCh/sistrip::FEDCH_PER_FEUNIT))) {
613 lFailMonitoringChannelCheck =
true;
618 bool apvBad[2] = {
false,
false};
637 !(lStatus & sistrip::CHANNEL_STATUS_IN_SYNC) ||
642 lChErr.IsActive =
true;
645 if (!(lStatus & sistrip::CHANNEL_STATUS_IN_SYNC)) {
646 lChErr.OutOfSync =
true;
650 lChErr.Unlocked =
true;
656 if (!apvBad[0] && !apvBad[1]) {
657 lChErr.IsActive =
true;
662 if (lChErr.Unlocked || lChErr.OutOfSync) addBadChannel(lChErr);
669 for (
unsigned int iAPV = 0; iAPV < 2; iAPV++) {
671 FEDErrors::APVLevelErrors lAPVErr;
672 lAPVErr.APVID = 2*iCh+iAPV;
673 lAPVErr.ChannelID = iCh;
674 lAPVErr.Connected = connected_[iCh];
675 lAPVErr.IsActive = lChErr.IsActive;
676 lAPVErr.APVStatusBit =
false;
677 lAPVErr.APVError =
false;
678 lAPVErr.APVAddressError =
false;
682 lFailMonitoringChannelCheck =
true;
683 lAPVErr.APVStatusBit =
true;
687 if (debugHeader && !lChErr.Unlocked && !lChErr.OutOfSync) {
689 if ( (iAPV==0 && !(lStatus & sistrip::CHANNEL_STATUS_APV0_NO_ERROR_BIT)) ||
690 (iAPV==1 && !(lStatus & sistrip::CHANNEL_STATUS_APV1_NO_ERROR_BIT))) {
691 lAPVErr.APVError =
true;
696 lAPVErr.APVAddressError =
true;
700 if ( lAPVErr.APVStatusBit ||
702 lAPVErr.APVAddressError
703 ) addBadAPV(lAPVErr, lFirst);
710 if (lFailUnpackerChannelCheck != lFailMonitoringChannelCheck && connected_[iCh]){
712 std::ostringstream debugStream;
713 debugStream <<
"[FEDErrors] ------ WARNING: FED " << fedID_ <<
", channel " << iCh
714 <<
", isConnected = " << connected_[iCh] << std::endl
715 <<
"[FEDErrors] --------- Monitoring Channel check " ;
716 if (lFailMonitoringChannelCheck) debugStream <<
"failed." << std::endl;
717 else debugStream <<
"passed." << std::endl ;
718 debugStream <<
"[FEDErrors] --------- Unpacker Channel check " ;
719 if (lFailUnpackerChannelCheck) debugStream <<
"failed." << std::endl;
720 else debugStream <<
"passed." << std::endl;
721 debugStream <<
"[FEDErrors] --------- fegood = "
722 << aBuffer->
feGood(static_cast<unsigned int>(iCh/sistrip::FEDCH_PER_FEUNIT))
724 <<
"[FEDErrors] --------- unpacker FED check = " << failUnpackerFEDCheck_ << std::endl;
725 edm::LogError(
"SiStripMonitorHardware") << debugStream.str();
728 if (lFailMonitoringChannelCheck) aCounterMonitoring++;
729 if (lFailUnpackerChannelCheck) aCounterUnpacker++;
732 if (lMedValid && !foundError && lPassedMonitoringFEDcheck && aDoMeds) {
736 HistogramBase::fillHistogram(aMedianHist0,
738 HistogramBase::fillHistogram(aMedianHist1,
748 void FEDErrors::fillBadChannelList(
const bool doTkHistoMap,
751 unsigned int & aNBadChannels,
752 unsigned int & aNBadActiveChannels)
755 uint32_t lPrevId = 0;
757 uint16_t lPrevTot = 0;
758 bool hasBeenProcessed =
false;
759 bool lFailFED = failMonitoringFEDCheck();
761 for (
unsigned int iCh = 0;
765 if (!connected_[iCh])
continue;
769 lPrevId = detid_[iCh];
770 lPrevTot = nChInModule_[iCh];
775 bool isBadFE =
false;
776 bool isMissingFE =
false;
778 for (
unsigned int badfe(0); badfe<feErrors_.size(); badfe++) {
779 if ((feErrors_[badfe]).FeID == feNumber) {
781 if ((feErrors_[badfe]).Missing) isMissingFE =
true;
786 bool isBadChan =
false;
787 bool isActiveChan =
false;
798 bool isBadApv1 =
false;
799 bool isBadApv2 =
false;
800 for (
unsigned int badApv(0); badApv<apvErrors_.size(); badApv++) {
801 if ((apvErrors_[badApv]).ChannelID == iCh) {
803 if (apvErrors_[badApv].IsActive) isActiveChan =
true;
805 if (apvErrors_[badApv].APVID == 2 * iCh ) isBadApv1 =
true;
806 if (apvErrors_[badApv].APVID == 2 * iCh + 1 )
814 if (detid_[iCh] == lPrevId){
815 if (hasBeenProcessed) hasBeenProcessed =
false;
818 if (detid_[iCh] != lPrevId){
825 lPrevId = detid_[iCh];
826 lPrevTot = nChInModule_[iCh];
827 hasBeenProcessed =
true;
830 bool lHasErr = lFailFED || isBadFE || isBadChan;
831 incrementLumiErrors(lHasErr,subDetId_[feNumber]);
837 if ((isBadChan && isActiveChan) || lFailFED || (isBadFE && !isMissingFE)) aNBadActiveChannels++;
838 if ( isBadApv1 || lFailFED || isBadFE ) HistogramBase::fillHistogram ( aFedIdVsApvId , 2 * iCh , fedID_ ) ;
839 if ( isBadApv2 || lFailFED || isBadFE ) HistogramBase::fillHistogram ( aFedIdVsApvId , 2 * iCh + 1 , fedID_ ) ;
846 if (!hasBeenProcessed){
858 void FEDErrors::fillEventProperties(
long long dbx) {
859 eventProp_.deltaBX = dbx;
862 void FEDErrors::incrementLumiErrors(
const bool hasError,
863 const unsigned int aSubDet){
864 if (!lumiErr_.nTotal.size())
return;
865 if (aSubDet >= lumiErr_.nTotal.size()) {
866 edm::LogError(
"SiStripMonitorHardware") <<
" -- FED " << fedID_
867 <<
", invalid subdetid : " << aSubDet
868 <<
", size of lumiErr : "
869 << lumiErr_.nTotal.size()
873 if (hasError) lumiErr_.nErrors[aSubDet]++;
874 lumiErr_.nTotal[aSubDet]++;
878 void FEDErrors::processDet(
const uint32_t aPrevId,
879 const uint16_t aPrevTot,
880 const bool doTkHistoMap,
885 if (aPrevTot < nBad){
886 edm::LogError(
"SiStripMonitorHardware") <<
" -- Number of bad channels in det " << aPrevId
888 <<
", total number of pairs for this det = " << aPrevTot
893 uint32_t lDetid = aPrevId;
894 if (aPrevTot != 0 && doTkHistoMap && aTkMapPointer)
895 HistogramBase::fillTkHistoMap(aTkMapPointer,lDetid,static_cast<float>(nBad)/aPrevTot);
901 const bool FEDErrors::failMonitoringFEDCheck()
903 return ( anyFEDErrors() ||
904 fedErrors_.CorruptBuffer
908 const bool FEDErrors::anyDAQProblems()
910 return ( fedErrors_.DataMissing ||
911 fedErrors_.InvalidBuffers ||
912 fedErrors_.BadFEDCRCs ||
913 fedErrors_.BadDAQCRCs ||
915 fedErrors_.BadDAQPacket
919 const bool FEDErrors::anyFEDErrors()
921 return ( fedErrors_.InvalidBuffers ||
922 fedErrors_.BadFEDCRCs ||
923 fedErrors_.BadDAQCRCs ||
925 fedErrors_.BadDAQPacket ||
926 fedErrors_.FEsOverflow
930 const bool FEDErrors::anyFEProblems()
932 return ( fedErrors_.FEsOverflow ||
933 fedErrors_.FEsMissing ||
934 fedErrors_.FEsBadMajorityAddress
940 return ( anyFEDErrors() ||
942 fedErrors_.CorruptBuffer ||
943 fedErrors_.BadChannelStatusBit
948 const unsigned int FEDErrors::fedID(){
953 FEDErrors::FEDCounters & FEDErrors::getFEDErrorsCounters()
955 static FEDCounters lFedCounter;
959 FEDErrors::ChannelCounters & FEDErrors::getChannelErrorsCounters()
961 static ChannelCounters lChCounter;
965 FEDErrors::FECounters & FEDErrors::getFEErrorsCounters()
970 FEDErrors::FEDLevelErrors & FEDErrors::getFEDLevelErrors()
975 FEDErrors::EventProperties & FEDErrors::getEventProperties()
980 std::vector<FEDErrors::FELevelErrors> & FEDErrors::getFELevelErrors()
985 std::vector<FEDErrors::ChannelLevelErrors> & FEDErrors::getChannelLevelErrors()
987 return chErrorsDetailed_;
990 std::vector<FEDErrors::APVLevelErrors> & FEDErrors::getAPVLevelErrors()
995 std::vector<std::pair<unsigned int,bool> > & FEDErrors::getBadChannels()
1000 const FEDErrors::LumiErrors & FEDErrors::getLumiErrors(){
1004 void FEDErrors::addBadFE(
const FEDErrors::FELevelErrors & aFE)
1007 fedErrors_.FEsOverflow =
true;
1008 (feCounter_.nFEOverflows)++;
1010 else if (aFE.Missing) {
1011 fedErrors_.FEsMissing =
true;
1012 (feCounter_.nFEMissing)++;
1013 feErrors_.push_back(aFE);
1015 else if (aFE.BadMajorityAddress) {
1016 fedErrors_.FEsBadMajorityAddress =
true;
1017 (feCounter_.nFEBadMajorityAddresses)++;
1018 feErrors_.push_back(aFE);
1020 else if (aFE.TimeDifference != 0) {
1021 feErrors_.push_back(aFE);
1025 void FEDErrors::addBadChannel(
const FEDErrors::ChannelLevelErrors & aChannel)
1027 if (aChannel.Connected) chErrorsDetailed_.push_back(aChannel);
1028 incrementChannelCounters(aChannel);
1031 void FEDErrors::addBadAPV(
const FEDErrors::APVLevelErrors & aAPV,
bool & aFirst)
1033 apvErrors_.push_back(aAPV);
1034 incrementAPVCounters(aAPV);
1035 if (aAPV.APVStatusBit && aFirst) {
1036 fedErrors_.BadChannelStatusBit =
true;
1037 (FEDErrors::getFEDErrorsCounters().nBadChannels)++;
1038 chErrors_.push_back(std::pair<unsigned int, bool>(aAPV.ChannelID,aAPV.IsActive));
1039 if (aAPV.IsActive) {
1041 fedErrors_.BadActiveChannelStatusBit =
true;
1042 (FEDErrors::getFEDErrorsCounters().nBadActiveChannels)++;
1050 void FEDErrors::incrementFEDCounters()
1052 if (fedErrors_.InvalidBuffers ||
1053 fedErrors_.BadFEDCRCs ||
1054 fedErrors_.BadDAQCRCs ||
1055 fedErrors_.BadIDs ||
1056 fedErrors_.BadDAQPacket
1058 (FEDErrors::getFEDErrorsCounters().nDAQProblems)++;
1059 (FEDErrors::getFEDErrorsCounters().nFEDErrors)++;
1063 if (fedErrors_.FEsOverflow){
1064 (FEDErrors::getFEDErrorsCounters().nFEDsWithFEOverflows)++;
1066 else if (fedErrors_.FEsMissing){
1067 (FEDErrors::getFEDErrorsCounters().nFEDsWithMissingFEs)++;
1069 else if (fedErrors_.FEsBadMajorityAddress){
1070 (FEDErrors::getFEDErrorsCounters().nFEDsWithFEBadMajorityAddresses)++;
1073 if (fedErrors_.FEsOverflow ||
1074 fedErrors_.FEsBadMajorityAddress ||
1075 fedErrors_.FEsMissing
1077 (FEDErrors::getFEDErrorsCounters().nFEDsWithFEProblems)++;
1078 (FEDErrors::getFEDErrorsCounters().nFEDErrors)++;
1080 else if (fedErrors_.CorruptBuffer) {
1081 (FEDErrors::getFEDErrorsCounters().nCorruptBuffers)++;
1082 (FEDErrors::getFEDErrorsCounters().nFEDErrors)++;
1089 void FEDErrors::incrementChannelCounters(
const FEDErrors::ChannelLevelErrors & aChannel)
1091 if (aChannel.Unlocked && aChannel.Connected) (FEDErrors::getChannelErrorsCounters().nUnlocked)++;
1092 if (aChannel.OutOfSync && aChannel.Connected) (FEDErrors::getChannelErrorsCounters().nOutOfSync)++;
1093 if (!aChannel.Connected) (FEDErrors::getChannelErrorsCounters().nNotConnected)++;
1096 void FEDErrors::incrementAPVCounters(
const FEDErrors::APVLevelErrors & aAPV)
1098 if (aAPV.Connected && aAPV.IsActive){
1099 if (aAPV.APVStatusBit) (FEDErrors::getChannelErrorsCounters().nAPVStatusBit)++;
1100 if (aAPV.APVAddressError) (FEDErrors::getChannelErrorsCounters().nAPVAddressError)++;
1101 if (aAPV.APVError) (FEDErrors::getChannelErrorsCounters().nAPVError)++;
1107 if (this->ChannelID < aErr.ChannelID)
return true;
1114 if (this->ChannelID < aErr.ChannelID)
return true;
1119 void FEDErrors::print(
const FEDErrors::FEDCounters & aFEDCounter, std::ostream & aOs)
1123 aOs <<
"[FEDErrors]============================================" << std::endl
1124 <<
"[FEDErrors]==== Printing FEDCounters information : ====" << std::endl
1125 <<
"[FEDErrors]============================================" << std::endl
1126 <<
"[FEDErrors]======== nFEDErrors = " << aFEDCounter.nFEDErrors << std::endl
1127 <<
"[FEDErrors]======== nDAQProblems = " << aFEDCounter.nDAQProblems << std::endl
1128 <<
"[FEDErrors]======== nFEDsWithFEProblems = " << aFEDCounter.nFEDsWithFEProblems << std::endl
1129 <<
"[FEDErrors]======== nCorruptBuffers = " << aFEDCounter.nCorruptBuffers << std::endl
1130 <<
"[FEDErrors]======== nBadChannels = " << aFEDCounter.nBadChannels << std::endl
1131 <<
"[FEDErrors]======== nBadActiveChannels = " << aFEDCounter.nBadActiveChannels << std::endl
1132 <<
"[FEDErrors]======== nFEDsWithFEOverflows = " << aFEDCounter.nFEDsWithFEOverflows << std::endl
1133 <<
"[FEDErrors]======== nFEDsWithFEBadMajorityAddresses = " << aFEDCounter.nFEDsWithFEBadMajorityAddresses << std::endl
1134 <<
"[FEDErrors]======== nFEDsWithMissingFEs = " << aFEDCounter.nFEDsWithMissingFEs << std::endl
1135 <<
"[FEDErrors]======== nTotalBadChannels = " << aFEDCounter.nTotalBadChannels << std::endl
1136 <<
"[FEDErrors]======== nTotalBadActiveChannels = " << aFEDCounter.nTotalBadActiveChannels << std::endl
1137 <<
"[FEDErrors]============================================" << std::endl;
1142 void FEDErrors::print(
const FEDErrors::FECounters & aFECounter, std::ostream & aOs)
1146 aOs <<
"[FEDErrors]============================================" << std::endl
1147 <<
"[FEDErrors]==== Printing FECounters information : ====" << std::endl
1148 <<
"[FEDErrors]============================================" << std::endl
1149 <<
"[FEDErrors]======== nFEOverflows = " << aFECounter.nFEOverflows << std::endl
1150 <<
"[FEDErrors]======== nFEBadMajorityAddresses = " << aFECounter.nFEBadMajorityAddresses << std::endl
1151 <<
"[FEDErrors]======== nFEMissing = " << aFECounter.nFEMissing << std::endl
1152 <<
"[FEDErrors]============================================" << std::endl;
1157 void FEDErrors::print(
const FEDErrors::FEDLevelErrors & aFEDErr, std::ostream & aOs)
1161 aOs <<
"[FEDErrors]============================================" << std::endl
1162 <<
"[FEDErrors]==== Printing FED errors information : ====" << std::endl
1163 <<
"[FEDErrors]============================================" << std::endl
1164 <<
"[FEDErrors]======== HasCabledChannels = " << aFEDErr.HasCabledChannels << std::endl
1165 <<
"[FEDErrors]======== DataPresent = " << aFEDErr.DataPresent << std::endl
1166 <<
"[FEDErrors]======== DataMissing = " << aFEDErr.DataMissing << std::endl
1167 <<
"[FEDErrors]======== InvalidBuffers = " << aFEDErr.InvalidBuffers << std::endl
1168 <<
"[FEDErrors]======== BadFEDCRCs = " << aFEDErr.BadFEDCRCs << std::endl
1169 <<
"[FEDErrors]======== BadDAQCRCs = " << aFEDErr.BadDAQCRCs << std::endl
1170 <<
"[FEDErrors]======== BadIDs = " << aFEDErr.BadIDs << std::endl
1171 <<
"[FEDErrors]======== BadDAQPacket = " << aFEDErr.BadDAQPacket << std::endl
1172 <<
"[FEDErrors]======== CorruptBuffer = " << aFEDErr.CorruptBuffer << std::endl
1173 <<
"[FEDErrors]======== FEOverflows = " << aFEDErr.FEsOverflow << std::endl
1174 <<
"[FEDErrors]======== FEMissing = " << aFEDErr.FEsMissing << std::endl
1175 <<
"[FEDErrors]======== BadMajorityAddresses = " << aFEDErr.FEsBadMajorityAddress << std::endl
1176 <<
"[FEDErrors]============================================" << std::endl;
1180 void FEDErrors::print(
const FEDErrors::FELevelErrors & aErr, std::ostream & aOs)
1184 aOs <<
"[FEDErrors]============================================" << std::endl
1185 <<
"[FEDErrors]==== Printing FE errors information : ====" << std::endl
1186 <<
"[FEDErrors]============================================" << std::endl
1187 <<
"[FEDErrors]======== FE #" << aErr.FeID << std::endl
1188 <<
"[FEDErrors]======== subdet " << aErr.SubDetID << std::endl
1189 <<
"[FEDErrors]======== FEOverflow = " << aErr.Overflow << std::endl
1190 <<
"[FEDErrors]======== FEMissing = " << aErr.Missing << std::endl
1191 <<
"[FEDErrors]======== BadMajorityAddresses = " << aErr.BadMajorityAddress << std::endl
1192 <<
"[FEDErrors]======== TimeDifference = " << aErr.TimeDifference << std::endl
1193 <<
"[FEDErrors]============================================" << std::endl;
1197 void FEDErrors::print(
const FEDErrors::ChannelLevelErrors & aErr, std::ostream & aOs)
1200 aOs <<
"[FEDErrors]=================================================" << std::endl
1201 <<
"[FEDErrors]==== Printing channel errors information : ====" << std::endl
1202 <<
"[FEDErrors]=================================================" << std::endl
1203 <<
"[FEDErrors]============ Channel #" << aErr.ChannelID << std::endl
1204 <<
"[FEDErrors]============ connected = " << aErr.Connected << std::endl
1205 <<
"[FEDErrors]============ isActive = " << aErr.IsActive << std::endl
1206 <<
"[FEDErrors]============ Unlocked = " << aErr.Unlocked << std::endl
1207 <<
"[FEDErrors]============ OutOfSync = " << aErr.OutOfSync << std::endl
1208 <<
"[FEDErrors]=================================================" << std::endl;
1212 void FEDErrors::print(
const FEDErrors::APVLevelErrors & aErr, std::ostream & aOs)
1215 aOs <<
"[FEDErrors]=================================================" << std::endl
1216 <<
"[FEDErrors]==== Printing APV errors information : ====" << std::endl
1217 <<
"[FEDErrors]=================================================" << std::endl
1218 <<
"[FEDErrors]============ APV #" << aErr.APVID << std::endl
1219 <<
"[FEDErrors]============ Channel #" << aErr.ChannelID << std::endl
1220 <<
"[FEDErrors]============ connected = " << aErr.Connected << std::endl
1221 <<
"[FEDErrors]============ isActive = " << aErr.IsActive << std::endl
1222 <<
"[FEDErrors]============ APVStatusBit = " << aErr.APVStatusBit << std::endl
1223 <<
"[FEDErrors]============ APVError = " << aErr.APVError << std::endl
1224 <<
"[FEDErrors]============ APVAddressError = " << aErr.APVAddressError << std::endl
1225 <<
"[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_
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
FEDReadoutMode readoutMode() 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
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
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
unsigned int tecSide(const DetId &id) const