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 lFedCounter_.nFEDErrors = 0;
47 lFedCounter_.nDAQProblems = 0;
48 lFedCounter_.nFEDsWithFEProblems = 0;
49 lFedCounter_.nCorruptBuffers = 0;
50 lFedCounter_.nBadChannels = 0;
51 lFedCounter_.nBadActiveChannels = 0;
52 lFedCounter_.nFEDsWithFEOverflows = 0;
53 lFedCounter_.nFEDsWithFEBadMajorityAddresses = 0;
54 lFedCounter_.nFEDsWithMissingFEs = 0;
55 lFedCounter_.nTotalBadChannels = 0;
56 lFedCounter_.nTotalBadActiveChannels = 0;
58 lChCounter_.nNotConnected = 0;
59 lChCounter_.nUnlocked = 0;
60 lChCounter_.nOutOfSync = 0;
61 lChCounter_.nAPVStatusBit = 0;
62 lChCounter_.nAPVError = 0;
63 lChCounter_.nAPVAddressError = 0;
65 feCounter_.nFEOverflows = 0;
66 feCounter_.nFEBadMajorityAddresses = 0;
67 feCounter_.nFEMissing = 0;
69 fedErrors_.HasCabledChannels =
false;
70 fedErrors_.DataPresent =
false;
71 fedErrors_.DataMissing =
false;
72 fedErrors_.InvalidBuffers =
false;
73 fedErrors_.BadFEDCRCs =
false;
74 fedErrors_.BadDAQCRCs =
false;
75 fedErrors_.BadIDs =
false;
76 fedErrors_.BadDAQPacket =
false;
77 fedErrors_.CorruptBuffer =
false;
78 fedErrors_.FEsOverflow =
false;
79 fedErrors_.FEsMissing =
false;
80 fedErrors_.FEsBadMajorityAddress =
false;
81 fedErrors_.BadChannelStatusBit =
false;
82 fedErrors_.BadActiveChannelStatusBit =
false;
86 chErrorsDetailed_.clear();
97 void FEDErrors::initialiseFED(
const unsigned int aFedID,
103 failUnpackerFEDCheck_ =
false;
117 for (
unsigned int iCh = 0;
123 detid_[iCh] = lConnection.
detId();
124 nChInModule_[iCh] = lConnection.
nApvPairs();
127 unsigned int lDetid = detid_[iCh];
130 unsigned int lSubid = 6;
140 if (tTopo->
tidSide(lDetid) == 2) lSubid = 4;
152 if (tTopo->
tecSide(lDetid) == 2) lSubid = 1;
162 subDetId_[lFeNumber] = lSubid;
169 feCounter_.nFEOverflows = 0;
170 feCounter_.nFEBadMajorityAddresses = 0;
171 feCounter_.nFEMissing = 0;
173 fedErrors_.HasCabledChannels =
false;
174 fedErrors_.DataPresent =
false;
175 fedErrors_.DataMissing =
false;
176 fedErrors_.InvalidBuffers =
false;
177 fedErrors_.BadFEDCRCs =
false;
178 fedErrors_.BadDAQCRCs =
false;
179 fedErrors_.BadIDs =
false;
180 fedErrors_.BadDAQPacket =
false;
181 fedErrors_.CorruptBuffer =
false;
182 fedErrors_.FEsOverflow =
false;
183 fedErrors_.FEsMissing =
false;
184 fedErrors_.FEsBadMajorityAddress =
false;
185 fedErrors_.BadChannelStatusBit =
false;
186 fedErrors_.BadActiveChannelStatusBit =
false;
190 chErrorsDetailed_.clear();
198 bool FEDErrors::checkDataPresent(
const FEDRawData& aFedData)
201 if (!aFedData.
size() || !aFedData.
data()) {
202 for (
unsigned int iCh = 0;
205 if (connected_[iCh]){
206 fedErrors_.HasCabledChannels =
true;
207 fedErrors_.DataMissing =
true;
211 fedErrors_.DataMissing =
true;
212 fedErrors_.HasCabledChannels =
false;
215 fedErrors_.DataPresent =
true;
216 for (
unsigned int iCh = 0;
219 if (connected_[iCh]){
220 fedErrors_.HasCabledChannels =
true;
229 bool FEDErrors::failUnpackerFEDCheck()
231 return failUnpackerFEDCheck_;
235 bool FEDErrors::fillFatalFEDErrors(
const FEDRawData& aFedData,
236 const unsigned int aPrintDebug)
239 std::auto_ptr<const sistrip::FEDBufferBase> bufferBase;
243 fedErrors_.InvalidBuffers =
true;
244 failUnpackerFEDCheck_ =
true;
251 if (!bufferBase->checkNoSlinkCRCError()) {
252 fedErrors_.BadFEDCRCs =
true;
254 }
else if (!bufferBase->checkCRC()) {
255 failUnpackerFEDCheck_ =
true;
256 fedErrors_.BadDAQCRCs =
true;
261 if (!bufferBase->checkSourceIDs() || !bufferBase->checkNoUnexpectedSourceID()) {
262 fedErrors_.BadIDs =
true;
267 else if (!bufferBase->doDAQHeaderAndTrailerChecks()) {
268 failUnpackerFEDCheck_ =
true;
269 fedErrors_.BadDAQPacket =
true;
275 if ( !(bufferBase->checkBufferFormat() &&
276 bufferBase->checkHeaderType() &&
277 bufferBase->checkReadoutMode()) ) {
278 failUnpackerFEDCheck_ =
true;
279 fedErrors_.InvalidBuffers =
true;
281 if (!
printDebug() || aPrintDebug<3 )
return false;
285 if (!bufferBase->checkNoFEOverflows()) {
286 failUnpackerFEDCheck_ =
true;
287 fedErrors_.FEsOverflow =
true;
289 if (!
printDebug() || aPrintDebug<3 )
return false;
302 fedErrors_.CorruptBuffer =
true;
314 unsigned int lBadChans = 0;
315 unsigned int lTotChans = 0;
317 bool lIsConnected =
false;
322 else lIsConnected = connected_[iCh];
324 if (!lIsConnected)
continue;
329 return static_cast<float>(lBadChans*1.0/lTotChans);
333 bool FEDErrors::fillFEDErrors(
const FEDRawData& aFedData,
335 const unsigned int aPrintDebug,
336 unsigned int & aCounterMonitoring,
337 unsigned int & aCounterUnpacker,
342 std::vector<std::vector<std::pair<unsigned int,unsigned int> > > & aFeMajFrac
348 if (!fillFatalFEDErrors(aFedData,aPrintDebug))
return false;
351 std::auto_ptr<const sistrip::FEDBuffer> buffer;
355 if (!buffer->checkChannelLengths()) failUnpackerFEDCheck_=
true;
358 if (!this->anyFEDErrors()) {
360 bool lCorruptCheck = fillCorruptBuffer(buffer.get());
361 if (aPrintDebug>1 && !lCorruptCheck) {
363 <<
"CorruptBuffer check failed for FED " << fedID_
365 <<
" -- buffer->checkChannelLengthsMatchBufferLength() = " << buffer->checkChannelLengthsMatchBufferLength()
367 <<
" -- buffer->checkChannelPacketCodes() = " << buffer->checkChannelPacketCodes()
369 <<
" -- buffer->checkFEUnitLengths() = " << buffer->checkFEUnitLengths()
377 fillFEErrors(buffer.get(),aDoFEMaj,aFeMajFrac);
380 fillChannelErrors(buffer.get(),
396 if (buffer.get()) debugBuffer = buffer.get();
399 std::vector<FEDErrors::APVLevelErrors> & lChVec = getAPVLevelErrors();
400 std::ostringstream debugStream;
403 debugStream <<
"[FEDErrors] Cabled channels which had errors: ";
405 for (
unsigned int iBadCh(0); iBadCh < lChVec.size(); iBadCh++) {
406 print(lChVec[iBadCh],debugStream);
408 debugStream << std::endl;
409 debugStream <<
"[FEDErrors] Active (have been locked in at least one event) cabled channels which had errors: ";
410 for (
unsigned int iBadCh(0); iBadCh < lChVec.size(); iBadCh++) {
411 if ((lChVec[iBadCh]).IsActive)
print(lChVec[iBadCh],debugStream);
415 debugStream << (*debugBuffer) << std::endl;
416 debugBuffer->
dump(debugStream);
417 debugStream << std::endl;
418 edm::LogInfo(
"SiStripMonitorHardware") <<
"[FEDErrors] Errors found in FED " << fedID_;
423 return !(anyFEDErrors());
428 std::vector<std::vector<std::pair<unsigned int,unsigned int> > > & aFeMajFrac)
430 bool foundOverflow =
false;
431 bool foundBadMajority =
false;
432 bool foundMissing =
false;
435 FEDErrors::FELevelErrors lFeErr;
437 lFeErr.SubDetID = subDetId_[iFE];
438 lFeErr.Overflow =
false;
439 lFeErr.Missing =
false;
440 lFeErr.BadMajorityAddress =
false;
441 lFeErr.TimeDifference = 0;
445 bool hasCabledChannels =
false;
447 if (connected_[iFE*sistrip::FEDCH_PER_FEUNIT+feUnitCh]) {
448 hasCabledChannels =
true;
453 if (!hasCabledChannels)
continue;
456 lFeErr.Overflow =
true;
457 foundOverflow =
true;
467 lFeErr.Missing =
true;
479 lFeErr.BadMajorityAddress =
true;
480 foundBadMajority =
true;
523 if (lFeErr.SubDetID == 2 || lFeErr.SubDetID == 3 || lFeErr.SubDetID == 4)
524 aFeMajFrac[0].push_back(std::pair<unsigned int, unsigned int>(fedID_,lFeErr.FeMaj));
525 else if (lFeErr.SubDetID == 5)
526 aFeMajFrac[1].push_back(std::pair<unsigned int, unsigned int>(fedID_,lFeErr.FeMaj));
527 else if (lFeErr.SubDetID == 0)
528 aFeMajFrac[2].push_back(std::pair<unsigned int, unsigned int>(fedID_,lFeErr.FeMaj));
529 else if (lFeErr.SubDetID == 1)
530 aFeMajFrac[3].push_back(std::pair<unsigned int, unsigned int>(fedID_,lFeErr.FeMaj));
535 lFeErr.TimeDifference =
542 if (foundBadMajority || lFeErr.TimeDifference != 0){
565 return !(foundOverflow || foundMissing || foundBadMajority);
570 const unsigned int aPrintDebug,
571 unsigned int & aCounterMonitoring,
572 unsigned int & aCounterUnpacker,
578 bool foundError =
false;
583 aFullDebug = debugHeader;
589 bool lPassedMonitoringFEDcheck = !fedErrors_.CorruptBuffer;
593 bool lFailUnpackerChannelCheck = (!aBuffer->
channelGood(iCh) && connected_[iCh]) || failUnpackerFEDCheck_;
594 bool lFailMonitoringChannelCheck = !lPassedMonitoringFEDcheck && connected_[iCh];
597 FEDErrors::ChannelLevelErrors lChErr;
598 lChErr.ChannelID = iCh;
599 lChErr.Connected = connected_[iCh];
600 lChErr.IsActive =
false;
601 lChErr.Unlocked =
false;
602 lChErr.OutOfSync =
false;
604 if (!connected_[iCh]) {
606 addBadChannel(lChErr);
610 if (!aBuffer->
feGood(static_cast<unsigned int>(iCh/sistrip::FEDCH_PER_FEUNIT))) {
611 lFailMonitoringChannelCheck =
true;
616 bool apvBad[2] = {
false,
false};
635 !(lStatus & sistrip::CHANNEL_STATUS_IN_SYNC) ||
640 lChErr.IsActive =
true;
643 if (!(lStatus & sistrip::CHANNEL_STATUS_IN_SYNC)) {
644 lChErr.OutOfSync =
true;
648 lChErr.Unlocked =
true;
654 if (!apvBad[0] && !apvBad[1]) {
655 lChErr.IsActive =
true;
660 if (lChErr.Unlocked || lChErr.OutOfSync) addBadChannel(lChErr);
667 for (
unsigned int iAPV = 0; iAPV < 2; iAPV++) {
669 FEDErrors::APVLevelErrors lAPVErr;
670 lAPVErr.APVID = 2*iCh+iAPV;
671 lAPVErr.ChannelID = iCh;
672 lAPVErr.Connected = connected_[iCh];
673 lAPVErr.IsActive = lChErr.IsActive;
674 lAPVErr.APVStatusBit =
false;
675 lAPVErr.APVError =
false;
676 lAPVErr.APVAddressError =
false;
680 lFailMonitoringChannelCheck =
true;
681 lAPVErr.APVStatusBit =
true;
685 if (debugHeader && !lChErr.Unlocked && !lChErr.OutOfSync) {
687 if ( (iAPV==0 && !(lStatus & sistrip::CHANNEL_STATUS_APV0_NO_ERROR_BIT)) ||
688 (iAPV==1 && !(lStatus & sistrip::CHANNEL_STATUS_APV1_NO_ERROR_BIT))) {
689 lAPVErr.APVError =
true;
694 lAPVErr.APVAddressError =
true;
698 if ( lAPVErr.APVStatusBit ||
700 lAPVErr.APVAddressError
701 ) addBadAPV(lAPVErr, lFirst);
708 if (lFailUnpackerChannelCheck != lFailMonitoringChannelCheck && connected_[iCh]){
710 std::ostringstream debugStream;
711 debugStream <<
"[FEDErrors] ------ WARNING: FED " << fedID_ <<
", channel " << iCh
712 <<
", isConnected = " << connected_[iCh] << std::endl
713 <<
"[FEDErrors] --------- Monitoring Channel check " ;
714 if (lFailMonitoringChannelCheck) debugStream <<
"failed." << std::endl;
715 else debugStream <<
"passed." << std::endl ;
716 debugStream <<
"[FEDErrors] --------- Unpacker Channel check " ;
717 if (lFailUnpackerChannelCheck) debugStream <<
"failed." << std::endl;
718 else debugStream <<
"passed." << std::endl;
719 debugStream <<
"[FEDErrors] --------- fegood = "
720 << aBuffer->
feGood(static_cast<unsigned int>(iCh/sistrip::FEDCH_PER_FEUNIT))
722 <<
"[FEDErrors] --------- unpacker FED check = " << failUnpackerFEDCheck_ << std::endl;
723 edm::LogError(
"SiStripMonitorHardware") << debugStream.str();
726 if (lFailMonitoringChannelCheck) aCounterMonitoring++;
727 if (lFailUnpackerChannelCheck) aCounterUnpacker++;
730 if (lMedValid && !foundError && lPassedMonitoringFEDcheck && aDoMeds) {
734 HistogramBase::fillHistogram(aMedianHist0,
736 HistogramBase::fillHistogram(aMedianHist1,
746 void FEDErrors::fillBadChannelList(
const bool doTkHistoMap,
749 unsigned int & aNBadChannels,
750 unsigned int & aNBadActiveChannels)
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]);
835 if ((isBadChan && isActiveChan) || lFailFED || (isBadFE && !isMissingFE)) aNBadActiveChannels++;
836 if ( isBadApv1 || lFailFED || isBadFE ) HistogramBase::fillHistogram ( aFedIdVsApvId , 2 * iCh , fedID_ ) ;
837 if ( isBadApv2 || lFailFED || isBadFE ) HistogramBase::fillHistogram ( aFedIdVsApvId , 2 * iCh + 1 , fedID_ ) ;
844 if (!hasBeenProcessed){
856 void FEDErrors::fillEventProperties(
long long dbx) {
857 eventProp_.deltaBX = dbx;
860 void FEDErrors::incrementLumiErrors(
const bool hasError,
861 const unsigned int aSubDet){
862 if (!lumiErr_.nTotal.size())
return;
863 if (aSubDet >= lumiErr_.nTotal.size()) {
864 edm::LogError(
"SiStripMonitorHardware") <<
" -- FED " << fedID_
865 <<
", invalid subdetid : " << aSubDet
866 <<
", size of lumiErr : "
867 << lumiErr_.nTotal.size()
871 if (hasError) lumiErr_.nErrors[aSubDet]++;
872 lumiErr_.nTotal[aSubDet]++;
876 void FEDErrors::processDet(
const uint32_t aPrevId,
877 const uint16_t aPrevTot,
878 const bool doTkHistoMap,
883 if (aPrevTot < nBad){
884 edm::LogError(
"SiStripMonitorHardware") <<
" -- Number of bad channels in det " << aPrevId
886 <<
", total number of pairs for this det = " << aPrevTot
891 uint32_t lDetid = aPrevId;
892 if (aPrevTot != 0 && doTkHistoMap && aTkMapPointer)
893 HistogramBase::fillTkHistoMap(aTkMapPointer,lDetid,static_cast<float>(nBad)/aPrevTot);
899 const bool FEDErrors::failMonitoringFEDCheck()
901 return ( anyFEDErrors() ||
902 fedErrors_.CorruptBuffer
906 const bool FEDErrors::anyDAQProblems()
908 return ( fedErrors_.DataMissing ||
909 fedErrors_.InvalidBuffers ||
910 fedErrors_.BadFEDCRCs ||
911 fedErrors_.BadDAQCRCs ||
913 fedErrors_.BadDAQPacket
917 const bool FEDErrors::anyFEDErrors()
919 return ( fedErrors_.InvalidBuffers ||
920 fedErrors_.BadFEDCRCs ||
921 fedErrors_.BadDAQCRCs ||
923 fedErrors_.BadDAQPacket ||
924 fedErrors_.FEsOverflow
928 const bool FEDErrors::anyFEProblems()
930 return ( fedErrors_.FEsOverflow ||
931 fedErrors_.FEsMissing ||
932 fedErrors_.FEsBadMajorityAddress
938 return ( anyFEDErrors() ||
940 fedErrors_.CorruptBuffer ||
941 fedErrors_.BadChannelStatusBit
946 const unsigned int FEDErrors::fedID(){
951 FEDErrors::FEDCounters & FEDErrors::getFEDErrorsCounters()
956 FEDErrors::ChannelCounters & FEDErrors::getChannelErrorsCounters()
961 FEDErrors::FECounters & FEDErrors::getFEErrorsCounters()
966 FEDErrors::FEDLevelErrors & FEDErrors::getFEDLevelErrors()
971 FEDErrors::EventProperties & FEDErrors::getEventProperties()
976 std::vector<FEDErrors::FELevelErrors> & FEDErrors::getFELevelErrors()
981 std::vector<FEDErrors::ChannelLevelErrors> & FEDErrors::getChannelLevelErrors()
983 return chErrorsDetailed_;
986 std::vector<FEDErrors::APVLevelErrors> & FEDErrors::getAPVLevelErrors()
991 std::vector<std::pair<unsigned int,bool> > & FEDErrors::getBadChannels()
996 const FEDErrors::LumiErrors & FEDErrors::getLumiErrors(){
1000 void FEDErrors::addBadFE(
const FEDErrors::FELevelErrors & aFE)
1003 fedErrors_.FEsOverflow =
true;
1004 (feCounter_.nFEOverflows)++;
1006 else if (aFE.Missing) {
1007 fedErrors_.FEsMissing =
true;
1008 (feCounter_.nFEMissing)++;
1009 feErrors_.push_back(aFE);
1011 else if (aFE.BadMajorityAddress) {
1012 fedErrors_.FEsBadMajorityAddress =
true;
1013 (feCounter_.nFEBadMajorityAddresses)++;
1014 feErrors_.push_back(aFE);
1016 else if (aFE.TimeDifference != 0) {
1017 feErrors_.push_back(aFE);
1021 void FEDErrors::addBadChannel(
const FEDErrors::ChannelLevelErrors & aChannel)
1023 if (aChannel.Connected) chErrorsDetailed_.push_back(aChannel);
1024 incrementChannelCounters(aChannel);
1027 void FEDErrors::addBadAPV(
const FEDErrors::APVLevelErrors & aAPV,
bool & aFirst)
1029 apvErrors_.push_back(aAPV);
1030 incrementAPVCounters(aAPV);
1031 if (aAPV.APVStatusBit && aFirst) {
1032 fedErrors_.BadChannelStatusBit =
true;
1033 lFedCounter_.nBadChannels++;
1034 chErrors_.push_back(std::pair<unsigned int, bool>(aAPV.ChannelID,aAPV.IsActive));
1035 if (aAPV.IsActive) {
1037 fedErrors_.BadActiveChannelStatusBit =
true;
1038 lFedCounter_.nBadActiveChannels++;
1046 void FEDErrors::incrementFEDCounters()
1048 if (fedErrors_.InvalidBuffers ||
1049 fedErrors_.BadFEDCRCs ||
1050 fedErrors_.BadDAQCRCs ||
1051 fedErrors_.BadIDs ||
1052 fedErrors_.BadDAQPacket
1054 lFedCounter_.nDAQProblems++;
1055 lFedCounter_.nFEDErrors++;
1059 if (fedErrors_.FEsOverflow){
1060 lFedCounter_.nFEDsWithFEOverflows++;
1062 else if (fedErrors_.FEsMissing){
1063 lFedCounter_.nFEDsWithMissingFEs++;
1065 else if (fedErrors_.FEsBadMajorityAddress){
1066 lFedCounter_.nFEDsWithFEBadMajorityAddresses++;
1069 if (fedErrors_.FEsOverflow ||
1070 fedErrors_.FEsBadMajorityAddress ||
1071 fedErrors_.FEsMissing
1073 lFedCounter_.nFEDsWithFEProblems++;
1074 lFedCounter_.nFEDErrors++;
1076 else if (fedErrors_.CorruptBuffer) {
1077 lFedCounter_.nCorruptBuffers++;
1078 lFedCounter_.nFEDErrors++;
1085 void FEDErrors::incrementChannelCounters(
const FEDErrors::ChannelLevelErrors & aChannel)
1087 if (aChannel.Unlocked && aChannel.Connected) lChCounter_.nUnlocked++;
1088 if (aChannel.OutOfSync && aChannel.Connected) lChCounter_.nOutOfSync++;
1089 if (!aChannel.Connected) lChCounter_.nNotConnected++;
1092 void FEDErrors::incrementAPVCounters(
const FEDErrors::APVLevelErrors & aAPV)
1094 if (aAPV.Connected && aAPV.IsActive){
1095 if (aAPV.APVStatusBit) lChCounter_.nAPVStatusBit++;
1096 if (aAPV.APVAddressError) lChCounter_.nAPVAddressError++;
1097 if (aAPV.APVError) lChCounter_.nAPVError++;
1103 if (this->ChannelID < aErr.ChannelID)
return true;
1110 if (this->ChannelID < aErr.ChannelID)
return true;
1115 void FEDErrors::print(
const FEDErrors::FEDCounters & aFEDCounter, std::ostream & aOs)
1119 aOs <<
"[FEDErrors]============================================" << std::endl
1120 <<
"[FEDErrors]==== Printing FEDCounters information : ====" << std::endl
1121 <<
"[FEDErrors]============================================" << std::endl
1122 <<
"[FEDErrors]======== nFEDErrors = " << aFEDCounter.nFEDErrors << std::endl
1123 <<
"[FEDErrors]======== nDAQProblems = " << aFEDCounter.nDAQProblems << std::endl
1124 <<
"[FEDErrors]======== nFEDsWithFEProblems = " << aFEDCounter.nFEDsWithFEProblems << std::endl
1125 <<
"[FEDErrors]======== nCorruptBuffers = " << aFEDCounter.nCorruptBuffers << std::endl
1126 <<
"[FEDErrors]======== nBadChannels = " << aFEDCounter.nBadChannels << std::endl
1127 <<
"[FEDErrors]======== nBadActiveChannels = " << aFEDCounter.nBadActiveChannels << std::endl
1128 <<
"[FEDErrors]======== nFEDsWithFEOverflows = " << aFEDCounter.nFEDsWithFEOverflows << std::endl
1129 <<
"[FEDErrors]======== nFEDsWithFEBadMajorityAddresses = " << aFEDCounter.nFEDsWithFEBadMajorityAddresses << std::endl
1130 <<
"[FEDErrors]======== nFEDsWithMissingFEs = " << aFEDCounter.nFEDsWithMissingFEs << std::endl
1131 <<
"[FEDErrors]======== nTotalBadChannels = " << aFEDCounter.nTotalBadChannels << std::endl
1132 <<
"[FEDErrors]======== nTotalBadActiveChannels = " << aFEDCounter.nTotalBadActiveChannels << std::endl
1133 <<
"[FEDErrors]============================================" << std::endl;
1138 void FEDErrors::print(
const FEDErrors::FECounters & aFECounter, std::ostream & aOs)
1142 aOs <<
"[FEDErrors]============================================" << std::endl
1143 <<
"[FEDErrors]==== Printing FECounters information : ====" << std::endl
1144 <<
"[FEDErrors]============================================" << std::endl
1145 <<
"[FEDErrors]======== nFEOverflows = " << aFECounter.nFEOverflows << std::endl
1146 <<
"[FEDErrors]======== nFEBadMajorityAddresses = " << aFECounter.nFEBadMajorityAddresses << std::endl
1147 <<
"[FEDErrors]======== nFEMissing = " << aFECounter.nFEMissing << std::endl
1148 <<
"[FEDErrors]============================================" << std::endl;
1153 void FEDErrors::print(
const FEDErrors::FEDLevelErrors & aFEDErr, std::ostream & aOs)
1157 aOs <<
"[FEDErrors]============================================" << std::endl
1158 <<
"[FEDErrors]==== Printing FED errors information : ====" << std::endl
1159 <<
"[FEDErrors]============================================" << std::endl
1160 <<
"[FEDErrors]======== HasCabledChannels = " << aFEDErr.HasCabledChannels << std::endl
1161 <<
"[FEDErrors]======== DataPresent = " << aFEDErr.DataPresent << std::endl
1162 <<
"[FEDErrors]======== DataMissing = " << aFEDErr.DataMissing << std::endl
1163 <<
"[FEDErrors]======== InvalidBuffers = " << aFEDErr.InvalidBuffers << std::endl
1164 <<
"[FEDErrors]======== BadFEDCRCs = " << aFEDErr.BadFEDCRCs << std::endl
1165 <<
"[FEDErrors]======== BadDAQCRCs = " << aFEDErr.BadDAQCRCs << std::endl
1166 <<
"[FEDErrors]======== BadIDs = " << aFEDErr.BadIDs << std::endl
1167 <<
"[FEDErrors]======== BadDAQPacket = " << aFEDErr.BadDAQPacket << std::endl
1168 <<
"[FEDErrors]======== CorruptBuffer = " << aFEDErr.CorruptBuffer << std::endl
1169 <<
"[FEDErrors]======== FEOverflows = " << aFEDErr.FEsOverflow << std::endl
1170 <<
"[FEDErrors]======== FEMissing = " << aFEDErr.FEsMissing << std::endl
1171 <<
"[FEDErrors]======== BadMajorityAddresses = " << aFEDErr.FEsBadMajorityAddress << std::endl
1172 <<
"[FEDErrors]============================================" << std::endl;
1176 void FEDErrors::print(
const FEDErrors::FELevelErrors & aErr, std::ostream & aOs)
1180 aOs <<
"[FEDErrors]============================================" << std::endl
1181 <<
"[FEDErrors]==== Printing FE errors information : ====" << std::endl
1182 <<
"[FEDErrors]============================================" << std::endl
1183 <<
"[FEDErrors]======== FE #" << aErr.FeID << std::endl
1184 <<
"[FEDErrors]======== subdet " << aErr.SubDetID << std::endl
1185 <<
"[FEDErrors]======== FEOverflow = " << aErr.Overflow << std::endl
1186 <<
"[FEDErrors]======== FEMissing = " << aErr.Missing << std::endl
1187 <<
"[FEDErrors]======== BadMajorityAddresses = " << aErr.BadMajorityAddress << std::endl
1188 <<
"[FEDErrors]======== TimeDifference = " << aErr.TimeDifference << std::endl
1189 <<
"[FEDErrors]============================================" << std::endl;
1193 void FEDErrors::print(
const FEDErrors::ChannelLevelErrors & aErr, std::ostream & aOs)
1196 aOs <<
"[FEDErrors]=================================================" << std::endl
1197 <<
"[FEDErrors]==== Printing channel errors information : ====" << std::endl
1198 <<
"[FEDErrors]=================================================" << std::endl
1199 <<
"[FEDErrors]============ Channel #" << aErr.ChannelID << std::endl
1200 <<
"[FEDErrors]============ connected = " << aErr.Connected << std::endl
1201 <<
"[FEDErrors]============ isActive = " << aErr.IsActive << std::endl
1202 <<
"[FEDErrors]============ Unlocked = " << aErr.Unlocked << std::endl
1203 <<
"[FEDErrors]============ OutOfSync = " << aErr.OutOfSync << std::endl
1204 <<
"[FEDErrors]=================================================" << std::endl;
1208 void FEDErrors::print(
const FEDErrors::APVLevelErrors & aErr, std::ostream & aOs)
1211 aOs <<
"[FEDErrors]=================================================" << std::endl
1212 <<
"[FEDErrors]==== Printing APV errors information : ====" << std::endl
1213 <<
"[FEDErrors]=================================================" << std::endl
1214 <<
"[FEDErrors]============ APV #" << aErr.APVID << std::endl
1215 <<
"[FEDErrors]============ Channel #" << aErr.ChannelID << std::endl
1216 <<
"[FEDErrors]============ connected = " << aErr.Connected << std::endl
1217 <<
"[FEDErrors]============ isActive = " << aErr.IsActive << std::endl
1218 <<
"[FEDErrors]============ APVStatusBit = " << aErr.APVStatusBit << std::endl
1219 <<
"[FEDErrors]============ APVError = " << aErr.APVError << std::endl
1220 <<
"[FEDErrors]============ APVAddressError = " << aErr.APVAddressError << std::endl
1221 <<
"[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