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::auto_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::auto_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(),
395 if (buffer.get()) debugBuffer = buffer.get();
398 std::vector<FEDErrors::APVLevelErrors> & lChVec = getAPVLevelErrors();
399 std::ostringstream debugStream;
401 std::sort(lChVec.begin(),lChVec.end());
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) && 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)
752 uint32_t lPrevId = 0;
754 uint16_t lPrevTot = 0;
755 bool hasBeenProcessed =
false;
756 bool lFailFED = failMonitoringFEDCheck();
758 for (
unsigned int iCh = 0;
762 if (!connected_[iCh])
continue;
766 lPrevId = detid_[iCh];
767 lPrevTot = nChInModule_[iCh];
772 bool isBadFE =
false;
773 bool isMissingFE =
false;
775 for (
unsigned int badfe(0); badfe<feErrors_.size(); badfe++) {
776 if ((feErrors_[badfe]).FeID == feNumber) {
778 if ((feErrors_[badfe]).Missing) isMissingFE =
true;
783 bool isBadChan =
false;
784 bool isActiveChan =
false;
795 bool isBadApv1 =
false;
796 bool isBadApv2 =
false;
797 for (
unsigned int badApv(0); badApv<apvErrors_.size(); badApv++) {
798 if ((apvErrors_[badApv]).ChannelID == iCh) {
800 if (apvErrors_[badApv].IsActive) isActiveChan =
true;
802 if (apvErrors_[badApv].APVID == 2 * iCh ) isBadApv1 =
true;
803 if (apvErrors_[badApv].APVID == 2 * iCh + 1 )
811 if (detid_[iCh] == lPrevId){
812 if (hasBeenProcessed) hasBeenProcessed =
false;
815 if (detid_[iCh] != lPrevId){
822 lPrevId = detid_[iCh];
823 lPrevTot = nChInModule_[iCh];
824 hasBeenProcessed =
true;
827 bool lHasErr = lFailFED || isBadFE || isBadChan;
828 incrementLumiErrors(lHasErr,subDetId_[feNumber]);
834 if ((isBadChan && isActiveChan) || lFailFED || (isBadFE && !isMissingFE)) aNBadActiveChannels++;
835 if ( isBadApv1 || lFailFED || isBadFE ) HistogramBase::fillHistogram ( aFedIdVsApvId , 2 * iCh , fedID_ ) ;
836 if ( isBadApv2 || lFailFED || isBadFE ) HistogramBase::fillHistogram ( aFedIdVsApvId , 2 * iCh + 1 , fedID_ ) ;
843 if (!hasBeenProcessed){
855 void FEDErrors::fillEventProperties(
long long dbx) {
856 eventProp_.deltaBX = dbx;
859 void FEDErrors::incrementLumiErrors(
const bool hasError,
860 const unsigned int aSubDet){
861 if (!lumiErr_.nTotal.size())
return;
862 if (aSubDet >= lumiErr_.nTotal.size()) {
863 edm::LogError(
"SiStripMonitorHardware") <<
" -- FED " << fedID_
864 <<
", invalid subdetid : " << aSubDet
865 <<
", size of lumiErr : "
866 << lumiErr_.nTotal.size()
870 if (hasError) lumiErr_.nErrors[aSubDet]++;
871 lumiErr_.nTotal[aSubDet]++;
875 void FEDErrors::processDet(
const uint32_t aPrevId,
876 const uint16_t aPrevTot,
877 const bool doTkHistoMap,
882 if (aPrevTot < nBad){
883 edm::LogError(
"SiStripMonitorHardware") <<
" -- Number of bad channels in det " << aPrevId
885 <<
", total number of pairs for this det = " << aPrevTot
890 uint32_t lDetid = aPrevId;
891 if (aPrevTot != 0 && doTkHistoMap && aTkMapPointer)
892 HistogramBase::fillTkHistoMap(aTkMapPointer,lDetid,static_cast<float>(nBad)/aPrevTot);
898 const bool FEDErrors::failMonitoringFEDCheck()
900 return ( anyFEDErrors() ||
901 fedErrors_.CorruptBuffer
905 const bool FEDErrors::anyDAQProblems()
907 return ( fedErrors_.DataMissing ||
908 fedErrors_.InvalidBuffers ||
909 fedErrors_.BadFEDCRCs ||
910 fedErrors_.BadDAQCRCs ||
912 fedErrors_.BadDAQPacket
916 const bool FEDErrors::anyFEDErrors()
918 return ( fedErrors_.InvalidBuffers ||
919 fedErrors_.BadFEDCRCs ||
920 fedErrors_.BadDAQCRCs ||
922 fedErrors_.BadDAQPacket ||
923 fedErrors_.FEsOverflow
927 const bool FEDErrors::anyFEProblems()
929 return ( fedErrors_.FEsOverflow ||
930 fedErrors_.FEsMissing ||
931 fedErrors_.FEsBadMajorityAddress
937 return ( anyFEDErrors() ||
939 fedErrors_.CorruptBuffer ||
940 fedErrors_.BadChannelStatusBit
945 const unsigned int FEDErrors::fedID(){
950 FEDErrors::FEDCounters & FEDErrors::getFEDErrorsCounters()
955 FEDErrors::ChannelCounters & FEDErrors::getChannelErrorsCounters()
960 FEDErrors::FECounters & FEDErrors::getFEErrorsCounters()
965 FEDErrors::FEDLevelErrors & FEDErrors::getFEDLevelErrors()
970 FEDErrors::EventProperties & FEDErrors::getEventProperties()
975 std::vector<FEDErrors::FELevelErrors> & FEDErrors::getFELevelErrors()
980 std::vector<FEDErrors::ChannelLevelErrors> & FEDErrors::getChannelLevelErrors()
982 return chErrorsDetailed_;
985 std::vector<FEDErrors::APVLevelErrors> & FEDErrors::getAPVLevelErrors()
990 std::vector<std::pair<unsigned int,bool> > & FEDErrors::getBadChannels()
995 const FEDErrors::LumiErrors & FEDErrors::getLumiErrors(){
999 void FEDErrors::addBadFE(
const FEDErrors::FELevelErrors & aFE)
1002 fedErrors_.FEsOverflow =
true;
1003 (feCounter_.nFEOverflows)++;
1005 else if (aFE.Missing) {
1006 fedErrors_.FEsMissing =
true;
1007 (feCounter_.nFEMissing)++;
1008 feErrors_.push_back(aFE);
1010 else if (aFE.BadMajorityAddress) {
1011 fedErrors_.FEsBadMajorityAddress =
true;
1012 (feCounter_.nFEBadMajorityAddresses)++;
1013 feErrors_.push_back(aFE);
1015 else if (aFE.TimeDifference != 0) {
1016 feErrors_.push_back(aFE);
1020 void FEDErrors::addBadChannel(
const FEDErrors::ChannelLevelErrors & aChannel)
1022 if (aChannel.Connected) chErrorsDetailed_.push_back(aChannel);
1023 incrementChannelCounters(aChannel);
1026 void FEDErrors::addBadAPV(
const FEDErrors::APVLevelErrors & aAPV,
bool & aFirst)
1028 apvErrors_.push_back(aAPV);
1029 incrementAPVCounters(aAPV);
1030 if (aAPV.APVStatusBit && aFirst) {
1031 fedErrors_.BadChannelStatusBit =
true;
1032 lFedCounter_.nBadChannels++;
1033 chErrors_.push_back(std::pair<unsigned int, bool>(aAPV.ChannelID,aAPV.IsActive));
1034 if (aAPV.IsActive) {
1036 fedErrors_.BadActiveChannelStatusBit =
true;
1037 lFedCounter_.nBadActiveChannels++;
1045 void FEDErrors::incrementFEDCounters()
1047 if (fedErrors_.InvalidBuffers ||
1048 fedErrors_.BadFEDCRCs ||
1049 fedErrors_.BadDAQCRCs ||
1050 fedErrors_.BadIDs ||
1051 fedErrors_.BadDAQPacket
1053 lFedCounter_.nDAQProblems++;
1054 lFedCounter_.nFEDErrors++;
1058 if (fedErrors_.FEsOverflow){
1059 lFedCounter_.nFEDsWithFEOverflows++;
1061 else if (fedErrors_.FEsMissing){
1062 lFedCounter_.nFEDsWithMissingFEs++;
1064 else if (fedErrors_.FEsBadMajorityAddress){
1065 lFedCounter_.nFEDsWithFEBadMajorityAddresses++;
1068 if (fedErrors_.FEsOverflow ||
1069 fedErrors_.FEsBadMajorityAddress ||
1070 fedErrors_.FEsMissing
1072 lFedCounter_.nFEDsWithFEProblems++;
1073 lFedCounter_.nFEDErrors++;
1075 else if (fedErrors_.CorruptBuffer) {
1076 lFedCounter_.nCorruptBuffers++;
1077 lFedCounter_.nFEDErrors++;
1084 void FEDErrors::incrementChannelCounters(
const FEDErrors::ChannelLevelErrors & aChannel)
1086 if (aChannel.Unlocked && aChannel.Connected) lChCounter_.nUnlocked++;
1087 if (aChannel.OutOfSync && aChannel.Connected) lChCounter_.nOutOfSync++;
1088 if (!aChannel.Connected) lChCounter_.nNotConnected++;
1091 void FEDErrors::incrementAPVCounters(
const FEDErrors::APVLevelErrors & aAPV)
1093 if (aAPV.Connected && aAPV.IsActive){
1094 if (aAPV.APVStatusBit) lChCounter_.nAPVStatusBit++;
1095 if (aAPV.APVAddressError) lChCounter_.nAPVAddressError++;
1096 if (aAPV.APVError) lChCounter_.nAPVError++;
1102 if (this->ChannelID < aErr.ChannelID)
return true;
1109 if (this->ChannelID < aErr.ChannelID)
return true;
1114 void FEDErrors::print(
const FEDErrors::FEDCounters & aFEDCounter, std::ostream & aOs)
1118 aOs <<
"[FEDErrors]============================================" << std::endl
1119 <<
"[FEDErrors]==== Printing FEDCounters information : ====" << std::endl
1120 <<
"[FEDErrors]============================================" << std::endl
1121 <<
"[FEDErrors]======== nFEDErrors = " << aFEDCounter.nFEDErrors << std::endl
1122 <<
"[FEDErrors]======== nDAQProblems = " << aFEDCounter.nDAQProblems << std::endl
1123 <<
"[FEDErrors]======== nFEDsWithFEProblems = " << aFEDCounter.nFEDsWithFEProblems << std::endl
1124 <<
"[FEDErrors]======== nCorruptBuffers = " << aFEDCounter.nCorruptBuffers << std::endl
1125 <<
"[FEDErrors]======== nBadChannels = " << aFEDCounter.nBadChannels << std::endl
1126 <<
"[FEDErrors]======== nBadActiveChannels = " << aFEDCounter.nBadActiveChannels << std::endl
1127 <<
"[FEDErrors]======== nFEDsWithFEOverflows = " << aFEDCounter.nFEDsWithFEOverflows << std::endl
1128 <<
"[FEDErrors]======== nFEDsWithFEBadMajorityAddresses = " << aFEDCounter.nFEDsWithFEBadMajorityAddresses << std::endl
1129 <<
"[FEDErrors]======== nFEDsWithMissingFEs = " << aFEDCounter.nFEDsWithMissingFEs << std::endl
1130 <<
"[FEDErrors]======== nTotalBadChannels = " << aFEDCounter.nTotalBadChannels << std::endl
1131 <<
"[FEDErrors]======== nTotalBadActiveChannels = " << aFEDCounter.nTotalBadActiveChannels << std::endl
1132 <<
"[FEDErrors]============================================" << std::endl;
1137 void FEDErrors::print(
const FEDErrors::FECounters & aFECounter, std::ostream & aOs)
1141 aOs <<
"[FEDErrors]============================================" << std::endl
1142 <<
"[FEDErrors]==== Printing FECounters information : ====" << std::endl
1143 <<
"[FEDErrors]============================================" << std::endl
1144 <<
"[FEDErrors]======== nFEOverflows = " << aFECounter.nFEOverflows << std::endl
1145 <<
"[FEDErrors]======== nFEBadMajorityAddresses = " << aFECounter.nFEBadMajorityAddresses << std::endl
1146 <<
"[FEDErrors]======== nFEMissing = " << aFECounter.nFEMissing << std::endl
1147 <<
"[FEDErrors]============================================" << std::endl;
1152 void FEDErrors::print(
const FEDErrors::FEDLevelErrors & aFEDErr, std::ostream & aOs)
1156 aOs <<
"[FEDErrors]============================================" << std::endl
1157 <<
"[FEDErrors]==== Printing FED errors information : ====" << std::endl
1158 <<
"[FEDErrors]============================================" << std::endl
1159 <<
"[FEDErrors]======== HasCabledChannels = " << aFEDErr.HasCabledChannels << std::endl
1160 <<
"[FEDErrors]======== DataPresent = " << aFEDErr.DataPresent << std::endl
1161 <<
"[FEDErrors]======== DataMissing = " << aFEDErr.DataMissing << std::endl
1162 <<
"[FEDErrors]======== InvalidBuffers = " << aFEDErr.InvalidBuffers << std::endl
1163 <<
"[FEDErrors]======== BadFEDCRCs = " << aFEDErr.BadFEDCRCs << std::endl
1164 <<
"[FEDErrors]======== BadDAQCRCs = " << aFEDErr.BadDAQCRCs << std::endl
1165 <<
"[FEDErrors]======== BadIDs = " << aFEDErr.BadIDs << std::endl
1166 <<
"[FEDErrors]======== BadDAQPacket = " << aFEDErr.BadDAQPacket << std::endl
1167 <<
"[FEDErrors]======== CorruptBuffer = " << aFEDErr.CorruptBuffer << std::endl
1168 <<
"[FEDErrors]======== FEOverflows = " << aFEDErr.FEsOverflow << std::endl
1169 <<
"[FEDErrors]======== FEMissing = " << aFEDErr.FEsMissing << std::endl
1170 <<
"[FEDErrors]======== BadMajorityAddresses = " << aFEDErr.FEsBadMajorityAddress << std::endl
1171 <<
"[FEDErrors]============================================" << std::endl;
1175 void FEDErrors::print(
const FEDErrors::FELevelErrors & aErr, std::ostream & aOs)
1179 aOs <<
"[FEDErrors]============================================" << std::endl
1180 <<
"[FEDErrors]==== Printing FE errors information : ====" << std::endl
1181 <<
"[FEDErrors]============================================" << std::endl
1182 <<
"[FEDErrors]======== FE #" << aErr.FeID << std::endl
1183 <<
"[FEDErrors]======== subdet " << aErr.SubDetID << std::endl
1184 <<
"[FEDErrors]======== FEOverflow = " << aErr.Overflow << std::endl
1185 <<
"[FEDErrors]======== FEMissing = " << aErr.Missing << std::endl
1186 <<
"[FEDErrors]======== BadMajorityAddresses = " << aErr.BadMajorityAddress << std::endl
1187 <<
"[FEDErrors]======== TimeDifference = " << aErr.TimeDifference << std::endl
1188 <<
"[FEDErrors]============================================" << std::endl;
1192 void FEDErrors::print(
const FEDErrors::ChannelLevelErrors & aErr, std::ostream & aOs)
1195 aOs <<
"[FEDErrors]=================================================" << std::endl
1196 <<
"[FEDErrors]==== Printing channel errors information : ====" << std::endl
1197 <<
"[FEDErrors]=================================================" << std::endl
1198 <<
"[FEDErrors]============ Channel #" << aErr.ChannelID << std::endl
1199 <<
"[FEDErrors]============ connected = " << aErr.Connected << std::endl
1200 <<
"[FEDErrors]============ isActive = " << aErr.IsActive << std::endl
1201 <<
"[FEDErrors]============ Unlocked = " << aErr.Unlocked << std::endl
1202 <<
"[FEDErrors]============ OutOfSync = " << aErr.OutOfSync << std::endl
1203 <<
"[FEDErrors]=================================================" << std::endl;
1207 void FEDErrors::print(
const FEDErrors::APVLevelErrors & aErr, std::ostream & aOs)
1210 aOs <<
"[FEDErrors]=================================================" << std::endl
1211 <<
"[FEDErrors]==== Printing APV errors information : ====" << std::endl
1212 <<
"[FEDErrors]=================================================" << std::endl
1213 <<
"[FEDErrors]============ APV #" << aErr.APVID << std::endl
1214 <<
"[FEDErrors]============ Channel #" << aErr.ChannelID << std::endl
1215 <<
"[FEDErrors]============ connected = " << aErr.Connected << std::endl
1216 <<
"[FEDErrors]============ isActive = " << aErr.IsActive << std::endl
1217 <<
"[FEDErrors]============ APVStatusBit = " << aErr.APVStatusBit << std::endl
1218 <<
"[FEDErrors]============ APVError = " << aErr.APVError << std::endl
1219 <<
"[FEDErrors]============ APVAddressError = " << aErr.APVAddressError << std::endl
1220 <<
"[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