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