5 #include "DQM/SiStripMonitorHardware/interface/FEDHistograms.hh" 7 FEDHistograms::FEDHistograms() {}
9 FEDHistograms::~FEDHistograms() {}
11 void FEDHistograms::initialise(
const edm::ParameterSet& iConfig, std::ostringstream* pDebugStream) {
12 getConfigForHistogram(fedEventSize_,
"FedEventSize", iConfig, pDebugStream);
13 getConfigForHistogram(fedMaxEventSizevsTime_,
"FedMaxEventSizevsTime", iConfig, pDebugStream);
15 getConfigForHistogram(dataPresent_,
"DataPresent", iConfig, pDebugStream);
16 getConfigForHistogram(anyFEDErrors_,
"AnyFEDErrors", iConfig, pDebugStream);
17 getConfigForHistogram(anyDAQProblems_,
"AnyDAQProblems", iConfig, pDebugStream);
18 getConfigForHistogram(anyFEProblems_,
"AnyFEProblems", iConfig, pDebugStream);
19 getConfigForHistogram(corruptBuffers_,
"CorruptBuffers", iConfig, pDebugStream);
20 getConfigForHistogram(badChannelStatusBits_,
"BadChannelStatusBits", iConfig, pDebugStream);
21 getConfigForHistogram(badActiveChannelStatusBits_,
"BadActiveChannelStatusBits", iConfig, pDebugStream);
23 getConfigForHistogram(feOverflows_,
"FEOverflows", iConfig, pDebugStream);
24 getConfigForHistogram(feMissing_,
"FEMissing", iConfig, pDebugStream);
25 getConfigForHistogram(badMajorityAddresses_,
"BadMajorityAddresses", iConfig, pDebugStream);
26 getConfigForHistogram(badMajorityInPartition_,
"BadMajorityInPartition", iConfig, pDebugStream);
27 getConfigForHistogram(feMajFracTIB_,
"FeMajFracTIB", iConfig, pDebugStream);
28 getConfigForHistogram(feMajFracTOB_,
"FeMajFracTOB", iConfig, pDebugStream);
29 getConfigForHistogram(feMajFracTECB_,
"FeMajFracTECB", iConfig, pDebugStream);
30 getConfigForHistogram(feMajFracTECF_,
"FeMajFracTECF", iConfig, pDebugStream);
32 getConfigForHistogram(dataMissing_,
"DataMissing", iConfig, pDebugStream);
33 getConfigForHistogram(badIDs_,
"BadIDs", iConfig, pDebugStream);
34 getConfigForHistogram(badDAQPacket_,
"BadDAQPacket", iConfig, pDebugStream);
35 getConfigForHistogram(invalidBuffers_,
"InvalidBuffers", iConfig, pDebugStream);
36 getConfigForHistogram(badDAQCRCs_,
"BadDAQCRCs", iConfig, pDebugStream);
37 getConfigForHistogram(badFEDCRCs_,
"BadFEDCRCs", iConfig, pDebugStream);
39 getConfigForHistogram(feOverflowDetailed_,
"FEOverflowsDetailed", iConfig, pDebugStream);
40 getConfigForHistogram(feMissingDetailed_,
"FEMissingDetailed", iConfig, pDebugStream);
41 getConfigForHistogram(badMajorityAddressDetailed_,
"BadMajorityAddressesDetailed", iConfig, pDebugStream);
42 getConfigForHistogram(badStatusBitsDetailed_,
"BadAPVStatusBitsDetailed", iConfig, pDebugStream);
43 getConfigForHistogram(apvErrorDetailed_,
"APVErrorBitsDetailed", iConfig, pDebugStream);
44 getConfigForHistogram(apvAddressErrorDetailed_,
"APVAddressErrorBitsDetailed", iConfig, pDebugStream);
45 getConfigForHistogram(unlockedDetailed_,
"UnlockedBitsDetailed", iConfig, pDebugStream);
46 getConfigForHistogram(outOfSyncDetailed_,
"OOSBitsDetailed", iConfig, pDebugStream);
48 getConfigForHistogram(nFEDErrors_,
"nFEDErrors", iConfig, pDebugStream);
49 getConfigForHistogram(nFEDDAQProblems_,
"nFEDDAQProblems", iConfig, pDebugStream);
50 getConfigForHistogram(nFEDsWithFEProblems_,
"nFEDsWithFEProblems", iConfig, pDebugStream);
51 getConfigForHistogram(nFEDCorruptBuffers_,
"nFEDCorruptBuffers", iConfig, pDebugStream);
52 getConfigForHistogram(nBadChannelStatusBits_,
"nBadChannelStatusBits", iConfig, pDebugStream);
53 getConfigForHistogram(nBadActiveChannelStatusBits_,
"nBadActiveChannelStatusBits", iConfig, pDebugStream);
54 getConfigForHistogram(nFEDsWithFEOverflows_,
"nFEDsWithFEOverflows", iConfig, pDebugStream);
55 getConfigForHistogram(nFEDsWithMissingFEs_,
"nFEDsWithMissingFEs", iConfig, pDebugStream);
56 getConfigForHistogram(nFEDsWithFEBadMajorityAddresses_,
"nFEDsWithFEBadMajorityAddresses", iConfig, pDebugStream);
58 getConfigForHistogram(nFEDErrorsvsTime_,
"nFEDErrorsvsTime", iConfig, pDebugStream);
59 getConfigForHistogram(fedErrorsVsIdVsLumi_,
"fedErrorsVsIdVsLumi", iConfig, pDebugStream);
60 getConfigForHistogram(nFEDCorruptBuffersvsTime_,
"nFEDCorruptBuffersvsTime", iConfig, pDebugStream);
61 getConfigForHistogram(nFEDsWithFEProblemsvsTime_,
"nFEDsWithFEProblemsvsTime", iConfig, pDebugStream);
63 getConfigForHistogram(nUnconnectedChannels_,
"nUnconnectedChannels", iConfig, pDebugStream);
65 getConfigForHistogram(nTotalBadChannels_,
"nTotalBadChannels", iConfig, pDebugStream);
66 getConfigForHistogram(nTotalBadActiveChannels_,
"nTotalBadActiveChannels", iConfig, pDebugStream);
68 getConfigForHistogram(nTotalBadChannelsvsTime_,
"nTotalBadChannelsvsTime", iConfig, pDebugStream);
69 getConfigForHistogram(nTotalBadActiveChannelsvsTime_,
"nTotalBadActiveChannelsvsTime", iConfig, pDebugStream);
71 getConfigForHistogram(nAPVStatusBit_,
"nAPVStatusBit", iConfig, pDebugStream);
72 getConfigForHistogram(nAPVError_,
"nAPVError", iConfig, pDebugStream);
73 getConfigForHistogram(nAPVAddressError_,
"nAPVAddressError", iConfig, pDebugStream);
74 getConfigForHistogram(nUnlocked_,
"nUnlocked", iConfig, pDebugStream);
75 getConfigForHistogram(nOutOfSync_,
"nOutOfSync", iConfig, pDebugStream);
77 getConfigForHistogram(nAPVStatusBitvsTime_,
"nAPVStatusBitvsTime", iConfig, pDebugStream);
78 getConfigForHistogram(nAPVErrorvsTime_,
"nAPVErrorvsTime", iConfig, pDebugStream);
79 getConfigForHistogram(nAPVAddressErrorvsTime_,
"nAPVAddressErrorvsTime", iConfig, pDebugStream);
80 getConfigForHistogram(nUnlockedvsTime_,
"nUnlockedvsTime", iConfig, pDebugStream);
81 getConfigForHistogram(nOutOfSyncvsTime_,
"nOutOfSyncvsTime", iConfig, pDebugStream);
83 getConfigForHistogram(tkMapConfig_,
"TkHistoMap", iConfig, pDebugStream);
85 getConfigForHistogram(feTimeDiffTIB_,
"FETimeDiffTIB", iConfig, pDebugStream);
86 getConfigForHistogram(feTimeDiffTOB_,
"FETimeDiffTOB", iConfig, pDebugStream);
87 getConfigForHistogram(feTimeDiffTECB_,
"FETimeDiffTECB", iConfig, pDebugStream);
88 getConfigForHistogram(feTimeDiffTECF_,
"FETimeDiffTECF", iConfig, pDebugStream);
90 getConfigForHistogram(feTimeDiffvsDBX_,
"FETimeDiffvsDBX", iConfig, pDebugStream);
92 getConfigForHistogram(apveAddress_,
"ApveAddress", iConfig, pDebugStream);
93 getConfigForHistogram(feMajAddress_,
"FeMajAddress", iConfig, pDebugStream);
95 getConfigForHistogram(medianAPV0_,
"MedianAPV0", iConfig, pDebugStream);
96 getConfigForHistogram(medianAPV1_,
"MedianAPV1", iConfig, pDebugStream);
98 getConfigForHistogram(lumiErrorFraction_,
"ErrorFractionByLumiBlock", iConfig, pDebugStream);
100 getConfigForHistogram(fedIdVsApvId_,
"FedIdVsApvId", iConfig, pDebugStream);
102 getConfigForHistogram(fedErrorsVsId_,
"FedErrorsVsId", iConfig, pDebugStream);
105 void FEDHistograms::fillCountersHistograms(
const FEDErrors::FEDCounters& fedLevelCounters,
106 const FEDErrors::ChannelCounters& chLevelCounters,
107 const unsigned int aMaxSize,
108 const double aTime) {
109 fillHistogram(fedMaxEventSizevsTime_, aTime, aMaxSize);
111 fillHistogram(nFEDErrors_, fedLevelCounters.nFEDErrors);
112 fillHistogram(nFEDDAQProblems_, fedLevelCounters.nDAQProblems);
113 fillHistogram(nFEDsWithFEProblems_, fedLevelCounters.nFEDsWithFEProblems);
114 fillHistogram(nFEDCorruptBuffers_, fedLevelCounters.nCorruptBuffers);
115 fillHistogram(nFEDsWithFEOverflows_, fedLevelCounters.nFEDsWithFEOverflows);
116 fillHistogram(nFEDsWithFEBadMajorityAddresses_, fedLevelCounters.nFEDsWithFEBadMajorityAddresses);
117 fillHistogram(nFEDsWithMissingFEs_, fedLevelCounters.nFEDsWithMissingFEs);
118 fillHistogram(nBadChannelStatusBits_, fedLevelCounters.nBadChannels);
119 fillHistogram(nBadActiveChannelStatusBits_, fedLevelCounters.nBadActiveChannels);
121 fillHistogram(nFEDErrorsvsTime_, aTime, fedLevelCounters.nFEDErrors);
122 fillHistogram(nFEDCorruptBuffersvsTime_, aTime, fedLevelCounters.nCorruptBuffers);
123 fillHistogram(nFEDsWithFEProblemsvsTime_, aTime, fedLevelCounters.nFEDsWithFEProblems);
125 fillHistogram(nUnconnectedChannels_, chLevelCounters.nNotConnected);
127 fillHistogram(nTotalBadChannels_, fedLevelCounters.nTotalBadChannels);
128 fillHistogram(nTotalBadActiveChannels_, fedLevelCounters.nTotalBadActiveChannels);
130 fillHistogram(nTotalBadChannelsvsTime_, aTime, fedLevelCounters.nTotalBadChannels);
131 fillHistogram(nTotalBadActiveChannelsvsTime_, aTime, fedLevelCounters.nTotalBadActiveChannels);
133 fillHistogram(nAPVStatusBit_, chLevelCounters.nAPVStatusBit);
134 fillHistogram(nAPVError_, chLevelCounters.nAPVError);
135 fillHistogram(nAPVAddressError_, chLevelCounters.nAPVAddressError);
136 fillHistogram(nUnlocked_, chLevelCounters.nUnlocked);
137 fillHistogram(nOutOfSync_, chLevelCounters.nOutOfSync);
139 fillHistogram(nAPVStatusBitvsTime_, aTime, chLevelCounters.nAPVStatusBit);
140 fillHistogram(nAPVErrorvsTime_, aTime, chLevelCounters.nAPVError);
141 fillHistogram(nAPVAddressErrorvsTime_, aTime, chLevelCounters.nAPVAddressError);
142 fillHistogram(nUnlockedvsTime_, aTime, chLevelCounters.nUnlocked);
143 fillHistogram(nOutOfSyncvsTime_, aTime, chLevelCounters.nOutOfSync);
146 void FEDHistograms::fillFEDHistograms(FEDErrors& aFedErr,
147 const unsigned int aEvtSize,
149 const double aLumiSection,
150 unsigned int& NumBadChannels_perFEDID) {
151 const FEDErrors::FEDLevelErrors& lFedLevelErrors = aFedErr.getFEDLevelErrors();
152 const unsigned int lFedId = aFedErr.fedID();
154 fillHistogram(fedEventSize_, lFedId, aEvtSize);
156 if (lFedLevelErrors.DataPresent)
157 fillHistogram(dataPresent_, lFedId);
159 if (lFedLevelErrors.HasCabledChannels && lFedLevelErrors.DataMissing) {
160 fillHistogram(dataMissing_, lFedId);
161 fillHistogram(fedErrorsVsId_, lFedId, 1);
164 if (lFedLevelErrors.InvalidBuffers) {
165 fillHistogram(invalidBuffers_, lFedId);
166 fillHistogram(fedErrorsVsId_, lFedId, 2);
167 }
else if (lFedLevelErrors.CorruptBuffer) {
168 fillHistogram(corruptBuffers_, lFedId);
169 fillHistogram(fedErrorsVsId_, lFedId, 3);
170 }
else if (lFedLevelErrors.BadFEDCRCs) {
171 fillHistogram(badFEDCRCs_, lFedId);
172 fillHistogram(fedErrorsVsId_, lFedId, 4);
173 }
else if (lFedLevelErrors.BadDAQCRCs) {
174 fillHistogram(badDAQCRCs_, lFedId);
175 fillHistogram(fedErrorsVsId_, lFedId, 5);
176 }
else if (lFedLevelErrors.BadIDs) {
177 fillHistogram(badIDs_, lFedId);
178 fillHistogram(fedErrorsVsId_, lFedId, 6);
179 }
else if (lFedLevelErrors.BadDAQPacket) {
180 fillHistogram(badDAQPacket_, lFedId);
181 fillHistogram(fedErrorsVsId_, lFedId, 7);
184 if (aFedErr.anyFEDErrors()) {
185 fillHistogram(anyFEDErrors_, lFedId);
186 fillHistogram(fedErrorsVsId_, lFedId, 8);
189 if (lFedLevelErrors.HasCabledChannels && aFedErr.anyDAQProblems()) {
190 fillHistogram(anyDAQProblems_, lFedId);
191 fillHistogram(fedErrorsVsId_, lFedId, 9);
193 if (aFedErr.anyFEProblems()) {
194 fillHistogram(anyFEProblems_, lFedId);
195 fillHistogram(fedErrorsVsId_, lFedId, 10);
198 if (lFedLevelErrors.FEsOverflow) {
199 fillHistogram(feOverflows_, lFedId);
200 fillHistogram(fedErrorsVsId_, lFedId, 11);
202 if (lFedLevelErrors.FEsMissing) {
203 fillHistogram(feMissing_, lFedId);
204 fillHistogram(fedErrorsVsId_, lFedId, 12);
206 if (lFedLevelErrors.FEsBadMajorityAddress) {
207 fillHistogram(badMajorityAddresses_, lFedId);
208 fillHistogram(fedErrorsVsId_, lFedId, 13);
211 if (lFedLevelErrors.BadChannelStatusBit) {
212 fillHistogram(badChannelStatusBits_, lFedId);
213 fillHistogram(fedErrorsVsId_, lFedId, 14);
215 if (lFedLevelErrors.BadActiveChannelStatusBit) {
216 fillHistogram(badActiveChannelStatusBits_, lFedId);
217 fillHistogram(fedErrorsVsId_, lFedId, 15);
220 std::vector<FEDErrors::FELevelErrors>& lFeVec = aFedErr.getFELevelErrors();
222 for (
unsigned int iFe(0); iFe < lFeVec.size(); iFe++) {
223 fillFEHistograms(lFedId, lFeVec[iFe], aFedErr.getEventProperties());
226 std::vector<FEDErrors::ChannelLevelErrors>& lChVec = aFedErr.getChannelLevelErrors();
227 for (
unsigned int iCh(0); iCh < lChVec.size(); iCh++) {
228 fillChannelsHistograms(lFedId, lChVec[iCh], lFullDebug);
231 std::vector<FEDErrors::APVLevelErrors>& lAPVVec = aFedErr.getAPVLevelErrors();
232 for (
unsigned int iApv(0); iApv < lAPVVec.size(); iApv++) {
233 fillAPVsHistograms(lFedId, lAPVVec[iApv], lFullDebug);
236 double numChannelLevelErrors = 0;
237 if (fedErrorsVsIdVsLumi_.globalswitchon) {
238 numChannelLevelErrors = double(lChVec.size());
239 fillHistogram2D(fedErrorsVsIdVsLumi_, aLumiSection, lFedId, numChannelLevelErrors);
244 void FEDHistograms::fillFEHistograms(
const unsigned int aFedId,
245 const FEDErrors::FELevelErrors& aFeLevelErrors,
246 const FEDErrors::EventProperties& aEventProp) {
247 const unsigned short lFeId = aFeLevelErrors.FeID;
255 if (aFeLevelErrors.Overflow)
256 fillHistogram(feOverflowDetailedMap_[aFedId], lFeId);
257 else if (aFeLevelErrors.Missing)
258 fillHistogram(feMissingDetailedMap_[aFedId], lFeId);
259 else if (aFeLevelErrors.BadMajorityAddress)
260 fillHistogram(badMajorityAddressDetailedMap_[aFedId], lFeId);
262 if (aFeLevelErrors.TimeDifference != 0) {
263 if (aFeLevelErrors.SubDetID == 2 || aFeLevelErrors.SubDetID == 3 || aFeLevelErrors.SubDetID == 4)
264 fillHistogram(feTimeDiffTIB_, aFeLevelErrors.TimeDifference);
265 else if (aFeLevelErrors.SubDetID == 5)
266 fillHistogram(feTimeDiffTOB_, aFeLevelErrors.TimeDifference);
267 else if (aFeLevelErrors.SubDetID == 0)
268 fillHistogram(feTimeDiffTECB_, aFeLevelErrors.TimeDifference);
269 else if (aFeLevelErrors.SubDetID == 1)
270 fillHistogram(feTimeDiffTECF_, aFeLevelErrors.TimeDifference);
274 aFeLevelErrors.TimeDifference < 0 ? aFeLevelErrors.TimeDifference + 192 : aFeLevelErrors.TimeDifference);
275 fillHistogram(apveAddress_, aFeLevelErrors.Apve);
276 fillHistogram(feMajAddress_, aFeLevelErrors.FeMaj);
281 void FEDHistograms::fillChannelsHistograms(
const unsigned int aFedId,
282 const FEDErrors::ChannelLevelErrors& aChErr,
284 unsigned int lChId = aChErr.ChannelID;
291 if (aChErr.Unlocked) {
292 fillHistogram(unlockedDetailedMap_[aFedId], lChId);
294 if (aChErr.OutOfSync) {
295 fillHistogram(outOfSyncDetailedMap_[aFedId], lChId);
299 void FEDHistograms::fillAPVsHistograms(
const unsigned int aFedId,
300 const FEDErrors::APVLevelErrors& aAPVErr,
302 unsigned int lChId = aAPVErr.APVID;
310 if (aAPVErr.APVStatusBit)
311 fillHistogram(badStatusBitsDetailedMap_[aFedId], lChId);
312 if (aAPVErr.APVError)
313 fillHistogram(apvErrorDetailedMap_[aFedId], lChId);
314 if (aAPVErr.APVAddressError)
315 fillHistogram(apvAddressErrorDetailedMap_[aFedId], lChId);
318 void FEDHistograms::fillMajorityHistograms(
const unsigned int aPart,
320 const std::vector<unsigned int>& aFedIdVec) {
322 fillHistogram(feMajFracTIB_, aValue);
324 fillHistogram(feMajFracTOB_, aValue);
326 fillHistogram(feMajFracTECB_, aValue);
328 fillHistogram(feMajFracTECF_, aValue);
330 for (
unsigned int iFed(0); iFed < aFedIdVec.size(); ++iFed) {
331 fillHistogram(badMajorityInPartition_, aFedIdVec[iFed]);
335 bool FEDHistograms::feMajHistosEnabled() {
336 return (feMajFracTIB_.enabled || feMajFracTOB_.enabled || feMajFracTECB_.enabled || feMajFracTECF_.enabled ||
337 badMajorityInPartition_.enabled);
340 void FEDHistograms::fillLumiHistograms(
const FEDErrors::LumiErrors& aLumErr) {
341 if (lumiErrorFraction_.enabled && lumiErrorFraction_.monitorEle) {
342 lumiErrorFraction_.monitorEle->Reset();
343 for (
unsigned int iD(0); iD < aLumErr.nTotal.size(); iD++) {
344 if (aLumErr.nTotal[iD] > 0)
345 fillHistogram(lumiErrorFraction_, iD + 1, static_cast<float>(aLumErr.nErrors[iD]) / aLumErr.nTotal[iD]);
350 bool FEDHistograms::cmHistosEnabled() {
return (medianAPV0_.enabled || medianAPV1_.enabled); }
354 return medianAPV0_.monitorEle;
356 return medianAPV1_.monitorEle;
361 void FEDHistograms::bookTopLevelHistograms(DQMStore::IBooker& ibooker,
369 histosBooked_.resize(siStripFedIdMax + 1,
false);
370 debugHistosBooked_.resize(siStripFedIdMax + 1,
false);
376 "Average FED buffer Size (B) per Event",
377 siStripFedIdMax - siStripFedIdMin + 1,
378 siStripFedIdMin - 0.5,
379 siStripFedIdMax + 0.5,
383 "<FED buffer Size> (B)");
385 bookHistogram(ibooker,
388 "Number of events where the data from a FED is seen",
389 siStripFedIdMax - siStripFedIdMin + 1,
390 siStripFedIdMin - 0.5,
391 siStripFedIdMax + 0.5,
394 bookHistogram(ibooker,
397 "Number of channels with any error",
398 "Total # bad enabled channels");
400 bookHistogram(ibooker,
401 nTotalBadActiveChannels_,
402 "nTotalBadActiveChannels",
403 "Number of active channels with any error",
404 "Total # bad active channels");
406 book2DHistogram(ibooker,
409 "Any error per APV per event",
419 book2DHistogram(ibooker,
423 siStripFedIdMax - siStripFedIdMin + 1,
431 fedErrorsVsId_.monitorEle->setBinLabel(1,
"Data Missing", 2);
432 fedErrorsVsId_.monitorEle->setBinLabel(2,
"Invalid Buffers", 2);
433 fedErrorsVsId_.monitorEle->setBinLabel(3,
"Corrupt Buffers", 2);
434 fedErrorsVsId_.monitorEle->setBinLabel(4,
"Bad FED CRC", 2);
435 fedErrorsVsId_.monitorEle->setBinLabel(5,
"Bad DAQ CRC", 2);
436 fedErrorsVsId_.monitorEle->setBinLabel(6,
"Bad IDs", 2);
437 fedErrorsVsId_.monitorEle->setBinLabel(7,
"Bad DAQ Packet", 2);
438 fedErrorsVsId_.monitorEle->setBinLabel(8,
"Any FED Errors", 2);
439 fedErrorsVsId_.monitorEle->setBinLabel(9,
"Any DAQ Problems", 2);
440 fedErrorsVsId_.monitorEle->setBinLabel(10,
"Any FE Problems", 2);
441 fedErrorsVsId_.monitorEle->setBinLabel(11,
"FE Overflows", 2);
442 fedErrorsVsId_.monitorEle->setBinLabel(12,
"FE Missing", 2);
443 fedErrorsVsId_.monitorEle->setBinLabel(13,
"FE Bad Maj Addr", 2);
444 fedErrorsVsId_.monitorEle->setBinLabel(14,
"Bad Ch Stat Bit", 2);
445 fedErrorsVsId_.monitorEle->setBinLabel(15,
"Bad Active Ch Stat Bit", 2);
449 ibooker.setCurrentFolder(lBaseDir +
"/FED");
452 ibooker, nFEDErrors_,
"nFEDErrors",
"Number of FEDs with errors (FED or FE Level) per event",
"# FEDErrors");
455 ibooker, nFEDDAQProblems_,
"nFEDDAQProblems",
"Number of FEDs with DAQ problems per event",
"# FEDDAQProblems");
457 bookHistogram(ibooker,
458 nFEDsWithFEProblems_,
459 "nFEDsWithFEProblems",
460 "Number of FEDs with FE problems per event",
461 "# FEDs with FE problems");
463 bookHistogram(ibooker,
465 "nFEDCorruptBuffers",
466 "Number of FEDs with corrupt buffers per event",
467 "# FEDs with corrupt buffer");
469 ibooker.setCurrentFolder(lBaseDir +
"/FED/VsId");
471 bookHistogram(ibooker,
474 "Number of events where the data from a FED with cabled channels is missing",
475 siStripFedIdMax - siStripFedIdMin + 1,
476 siStripFedIdMin - 0.5,
477 siStripFedIdMax + 0.5,
484 "Number of buffers with any FED error (excluding bad channel status bits, FE problems except overflows) per FED",
485 siStripFedIdMax - siStripFedIdMin + 1,
486 siStripFedIdMin - 0.5,
487 siStripFedIdMax + 0.5,
490 bookHistogram(ibooker,
493 "Number of corrupt FED buffers per FED",
494 siStripFedIdMax - siStripFedIdMin + 1,
495 siStripFedIdMin - 0.5,
496 siStripFedIdMax + 0.5,
499 bookHistogram(ibooker,
502 "Number of invalid FED buffers per FED",
503 siStripFedIdMax - siStripFedIdMin + 1,
504 siStripFedIdMin - 0.5,
505 siStripFedIdMax + 0.5,
508 bookHistogram(ibooker,
511 "Number of buffers with any problems flagged in DAQ header (including CRC)",
512 siStripFedIdMax - siStripFedIdMin + 1,
513 siStripFedIdMin - 0.5,
514 siStripFedIdMax + 0.5,
517 bookHistogram(ibooker,
520 "Number of buffers with non-SiStrip source IDs in DAQ header",
521 siStripFedIdMax - siStripFedIdMin + 1,
522 siStripFedIdMin - 0.5,
523 siStripFedIdMax + 0.5,
526 bookHistogram(ibooker,
529 "Number of buffers with bad CRCs from the DAQ",
530 siStripFedIdMax - siStripFedIdMin + 1,
531 siStripFedIdMin - 0.5,
532 siStripFedIdMax + 0.5,
535 bookHistogram(ibooker,
538 "Number of buffers with bad CRCs from the FED",
539 siStripFedIdMax - siStripFedIdMin + 1,
540 siStripFedIdMin - 0.5,
541 siStripFedIdMax + 0.5,
544 bookHistogram(ibooker,
547 "Number of buffers with (non-CRC) problems flagged in DAQ header/trailer",
548 siStripFedIdMax - siStripFedIdMin + 1,
549 siStripFedIdMin - 0.5,
550 siStripFedIdMax + 0.5,
553 ibooker.setCurrentFolder(lBaseDir +
"/FE");
555 bookHistogram(ibooker,
556 nFEDsWithFEOverflows_,
557 "nFEDsWithFEOverflows",
558 "Number FEDs with FE units which overflowed per event",
559 "# FEDs with FE overflows");
561 bookHistogram(ibooker,
562 nFEDsWithFEBadMajorityAddresses_,
563 "nFEDsWithFEBadMajorityAddresses",
564 "Number of FEDs with FE units with a bad majority address per event",
565 "# FEDs with bad address");
567 bookHistogram(ibooker,
568 nFEDsWithMissingFEs_,
569 "nFEDsWithMissingFEs",
570 "Number of FEDs with missing FE unit payloads per event",
571 "# FEDs with missing FEs");
573 bookHistogram(ibooker,
576 "Fraction of FEs matching majority address in TIB partition",
580 "n(majAddrFE)/n(totFE)");
582 bookHistogram(ibooker,
585 "Fraction of FEs matching majority address in TOB partition",
589 "n(majAddrFE)/n(totFE)");
591 bookHistogram(ibooker,
594 "Fraction of FEs matching majority address in TECB partition",
598 "n(majAddrFE)/n(totFE)");
600 bookHistogram(ibooker,
603 "Fraction of FEs matching majority address in TECF partition",
607 "n(majAddrFE)/n(totFE)");
609 ibooker.setCurrentFolder(lBaseDir +
"/FE/APVe");
611 bookHistogram(ibooker,
614 "(TimeLoc FE - TimeLoc APVe) for TIB/TID, when different",
618 "#Delta_{TimeLoc}(FE-APVe)");
620 bookHistogram(ibooker,
623 "(TimeLoc FE - TimeLoc APVe) for TOB, when different",
627 "#Delta_{TimeLoc}(FE-APVe)");
629 bookHistogram(ibooker,
632 "(TimeLoc FE - TimeLoc APVe) for TECB, when different",
636 "#Delta_{TimeLoc}(FE-APVe)");
638 bookHistogram(ibooker,
641 "(TimeLoc FE - TimeLoc APVe) for TECF, when different",
645 "#Delta_{TimeLoc}(FE-APVe)");
647 book2DHistogram(ibooker,
650 "(TimeLoc FE - TimeLoc APVe) vs DBX, when different",
658 "#Delta_{TimeLoc}(FE-APVe)");
660 bookHistogram(ibooker, apveAddress_,
"ApveAddress",
"apve Address", 256, 0, 256,
"apveAddress");
662 bookHistogram(ibooker, feMajAddress_,
"FeMajAddress",
"FE Majority Address", 256, 0, 256,
"feMajAddress");
664 ibooker.setCurrentFolder(lBaseDir +
"/FE/VsId");
666 bookHistogram(ibooker,
669 "Number of buffers with any FE unit problems",
670 siStripFedIdMax - siStripFedIdMin + 1,
671 siStripFedIdMin - 0.5,
672 siStripFedIdMax + 0.5,
675 bookHistogram(ibooker,
678 "Number of buffers with one or more FE overflow",
679 siStripFedIdMax - siStripFedIdMin + 1,
680 siStripFedIdMin - 0.5,
681 siStripFedIdMax + 0.5,
684 bookHistogram(ibooker,
685 badMajorityAddresses_,
686 "BadMajorityAddresses",
687 "Number of buffers with one or more FE with a bad majority APV address",
688 siStripFedIdMax - siStripFedIdMin + 1,
689 siStripFedIdMin - 0.5,
690 siStripFedIdMax + 0.5,
693 bookHistogram(ibooker,
694 badMajorityInPartition_,
695 "BadMajorityInPartition",
696 "Number of buffers with >=1 FE with FEaddress != majority in partition",
697 siStripFedIdMax - siStripFedIdMin + 1,
698 siStripFedIdMin - 0.5,
699 siStripFedIdMax + 0.5,
702 bookHistogram(ibooker,
705 "Number of buffers with one or more FE unit payload missing",
706 siStripFedIdMax - siStripFedIdMin + 1,
707 siStripFedIdMin - 0.5,
708 siStripFedIdMax + 0.5,
711 ibooker.setCurrentFolder(lBaseDir +
"/Fiber");
713 bookHistogram(ibooker,
714 nBadChannelStatusBits_,
715 "nBadChannelStatusBits",
716 "Number of channels with bad status bits per event",
717 "# bad enabled channels");
719 bookHistogram(ibooker,
720 nBadActiveChannelStatusBits_,
721 "nBadActiveChannelStatusBits",
722 "Number of active channels with bad status bits per event",
723 "# bad active channels");
725 bookHistogram(ibooker, nUnlocked_,
"nUnlocked",
"Number of channels Unlocked per event",
"# channels unlocked");
727 bookHistogram(ibooker, nOutOfSync_,
"nOutOfSync",
"Number of channels OutOfSync per event",
"# channels out-of-sync");
729 bookHistogram(ibooker,
730 nUnconnectedChannels_,
731 "nUnconnectedChannels",
732 "Number of channels not connected per event",
733 "# unconnected channels");
735 ibooker.setCurrentFolder(lBaseDir +
"/Fiber/VsId");
737 bookHistogram(ibooker,
738 badChannelStatusBits_,
739 "BadChannelStatusBits",
740 "Number of buffers with one or more enabled channel with bad status bits",
741 siStripFedIdMax - siStripFedIdMin + 1,
742 siStripFedIdMin - 0.5,
743 siStripFedIdMax + 0.5,
746 bookHistogram(ibooker,
747 badActiveChannelStatusBits_,
748 "BadActiveChannelStatusBits",
749 "Number of buffers with one or more active channel with bad status bits",
750 siStripFedIdMax - siStripFedIdMin + 1,
751 siStripFedIdMin - 0.5,
752 siStripFedIdMax + 0.5,
755 ibooker.setCurrentFolder(lBaseDir +
"/APV");
757 bookHistogram(ibooker, medianAPV0_,
"MedianAPV0",
"Median APV0",
"medianAPV0");
759 bookHistogram(ibooker, medianAPV1_,
"MedianAPV1",
"Median APV1",
"MedianAPV1");
761 bookHistogram(ibooker,
764 "Number of APVs with APVStatusBit error per event",
765 "# APVs with APVStatusBit error");
767 bookHistogram(ibooker, nAPVError_,
"nAPVError",
"Number of APVs with APVError per event",
"#APVs with APVError");
769 bookHistogram(ibooker,
772 "Number of APVs with APVAddressError per event",
773 "#APVs with APVAddressError");
775 ibooker.setCurrentFolder(lBaseDir +
"/Trends");
778 fedMaxEventSizevsTime_,
779 "FedMaxEventSizevsTime",
780 "Max FED buffer Size (B) per Event vs time",
784 "Max FED buffer Size (B)");
787 nTotalBadChannelsvsTime_,
788 "nTotalBadChannelsvsTime",
789 "Number of channels with any error vs time",
793 "Total # bad enabled channels");
796 nTotalBadActiveChannelsvsTime_,
797 "nTotalBadActiveChannelsvsTime",
798 "Number of active channels with any error vs time",
802 "Total # bad active channels");
804 ibooker.setCurrentFolder(lBaseDir +
"/Trends/FED");
806 if (fedErrorsVsIdVsLumi_.globalswitchon) {
807 bookProfile2D(ibooker,
808 fedErrorsVsIdVsLumi_,
809 "fedErrorsVsIdVsLumi",
810 "Total number of errors per FED ID per lumi section",
821 "Number of FEDs with any error vs time",
828 nFEDCorruptBuffersvsTime_,
829 "nFEDCorruptBuffersvsTime",
830 "Number of FEDs with corrupt buffer vs time",
834 "# FEDCorruptBuffer");
836 ibooker.setCurrentFolder(lBaseDir +
"/Trends/FE");
839 nFEDsWithFEProblemsvsTime_,
840 "nFEDsWithFEProblemsvsTime",
841 "Number of FEDs with any FE error vs time",
845 "# FEDsWithFEProblems");
847 ibooker.setCurrentFolder(lBaseDir +
"/Trends/Fiber");
852 "Number of channels Unlocked vs time",
856 "# channels unlocked ");
861 "Number of channels OutOfSync vs time",
865 "# channels out-of-sync");
867 ibooker.setCurrentFolder(lBaseDir +
"/Trends/APV");
870 nAPVStatusBitvsTime_,
871 "nAPVStatusBitvsTime",
872 "Number of APVs with APVStatusBit error vs time",
876 "# APVs with APVStatusBit error");
881 "Number of APVs with APVError vs time",
885 "# APVs with APVError");
888 nAPVAddressErrorvsTime_,
889 "nAPVAddressErrorvsTime",
890 "Number of APVs with APVAddressError vs time",
894 "# APVs with APVAddressError");
896 ibooker.setCurrentFolder(lBaseDir +
"/PerLumiSection");
898 bookHistogram(ibooker,
901 "Fraction of error per lumi section vs subdetector",
908 if (lumiErrorFraction_.enabled && lumiErrorFraction_.monitorEle) {
909 lumiErrorFraction_.monitorEle->setLumiFlag();
910 lumiErrorFraction_.monitorEle->setBinLabel(1,
"TECB");
911 lumiErrorFraction_.monitorEle->setBinLabel(2,
"TECF");
912 lumiErrorFraction_.monitorEle->setBinLabel(3,
"TIB");
913 lumiErrorFraction_.monitorEle->setBinLabel(4,
"TIDB");
914 lumiErrorFraction_.monitorEle->setBinLabel(5,
"TIDF");
915 lumiErrorFraction_.monitorEle->setBinLabel(6,
"TOB");
919 if (tkMapConfig_.enabled) {
920 tkmapFED_ = std::make_unique<TkHistoMap>(tkDetMap,
topFolderName,
"TkHMap_FractionOfBadChannels", 0.,
true);
925 void FEDHistograms::bookFEDHistograms(DQMStore::IBooker& ibooker,
unsigned int fedId,
bool fullDebugMode) {
926 if (!histosBooked_[fedId]) {
929 std::stringstream fedIdStream;
930 fedIdStream <<
fedId;
931 ibooker.setCurrentFolder(fedKey.path());
933 bookHistogram(ibooker,
935 feOverflowDetailedMap_[fedId],
936 "FEOverflowsForFED" + fedIdStream.str(),
937 "FE overflows per FE unit for FED ID " + fedIdStream.str(),
942 bookHistogram(ibooker,
943 badMajorityAddressDetailed_,
944 badMajorityAddressDetailedMap_[fedId],
945 "BadMajorityAddressesForFED" + fedIdStream.str(),
946 "Bad majority APV addresses per FE unit for FED ID " + fedIdStream.str(),
951 bookHistogram(ibooker,
953 feMissingDetailedMap_[fedId],
954 "FEMissingForFED" + fedIdStream.str(),
955 "Buffers with FE Unit payload missing per FE unit for FED ID " + fedIdStream.str(),
960 bookHistogram(ibooker,
961 badStatusBitsDetailed_,
962 badStatusBitsDetailedMap_[fedId],
963 "BadAPVStatusBitsForFED" + fedIdStream.str(),
964 "Bad apv status bits for FED ID " + fedIdStream.str(),
969 histosBooked_[
fedId] =
true;
971 if (fullDebugMode && !debugHistosBooked_[fedId]) {
974 std::stringstream fedIdStream;
975 fedIdStream <<
fedId;
976 ibooker.setCurrentFolder(fedKey.path());
978 bookHistogram(ibooker,
980 apvErrorDetailedMap_[fedId],
981 "APVErrorBitsForFED" + fedIdStream.str(),
982 "APV errors for FED ID " + fedIdStream.str(),
987 bookHistogram(ibooker,
988 apvAddressErrorDetailed_,
989 apvAddressErrorDetailedMap_[fedId],
990 "APVAddressErrorBitsForFED" + fedIdStream.str(),
991 "Wrong APV address errors for FED ID " + fedIdStream.str(),
996 bookHistogram(ibooker,
998 unlockedDetailedMap_[fedId],
999 "UnlockedBitsForFED" + fedIdStream.str(),
1000 "Unlocked channels for FED ID " + fedIdStream.str(),
1005 bookHistogram(ibooker,
1007 outOfSyncDetailedMap_[fedId],
1008 "OOSBitsForFED" + fedIdStream.str(),
1009 "Out of sync channels for FED ID " + fedIdStream.str(),
1014 debugHistosBooked_[
fedId] =
true;
1018 void FEDHistograms::bookAllFEDHistograms(DQMStore::IBooker& ibooker,
bool fullDebugMode) {
1023 for (
unsigned int iFed = siStripFedIdMin; iFed <= siStripFedIdMax; iFed++)
1024 bookFEDHistograms(ibooker, iFed, fullDebugMode);
1027 bool FEDHistograms::tkHistoMapEnabled(
unsigned int aIndex) {
return tkMapConfig_.enabled; }
1029 TkHistoMap* FEDHistograms::tkHistoMapPointer(
unsigned int aIndex) {
return tkmapFED_.get(); }
A container class for generic run and event-related info, information required by the commissioning a...
static const uint16_t FEUNITS_PER_FED
static const uint16_t APVS_PER_FED
dqm::legacy::MonitorElement MonitorElement
Constants and enumerated types for FED/FEC systems.
static const uint16_t FEDCH_PER_FED