File indexing completed on 2024-04-06 12:08:49
0001 #include "DataFormats/FEDRawData/interface/FEDNumbering.h"
0002 #include "DataFormats/SiStripCommon/interface/SiStripFedKey.h"
0003 #include "DataFormats/SiStripCommon/interface/ConstantsForHardwareSystems.h"
0004
0005 #include "DQM/SiStripMonitorHardware/interface/FEDHistograms.hh"
0006
0007 FEDHistograms::FEDHistograms() {}
0008
0009 FEDHistograms::~FEDHistograms() {}
0010
0011 void FEDHistograms::initialise(const edm::ParameterSet& iConfig, std::ostringstream* pDebugStream) {
0012 getConfigForHistogram(fedEventSize_, "FedEventSize", iConfig, pDebugStream);
0013 getConfigForHistogram(fedMaxEventSizevsTime_, "FedMaxEventSizevsTime", iConfig, pDebugStream);
0014
0015 getConfigForHistogram(dataPresent_, "DataPresent", iConfig, pDebugStream);
0016 getConfigForHistogram(anyFEDErrors_, "AnyFEDErrors", iConfig, pDebugStream);
0017 getConfigForHistogram(anyDAQProblems_, "AnyDAQProblems", iConfig, pDebugStream);
0018 getConfigForHistogram(anyFEProblems_, "AnyFEProblems", iConfig, pDebugStream);
0019 getConfigForHistogram(corruptBuffers_, "CorruptBuffers", iConfig, pDebugStream);
0020 getConfigForHistogram(badChannelStatusBits_, "BadChannelStatusBits", iConfig, pDebugStream);
0021 getConfigForHistogram(badActiveChannelStatusBits_, "BadActiveChannelStatusBits", iConfig, pDebugStream);
0022
0023 getConfigForHistogram(feOverflows_, "FEOverflows", iConfig, pDebugStream);
0024 getConfigForHistogram(feMissing_, "FEMissing", iConfig, pDebugStream);
0025 getConfigForHistogram(badMajorityAddresses_, "BadMajorityAddresses", iConfig, pDebugStream);
0026 getConfigForHistogram(badMajorityInPartition_, "BadMajorityInPartition", iConfig, pDebugStream);
0027 getConfigForHistogram(feMajFracTIB_, "FeMajFracTIB", iConfig, pDebugStream);
0028 getConfigForHistogram(feMajFracTOB_, "FeMajFracTOB", iConfig, pDebugStream);
0029 getConfigForHistogram(feMajFracTECB_, "FeMajFracTECB", iConfig, pDebugStream);
0030 getConfigForHistogram(feMajFracTECF_, "FeMajFracTECF", iConfig, pDebugStream);
0031
0032 getConfigForHistogram(dataMissing_, "DataMissing", iConfig, pDebugStream);
0033 getConfigForHistogram(badIDs_, "BadIDs", iConfig, pDebugStream);
0034 getConfigForHistogram(badDAQPacket_, "BadDAQPacket", iConfig, pDebugStream);
0035 getConfigForHistogram(invalidBuffers_, "InvalidBuffers", iConfig, pDebugStream);
0036 getConfigForHistogram(badDAQCRCs_, "BadDAQCRCs", iConfig, pDebugStream);
0037 getConfigForHistogram(badFEDCRCs_, "BadFEDCRCs", iConfig, pDebugStream);
0038
0039 getConfigForHistogram(feOverflowDetailed_, "FEOverflowsDetailed", iConfig, pDebugStream);
0040 getConfigForHistogram(feMissingDetailed_, "FEMissingDetailed", iConfig, pDebugStream);
0041 getConfigForHistogram(badMajorityAddressDetailed_, "BadMajorityAddressesDetailed", iConfig, pDebugStream);
0042 getConfigForHistogram(badStatusBitsDetailed_, "BadAPVStatusBitsDetailed", iConfig, pDebugStream);
0043 getConfigForHistogram(apvErrorDetailed_, "APVErrorBitsDetailed", iConfig, pDebugStream);
0044 getConfigForHistogram(apvAddressErrorDetailed_, "APVAddressErrorBitsDetailed", iConfig, pDebugStream);
0045 getConfigForHistogram(unlockedDetailed_, "UnlockedBitsDetailed", iConfig, pDebugStream);
0046 getConfigForHistogram(outOfSyncDetailed_, "OOSBitsDetailed", iConfig, pDebugStream);
0047
0048 getConfigForHistogram(nFEDErrors_, "nFEDErrors", iConfig, pDebugStream);
0049 getConfigForHistogram(nFEDDAQProblems_, "nFEDDAQProblems", iConfig, pDebugStream);
0050 getConfigForHistogram(nFEDsWithFEProblems_, "nFEDsWithFEProblems", iConfig, pDebugStream);
0051 getConfigForHistogram(nFEDCorruptBuffers_, "nFEDCorruptBuffers", iConfig, pDebugStream);
0052 getConfigForHistogram(nBadChannelStatusBits_, "nBadChannelStatusBits", iConfig, pDebugStream);
0053 getConfigForHistogram(nBadActiveChannelStatusBits_, "nBadActiveChannelStatusBits", iConfig, pDebugStream);
0054 getConfigForHistogram(nFEDsWithFEOverflows_, "nFEDsWithFEOverflows", iConfig, pDebugStream);
0055 getConfigForHistogram(nFEDsWithMissingFEs_, "nFEDsWithMissingFEs", iConfig, pDebugStream);
0056 getConfigForHistogram(nFEDsWithFEBadMajorityAddresses_, "nFEDsWithFEBadMajorityAddresses", iConfig, pDebugStream);
0057
0058 getConfigForHistogram(nFEDErrorsvsTime_, "nFEDErrorsvsTime", iConfig, pDebugStream);
0059 getConfigForHistogram(fedErrorsVsIdVsLumi_, "fedErrorsVsIdVsLumi", iConfig, pDebugStream);
0060 getConfigForHistogram(nFEDCorruptBuffersvsTime_, "nFEDCorruptBuffersvsTime", iConfig, pDebugStream);
0061 getConfigForHistogram(nFEDsWithFEProblemsvsTime_, "nFEDsWithFEProblemsvsTime", iConfig, pDebugStream);
0062
0063 getConfigForHistogram(nUnconnectedChannels_, "nUnconnectedChannels", iConfig, pDebugStream);
0064
0065 getConfigForHistogram(nTotalBadChannels_, "nTotalBadChannels", iConfig, pDebugStream);
0066 getConfigForHistogram(nTotalBadActiveChannels_, "nTotalBadActiveChannels", iConfig, pDebugStream);
0067
0068 getConfigForHistogram(nTotalBadChannelsvsTime_, "nTotalBadChannelsvsTime", iConfig, pDebugStream);
0069 getConfigForHistogram(nTotalBadActiveChannelsvsTime_, "nTotalBadActiveChannelsvsTime", iConfig, pDebugStream);
0070
0071 getConfigForHistogram(nAPVStatusBit_, "nAPVStatusBit", iConfig, pDebugStream);
0072 getConfigForHistogram(nAPVError_, "nAPVError", iConfig, pDebugStream);
0073 getConfigForHistogram(nAPVAddressError_, "nAPVAddressError", iConfig, pDebugStream);
0074 getConfigForHistogram(nUnlocked_, "nUnlocked", iConfig, pDebugStream);
0075 getConfigForHistogram(nOutOfSync_, "nOutOfSync", iConfig, pDebugStream);
0076
0077 getConfigForHistogram(nAPVStatusBitvsTime_, "nAPVStatusBitvsTime", iConfig, pDebugStream);
0078 getConfigForHistogram(nAPVErrorvsTime_, "nAPVErrorvsTime", iConfig, pDebugStream);
0079 getConfigForHistogram(nAPVAddressErrorvsTime_, "nAPVAddressErrorvsTime", iConfig, pDebugStream);
0080 getConfigForHistogram(nUnlockedvsTime_, "nUnlockedvsTime", iConfig, pDebugStream);
0081 getConfigForHistogram(nOutOfSyncvsTime_, "nOutOfSyncvsTime", iConfig, pDebugStream);
0082
0083 getConfigForHistogram(tkMapConfig_, "TkHistoMap", iConfig, pDebugStream);
0084
0085 getConfigForHistogram(feTimeDiffTIB_, "FETimeDiffTIB", iConfig, pDebugStream);
0086 getConfigForHistogram(feTimeDiffTOB_, "FETimeDiffTOB", iConfig, pDebugStream);
0087 getConfigForHistogram(feTimeDiffTECB_, "FETimeDiffTECB", iConfig, pDebugStream);
0088 getConfigForHistogram(feTimeDiffTECF_, "FETimeDiffTECF", iConfig, pDebugStream);
0089
0090 getConfigForHistogram(feTimeDiffvsDBX_, "FETimeDiffvsDBX", iConfig, pDebugStream);
0091
0092 getConfigForHistogram(apveAddress_, "ApveAddress", iConfig, pDebugStream);
0093 getConfigForHistogram(feMajAddress_, "FeMajAddress", iConfig, pDebugStream);
0094
0095 getConfigForHistogram(medianAPV0_, "MedianAPV0", iConfig, pDebugStream);
0096 getConfigForHistogram(medianAPV1_, "MedianAPV1", iConfig, pDebugStream);
0097
0098 getConfigForHistogram(fedIdVsApvId_, "FedIdVsApvId", iConfig, pDebugStream);
0099
0100 getConfigForHistogram(fedErrorsVsId_, "FedErrorsVsId", iConfig, pDebugStream);
0101 }
0102
0103 void FEDHistograms::fillCountersHistograms(const FEDErrors::FEDCounters& fedLevelCounters,
0104 const FEDErrors::ChannelCounters& chLevelCounters,
0105 const unsigned int aMaxSize,
0106 const double aTime) {
0107 fillHistogram(fedMaxEventSizevsTime_, aTime, aMaxSize);
0108
0109 fillHistogram(nFEDErrors_, fedLevelCounters.nFEDErrors);
0110 fillHistogram(nFEDDAQProblems_, fedLevelCounters.nDAQProblems);
0111 fillHistogram(nFEDsWithFEProblems_, fedLevelCounters.nFEDsWithFEProblems);
0112 fillHistogram(nFEDCorruptBuffers_, fedLevelCounters.nCorruptBuffers);
0113 fillHistogram(nFEDsWithFEOverflows_, fedLevelCounters.nFEDsWithFEOverflows);
0114 fillHistogram(nFEDsWithFEBadMajorityAddresses_, fedLevelCounters.nFEDsWithFEBadMajorityAddresses);
0115 fillHistogram(nFEDsWithMissingFEs_, fedLevelCounters.nFEDsWithMissingFEs);
0116 fillHistogram(nBadChannelStatusBits_, fedLevelCounters.nBadChannels);
0117 fillHistogram(nBadActiveChannelStatusBits_, fedLevelCounters.nBadActiveChannels);
0118
0119 fillHistogram(nFEDErrorsvsTime_, aTime, fedLevelCounters.nFEDErrors);
0120 fillHistogram(nFEDCorruptBuffersvsTime_, aTime, fedLevelCounters.nCorruptBuffers);
0121 fillHistogram(nFEDsWithFEProblemsvsTime_, aTime, fedLevelCounters.nFEDsWithFEProblems);
0122
0123 fillHistogram(nUnconnectedChannels_, chLevelCounters.nNotConnected);
0124
0125 fillHistogram(nTotalBadChannels_, fedLevelCounters.nTotalBadChannels);
0126 fillHistogram(nTotalBadActiveChannels_, fedLevelCounters.nTotalBadActiveChannels);
0127
0128 fillHistogram(nTotalBadChannelsvsTime_, aTime, fedLevelCounters.nTotalBadChannels);
0129 fillHistogram(nTotalBadActiveChannelsvsTime_, aTime, fedLevelCounters.nTotalBadActiveChannels);
0130
0131 fillHistogram(nAPVStatusBit_, chLevelCounters.nAPVStatusBit);
0132 fillHistogram(nAPVError_, chLevelCounters.nAPVError);
0133 fillHistogram(nAPVAddressError_, chLevelCounters.nAPVAddressError);
0134 fillHistogram(nUnlocked_, chLevelCounters.nUnlocked);
0135 fillHistogram(nOutOfSync_, chLevelCounters.nOutOfSync);
0136
0137 fillHistogram(nAPVStatusBitvsTime_, aTime, chLevelCounters.nAPVStatusBit);
0138 fillHistogram(nAPVErrorvsTime_, aTime, chLevelCounters.nAPVError);
0139 fillHistogram(nAPVAddressErrorvsTime_, aTime, chLevelCounters.nAPVAddressError);
0140 fillHistogram(nUnlockedvsTime_, aTime, chLevelCounters.nUnlocked);
0141 fillHistogram(nOutOfSyncvsTime_, aTime, chLevelCounters.nOutOfSync);
0142 }
0143
0144 void FEDHistograms::fillFEDHistograms(FEDErrors& aFedErr,
0145 const unsigned int aEvtSize,
0146 bool lFullDebug,
0147 const double aLumiSection,
0148 unsigned int& NumBadChannels_perFEDID) {
0149 const FEDErrors::FEDLevelErrors& lFedLevelErrors = aFedErr.getFEDLevelErrors();
0150 const unsigned int lFedId = aFedErr.fedID();
0151
0152 fillHistogram(fedEventSize_, lFedId, aEvtSize);
0153
0154 if (lFedLevelErrors.DataPresent)
0155 fillHistogram(dataPresent_, lFedId);
0156
0157 if (lFedLevelErrors.HasCabledChannels && lFedLevelErrors.DataMissing) {
0158 fillHistogram(dataMissing_, lFedId);
0159 fillHistogram(fedErrorsVsId_, lFedId, 1);
0160 }
0161
0162 if (lFedLevelErrors.InvalidBuffers) {
0163 fillHistogram(invalidBuffers_, lFedId);
0164 fillHistogram(fedErrorsVsId_, lFedId, 2);
0165 } else if (lFedLevelErrors.CorruptBuffer) {
0166 fillHistogram(corruptBuffers_, lFedId);
0167 fillHistogram(fedErrorsVsId_, lFedId, 3);
0168 } else if (lFedLevelErrors.BadFEDCRCs) {
0169 fillHistogram(badFEDCRCs_, lFedId);
0170 fillHistogram(fedErrorsVsId_, lFedId, 4);
0171 } else if (lFedLevelErrors.BadDAQCRCs) {
0172 fillHistogram(badDAQCRCs_, lFedId);
0173 fillHistogram(fedErrorsVsId_, lFedId, 5);
0174 } else if (lFedLevelErrors.BadIDs) {
0175 fillHistogram(badIDs_, lFedId);
0176 fillHistogram(fedErrorsVsId_, lFedId, 6);
0177 } else if (lFedLevelErrors.BadDAQPacket) {
0178 fillHistogram(badDAQPacket_, lFedId);
0179 fillHistogram(fedErrorsVsId_, lFedId, 7);
0180 }
0181
0182 if (aFedErr.anyFEDErrors()) {
0183 fillHistogram(anyFEDErrors_, lFedId);
0184 fillHistogram(fedErrorsVsId_, lFedId, 8);
0185 }
0186
0187 if (lFedLevelErrors.HasCabledChannels && aFedErr.anyDAQProblems()) {
0188 fillHistogram(anyDAQProblems_, lFedId);
0189 fillHistogram(fedErrorsVsId_, lFedId, 9);
0190 }
0191 if (aFedErr.anyFEProblems()) {
0192 fillHistogram(anyFEProblems_, lFedId);
0193 fillHistogram(fedErrorsVsId_, lFedId, 10);
0194 }
0195
0196 if (lFedLevelErrors.FEsOverflow) {
0197 fillHistogram(feOverflows_, lFedId);
0198 fillHistogram(fedErrorsVsId_, lFedId, 11);
0199 }
0200 if (lFedLevelErrors.FEsMissing) {
0201 fillHistogram(feMissing_, lFedId);
0202 fillHistogram(fedErrorsVsId_, lFedId, 12);
0203 }
0204 if (lFedLevelErrors.FEsBadMajorityAddress) {
0205 fillHistogram(badMajorityAddresses_, lFedId);
0206 fillHistogram(fedErrorsVsId_, lFedId, 13);
0207 }
0208
0209 if (lFedLevelErrors.BadChannelStatusBit) {
0210 fillHistogram(badChannelStatusBits_, lFedId);
0211 fillHistogram(fedErrorsVsId_, lFedId, 14);
0212 }
0213 if (lFedLevelErrors.BadActiveChannelStatusBit) {
0214 fillHistogram(badActiveChannelStatusBits_, lFedId);
0215 fillHistogram(fedErrorsVsId_, lFedId, 15);
0216 }
0217
0218 std::vector<FEDErrors::FELevelErrors>& lFeVec = aFedErr.getFELevelErrors();
0219
0220 for (unsigned int iFe(0); iFe < lFeVec.size(); iFe++) {
0221 fillFEHistograms(lFedId, lFeVec[iFe], aFedErr.getEventProperties());
0222 }
0223
0224 std::vector<FEDErrors::ChannelLevelErrors>& lChVec = aFedErr.getChannelLevelErrors();
0225 for (unsigned int iCh(0); iCh < lChVec.size(); iCh++) {
0226 fillChannelsHistograms(lFedId, lChVec[iCh], lFullDebug);
0227 }
0228
0229 std::vector<FEDErrors::APVLevelErrors>& lAPVVec = aFedErr.getAPVLevelErrors();
0230 for (unsigned int iApv(0); iApv < lAPVVec.size(); iApv++) {
0231 fillAPVsHistograms(lFedId, lAPVVec[iApv], lFullDebug);
0232 }
0233
0234 double numChannelLevelErrors = 0;
0235 if (fedErrorsVsIdVsLumi_.globalswitchon) {
0236 numChannelLevelErrors = double(lChVec.size());
0237 fillHistogram2D(fedErrorsVsIdVsLumi_, aLumiSection, lFedId, numChannelLevelErrors);
0238 }
0239 }
0240
0241
0242 void FEDHistograms::fillFEHistograms(const unsigned int aFedId,
0243 const FEDErrors::FELevelErrors& aFeLevelErrors,
0244 const FEDErrors::EventProperties& aEventProp) {
0245 const unsigned short lFeId = aFeLevelErrors.FeID;
0246
0247
0248
0249
0250
0251
0252
0253 if (aFeLevelErrors.Overflow)
0254 fillHistogram(feOverflowDetailedMap_[aFedId], lFeId);
0255 else if (aFeLevelErrors.Missing)
0256 fillHistogram(feMissingDetailedMap_[aFedId], lFeId);
0257 else if (aFeLevelErrors.BadMajorityAddress)
0258 fillHistogram(badMajorityAddressDetailedMap_[aFedId], lFeId);
0259
0260 if (aFeLevelErrors.TimeDifference != 0) {
0261 if (aFeLevelErrors.SubDetID == 2 || aFeLevelErrors.SubDetID == 3 || aFeLevelErrors.SubDetID == 4)
0262 fillHistogram(feTimeDiffTIB_, aFeLevelErrors.TimeDifference);
0263 else if (aFeLevelErrors.SubDetID == 5)
0264 fillHistogram(feTimeDiffTOB_, aFeLevelErrors.TimeDifference);
0265 else if (aFeLevelErrors.SubDetID == 0)
0266 fillHistogram(feTimeDiffTECB_, aFeLevelErrors.TimeDifference);
0267 else if (aFeLevelErrors.SubDetID == 1)
0268 fillHistogram(feTimeDiffTECF_, aFeLevelErrors.TimeDifference);
0269 fillHistogram(
0270 feTimeDiffvsDBX_,
0271 aEventProp.deltaBX,
0272 aFeLevelErrors.TimeDifference < 0 ? aFeLevelErrors.TimeDifference + 192 : aFeLevelErrors.TimeDifference);
0273 fillHistogram(apveAddress_, aFeLevelErrors.Apve);
0274 fillHistogram(feMajAddress_, aFeLevelErrors.FeMaj);
0275 }
0276 }
0277
0278
0279 void FEDHistograms::fillChannelsHistograms(const unsigned int aFedId,
0280 const FEDErrors::ChannelLevelErrors& aChErr,
0281 bool fullDebug) {
0282 unsigned int lChId = aChErr.ChannelID;
0283
0284
0285
0286
0287
0288
0289 if (aChErr.Unlocked) {
0290 fillHistogram(unlockedDetailedMap_[aFedId], lChId);
0291 }
0292 if (aChErr.OutOfSync) {
0293 fillHistogram(outOfSyncDetailedMap_[aFedId], lChId);
0294 }
0295 }
0296
0297 void FEDHistograms::fillAPVsHistograms(const unsigned int aFedId,
0298 const FEDErrors::APVLevelErrors& aAPVErr,
0299 bool fullDebug) {
0300 unsigned int lChId = aAPVErr.APVID;
0301
0302
0303
0304
0305
0306
0307
0308 if (aAPVErr.APVStatusBit)
0309 fillHistogram(badStatusBitsDetailedMap_[aFedId], lChId);
0310 if (aAPVErr.APVError)
0311 fillHistogram(apvErrorDetailedMap_[aFedId], lChId);
0312 if (aAPVErr.APVAddressError)
0313 fillHistogram(apvAddressErrorDetailedMap_[aFedId], lChId);
0314 }
0315
0316 void FEDHistograms::fillMajorityHistograms(const unsigned int aPart,
0317 const float aValue,
0318 const std::vector<unsigned int>& aFedIdVec) {
0319 if (aPart == 0)
0320 fillHistogram(feMajFracTIB_, aValue);
0321 else if (aPart == 1)
0322 fillHistogram(feMajFracTOB_, aValue);
0323 else if (aPart == 2)
0324 fillHistogram(feMajFracTECB_, aValue);
0325 else if (aPart == 3)
0326 fillHistogram(feMajFracTECF_, aValue);
0327
0328 for (unsigned int iFed(0); iFed < aFedIdVec.size(); ++iFed) {
0329 fillHistogram(badMajorityInPartition_, aFedIdVec[iFed]);
0330 }
0331 }
0332
0333 bool FEDHistograms::feMajHistosEnabled() {
0334 return (feMajFracTIB_.enabled || feMajFracTOB_.enabled || feMajFracTECB_.enabled || feMajFracTECF_.enabled ||
0335 badMajorityInPartition_.enabled);
0336 }
0337
0338 bool FEDHistograms::cmHistosEnabled() { return (medianAPV0_.enabled || medianAPV1_.enabled); }
0339
0340 FEDHistograms::MonitorElement* FEDHistograms::cmHistPointer(bool aApv1) {
0341 if (!aApv1)
0342 return medianAPV0_.monitorEle;
0343 else
0344 return medianAPV1_.monitorEle;
0345 }
0346
0347 FEDHistograms::MonitorElement* FEDHistograms::getFedvsAPVpointer() { return fedIdVsApvId_.monitorEle; }
0348
0349 void FEDHistograms::bookTopLevelHistograms(DQMStore::IBooker& ibooker,
0350 const TkDetMap* tkDetMap,
0351 std::string topFolderName) {
0352
0353 const unsigned int siStripFedIdMin = FEDNumbering::MINSiStripFEDID;
0354 const unsigned int siStripFedIdMax = FEDNumbering::MAXSiStripFEDID;
0355
0356
0357 histosBooked_.resize(siStripFedIdMax + 1, false);
0358 debugHistosBooked_.resize(siStripFedIdMax + 1, false);
0359
0360
0361 bookProfile(ibooker,
0362 fedEventSize_,
0363 "FedEventSize",
0364 "Average FED buffer Size (B) per Event",
0365 siStripFedIdMax - siStripFedIdMin + 1,
0366 siStripFedIdMin - 0.5,
0367 siStripFedIdMax + 0.5,
0368 0,
0369 42241,
0370 "FED-ID",
0371 "<FED buffer Size> (B)");
0372
0373 bookHistogram(ibooker,
0374 dataPresent_,
0375 "DataPresent",
0376 "Number of events where the data from a FED is seen",
0377 siStripFedIdMax - siStripFedIdMin + 1,
0378 siStripFedIdMin - 0.5,
0379 siStripFedIdMax + 0.5,
0380 "FED-ID");
0381
0382 bookHistogram(ibooker,
0383 nTotalBadChannels_,
0384 "nTotalBadChannels",
0385 "Number of channels with any error",
0386 "Total # bad enabled channels");
0387
0388 bookHistogram(ibooker,
0389 nTotalBadActiveChannels_,
0390 "nTotalBadActiveChannels",
0391 "Number of active channels with any error",
0392 "Total # bad active channels");
0393
0394 book2DHistogram(ibooker,
0395 fedIdVsApvId_,
0396 "FedIdVsApvId",
0397 "Any error per APV per event",
0398 192,
0399 0,
0400 192,
0401 440,
0402 50,
0403 490,
0404 "APV-ID",
0405 "FED-ID");
0406
0407 book2DHistogram(ibooker,
0408 fedErrorsVsId_,
0409 "FEDErrorsVsId",
0410 "FED Errors vs ID",
0411 siStripFedIdMax - siStripFedIdMin + 1,
0412 siStripFedIdMin,
0413 siStripFedIdMax + 1,
0414 15,
0415 1,
0416 16,
0417 "FED ID",
0418 "Error Type");
0419 fedErrorsVsId_.monitorEle->setBinLabel(1, "Data Missing", 2);
0420 fedErrorsVsId_.monitorEle->setBinLabel(2, "Invalid Buffers", 2);
0421 fedErrorsVsId_.monitorEle->setBinLabel(3, "Corrupt Buffers", 2);
0422 fedErrorsVsId_.monitorEle->setBinLabel(4, "Bad FED CRC", 2);
0423 fedErrorsVsId_.monitorEle->setBinLabel(5, "Bad DAQ CRC", 2);
0424 fedErrorsVsId_.monitorEle->setBinLabel(6, "Bad IDs", 2);
0425 fedErrorsVsId_.monitorEle->setBinLabel(7, "Bad DAQ Packet", 2);
0426 fedErrorsVsId_.monitorEle->setBinLabel(8, "Any FED Errors", 2);
0427 fedErrorsVsId_.monitorEle->setBinLabel(9, "Any DAQ Problems", 2);
0428 fedErrorsVsId_.monitorEle->setBinLabel(10, "Any FE Problems", 2);
0429 fedErrorsVsId_.monitorEle->setBinLabel(11, "FE Overflows", 2);
0430 fedErrorsVsId_.monitorEle->setBinLabel(12, "FE Missing", 2);
0431 fedErrorsVsId_.monitorEle->setBinLabel(13, "FE Bad Maj Addr", 2);
0432 fedErrorsVsId_.monitorEle->setBinLabel(14, "Bad Ch Stat Bit", 2);
0433 fedErrorsVsId_.monitorEle->setBinLabel(15, "Bad Active Ch Stat Bit", 2);
0434
0435 const std::string lBaseDir = ibooker.pwd();
0436
0437 ibooker.setCurrentFolder(lBaseDir + "/FED");
0438
0439 bookHistogram(
0440 ibooker, nFEDErrors_, "nFEDErrors", "Number of FEDs with errors (FED or FE Level) per event", "# FEDErrors");
0441
0442 bookHistogram(
0443 ibooker, nFEDDAQProblems_, "nFEDDAQProblems", "Number of FEDs with DAQ problems per event", "# FEDDAQProblems");
0444
0445 bookHistogram(ibooker,
0446 nFEDsWithFEProblems_,
0447 "nFEDsWithFEProblems",
0448 "Number of FEDs with FE problems per event",
0449 "# FEDs with FE problems");
0450
0451 bookHistogram(ibooker,
0452 nFEDCorruptBuffers_,
0453 "nFEDCorruptBuffers",
0454 "Number of FEDs with corrupt buffers per event",
0455 "# FEDs with corrupt buffer");
0456
0457 ibooker.setCurrentFolder(lBaseDir + "/FED/VsId");
0458
0459 bookHistogram(ibooker,
0460 dataMissing_,
0461 "DataMissing",
0462 "Number of events where the data from a FED with cabled channels is missing",
0463 siStripFedIdMax - siStripFedIdMin + 1,
0464 siStripFedIdMin - 0.5,
0465 siStripFedIdMax + 0.5,
0466 "FED-ID");
0467
0468 bookHistogram(
0469 ibooker,
0470 anyFEDErrors_,
0471 "AnyFEDErrors",
0472 "Number of buffers with any FED error (excluding bad channel status bits, FE problems except overflows) per FED",
0473 siStripFedIdMax - siStripFedIdMin + 1,
0474 siStripFedIdMin - 0.5,
0475 siStripFedIdMax + 0.5,
0476 "FED-ID");
0477
0478 bookHistogram(ibooker,
0479 corruptBuffers_,
0480 "CorruptBuffers",
0481 "Number of corrupt FED buffers per FED",
0482 siStripFedIdMax - siStripFedIdMin + 1,
0483 siStripFedIdMin - 0.5,
0484 siStripFedIdMax + 0.5,
0485 "FED-ID");
0486
0487 bookHistogram(ibooker,
0488 invalidBuffers_,
0489 "InvalidBuffers",
0490 "Number of invalid FED buffers per FED",
0491 siStripFedIdMax - siStripFedIdMin + 1,
0492 siStripFedIdMin - 0.5,
0493 siStripFedIdMax + 0.5,
0494 "FED-ID");
0495
0496 bookHistogram(ibooker,
0497 anyDAQProblems_,
0498 "AnyDAQProblems",
0499 "Number of buffers with any problems flagged in DAQ header (including CRC)",
0500 siStripFedIdMax - siStripFedIdMin + 1,
0501 siStripFedIdMin - 0.5,
0502 siStripFedIdMax + 0.5,
0503 "FED-ID");
0504
0505 bookHistogram(ibooker,
0506 badIDs_,
0507 "BadIDs",
0508 "Number of buffers with non-SiStrip source IDs in DAQ header",
0509 siStripFedIdMax - siStripFedIdMin + 1,
0510 siStripFedIdMin - 0.5,
0511 siStripFedIdMax + 0.5,
0512 "FED-ID");
0513
0514 bookHistogram(ibooker,
0515 badDAQCRCs_,
0516 "BadDAQCRCs",
0517 "Number of buffers with bad CRCs from the DAQ",
0518 siStripFedIdMax - siStripFedIdMin + 1,
0519 siStripFedIdMin - 0.5,
0520 siStripFedIdMax + 0.5,
0521 "FED-ID");
0522
0523 bookHistogram(ibooker,
0524 badFEDCRCs_,
0525 "BadFEDCRCs",
0526 "Number of buffers with bad CRCs from the FED",
0527 siStripFedIdMax - siStripFedIdMin + 1,
0528 siStripFedIdMin - 0.5,
0529 siStripFedIdMax + 0.5,
0530 "FED-ID");
0531
0532 bookHistogram(ibooker,
0533 badDAQPacket_,
0534 "BadDAQPacket",
0535 "Number of buffers with (non-CRC) problems flagged in DAQ header/trailer",
0536 siStripFedIdMax - siStripFedIdMin + 1,
0537 siStripFedIdMin - 0.5,
0538 siStripFedIdMax + 0.5,
0539 "FED-ID");
0540
0541 ibooker.setCurrentFolder(lBaseDir + "/FE");
0542
0543 bookHistogram(ibooker,
0544 nFEDsWithFEOverflows_,
0545 "nFEDsWithFEOverflows",
0546 "Number FEDs with FE units which overflowed per event",
0547 "# FEDs with FE overflows");
0548
0549 bookHistogram(ibooker,
0550 nFEDsWithFEBadMajorityAddresses_,
0551 "nFEDsWithFEBadMajorityAddresses",
0552 "Number of FEDs with FE units with a bad majority address per event",
0553 "# FEDs with bad address");
0554
0555 bookHistogram(ibooker,
0556 nFEDsWithMissingFEs_,
0557 "nFEDsWithMissingFEs",
0558 "Number of FEDs with missing FE unit payloads per event",
0559 "# FEDs with missing FEs");
0560
0561 bookHistogram(ibooker,
0562 feMajFracTIB_,
0563 "FeMajFracTIB",
0564 "Fraction of FEs matching majority address in TIB partition",
0565 101,
0566 0,
0567 1.01,
0568 "n(majAddrFE)/n(totFE)");
0569
0570 bookHistogram(ibooker,
0571 feMajFracTOB_,
0572 "FeMajFracTOB",
0573 "Fraction of FEs matching majority address in TOB partition",
0574 101,
0575 0,
0576 1.01,
0577 "n(majAddrFE)/n(totFE)");
0578
0579 bookHistogram(ibooker,
0580 feMajFracTECB_,
0581 "FeMajFracTECB",
0582 "Fraction of FEs matching majority address in TECB partition",
0583 101,
0584 0,
0585 1.01,
0586 "n(majAddrFE)/n(totFE)");
0587
0588 bookHistogram(ibooker,
0589 feMajFracTECF_,
0590 "FeMajFracTECF",
0591 "Fraction of FEs matching majority address in TECF partition",
0592 101,
0593 0,
0594 1.01,
0595 "n(majAddrFE)/n(totFE)");
0596
0597 ibooker.setCurrentFolder(lBaseDir + "/FE/APVe");
0598
0599 bookHistogram(ibooker,
0600 feTimeDiffTIB_,
0601 "FETimeDiffTIB",
0602 "(TimeLoc FE - TimeLoc APVe) for TIB/TID, when different",
0603 401,
0604 -200,
0605 201,
0606 "#Delta_{TimeLoc}(FE-APVe)");
0607
0608 bookHistogram(ibooker,
0609 feTimeDiffTOB_,
0610 "FETimeDiffTOB",
0611 "(TimeLoc FE - TimeLoc APVe) for TOB, when different",
0612 401,
0613 -200,
0614 201,
0615 "#Delta_{TimeLoc}(FE-APVe)");
0616
0617 bookHistogram(ibooker,
0618 feTimeDiffTECB_,
0619 "FETimeDiffTECB",
0620 "(TimeLoc FE - TimeLoc APVe) for TECB, when different",
0621 401,
0622 -200,
0623 201,
0624 "#Delta_{TimeLoc}(FE-APVe)");
0625
0626 bookHistogram(ibooker,
0627 feTimeDiffTECF_,
0628 "FETimeDiffTECF",
0629 "(TimeLoc FE - TimeLoc APVe) for TECF, when different",
0630 401,
0631 -200,
0632 201,
0633 "#Delta_{TimeLoc}(FE-APVe)");
0634
0635 book2DHistogram(ibooker,
0636 feTimeDiffvsDBX_,
0637 "FETimeDiffvsDBX",
0638 "(TimeLoc FE - TimeLoc APVe) vs DBX, when different",
0639 2000,
0640 -0.5,
0641 1999.5,
0642 201,
0643 0,
0644 201,
0645 "DeltaBX",
0646 "#Delta_{TimeLoc}(FE-APVe)");
0647
0648 bookHistogram(ibooker, apveAddress_, "ApveAddress", "apve Address", 256, 0, 256, "apveAddress");
0649
0650 bookHistogram(ibooker, feMajAddress_, "FeMajAddress", "FE Majority Address", 256, 0, 256, "feMajAddress");
0651
0652 ibooker.setCurrentFolder(lBaseDir + "/FE/VsId");
0653
0654 bookHistogram(ibooker,
0655 anyFEProblems_,
0656 "AnyFEProblems",
0657 "Number of buffers with any FE unit problems",
0658 siStripFedIdMax - siStripFedIdMin + 1,
0659 siStripFedIdMin - 0.5,
0660 siStripFedIdMax + 0.5,
0661 "FED-ID");
0662
0663 bookHistogram(ibooker,
0664 feOverflows_,
0665 "FEOverflows",
0666 "Number of buffers with one or more FE overflow",
0667 siStripFedIdMax - siStripFedIdMin + 1,
0668 siStripFedIdMin - 0.5,
0669 siStripFedIdMax + 0.5,
0670 "FED-ID");
0671
0672 bookHistogram(ibooker,
0673 badMajorityAddresses_,
0674 "BadMajorityAddresses",
0675 "Number of buffers with one or more FE with a bad majority APV address",
0676 siStripFedIdMax - siStripFedIdMin + 1,
0677 siStripFedIdMin - 0.5,
0678 siStripFedIdMax + 0.5,
0679 "FED-ID");
0680
0681 bookHistogram(ibooker,
0682 badMajorityInPartition_,
0683 "BadMajorityInPartition",
0684 "Number of buffers with >=1 FE with FEaddress != majority in partition",
0685 siStripFedIdMax - siStripFedIdMin + 1,
0686 siStripFedIdMin - 0.5,
0687 siStripFedIdMax + 0.5,
0688 "FED-ID");
0689
0690 bookHistogram(ibooker,
0691 feMissing_,
0692 "FEMissing",
0693 "Number of buffers with one or more FE unit payload missing",
0694 siStripFedIdMax - siStripFedIdMin + 1,
0695 siStripFedIdMin - 0.5,
0696 siStripFedIdMax + 0.5,
0697 "FED-ID");
0698
0699 ibooker.setCurrentFolder(lBaseDir + "/Fiber");
0700
0701 bookHistogram(ibooker,
0702 nBadChannelStatusBits_,
0703 "nBadChannelStatusBits",
0704 "Number of channels with bad status bits per event",
0705 "# bad enabled channels");
0706
0707 bookHistogram(ibooker,
0708 nBadActiveChannelStatusBits_,
0709 "nBadActiveChannelStatusBits",
0710 "Number of active channels with bad status bits per event",
0711 "# bad active channels");
0712
0713 bookHistogram(ibooker, nUnlocked_, "nUnlocked", "Number of channels Unlocked per event", "# channels unlocked");
0714
0715 bookHistogram(ibooker, nOutOfSync_, "nOutOfSync", "Number of channels OutOfSync per event", "# channels out-of-sync");
0716
0717 bookHistogram(ibooker,
0718 nUnconnectedChannels_,
0719 "nUnconnectedChannels",
0720 "Number of channels not connected per event",
0721 "# unconnected channels");
0722
0723 ibooker.setCurrentFolder(lBaseDir + "/Fiber/VsId");
0724
0725 bookHistogram(ibooker,
0726 badChannelStatusBits_,
0727 "BadChannelStatusBits",
0728 "Number of buffers with one or more enabled channel with bad status bits",
0729 siStripFedIdMax - siStripFedIdMin + 1,
0730 siStripFedIdMin - 0.5,
0731 siStripFedIdMax + 0.5,
0732 "FED-ID");
0733
0734 bookHistogram(ibooker,
0735 badActiveChannelStatusBits_,
0736 "BadActiveChannelStatusBits",
0737 "Number of buffers with one or more active channel with bad status bits",
0738 siStripFedIdMax - siStripFedIdMin + 1,
0739 siStripFedIdMin - 0.5,
0740 siStripFedIdMax + 0.5,
0741 "FED-ID");
0742
0743 ibooker.setCurrentFolder(lBaseDir + "/APV");
0744
0745 bookHistogram(ibooker, medianAPV0_, "MedianAPV0", "Median APV0", "medianAPV0");
0746
0747 bookHistogram(ibooker, medianAPV1_, "MedianAPV1", "Median APV1", "MedianAPV1");
0748
0749 bookHistogram(ibooker,
0750 nAPVStatusBit_,
0751 "nAPVStatusBit",
0752 "Number of APVs with APVStatusBit error per event",
0753 "# APVs with APVStatusBit error");
0754
0755 bookHistogram(ibooker, nAPVError_, "nAPVError", "Number of APVs with APVError per event", "#APVs with APVError");
0756
0757 bookHistogram(ibooker,
0758 nAPVAddressError_,
0759 "nAPVAddressError",
0760 "Number of APVs with APVAddressError per event",
0761 "#APVs with APVAddressError");
0762
0763 ibooker.setCurrentFolder(lBaseDir + "/Trends");
0764
0765 bookProfile(ibooker,
0766 fedMaxEventSizevsTime_,
0767 "FedMaxEventSizevsTime",
0768 "Max FED buffer Size (B) per Event vs time",
0769 0,
0770 42241,
0771 "Time",
0772 "Max FED buffer Size (B)");
0773
0774 bookProfile(ibooker,
0775 nTotalBadChannelsvsTime_,
0776 "nTotalBadChannelsvsTime",
0777 "Number of channels with any error vs time",
0778 0,
0779 42241,
0780 "Time",
0781 "Total # bad enabled channels");
0782
0783 bookProfile(ibooker,
0784 nTotalBadActiveChannelsvsTime_,
0785 "nTotalBadActiveChannelsvsTime",
0786 "Number of active channels with any error vs time",
0787 0,
0788 42241,
0789 "Time",
0790 "Total # bad active channels");
0791
0792 ibooker.setCurrentFolder(lBaseDir + "/Trends/FED");
0793
0794 if (fedErrorsVsIdVsLumi_.globalswitchon) {
0795 bookProfile2D(ibooker,
0796 fedErrorsVsIdVsLumi_,
0797 "fedErrorsVsIdVsLumi",
0798 "Total number of errors per FED ID per lumi section",
0799 440,
0800 49.5,
0801 489.5,
0802 "Lumi. Section",
0803 "FED ID");
0804 }
0805
0806 bookProfile(ibooker,
0807 nFEDErrorsvsTime_,
0808 "nFEDErrorsvsTime",
0809 "Number of FEDs with any error vs time",
0810 0,
0811 42241,
0812 "Time",
0813 "# FEDErrors");
0814
0815 bookProfile(ibooker,
0816 nFEDCorruptBuffersvsTime_,
0817 "nFEDCorruptBuffersvsTime",
0818 "Number of FEDs with corrupt buffer vs time",
0819 0,
0820 42241,
0821 "Time",
0822 "# FEDCorruptBuffer");
0823
0824 ibooker.setCurrentFolder(lBaseDir + "/Trends/FE");
0825
0826 bookProfile(ibooker,
0827 nFEDsWithFEProblemsvsTime_,
0828 "nFEDsWithFEProblemsvsTime",
0829 "Number of FEDs with any FE error vs time",
0830 0,
0831 42241,
0832 "Time",
0833 "# FEDsWithFEProblems");
0834
0835 ibooker.setCurrentFolder(lBaseDir + "/Trends/Fiber");
0836
0837 bookProfile(ibooker,
0838 nUnlockedvsTime_,
0839 "nUnlockedvsTime",
0840 "Number of channels Unlocked vs time",
0841 0,
0842 42241,
0843 "Time",
0844 "# channels unlocked ");
0845
0846 bookProfile(ibooker,
0847 nOutOfSyncvsTime_,
0848 "nOutOfSyncvsTime",
0849 "Number of channels OutOfSync vs time",
0850 0,
0851 42241,
0852 "Time",
0853 "# channels out-of-sync");
0854
0855 ibooker.setCurrentFolder(lBaseDir + "/Trends/APV");
0856
0857 bookProfile(ibooker,
0858 nAPVStatusBitvsTime_,
0859 "nAPVStatusBitvsTime",
0860 "Number of APVs with APVStatusBit error vs time",
0861 0,
0862 42241,
0863 "Time",
0864 "# APVs with APVStatusBit error");
0865
0866 bookProfile(ibooker,
0867 nAPVErrorvsTime_,
0868 "nAPVErrorvsTime",
0869 "Number of APVs with APVError vs time",
0870 0,
0871 42241,
0872 "Time",
0873 "# APVs with APVError");
0874
0875 bookProfile(ibooker,
0876 nAPVAddressErrorvsTime_,
0877 "nAPVAddressErrorvsTime",
0878 "Number of APVs with APVAddressError vs time",
0879 0,
0880 42241,
0881 "Time",
0882 "# APVs with APVAddressError");
0883
0884
0885 if (tkMapConfig_.enabled) {
0886 tkmapFED_ = std::make_unique<TkHistoMap>(tkDetMap, topFolderName, "TkHMap_FractionOfBadChannels", 0., true);
0887 } else
0888 tkmapFED_ = nullptr;
0889 }
0890
0891 void FEDHistograms::bookFEDHistograms(DQMStore::IBooker& ibooker, unsigned int fedId, bool fullDebugMode) {
0892 if (!histosBooked_[fedId]) {
0893
0894 SiStripFedKey fedKey(fedId, 0, 0, 0);
0895 std::stringstream fedIdStream;
0896 fedIdStream << fedId;
0897 ibooker.setCurrentFolder(fedKey.path());
0898
0899 bookHistogram(ibooker,
0900 feOverflowDetailed_,
0901 feOverflowDetailedMap_[fedId],
0902 "FEOverflowsForFED" + fedIdStream.str(),
0903 "FE overflows per FE unit for FED ID " + fedIdStream.str(),
0904 sistrip::FEUNITS_PER_FED,
0905 0,
0906 sistrip::FEUNITS_PER_FED,
0907 "FE-Index");
0908 bookHistogram(ibooker,
0909 badMajorityAddressDetailed_,
0910 badMajorityAddressDetailedMap_[fedId],
0911 "BadMajorityAddressesForFED" + fedIdStream.str(),
0912 "Bad majority APV addresses per FE unit for FED ID " + fedIdStream.str(),
0913 sistrip::FEUNITS_PER_FED,
0914 0,
0915 sistrip::FEUNITS_PER_FED,
0916 "FE-Index");
0917 bookHistogram(ibooker,
0918 feMissingDetailed_,
0919 feMissingDetailedMap_[fedId],
0920 "FEMissingForFED" + fedIdStream.str(),
0921 "Buffers with FE Unit payload missing per FE unit for FED ID " + fedIdStream.str(),
0922 sistrip::FEUNITS_PER_FED,
0923 0,
0924 sistrip::FEUNITS_PER_FED,
0925 "FE-Index");
0926 bookHistogram(ibooker,
0927 badStatusBitsDetailed_,
0928 badStatusBitsDetailedMap_[fedId],
0929 "BadAPVStatusBitsForFED" + fedIdStream.str(),
0930 "Bad apv status bits for FED ID " + fedIdStream.str(),
0931 sistrip::APVS_PER_FED,
0932 0,
0933 sistrip::APVS_PER_FED,
0934 "APV-Index");
0935 histosBooked_[fedId] = true;
0936 }
0937 if (fullDebugMode && !debugHistosBooked_[fedId]) {
0938
0939 SiStripFedKey fedKey(fedId, 0, 0, 0);
0940 std::stringstream fedIdStream;
0941 fedIdStream << fedId;
0942 ibooker.setCurrentFolder(fedKey.path());
0943
0944 bookHistogram(ibooker,
0945 apvErrorDetailed_,
0946 apvErrorDetailedMap_[fedId],
0947 "APVErrorBitsForFED" + fedIdStream.str(),
0948 "APV errors for FED ID " + fedIdStream.str(),
0949 sistrip::APVS_PER_FED,
0950 0,
0951 sistrip::APVS_PER_FED,
0952 "APV-Index");
0953 bookHistogram(ibooker,
0954 apvAddressErrorDetailed_,
0955 apvAddressErrorDetailedMap_[fedId],
0956 "APVAddressErrorBitsForFED" + fedIdStream.str(),
0957 "Wrong APV address errors for FED ID " + fedIdStream.str(),
0958 sistrip::APVS_PER_FED,
0959 0,
0960 sistrip::APVS_PER_FED,
0961 "APV-Index");
0962 bookHistogram(ibooker,
0963 unlockedDetailed_,
0964 unlockedDetailedMap_[fedId],
0965 "UnlockedBitsForFED" + fedIdStream.str(),
0966 "Unlocked channels for FED ID " + fedIdStream.str(),
0967 sistrip::FEDCH_PER_FED,
0968 0,
0969 sistrip::FEDCH_PER_FED,
0970 "Channel-Index");
0971 bookHistogram(ibooker,
0972 outOfSyncDetailed_,
0973 outOfSyncDetailedMap_[fedId],
0974 "OOSBitsForFED" + fedIdStream.str(),
0975 "Out of sync channels for FED ID " + fedIdStream.str(),
0976 sistrip::FEDCH_PER_FED,
0977 0,
0978 sistrip::FEDCH_PER_FED,
0979 "Channel-Index");
0980 debugHistosBooked_[fedId] = true;
0981 }
0982 }
0983
0984 void FEDHistograms::bookAllFEDHistograms(DQMStore::IBooker& ibooker, bool fullDebugMode) {
0985
0986 const unsigned int siStripFedIdMin = FEDNumbering::MINSiStripFEDID;
0987 const unsigned int siStripFedIdMax = FEDNumbering::MAXSiStripFEDID;
0988
0989 for (unsigned int iFed = siStripFedIdMin; iFed <= siStripFedIdMax; iFed++)
0990 bookFEDHistograms(ibooker, iFed, fullDebugMode);
0991 }
0992
0993 bool FEDHistograms::tkHistoMapEnabled(unsigned int aIndex) { return tkMapConfig_.enabled; }
0994
0995 TkHistoMap* FEDHistograms::tkHistoMapPointer(unsigned int aIndex) { return tkmapFED_.get(); }