CMS 3D CMS Logo

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