CMS 3D CMS Logo

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