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