CMS 3D CMS Logo

FEDHistograms.cc
Go to the documentation of this file.
4 
5 #include "DQM/SiStripMonitorHardware/interface/FEDHistograms.hh"
6 
7 FEDHistograms::FEDHistograms() {}
8 
9 FEDHistograms::~FEDHistograms() {}
10 
11 void FEDHistograms::initialise(const edm::ParameterSet& iConfig, std::ostringstream* pDebugStream) {
12  getConfigForHistogram(fedEventSize_, "FedEventSize", iConfig, pDebugStream);
13  getConfigForHistogram(fedMaxEventSizevsTime_, "FedMaxEventSizevsTime", iConfig, pDebugStream);
14 
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);
22 
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);
31 
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);
38 
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);
47 
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);
57 
58  getConfigForHistogram(nFEDErrorsvsTime_, "nFEDErrorsvsTime", iConfig, pDebugStream);
59  getConfigForHistogram(fedErrorsVsIdVsLumi_, "fedErrorsVsIdVsLumi", iConfig, pDebugStream);
60  getConfigForHistogram(nFEDCorruptBuffersvsTime_, "nFEDCorruptBuffersvsTime", iConfig, pDebugStream);
61  getConfigForHistogram(nFEDsWithFEProblemsvsTime_, "nFEDsWithFEProblemsvsTime", iConfig, pDebugStream);
62 
63  getConfigForHistogram(nUnconnectedChannels_, "nUnconnectedChannels", iConfig, pDebugStream);
64 
65  getConfigForHistogram(nTotalBadChannels_, "nTotalBadChannels", iConfig, pDebugStream);
66  getConfigForHistogram(nTotalBadActiveChannels_, "nTotalBadActiveChannels", iConfig, pDebugStream);
67 
68  getConfigForHistogram(nTotalBadChannelsvsTime_, "nTotalBadChannelsvsTime", iConfig, pDebugStream);
69  getConfigForHistogram(nTotalBadActiveChannelsvsTime_, "nTotalBadActiveChannelsvsTime", iConfig, pDebugStream);
70 
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);
76 
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);
82 
83  getConfigForHistogram(tkMapConfig_, "TkHistoMap", iConfig, pDebugStream);
84 
85  getConfigForHistogram(feTimeDiffTIB_, "FETimeDiffTIB", iConfig, pDebugStream);
86  getConfigForHistogram(feTimeDiffTOB_, "FETimeDiffTOB", iConfig, pDebugStream);
87  getConfigForHistogram(feTimeDiffTECB_, "FETimeDiffTECB", iConfig, pDebugStream);
88  getConfigForHistogram(feTimeDiffTECF_, "FETimeDiffTECF", iConfig, pDebugStream);
89 
90  getConfigForHistogram(feTimeDiffvsDBX_, "FETimeDiffvsDBX", iConfig, pDebugStream);
91 
92  getConfigForHistogram(apveAddress_, "ApveAddress", iConfig, pDebugStream);
93  getConfigForHistogram(feMajAddress_, "FeMajAddress", iConfig, pDebugStream);
94 
95  getConfigForHistogram(medianAPV0_, "MedianAPV0", iConfig, pDebugStream);
96  getConfigForHistogram(medianAPV1_, "MedianAPV1", iConfig, pDebugStream);
97 
98  getConfigForHistogram(fedIdVsApvId_, "FedIdVsApvId", iConfig, pDebugStream);
99 
100  getConfigForHistogram(fedErrorsVsId_, "FedErrorsVsId", iConfig, pDebugStream);
101 }
102 
103 void FEDHistograms::fillCountersHistograms(const FEDErrors::FEDCounters& fedLevelCounters,
104  const FEDErrors::ChannelCounters& chLevelCounters,
105  const unsigned int aMaxSize,
106  const double aTime) {
107  fillHistogram(fedMaxEventSizevsTime_, aTime, aMaxSize);
108 
109  fillHistogram(nFEDErrors_, fedLevelCounters.nFEDErrors);
110  fillHistogram(nFEDDAQProblems_, fedLevelCounters.nDAQProblems);
111  fillHistogram(nFEDsWithFEProblems_, fedLevelCounters.nFEDsWithFEProblems);
112  fillHistogram(nFEDCorruptBuffers_, fedLevelCounters.nCorruptBuffers);
113  fillHistogram(nFEDsWithFEOverflows_, fedLevelCounters.nFEDsWithFEOverflows);
114  fillHistogram(nFEDsWithFEBadMajorityAddresses_, fedLevelCounters.nFEDsWithFEBadMajorityAddresses);
115  fillHistogram(nFEDsWithMissingFEs_, fedLevelCounters.nFEDsWithMissingFEs);
116  fillHistogram(nBadChannelStatusBits_, fedLevelCounters.nBadChannels);
117  fillHistogram(nBadActiveChannelStatusBits_, fedLevelCounters.nBadActiveChannels);
118 
119  fillHistogram(nFEDErrorsvsTime_, aTime, fedLevelCounters.nFEDErrors);
120  fillHistogram(nFEDCorruptBuffersvsTime_, aTime, fedLevelCounters.nCorruptBuffers);
121  fillHistogram(nFEDsWithFEProblemsvsTime_, aTime, fedLevelCounters.nFEDsWithFEProblems);
122 
123  fillHistogram(nUnconnectedChannels_, chLevelCounters.nNotConnected);
124 
125  fillHistogram(nTotalBadChannels_, fedLevelCounters.nTotalBadChannels);
126  fillHistogram(nTotalBadActiveChannels_, fedLevelCounters.nTotalBadActiveChannels);
127 
128  fillHistogram(nTotalBadChannelsvsTime_, aTime, fedLevelCounters.nTotalBadChannels);
129  fillHistogram(nTotalBadActiveChannelsvsTime_, aTime, fedLevelCounters.nTotalBadActiveChannels);
130 
131  fillHistogram(nAPVStatusBit_, chLevelCounters.nAPVStatusBit);
132  fillHistogram(nAPVError_, chLevelCounters.nAPVError);
133  fillHistogram(nAPVAddressError_, chLevelCounters.nAPVAddressError);
134  fillHistogram(nUnlocked_, chLevelCounters.nUnlocked);
135  fillHistogram(nOutOfSync_, chLevelCounters.nOutOfSync);
136 
137  fillHistogram(nAPVStatusBitvsTime_, aTime, chLevelCounters.nAPVStatusBit);
138  fillHistogram(nAPVErrorvsTime_, aTime, chLevelCounters.nAPVError);
139  fillHistogram(nAPVAddressErrorvsTime_, aTime, chLevelCounters.nAPVAddressError);
140  fillHistogram(nUnlockedvsTime_, aTime, chLevelCounters.nUnlocked);
141  fillHistogram(nOutOfSyncvsTime_, aTime, chLevelCounters.nOutOfSync);
142 }
143 
144 void FEDHistograms::fillFEDHistograms(FEDErrors& aFedErr,
145  const unsigned int aEvtSize,
146  bool lFullDebug,
147  const double aLumiSection,
148  unsigned int& NumBadChannels_perFEDID) {
149  const FEDErrors::FEDLevelErrors& lFedLevelErrors = aFedErr.getFEDLevelErrors();
150  const unsigned int lFedId = aFedErr.fedID();
151 
152  fillHistogram(fedEventSize_, lFedId, aEvtSize);
153 
154  if (lFedLevelErrors.DataPresent)
155  fillHistogram(dataPresent_, lFedId);
156 
157  if (lFedLevelErrors.HasCabledChannels && lFedLevelErrors.DataMissing) {
158  fillHistogram(dataMissing_, lFedId);
159  fillHistogram(fedErrorsVsId_, lFedId, 1);
160  }
161 
162  if (lFedLevelErrors.InvalidBuffers) {
163  fillHistogram(invalidBuffers_, lFedId);
164  fillHistogram(fedErrorsVsId_, lFedId, 2);
165  } else if (lFedLevelErrors.CorruptBuffer) {
166  fillHistogram(corruptBuffers_, lFedId);
167  fillHistogram(fedErrorsVsId_, lFedId, 3);
168  } else if (lFedLevelErrors.BadFEDCRCs) {
169  fillHistogram(badFEDCRCs_, lFedId);
170  fillHistogram(fedErrorsVsId_, lFedId, 4);
171  } else if (lFedLevelErrors.BadDAQCRCs) {
172  fillHistogram(badDAQCRCs_, lFedId);
173  fillHistogram(fedErrorsVsId_, lFedId, 5);
174  } else if (lFedLevelErrors.BadIDs) {
175  fillHistogram(badIDs_, lFedId);
176  fillHistogram(fedErrorsVsId_, lFedId, 6);
177  } else if (lFedLevelErrors.BadDAQPacket) {
178  fillHistogram(badDAQPacket_, lFedId);
179  fillHistogram(fedErrorsVsId_, lFedId, 7);
180  }
181 
182  if (aFedErr.anyFEDErrors()) {
183  fillHistogram(anyFEDErrors_, lFedId);
184  fillHistogram(fedErrorsVsId_, lFedId, 8);
185  }
186 
187  if (lFedLevelErrors.HasCabledChannels && aFedErr.anyDAQProblems()) {
188  fillHistogram(anyDAQProblems_, lFedId);
189  fillHistogram(fedErrorsVsId_, lFedId, 9);
190  }
191  if (aFedErr.anyFEProblems()) {
192  fillHistogram(anyFEProblems_, lFedId);
193  fillHistogram(fedErrorsVsId_, lFedId, 10);
194  }
195 
196  if (lFedLevelErrors.FEsOverflow) {
197  fillHistogram(feOverflows_, lFedId);
198  fillHistogram(fedErrorsVsId_, lFedId, 11);
199  }
200  if (lFedLevelErrors.FEsMissing) {
201  fillHistogram(feMissing_, lFedId);
202  fillHistogram(fedErrorsVsId_, lFedId, 12);
203  }
204  if (lFedLevelErrors.FEsBadMajorityAddress) {
205  fillHistogram(badMajorityAddresses_, lFedId);
206  fillHistogram(fedErrorsVsId_, lFedId, 13);
207  }
208 
209  if (lFedLevelErrors.BadChannelStatusBit) {
210  fillHistogram(badChannelStatusBits_, lFedId);
211  fillHistogram(fedErrorsVsId_, lFedId, 14);
212  }
213  if (lFedLevelErrors.BadActiveChannelStatusBit) {
214  fillHistogram(badActiveChannelStatusBits_, lFedId);
215  fillHistogram(fedErrorsVsId_, lFedId, 15);
216  }
217 
218  std::vector<FEDErrors::FELevelErrors>& lFeVec = aFedErr.getFELevelErrors();
219 
220  for (unsigned int iFe(0); iFe < lFeVec.size(); iFe++) {
221  fillFEHistograms(lFedId, lFeVec[iFe], aFedErr.getEventProperties());
222  }
223 
224  std::vector<FEDErrors::ChannelLevelErrors>& lChVec = aFedErr.getChannelLevelErrors();
225  for (unsigned int iCh(0); iCh < lChVec.size(); iCh++) {
226  fillChannelsHistograms(lFedId, lChVec[iCh], lFullDebug);
227  }
228 
229  std::vector<FEDErrors::APVLevelErrors>& lAPVVec = aFedErr.getAPVLevelErrors();
230  for (unsigned int iApv(0); iApv < lAPVVec.size(); iApv++) {
231  fillAPVsHistograms(lFedId, lAPVVec[iApv], lFullDebug);
232  }
233 
234  double numChannelLevelErrors = 0;
235  if (fedErrorsVsIdVsLumi_.globalswitchon) {
236  numChannelLevelErrors = double(lChVec.size());
237  fillHistogram2D(fedErrorsVsIdVsLumi_, aLumiSection, lFedId, numChannelLevelErrors);
238  }
239 }
240 
241 //fill a histogram if the pointer is not NULL (ie if it has been booked)
242 void FEDHistograms::fillFEHistograms(const unsigned int aFedId,
243  const FEDErrors::FELevelErrors& aFeLevelErrors,
244  const FEDErrors::EventProperties& aEventProp) {
245  const unsigned short lFeId = aFeLevelErrors.FeID;
246  /*
247  if ( (feOverflowDetailed_.enabled && aFeLevelErrors.Overflow) ||
248  (badMajorityAddressDetailed_.enabled && aFeLevelErrors.BadMajorityAddress) ||
249  (feMissingDetailed_.enabled && aFeLevelErrors.Missing)
250  )
251  bookFEDHistograms(aFedId);
252  */
253  if (aFeLevelErrors.Overflow)
254  fillHistogram(feOverflowDetailedMap_[aFedId], lFeId);
255  else if (aFeLevelErrors.Missing)
256  fillHistogram(feMissingDetailedMap_[aFedId], lFeId);
257  else if (aFeLevelErrors.BadMajorityAddress)
258  fillHistogram(badMajorityAddressDetailedMap_[aFedId], lFeId);
259 
260  if (aFeLevelErrors.TimeDifference != 0) {
261  if (aFeLevelErrors.SubDetID == 2 || aFeLevelErrors.SubDetID == 3 || aFeLevelErrors.SubDetID == 4)
262  fillHistogram(feTimeDiffTIB_, aFeLevelErrors.TimeDifference);
263  else if (aFeLevelErrors.SubDetID == 5)
264  fillHistogram(feTimeDiffTOB_, aFeLevelErrors.TimeDifference);
265  else if (aFeLevelErrors.SubDetID == 0)
266  fillHistogram(feTimeDiffTECB_, aFeLevelErrors.TimeDifference);
267  else if (aFeLevelErrors.SubDetID == 1)
268  fillHistogram(feTimeDiffTECF_, aFeLevelErrors.TimeDifference);
269  fillHistogram(
270  feTimeDiffvsDBX_,
271  aEventProp.deltaBX,
272  aFeLevelErrors.TimeDifference < 0 ? aFeLevelErrors.TimeDifference + 192 : aFeLevelErrors.TimeDifference);
273  fillHistogram(apveAddress_, aFeLevelErrors.Apve);
274  fillHistogram(feMajAddress_, aFeLevelErrors.FeMaj);
275  }
276 }
277 
278 //fill a histogram if the pointer is not NULL (ie if it has been booked)
279 void FEDHistograms::fillChannelsHistograms(const unsigned int aFedId,
280  const FEDErrors::ChannelLevelErrors& aChErr,
281  bool fullDebug) {
282  unsigned int lChId = aChErr.ChannelID;
283  /*
284  if ( (unlockedDetailed_.enabled && aChErr.Unlocked) ||
285  (outOfSyncDetailed_.enabled && aChErr.OutOfSync)
286  )
287  bookFEDHistograms(aFedId,fullDebug);
288  */
289  if (aChErr.Unlocked) {
290  fillHistogram(unlockedDetailedMap_[aFedId], lChId);
291  }
292  if (aChErr.OutOfSync) {
293  fillHistogram(outOfSyncDetailedMap_[aFedId], lChId);
294  }
295 }
296 
297 void FEDHistograms::fillAPVsHistograms(const unsigned int aFedId,
298  const FEDErrors::APVLevelErrors& aAPVErr,
299  bool fullDebug) {
300  unsigned int lChId = aAPVErr.APVID;
301  /*
302  if ( (badStatusBitsDetailed_.enabled && aAPVErr.APVStatusBit) ||
303  (apvErrorDetailed_.enabled && aAPVErr.APVError) ||
304  (apvAddressErrorDetailed_.enabled && aAPVErr.APVAddressError)
305  ) bookFEDHistograms(aFedId,fullDebug);
306  */
307 
308  if (aAPVErr.APVStatusBit)
309  fillHistogram(badStatusBitsDetailedMap_[aFedId], lChId);
310  if (aAPVErr.APVError)
311  fillHistogram(apvErrorDetailedMap_[aFedId], lChId);
312  if (aAPVErr.APVAddressError)
313  fillHistogram(apvAddressErrorDetailedMap_[aFedId], lChId);
314 }
315 
316 void FEDHistograms::fillMajorityHistograms(const unsigned int aPart,
317  const float aValue,
318  const std::vector<unsigned int>& aFedIdVec) {
319  if (aPart == 0)
320  fillHistogram(feMajFracTIB_, aValue);
321  else if (aPart == 1)
322  fillHistogram(feMajFracTOB_, aValue);
323  else if (aPart == 2)
324  fillHistogram(feMajFracTECB_, aValue);
325  else if (aPart == 3)
326  fillHistogram(feMajFracTECF_, aValue);
327 
328  for (unsigned int iFed(0); iFed < aFedIdVec.size(); ++iFed) {
329  fillHistogram(badMajorityInPartition_, aFedIdVec[iFed]);
330  }
331 }
332 
333 bool FEDHistograms::feMajHistosEnabled() {
334  return (feMajFracTIB_.enabled || feMajFracTOB_.enabled || feMajFracTECB_.enabled || feMajFracTECF_.enabled ||
335  badMajorityInPartition_.enabled);
336 }
337 
338 bool FEDHistograms::cmHistosEnabled() { return (medianAPV0_.enabled || medianAPV1_.enabled); }
339 
340 FEDHistograms::MonitorElement* FEDHistograms::cmHistPointer(bool aApv1) {
341  if (!aApv1)
342  return medianAPV0_.monitorEle;
343  else
344  return medianAPV1_.monitorEle;
345 }
346 
347 FEDHistograms::MonitorElement* FEDHistograms::getFedvsAPVpointer() { return fedIdVsApvId_.monitorEle; }
348 
349 void FEDHistograms::bookTopLevelHistograms(DQMStore::IBooker& ibooker,
350  const TkDetMap* tkDetMap,
352  //get FED IDs
353  const unsigned int siStripFedIdMin = FEDNumbering::MINSiStripFEDID;
354  const unsigned int siStripFedIdMax = FEDNumbering::MAXSiStripFEDID;
355 
356  //book FED level histograms
357  histosBooked_.resize(siStripFedIdMax + 1, false);
358  debugHistosBooked_.resize(siStripFedIdMax + 1, false);
359 
360  //book histos
361  bookProfile(ibooker,
362  fedEventSize_,
363  "FedEventSize",
364  "Average FED buffer Size (B) per Event",
365  siStripFedIdMax - siStripFedIdMin + 1,
366  siStripFedIdMin - 0.5,
367  siStripFedIdMax + 0.5,
368  0,
369  42241, //total number of channels
370  "FED-ID",
371  "<FED buffer Size> (B)");
372 
373  bookHistogram(ibooker,
374  dataPresent_,
375  "DataPresent",
376  "Number of events where the data from a FED is seen",
377  siStripFedIdMax - siStripFedIdMin + 1,
378  siStripFedIdMin - 0.5,
379  siStripFedIdMax + 0.5,
380  "FED-ID");
381 
382  bookHistogram(ibooker,
383  nTotalBadChannels_,
384  "nTotalBadChannels",
385  "Number of channels with any error",
386  "Total # bad enabled channels");
387 
388  bookHistogram(ibooker,
389  nTotalBadActiveChannels_,
390  "nTotalBadActiveChannels",
391  "Number of active channels with any error",
392  "Total # bad active channels");
393 
394  book2DHistogram(ibooker,
395  fedIdVsApvId_,
396  "FedIdVsApvId",
397  "Any error per APV per event",
398  192,
399  0,
400  192,
401  440,
402  50,
403  490,
404  "APV-ID",
405  "FED-ID");
406 
407  book2DHistogram(ibooker,
408  fedErrorsVsId_,
409  "FEDErrorsVsId",
410  "FED Errors vs ID",
411  siStripFedIdMax - siStripFedIdMin + 1,
412  siStripFedIdMin,
413  siStripFedIdMax + 1,
414  15,
415  1,
416  16,
417  "FED ID",
418  "Error Type");
419  fedErrorsVsId_.monitorEle->setBinLabel(1, "Data Missing", 2);
420  fedErrorsVsId_.monitorEle->setBinLabel(2, "Invalid Buffers", 2);
421  fedErrorsVsId_.monitorEle->setBinLabel(3, "Corrupt Buffers", 2);
422  fedErrorsVsId_.monitorEle->setBinLabel(4, "Bad FED CRC", 2);
423  fedErrorsVsId_.monitorEle->setBinLabel(5, "Bad DAQ CRC", 2);
424  fedErrorsVsId_.monitorEle->setBinLabel(6, "Bad IDs", 2);
425  fedErrorsVsId_.monitorEle->setBinLabel(7, "Bad DAQ Packet", 2);
426  fedErrorsVsId_.monitorEle->setBinLabel(8, "Any FED Errors", 2);
427  fedErrorsVsId_.monitorEle->setBinLabel(9, "Any DAQ Problems", 2);
428  fedErrorsVsId_.monitorEle->setBinLabel(10, "Any FE Problems", 2);
429  fedErrorsVsId_.monitorEle->setBinLabel(11, "FE Overflows", 2);
430  fedErrorsVsId_.monitorEle->setBinLabel(12, "FE Missing", 2);
431  fedErrorsVsId_.monitorEle->setBinLabel(13, "FE Bad Maj Addr", 2);
432  fedErrorsVsId_.monitorEle->setBinLabel(14, "Bad Ch Stat Bit", 2);
433  fedErrorsVsId_.monitorEle->setBinLabel(15, "Bad Active Ch Stat Bit", 2);
434 
435  const std::string lBaseDir = ibooker.pwd();
436 
437  ibooker.setCurrentFolder(lBaseDir + "/FED");
438 
439  bookHistogram(
440  ibooker, nFEDErrors_, "nFEDErrors", "Number of FEDs with errors (FED or FE Level) per event", "# FEDErrors");
441 
442  bookHistogram(
443  ibooker, nFEDDAQProblems_, "nFEDDAQProblems", "Number of FEDs with DAQ problems per event", "# FEDDAQProblems");
444 
445  bookHistogram(ibooker,
446  nFEDsWithFEProblems_,
447  "nFEDsWithFEProblems",
448  "Number of FEDs with FE problems per event",
449  "# FEDs with FE problems");
450 
451  bookHistogram(ibooker,
452  nFEDCorruptBuffers_,
453  "nFEDCorruptBuffers",
454  "Number of FEDs with corrupt buffers per event",
455  "# FEDs with corrupt buffer");
456 
457  ibooker.setCurrentFolder(lBaseDir + "/FED/VsId");
458 
459  bookHistogram(ibooker,
460  dataMissing_,
461  "DataMissing",
462  "Number of events where the data from a FED with cabled channels is missing",
463  siStripFedIdMax - siStripFedIdMin + 1,
464  siStripFedIdMin - 0.5,
465  siStripFedIdMax + 0.5,
466  "FED-ID");
467 
468  bookHistogram(
469  ibooker,
470  anyFEDErrors_,
471  "AnyFEDErrors",
472  "Number of buffers with any FED error (excluding bad channel status bits, FE problems except overflows) per FED",
473  siStripFedIdMax - siStripFedIdMin + 1,
474  siStripFedIdMin - 0.5,
475  siStripFedIdMax + 0.5,
476  "FED-ID");
477 
478  bookHistogram(ibooker,
479  corruptBuffers_,
480  "CorruptBuffers",
481  "Number of corrupt FED buffers per FED",
482  siStripFedIdMax - siStripFedIdMin + 1,
483  siStripFedIdMin - 0.5,
484  siStripFedIdMax + 0.5,
485  "FED-ID");
486 
487  bookHistogram(ibooker,
488  invalidBuffers_,
489  "InvalidBuffers",
490  "Number of invalid FED buffers per FED",
491  siStripFedIdMax - siStripFedIdMin + 1,
492  siStripFedIdMin - 0.5,
493  siStripFedIdMax + 0.5,
494  "FED-ID");
495 
496  bookHistogram(ibooker,
497  anyDAQProblems_,
498  "AnyDAQProblems",
499  "Number of buffers with any problems flagged in DAQ header (including CRC)",
500  siStripFedIdMax - siStripFedIdMin + 1,
501  siStripFedIdMin - 0.5,
502  siStripFedIdMax + 0.5,
503  "FED-ID");
504 
505  bookHistogram(ibooker,
506  badIDs_,
507  "BadIDs",
508  "Number of buffers with non-SiStrip source IDs in DAQ header",
509  siStripFedIdMax - siStripFedIdMin + 1,
510  siStripFedIdMin - 0.5,
511  siStripFedIdMax + 0.5,
512  "FED-ID");
513 
514  bookHistogram(ibooker,
515  badDAQCRCs_,
516  "BadDAQCRCs",
517  "Number of buffers with bad CRCs from the DAQ",
518  siStripFedIdMax - siStripFedIdMin + 1,
519  siStripFedIdMin - 0.5,
520  siStripFedIdMax + 0.5,
521  "FED-ID");
522 
523  bookHistogram(ibooker,
524  badFEDCRCs_,
525  "BadFEDCRCs",
526  "Number of buffers with bad CRCs from the FED",
527  siStripFedIdMax - siStripFedIdMin + 1,
528  siStripFedIdMin - 0.5,
529  siStripFedIdMax + 0.5,
530  "FED-ID");
531 
532  bookHistogram(ibooker,
533  badDAQPacket_,
534  "BadDAQPacket",
535  "Number of buffers with (non-CRC) problems flagged in DAQ header/trailer",
536  siStripFedIdMax - siStripFedIdMin + 1,
537  siStripFedIdMin - 0.5,
538  siStripFedIdMax + 0.5,
539  "FED-ID");
540 
541  ibooker.setCurrentFolder(lBaseDir + "/FE");
542 
543  bookHistogram(ibooker,
544  nFEDsWithFEOverflows_,
545  "nFEDsWithFEOverflows",
546  "Number FEDs with FE units which overflowed per event",
547  "# FEDs with FE overflows");
548 
549  bookHistogram(ibooker,
550  nFEDsWithFEBadMajorityAddresses_,
551  "nFEDsWithFEBadMajorityAddresses",
552  "Number of FEDs with FE units with a bad majority address per event",
553  "# FEDs with bad address");
554 
555  bookHistogram(ibooker,
556  nFEDsWithMissingFEs_,
557  "nFEDsWithMissingFEs",
558  "Number of FEDs with missing FE unit payloads per event",
559  "# FEDs with missing FEs");
560 
561  bookHistogram(ibooker,
562  feMajFracTIB_,
563  "FeMajFracTIB",
564  "Fraction of FEs matching majority address in TIB partition",
565  101,
566  0,
567  1.01,
568  "n(majAddrFE)/n(totFE)");
569 
570  bookHistogram(ibooker,
571  feMajFracTOB_,
572  "FeMajFracTOB",
573  "Fraction of FEs matching majority address in TOB partition",
574  101,
575  0,
576  1.01,
577  "n(majAddrFE)/n(totFE)");
578 
579  bookHistogram(ibooker,
580  feMajFracTECB_,
581  "FeMajFracTECB",
582  "Fraction of FEs matching majority address in TECB partition",
583  101,
584  0,
585  1.01,
586  "n(majAddrFE)/n(totFE)");
587 
588  bookHistogram(ibooker,
589  feMajFracTECF_,
590  "FeMajFracTECF",
591  "Fraction of FEs matching majority address in TECF partition",
592  101,
593  0,
594  1.01,
595  "n(majAddrFE)/n(totFE)");
596 
597  ibooker.setCurrentFolder(lBaseDir + "/FE/APVe");
598 
599  bookHistogram(ibooker,
600  feTimeDiffTIB_,
601  "FETimeDiffTIB",
602  "(TimeLoc FE - TimeLoc APVe) for TIB/TID, when different",
603  401,
604  -200,
605  201,
606  "#Delta_{TimeLoc}(FE-APVe)");
607 
608  bookHistogram(ibooker,
609  feTimeDiffTOB_,
610  "FETimeDiffTOB",
611  "(TimeLoc FE - TimeLoc APVe) for TOB, when different",
612  401,
613  -200,
614  201,
615  "#Delta_{TimeLoc}(FE-APVe)");
616 
617  bookHistogram(ibooker,
618  feTimeDiffTECB_,
619  "FETimeDiffTECB",
620  "(TimeLoc FE - TimeLoc APVe) for TECB, when different",
621  401,
622  -200,
623  201,
624  "#Delta_{TimeLoc}(FE-APVe)");
625 
626  bookHistogram(ibooker,
627  feTimeDiffTECF_,
628  "FETimeDiffTECF",
629  "(TimeLoc FE - TimeLoc APVe) for TECF, when different",
630  401,
631  -200,
632  201,
633  "#Delta_{TimeLoc}(FE-APVe)");
634 
635  book2DHistogram(ibooker,
636  feTimeDiffvsDBX_,
637  "FETimeDiffvsDBX",
638  "(TimeLoc FE - TimeLoc APVe) vs DBX, when different",
639  2000,
640  -0.5,
641  1999.5,
642  201,
643  0,
644  201,
645  "DeltaBX",
646  "#Delta_{TimeLoc}(FE-APVe)");
647 
648  bookHistogram(ibooker, apveAddress_, "ApveAddress", "apve Address", 256, 0, 256, "apveAddress");
649 
650  bookHistogram(ibooker, feMajAddress_, "FeMajAddress", "FE Majority Address", 256, 0, 256, "feMajAddress");
651 
652  ibooker.setCurrentFolder(lBaseDir + "/FE/VsId");
653 
654  bookHistogram(ibooker,
655  anyFEProblems_,
656  "AnyFEProblems",
657  "Number of buffers with any FE unit problems",
658  siStripFedIdMax - siStripFedIdMin + 1,
659  siStripFedIdMin - 0.5,
660  siStripFedIdMax + 0.5,
661  "FED-ID");
662 
663  bookHistogram(ibooker,
664  feOverflows_,
665  "FEOverflows",
666  "Number of buffers with one or more FE overflow",
667  siStripFedIdMax - siStripFedIdMin + 1,
668  siStripFedIdMin - 0.5,
669  siStripFedIdMax + 0.5,
670  "FED-ID");
671 
672  bookHistogram(ibooker,
673  badMajorityAddresses_,
674  "BadMajorityAddresses",
675  "Number of buffers with one or more FE with a bad majority APV address",
676  siStripFedIdMax - siStripFedIdMin + 1,
677  siStripFedIdMin - 0.5,
678  siStripFedIdMax + 0.5,
679  "FED-ID");
680 
681  bookHistogram(ibooker,
682  badMajorityInPartition_,
683  "BadMajorityInPartition",
684  "Number of buffers with >=1 FE with FEaddress != majority in partition",
685  siStripFedIdMax - siStripFedIdMin + 1,
686  siStripFedIdMin - 0.5,
687  siStripFedIdMax + 0.5,
688  "FED-ID");
689 
690  bookHistogram(ibooker,
691  feMissing_,
692  "FEMissing",
693  "Number of buffers with one or more FE unit payload missing",
694  siStripFedIdMax - siStripFedIdMin + 1,
695  siStripFedIdMin - 0.5,
696  siStripFedIdMax + 0.5,
697  "FED-ID");
698 
699  ibooker.setCurrentFolder(lBaseDir + "/Fiber");
700 
701  bookHistogram(ibooker,
702  nBadChannelStatusBits_,
703  "nBadChannelStatusBits",
704  "Number of channels with bad status bits per event",
705  "# bad enabled channels");
706 
707  bookHistogram(ibooker,
708  nBadActiveChannelStatusBits_,
709  "nBadActiveChannelStatusBits",
710  "Number of active channels with bad status bits per event",
711  "# bad active channels");
712 
713  bookHistogram(ibooker, nUnlocked_, "nUnlocked", "Number of channels Unlocked per event", "# channels unlocked");
714 
715  bookHistogram(ibooker, nOutOfSync_, "nOutOfSync", "Number of channels OutOfSync per event", "# channels out-of-sync");
716 
717  bookHistogram(ibooker,
718  nUnconnectedChannels_,
719  "nUnconnectedChannels",
720  "Number of channels not connected per event",
721  "# unconnected channels");
722 
723  ibooker.setCurrentFolder(lBaseDir + "/Fiber/VsId");
724 
725  bookHistogram(ibooker,
726  badChannelStatusBits_,
727  "BadChannelStatusBits",
728  "Number of buffers with one or more enabled channel with bad status bits",
729  siStripFedIdMax - siStripFedIdMin + 1,
730  siStripFedIdMin - 0.5,
731  siStripFedIdMax + 0.5,
732  "FED-ID");
733 
734  bookHistogram(ibooker,
735  badActiveChannelStatusBits_,
736  "BadActiveChannelStatusBits",
737  "Number of buffers with one or more active channel with bad status bits",
738  siStripFedIdMax - siStripFedIdMin + 1,
739  siStripFedIdMin - 0.5,
740  siStripFedIdMax + 0.5,
741  "FED-ID");
742 
743  ibooker.setCurrentFolder(lBaseDir + "/APV");
744 
745  bookHistogram(ibooker, medianAPV0_, "MedianAPV0", "Median APV0", "medianAPV0");
746 
747  bookHistogram(ibooker, medianAPV1_, "MedianAPV1", "Median APV1", "MedianAPV1");
748 
749  bookHistogram(ibooker,
750  nAPVStatusBit_,
751  "nAPVStatusBit",
752  "Number of APVs with APVStatusBit error per event",
753  "# APVs with APVStatusBit error");
754 
755  bookHistogram(ibooker, nAPVError_, "nAPVError", "Number of APVs with APVError per event", "#APVs with APVError");
756 
757  bookHistogram(ibooker,
758  nAPVAddressError_,
759  "nAPVAddressError",
760  "Number of APVs with APVAddressError per event",
761  "#APVs with APVAddressError");
762 
763  ibooker.setCurrentFolder(lBaseDir + "/Trends");
764 
765  bookProfile(ibooker,
766  fedMaxEventSizevsTime_,
767  "FedMaxEventSizevsTime",
768  "Max FED buffer Size (B) per Event vs time",
769  0,
770  42241, //total number of channels
771  "Time",
772  "Max FED buffer Size (B)");
773 
774  bookProfile(ibooker,
775  nTotalBadChannelsvsTime_,
776  "nTotalBadChannelsvsTime",
777  "Number of channels with any error vs time",
778  0,
779  42241, //total number of channels
780  "Time",
781  "Total # bad enabled channels");
782 
783  bookProfile(ibooker,
784  nTotalBadActiveChannelsvsTime_,
785  "nTotalBadActiveChannelsvsTime",
786  "Number of active channels with any error vs time",
787  0,
788  42241, //total number of channels
789  "Time",
790  "Total # bad active channels");
791 
792  ibooker.setCurrentFolder(lBaseDir + "/Trends/FED");
793 
794  if (fedErrorsVsIdVsLumi_.globalswitchon) {
795  bookProfile2D(ibooker,
796  fedErrorsVsIdVsLumi_,
797  "fedErrorsVsIdVsLumi",
798  "Total number of errors per FED ID per lumi section",
799  440, //# FED IDS
800  49.5, // Lowest FED ID
801  489.5, // Highest FED ID
802  "Lumi. Section",
803  "FED ID");
804  }
805 
806  bookProfile(ibooker,
807  nFEDErrorsvsTime_,
808  "nFEDErrorsvsTime",
809  "Number of FEDs with any error vs time",
810  0,
811  42241, //total number of channels
812  "Time",
813  "# FEDErrors");
814 
815  bookProfile(ibooker,
816  nFEDCorruptBuffersvsTime_,
817  "nFEDCorruptBuffersvsTime",
818  "Number of FEDs with corrupt buffer vs time",
819  0,
820  42241, //total number of channels
821  "Time",
822  "# FEDCorruptBuffer");
823 
824  ibooker.setCurrentFolder(lBaseDir + "/Trends/FE");
825 
826  bookProfile(ibooker,
827  nFEDsWithFEProblemsvsTime_,
828  "nFEDsWithFEProblemsvsTime",
829  "Number of FEDs with any FE error vs time",
830  0,
831  42241, //total number of channels
832  "Time",
833  "# FEDsWithFEProblems");
834 
835  ibooker.setCurrentFolder(lBaseDir + "/Trends/Fiber");
836 
837  bookProfile(ibooker,
838  nUnlockedvsTime_,
839  "nUnlockedvsTime",
840  "Number of channels Unlocked vs time",
841  0,
842  42241, //total number of channels
843  "Time",
844  "# channels unlocked ");
845 
846  bookProfile(ibooker,
847  nOutOfSyncvsTime_,
848  "nOutOfSyncvsTime",
849  "Number of channels OutOfSync vs time",
850  0,
851  42241, //total number of channels
852  "Time",
853  "# channels out-of-sync");
854 
855  ibooker.setCurrentFolder(lBaseDir + "/Trends/APV");
856 
857  bookProfile(ibooker,
858  nAPVStatusBitvsTime_,
859  "nAPVStatusBitvsTime",
860  "Number of APVs with APVStatusBit error vs time",
861  0,
862  42241, //total number of channels
863  "Time",
864  "# APVs with APVStatusBit error");
865 
866  bookProfile(ibooker,
867  nAPVErrorvsTime_,
868  "nAPVErrorvsTime",
869  "Number of APVs with APVError vs time",
870  0,
871  42241, //total number of channels
872  "Time",
873  "# APVs with APVError");
874 
875  bookProfile(ibooker,
876  nAPVAddressErrorvsTime_,
877  "nAPVAddressErrorvsTime",
878  "Number of APVs with APVAddressError vs time",
879  0,
880  42241, //total number of channels
881  "Time",
882  "# APVs with APVAddressError");
883 
884  //book map after, as it creates a new folder...
885  if (tkMapConfig_.enabled) {
886  tkmapFED_ = std::make_unique<TkHistoMap>(tkDetMap, topFolderName, "TkHMap_FractionOfBadChannels", 0., true);
887  } else
888  tkmapFED_ = nullptr;
889 }
890 
891 void FEDHistograms::bookFEDHistograms(DQMStore::IBooker& ibooker, unsigned int fedId, bool fullDebugMode) {
892  if (!histosBooked_[fedId]) {
893  //will do that only once
894  SiStripFedKey fedKey(fedId, 0, 0, 0);
895  std::stringstream fedIdStream;
896  fedIdStream << fedId;
897  ibooker.setCurrentFolder(fedKey.path());
898 
899  bookHistogram(ibooker,
900  feOverflowDetailed_,
901  feOverflowDetailedMap_[fedId],
902  "FEOverflowsForFED" + fedIdStream.str(),
903  "FE overflows per FE unit for FED ID " + fedIdStream.str(),
905  0,
907  "FE-Index");
908  bookHistogram(ibooker,
909  badMajorityAddressDetailed_,
910  badMajorityAddressDetailedMap_[fedId],
911  "BadMajorityAddressesForFED" + fedIdStream.str(),
912  "Bad majority APV addresses per FE unit for FED ID " + fedIdStream.str(),
914  0,
916  "FE-Index");
917  bookHistogram(ibooker,
918  feMissingDetailed_,
919  feMissingDetailedMap_[fedId],
920  "FEMissingForFED" + fedIdStream.str(),
921  "Buffers with FE Unit payload missing per FE unit for FED ID " + fedIdStream.str(),
923  0,
925  "FE-Index");
926  bookHistogram(ibooker,
927  badStatusBitsDetailed_,
928  badStatusBitsDetailedMap_[fedId],
929  "BadAPVStatusBitsForFED" + fedIdStream.str(),
930  "Bad apv status bits for FED ID " + fedIdStream.str(),
932  0,
934  "APV-Index");
935  histosBooked_[fedId] = true;
936  }
937  if (fullDebugMode && !debugHistosBooked_[fedId]) {
938  //will do that only once
939  SiStripFedKey fedKey(fedId, 0, 0, 0);
940  std::stringstream fedIdStream;
941  fedIdStream << fedId;
942  ibooker.setCurrentFolder(fedKey.path());
943 
944  bookHistogram(ibooker,
945  apvErrorDetailed_,
946  apvErrorDetailedMap_[fedId],
947  "APVErrorBitsForFED" + fedIdStream.str(),
948  "APV errors for FED ID " + fedIdStream.str(),
950  0,
952  "APV-Index");
953  bookHistogram(ibooker,
954  apvAddressErrorDetailed_,
955  apvAddressErrorDetailedMap_[fedId],
956  "APVAddressErrorBitsForFED" + fedIdStream.str(),
957  "Wrong APV address errors for FED ID " + fedIdStream.str(),
959  0,
961  "APV-Index");
962  bookHistogram(ibooker,
963  unlockedDetailed_,
964  unlockedDetailedMap_[fedId],
965  "UnlockedBitsForFED" + fedIdStream.str(),
966  "Unlocked channels for FED ID " + fedIdStream.str(),
968  0,
970  "Channel-Index");
971  bookHistogram(ibooker,
972  outOfSyncDetailed_,
973  outOfSyncDetailedMap_[fedId],
974  "OOSBitsForFED" + fedIdStream.str(),
975  "Out of sync channels for FED ID " + fedIdStream.str(),
977  0,
979  "Channel-Index");
980  debugHistosBooked_[fedId] = true;
981  }
982 }
983 
984 void FEDHistograms::bookAllFEDHistograms(DQMStore::IBooker& ibooker, bool fullDebugMode) {
985  //get FED IDs
986  const unsigned int siStripFedIdMin = FEDNumbering::MINSiStripFEDID;
987  const unsigned int siStripFedIdMax = FEDNumbering::MAXSiStripFEDID;
988  //book them
989  for (unsigned int iFed = siStripFedIdMin; iFed <= siStripFedIdMax; iFed++)
990  bookFEDHistograms(ibooker, iFed, fullDebugMode);
991 }
992 
993 bool FEDHistograms::tkHistoMapEnabled(unsigned int aIndex) { return tkMapConfig_.enabled; }
994 
995 TkHistoMap* FEDHistograms::tkHistoMapPointer(unsigned int aIndex) { return tkmapFED_.get(); }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
virtual std::string pwd()
Definition: DQMStore.cc:16
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