CMS 3D CMS Logo

FEDErrors.cc
Go to the documentation of this file.
3 
7 
9 
10 #include "DQM/SiStripMonitorHardware/interface/HistogramBase.hh"
11 #include "DQM/SiStripMonitorHardware/interface/FEDErrors.hh"
13 
14 FEDErrors::FEDErrors() {
15  //initialiseLumiBlock();
16  initialiseEvent();
17 }
18 
19 FEDErrors::~FEDErrors() {}
20 
21 void FEDErrors::initialiseLumiBlock() {}
22 
23 void FEDErrors::initialiseEvent() {
24  fedID_ = 0;
25  failUnpackerFEDCheck_ = false;
26 
27  connected_.clear();
28  detid_.clear();
29  nChInModule_.clear();
30 
31  subDetId_.clear();
32 
33  lFedCounter_.nFEDErrors = 0;
34  lFedCounter_.nDAQProblems = 0;
35  lFedCounter_.nFEDsWithFEProblems = 0;
36  lFedCounter_.nCorruptBuffers = 0;
37  lFedCounter_.nBadChannels = 0;
38  lFedCounter_.nBadActiveChannels = 0;
39  lFedCounter_.nFEDsWithFEOverflows = 0;
40  lFedCounter_.nFEDsWithFEBadMajorityAddresses = 0;
41  lFedCounter_.nFEDsWithMissingFEs = 0;
42  lFedCounter_.nTotalBadChannels = 0;
43  lFedCounter_.nTotalBadActiveChannels = 0;
44 
45  lChCounter_.nNotConnected = 0;
46  lChCounter_.nUnlocked = 0;
47  lChCounter_.nOutOfSync = 0;
48  lChCounter_.nAPVStatusBit = 0;
49  lChCounter_.nAPVError = 0;
50  lChCounter_.nAPVAddressError = 0;
51 
52  feCounter_.nFEOverflows = 0;
53  feCounter_.nFEBadMajorityAddresses = 0;
54  feCounter_.nFEMissing = 0;
55 
56  fedErrors_.HasCabledChannels = false;
57  fedErrors_.DataPresent = false;
58  fedErrors_.DataMissing = false;
59  fedErrors_.InvalidBuffers = false;
60  fedErrors_.BadFEDCRCs = false;
61  fedErrors_.BadDAQCRCs = false;
62  fedErrors_.BadIDs = false;
63  fedErrors_.BadDAQPacket = false;
64  fedErrors_.CorruptBuffer = false;
65  fedErrors_.FEsOverflow = false;
66  fedErrors_.FEsMissing = false;
67  fedErrors_.FEsBadMajorityAddress = false;
68  fedErrors_.BadChannelStatusBit = false;
69  fedErrors_.BadActiveChannelStatusBit = false;
70 
71  feErrors_.clear();
72 
73  chErrorsDetailed_.clear();
74 
75  apvErrors_.clear();
76 
77  chErrors_.clear();
78 
79  eventProp_.deltaBX = 0;
80 }
81 
82 void FEDErrors::initialiseFED(const unsigned int aFedID,
83  const SiStripFedCabling* aCabling,
84  const TrackerTopology* tTopo,
85  const bool initVars) {
86  fedID_ = aFedID;
87  failUnpackerFEDCheck_ = false;
88 
89  //initialise first. if no channel connected in one FE, subdetid =
90  //0. in the loop on channels, if at least one channel is connected
91  //and has a valid ID, the subdet value will be changed to the right
92  //one.
93  if (initVars) {
94  subDetId_.resize(sistrip::FEUNITS_PER_FED, 0);
95 
96  connected_.resize(sistrip::FEDCH_PER_FED, false);
97  detid_.resize(sistrip::FEDCH_PER_FED, 0);
98  nChInModule_.resize(sistrip::FEDCH_PER_FED, 0);
99 
100  for (unsigned int iCh = 0; iCh < sistrip::FEDCH_PER_FED; iCh++) {
101  const FedChannelConnection& lConnection = aCabling->fedConnection(fedID_, iCh);
102  connected_[iCh] = lConnection.isConnected();
103  detid_[iCh] = lConnection.detId();
104  nChInModule_[iCh] = lConnection.nApvPairs();
105 
106  unsigned short lFeNumber = static_cast<unsigned int>(iCh / sistrip::FEDCH_PER_FEUNIT);
107  unsigned int lDetid = detid_[iCh];
108 
109  if (lDetid && lDetid != sistrip::invalid32_ && connected_[iCh]) {
110  unsigned int lSubid = 6;
111  // 3=TIB, 4=TID, 5=TOB, 6=TEC (TECB here)
112  switch (DetId(lDetid).subdetId()) {
113  case 3:
114  lSubid = 2; //TIB
115  break;
116 
117  case 4: {
118  if (tTopo->tidSide(lDetid) == 2)
119  lSubid = 4; //TIDF
120  else
121  lSubid = 3; //TIDB
122  break;
123  }
124 
125  case 5:
126  lSubid = 5; //TOB
127  break;
128 
129  case 6: {
130  if (tTopo->tecSide(lDetid) == 2)
131  lSubid = 1; //TECF
132  else
133  lSubid = 0; //TECB
134  break;
135  }
136 
137  default:
138  lSubid = 6;
139  break;
140  }
141  subDetId_[lFeNumber] = lSubid;
142  //if (iCh%12==0) std::cout << fedID_ << " " << lFeNumber << " " << subDetId_[lFeNumber] << std::endl;
143  }
144  }
145 
146  feCounter_.nFEOverflows = 0;
147  feCounter_.nFEBadMajorityAddresses = 0;
148  feCounter_.nFEMissing = 0;
149 
150  fedErrors_.HasCabledChannels = false;
151  fedErrors_.DataPresent = false;
152  fedErrors_.DataMissing = false;
153  fedErrors_.InvalidBuffers = false;
154  fedErrors_.BadFEDCRCs = false;
155  fedErrors_.BadDAQCRCs = false;
156  fedErrors_.BadIDs = false;
157  fedErrors_.BadDAQPacket = false;
158  fedErrors_.CorruptBuffer = false;
159  fedErrors_.FEsOverflow = false;
160  fedErrors_.FEsMissing = false;
161  fedErrors_.FEsBadMajorityAddress = false;
162  fedErrors_.BadChannelStatusBit = false;
163  fedErrors_.BadActiveChannelStatusBit = false;
164 
165  feErrors_.clear();
166 
167  chErrorsDetailed_.clear();
168 
169  apvErrors_.clear();
170 
171  chErrors_.clear();
172  }
173 }
174 
175 bool FEDErrors::checkDataPresent(const FEDRawData& aFedData) {
176  if (!aFedData.size() || !aFedData.data()) {
177  for (unsigned int iCh = 0; iCh < sistrip::FEDCH_PER_FED; iCh++) {
178  if (connected_[iCh]) {
179  fedErrors_.HasCabledChannels = true;
180  fedErrors_.DataMissing = true;
181  return false;
182  }
183  }
184  fedErrors_.DataMissing = true;
185  fedErrors_.HasCabledChannels = false;
186  return false;
187  } else {
188  fedErrors_.DataPresent = true;
189  for (unsigned int iCh = 0; iCh < sistrip::FEDCH_PER_FED; iCh++) {
190  if (connected_[iCh]) {
191  fedErrors_.HasCabledChannels = true;
192  break;
193  }
194  }
195  return true;
196  }
197 }
198 
199 bool FEDErrors::failUnpackerFEDCheck() { return failUnpackerFEDCheck_; }
200 
201 bool FEDErrors::fillFatalFEDErrors(const FEDRawData& aFedData, const unsigned int aPrintDebug) {
202  const auto st_buffer = sistrip::preconstructCheckFEDBufferBase(aFedData);
203  if (sistrip::FEDBufferStatusCode::SUCCESS != st_buffer) {
204  fedErrors_.InvalidBuffers = true;
205  failUnpackerFEDCheck_ = true;
206  //don't check anything else if the buffer is invalid
207  return false;
208  }
209  const sistrip::FEDBufferBase buffer{aFedData};
210 
211  //CRC checks
212  //if CRC fails then don't continue as if the buffer has been corrupted in DAQ then anything else could be invalid
213  if (!buffer.checkNoSlinkCRCError()) {
214  fedErrors_.BadFEDCRCs = true;
215  return false;
216  } else if (!buffer.checkCRC()) {
217  failUnpackerFEDCheck_ = true;
218  fedErrors_.BadDAQCRCs = true;
219  return false;
220  }
221  //next check that it is a SiStrip buffer
222  //if not then stop checks
223  if (!buffer.checkSourceIDs() || !buffer.checkNoUnexpectedSourceID()) {
224  fedErrors_.BadIDs = true;
225  return false;
226  }
227  //if so then do DAQ header/trailer checks
228  //if these fail then buffer may be incomplete and checking contents doesn't make sense
229  else if (!buffer.doDAQHeaderAndTrailerChecks()) {
230  failUnpackerFEDCheck_ = true;
231  fedErrors_.BadDAQPacket = true;
232  return false;
233  }
234 
235  //now do checks on header
236  //check that tracker special header is consistent
237  if (!(buffer.checkBufferFormat() && buffer.checkHeaderType() && buffer.checkReadoutMode())) {
238  failUnpackerFEDCheck_ = true;
239  fedErrors_.InvalidBuffers = true;
240  //do not return false if debug printout of the buffer done below...
241  if (!printDebug() || aPrintDebug < 3)
242  return false;
243  }
244 
245  //FE unit overflows
246  if (!buffer.checkNoFEOverflows()) {
247  failUnpackerFEDCheck_ = true;
248  fedErrors_.FEsOverflow = true;
249  //do not return false if debug printout of the buffer done below...
250  if (!printDebug() || aPrintDebug < 3)
251  return false;
252  }
253 
254  return true;
255 }
256 
257 bool FEDErrors::fillCorruptBuffer(const sistrip::FEDBuffer& aBuffer) {
258  //corrupt buffer checks
259  if (!(aBuffer.checkChannelLengthsMatchBufferLength() && aBuffer.checkChannelPacketCodes() &&
260  aBuffer.checkFEUnitLengths())) {
261  fedErrors_.CorruptBuffer = true;
262 
263  return false;
264  }
265 
266  return true;
267 }
268 
269 float FEDErrors::fillNonFatalFEDErrors(const sistrip::FEDBuffer* aBuffer, const SiStripFedCabling* aCabling) {
270  unsigned int lBadChans = 0;
271  unsigned int lTotChans = 0;
272  for (unsigned int iCh = 0; iCh < sistrip::FEDCH_PER_FED; iCh++) { //loop on channels
273  bool lIsConnected = false;
274  if (aCabling) {
275  const FedChannelConnection& lConnection = aCabling->fedConnection(fedID_, iCh);
276  lIsConnected = lConnection.isConnected();
277  } else
278  lIsConnected = connected_[iCh];
279 
280  if (!lIsConnected)
281  continue;
282  lTotChans++;
283  if (!aBuffer->channelGood(iCh, true))
284  lBadChans++;
285  }
286 
287  return static_cast<float>(lBadChans * 1.0 / lTotChans);
288 }
289 
290 bool FEDErrors::fillFEDErrors(const FEDRawData& aFedData,
291  bool& aFullDebug,
292  const unsigned int aPrintDebug,
293  unsigned int& aCounterMonitoring,
294  unsigned int& aCounterUnpacker,
295  const bool aDoMeds,
296  MonitorElement* aMedianHist0,
297  MonitorElement* aMedianHist1,
298  const bool aDoFEMaj,
299  std::vector<std::vector<std::pair<unsigned int, unsigned int> > >& aFeMajFrac) {
300  //try to construct the basic buffer object (do not check payload)
301  //if this fails then count it as an invalid buffer and stop checks since we can't understand things like buffer ordering
302 
303  if (!fillFatalFEDErrors(aFedData, aPrintDebug))
304  return false;
305 
306  //need to construct full object to go any further
307  const auto st_buffer = sistrip::preconstructCheckFEDBuffer(aFedData, true);
308  if (sistrip::FEDBufferStatusCode::SUCCESS != st_buffer) {
309  throw cms::Exception("FEDBuffer") << st_buffer << " (check debug output for more details)";
310  }
311  sistrip::FEDBuffer buffer{aFedData, true};
312  buffer.findChannels(); // no need to check the status, also bad buffers are allowed
313 
314  //fill remaining unpackerFEDcheck
315  if (!buffer.checkChannelLengths())
316  failUnpackerFEDCheck_ = true;
317 
318  //payload checks, only if none of the above error occured
319  if (!this->anyFEDErrors()) {
320  bool lCorruptCheck = fillCorruptBuffer(buffer);
321  if (aPrintDebug > 1 && !lCorruptCheck) {
322  edm::LogWarning("SiStripMonitorHardware")
323  << "CorruptBuffer check failed for FED " << fedID_ << std::endl
324  << " -- buffer->checkChannelLengthsMatchBufferLength() = " << buffer.checkChannelLengthsMatchBufferLength()
325  << std::endl
326  << " -- buffer->checkChannelPacketCodes() = " << buffer.checkChannelPacketCodes() << std::endl
327  << " -- buffer->checkFEUnitLengths() = " << buffer.checkFEUnitLengths() << std::endl;
328  }
329 
330  //corruptBuffer concerns the payload: header info should still be reliable...
331  //so analyze FE and channels to fill histograms.
332 
333  //fe check...
334  fillFEErrors(buffer, aDoFEMaj, aFeMajFrac);
335 
336  //channel checks
337  fillChannelErrors(
338  buffer, aFullDebug, aPrintDebug, aCounterMonitoring, aCounterUnpacker, aDoMeds, aMedianHist0, aMedianHist1);
339  }
340 
341  if (printDebug() && aPrintDebug > 2) {
342  const sistrip::FEDBufferBase& debugBuffer = buffer;
343 
344  std::vector<FEDErrors::APVLevelErrors>& lChVec = getAPVLevelErrors();
345  std::ostringstream debugStream;
346  if (!lChVec.empty()) {
347  std::sort(lChVec.begin(), lChVec.end());
348  debugStream << "[FEDErrors] Cabled channels which had errors: ";
349 
350  for (unsigned int iBadCh(0); iBadCh < lChVec.size(); iBadCh++) {
351  print(lChVec[iBadCh], debugStream);
352  }
353  debugStream << std::endl;
354  debugStream << "[FEDErrors] Active (have been locked in at least one event) cabled channels which had errors: ";
355  for (unsigned int iBadCh(0); iBadCh < lChVec.size(); iBadCh++) {
356  if ((lChVec[iBadCh]).IsActive)
357  print(lChVec[iBadCh], debugStream);
358  }
359  }
360  debugStream << debugBuffer << std::endl;
361  debugBuffer.dump(debugStream);
362  debugStream << std::endl;
363  edm::LogInfo("SiStripMonitorHardware") << "[FEDErrors] Errors found in FED " << fedID_;
364  edm::LogVerbatim("SiStripMonitorHardware") << debugStream.str();
365  }
366 
367  return !(anyFEDErrors());
368 }
369 
370 bool FEDErrors::fillFEErrors(const sistrip::FEDBuffer& aBuffer,
371  const bool aDoFEMaj,
372  std::vector<std::vector<std::pair<unsigned int, unsigned int> > >& aFeMajFrac) {
373  bool foundOverflow = false;
374  bool foundBadMajority = false;
375  bool foundMissing = false;
376  for (unsigned int iFE = 0; iFE < sistrip::FEUNITS_PER_FED; iFE++) {
377  FEDErrors::FELevelErrors lFeErr;
378  lFeErr.FeID = iFE;
379  lFeErr.SubDetID = subDetId_[iFE];
380  lFeErr.Overflow = false;
381  lFeErr.Missing = false;
382  lFeErr.BadMajorityAddress = false;
383  lFeErr.TimeDifference = 0;
384  lFeErr.Apve = 0;
385  lFeErr.FeMaj = 0;
386  //check for cabled channels
387  bool hasCabledChannels = false;
388  for (unsigned int feUnitCh = 0; feUnitCh < sistrip::FEDCH_PER_FEUNIT; feUnitCh++) {
389  if (connected_[iFE * sistrip::FEDCH_PER_FEUNIT + feUnitCh]) {
390  hasCabledChannels = true;
391  break;
392  }
393  }
394 
395  if (!hasCabledChannels)
396  continue;
397 
398  if (aBuffer.feOverflow(iFE)) {
399  lFeErr.Overflow = true;
400  foundOverflow = true;
401  addBadFE(lFeErr);
402  //if FE overflowed then address isn't valid
403  continue;
404  }
405  if (!aBuffer.feEnabled(iFE))
406  continue;
407 
408  //check for missing data
409  if (!aBuffer.fePresent(iFE)) {
410  //if (hasCabledChannels) {
411  lFeErr.Missing = true;
412  foundMissing = true;
413  addBadFE(lFeErr);
414  //}
415  continue;
416  }
417  //two independent checks for the majority address of a FE:
418  //first is done inside the FED,
419  //second is comparing explicitely the FE majAddress with the APVe address.
421  //want to do it only for this FE... do it directly with the time difference.
422  if (aBuffer.majorityAddressErrorForFEUnit(iFE)) {
423  lFeErr.BadMajorityAddress = true;
424  foundBadMajority = true;
425  //no continue to fill the timeDifference.
426  }
427 
428  //need fullDebugHeader to fill histo with time difference between APVe and FEmajAddress
429  const sistrip::FEDFEHeader* header = aBuffer.feHeader();
430  const sistrip::FEDFullDebugHeader* debugHeader = dynamic_cast<const sistrip::FEDFullDebugHeader*>(header);
431  // if (debugHeader) {
432  // unsigned int apveTime = static_cast<unsigned int>(sistrip::FEDAddressConversion::timeLocation(aBuffer.apveAddress()));
433  // unsigned int feTime = static_cast<unsigned int>(sistrip::FEDAddressConversion::timeLocation(debugHeader->feUnitMajorityAddress(iFE)));
434  // if ((apveTime == 200 && aBuffer.apveAddress()) || feTime == 200) {
435  // std::cout << "FED " << fedID_ << ", iFE = " << iFE << std::endl
436  // << " -- aBuffer.apveAddress() = " << static_cast<unsigned int>(aBuffer.apveAddress())
437  // // << ", debugHeader = " << debugHeader
438  // // << ", header->feGood(iFE) = " << aBuffer.feGood(iFE)
439  // << ", debugHeader->feUnitMajorityAddress(iFE) " << static_cast<unsigned int>(debugHeader->feUnitMajorityAddress(iFE))
440  // << std::endl
441  // << " -- timeLoc(feUnitMajAddr) = "
442  // << static_cast<unsigned int>(sistrip::FEDAddressConversion::timeLocation(debugHeader->feUnitMajorityAddress(iFE)))
443  // << ", timeLoc(apveAddr) = "
444  // << static_cast<unsigned int>(sistrip::FEDAddressConversion::timeLocation(aBuffer.apveAddress()))
445  // // << ", aBuffer.checkFEUnitAPVAddresses() = "
446  // // << aBuffer.checkFEUnitAPVAddresses()
447  // << std::endl;
448  // std::cout << "My checks = "
449  // << ", feOverflows = " << lFeErr.Overflow << " " << foundOverflow
450  // << ", feMissing = " << lFeErr.Missing << " " << foundMissing
451  // << ", feBadMajAddr = " << lFeErr.BadMajorityAddress << " " << foundBadMajority
452  // << std::endl;
453 
454  // std::cout << "TimeDiff = " << feTime-apveTime << std::endl;
455 
456  // // std::cout << "aBuffer.checkFEUnitAPVAddresses() = " << aBuffer.checkFEUnitAPVAddresses() << std::endl;
457  // }
458  // }
459 
460  lFeErr.Apve = aBuffer.apveAddress();
461 
462  if (debugHeader) {
463  lFeErr.FeMaj = debugHeader->feUnitMajorityAddress(iFE);
464 
465  if (aDoFEMaj) {
466  if (lFeErr.SubDetID == 2 || lFeErr.SubDetID == 3 || lFeErr.SubDetID == 4)
467  aFeMajFrac[0].push_back(std::pair<unsigned int, unsigned int>(fedID_, lFeErr.FeMaj));
468  else if (lFeErr.SubDetID == 5)
469  aFeMajFrac[1].push_back(std::pair<unsigned int, unsigned int>(fedID_, lFeErr.FeMaj));
470  else if (lFeErr.SubDetID == 0)
471  aFeMajFrac[2].push_back(std::pair<unsigned int, unsigned int>(fedID_, lFeErr.FeMaj));
472  else if (lFeErr.SubDetID == 1)
473  aFeMajFrac[3].push_back(std::pair<unsigned int, unsigned int>(fedID_, lFeErr.FeMaj));
474  }
475 
476  if (aBuffer.apveAddress()) {
477  lFeErr.TimeDifference = //0;
478  static_cast<unsigned int>(
480  static_cast<unsigned int>(sistrip::FEDAddressConversion::timeLocation(aBuffer.apveAddress()));
481  //aBuffer.apveAddress(), debugHeader->feUnitMajorityAddress(iFE)
482  //FEDAddressConversion::timeLocation(const uint8_t aPipelineAddress)
483  }
484  }
485 
486  if (foundBadMajority || lFeErr.TimeDifference != 0) {
487  addBadFE(lFeErr);
488 
489  // LogDebug("SiStripMonitorHardware") << " -- Problem found with FE maj address :" << std::endl
490  // << " --- FED = " << fedID_
491  // << ", iFE = " << iFE << std::endl
492  // << " --- aBuffer.apveAddress() = " << static_cast<unsigned int>(aBuffer.apveAddress())
493  // << std::endl
494  // << " --- debugHeader->feUnitMajorityAddress(iFE) " << static_cast<unsigned int>(debugHeader->feUnitMajorityAddress(iFE))<< std::endl
495  // << " --- timeLoc(feUnitMajAddr) = "
496  // << static_cast<unsigned int>(sistrip::FEDAddressConversion::timeLocation(debugHeader->feUnitMajorityAddress(iFE)))<< std::endl
497  // << " --- timeLoc(apveAddr) = "
498  // << static_cast<unsigned int>(sistrip::FEDAddressConversion::timeLocation(aBuffer.apveAddress())) << std::endl
499  // << " --- aBuffer.checkFEUnitAPVAddresses() = "
500  // << aBuffer.checkFEUnitAPVAddresses()
501  // << std::endl;
502  }
503  }
504 
505  return !(foundOverflow || foundMissing || foundBadMajority);
506 }
507 
508 bool FEDErrors::fillChannelErrors(const sistrip::FEDBuffer& aBuffer,
509  bool& aFullDebug,
510  const unsigned int aPrintDebug,
511  unsigned int& aCounterMonitoring,
512  unsigned int& aCounterUnpacker,
513  const bool aDoMeds,
514  MonitorElement* aMedianHist0,
515  MonitorElement* aMedianHist1) {
516  bool foundError = false;
517 
518  const sistrip::FEDFEHeader* header = aBuffer.feHeader();
519  const sistrip::FEDFullDebugHeader* debugHeader = dynamic_cast<const sistrip::FEDFullDebugHeader*>(header);
520 
521  aFullDebug = debugHeader;
522 
523  bool lMedValid = aBuffer.readoutMode() == sistrip::READOUT_MODE_ZERO_SUPPRESSED;
524 
525  //this method is not called if there was anyFEDerrors(),
526  //so only corruptBuffer+FE check are useful.
527  bool lPassedMonitoringFEDcheck = !fedErrors_.CorruptBuffer;
528 
529  for (unsigned int iCh = 0; iCh < sistrip::FEDCH_PER_FED; iCh++) { //loop on channels
530 
531  bool lFailUnpackerChannelCheck = (!aBuffer.channelGood(iCh, true) && connected_[iCh]) || failUnpackerFEDCheck_;
532  bool lFailMonitoringChannelCheck = !lPassedMonitoringFEDcheck && connected_[iCh];
533 
534  FEDErrors::ChannelLevelErrors lChErr;
535  lChErr.ChannelID = iCh;
536  lChErr.Connected = connected_[iCh];
537  lChErr.IsActive = false;
538  lChErr.Unlocked = false;
539  lChErr.OutOfSync = false;
540 
541  if (!connected_[iCh]) {
542  //to fill histo with unconnected channels
543  addBadChannel(lChErr);
544  foundError = true;
545  } else { //if channel connected
546  if (!aBuffer.feGood(static_cast<unsigned int>(iCh / sistrip::FEDCH_PER_FEUNIT))) {
547  lFailMonitoringChannelCheck = true;
548  foundError = true;
549  } else { //if FE good
550 
551  bool apvBad[2] = {false, false};
553  //CHANNEL_STATUS_NO_PROBLEMS
554  //CHANNEL_STATUS_LOCKED
555  //CHANNEL_STATUS_IN_SYNC
556  //CHANNEL_STATUS_APV1_ADDRESS_GOOD
557  //CHANNEL_STATUS_APV1_NO_ERROR_BIT
558  //CHANNEL_STATUS_APV0_ADDRESS_GOOD
559  //CHANNEL_STATUS_APV0_NO_ERROR_BIT
560 
561  if (debugHeader) {
562  lStatus = debugHeader->getChannelStatus(iCh);
563  apvBad[0] = !(lStatus & sistrip::CHANNEL_STATUS_LOCKED) || !(lStatus & sistrip::CHANNEL_STATUS_IN_SYNC) ||
566  apvBad[1] = !(lStatus & sistrip::CHANNEL_STATUS_LOCKED) || !(lStatus & sistrip::CHANNEL_STATUS_IN_SYNC) ||
569  //if (!debugHeader->unlocked(iCh)) {
570  if (lStatus & sistrip::CHANNEL_STATUS_LOCKED) {
571  lChErr.IsActive = true;
573  continue;
574  //if (debugHeader->outOfSyncFromBit(iCh)) {
575  if (!(lStatus & sistrip::CHANNEL_STATUS_IN_SYNC)) {
576  lChErr.OutOfSync = true;
577  }
578  } else {
579  lChErr.Unlocked = true;
580  }
581  } else {
582  //if (header->checkChannelStatusBits(iCh)) activeChannel = true;
583  [[clang::suppress]] apvBad[0] = !header->checkStatusBits(iCh, 0);
584  [[clang::suppress]] apvBad[1] = !header->checkStatusBits(iCh, 1);
585  if (!apvBad[0] && !apvBad[1]) {
586  lChErr.IsActive = true;
587  continue;
588  }
589  }
590 
591  if (lChErr.Unlocked || lChErr.OutOfSync)
592  addBadChannel(lChErr);
593 
594  //std::ostringstream lMode;
595  //lMode << aBuffer.readoutMode();
596 
597  bool lFirst = true;
598 
599  for (unsigned int iAPV = 0; iAPV < 2; iAPV++) { //loop on APVs
600 
601  FEDErrors::APVLevelErrors lAPVErr;
602  lAPVErr.APVID = 2 * iCh + iAPV;
603  lAPVErr.ChannelID = iCh;
604  lAPVErr.Connected = connected_[iCh];
605  lAPVErr.IsActive = lChErr.IsActive;
606  lAPVErr.APVStatusBit = false;
607  lAPVErr.APVError = false;
608  lAPVErr.APVAddressError = false;
609 
610  //if (!header->checkStatusBits(iCh,iAPV)){
611  if (apvBad[iAPV]) {
612  lFailMonitoringChannelCheck = true;
613  lAPVErr.APVStatusBit = true;
614  foundError = true;
615  }
616 
617  if (debugHeader && !lChErr.Unlocked && !lChErr.OutOfSync) {
618  //if (debugHeader->apvErrorFromBit(iCh,iAPV)) {
619  if ((iAPV == 0 && !(lStatus & sistrip::CHANNEL_STATUS_APV0_NO_ERROR_BIT)) ||
620  (iAPV == 1 && !(lStatus & sistrip::CHANNEL_STATUS_APV1_NO_ERROR_BIT))) {
621  lAPVErr.APVError = true;
622  }
623  //if (debugHeader->apvAddressErrorFromBit(iCh,iAPV)) {
624  if ((iAPV == 0 && !(lStatus & sistrip::CHANNEL_STATUS_APV0_ADDRESS_GOOD)) ||
625  (iAPV == 1 && !(lStatus & sistrip::CHANNEL_STATUS_APV1_ADDRESS_GOOD))) {
626  lAPVErr.APVAddressError = true;
627  }
628  }
629 
630  if (lAPVErr.APVStatusBit || lAPVErr.APVError || lAPVErr.APVAddressError)
631  addBadAPV(lAPVErr, lFirst);
632  } //loop on APVs
633 
634  } //if FE good
635  } //if connected
636 
637  if (lFailUnpackerChannelCheck != lFailMonitoringChannelCheck && connected_[iCh]) {
638  if (aPrintDebug > 1) {
639  std::ostringstream debugStream;
640  debugStream << "[FEDErrors] ------ WARNING: FED " << fedID_ << ", channel " << iCh
641  << ", isConnected = " << connected_[iCh] << std::endl
642  << "[FEDErrors] --------- Monitoring Channel check ";
643  if (lFailMonitoringChannelCheck)
644  debugStream << "failed." << std::endl;
645  else
646  debugStream << "passed." << std::endl;
647  debugStream << "[FEDErrors] --------- Unpacker Channel check ";
648  if (lFailUnpackerChannelCheck)
649  debugStream << "failed." << std::endl;
650  else
651  debugStream << "passed." << std::endl;
652  debugStream << "[FEDErrors] --------- fegood = "
653  << aBuffer.feGood(static_cast<unsigned int>(iCh / sistrip::FEDCH_PER_FEUNIT)) << std::endl
654  << "[FEDErrors] --------- unpacker FED check = " << failUnpackerFEDCheck_ << std::endl;
655  edm::LogError("SiStripMonitorHardware") << debugStream.str();
656  }
657 
658  if (lFailMonitoringChannelCheck)
659  aCounterMonitoring++;
660  if (lFailUnpackerChannelCheck)
661  aCounterUnpacker++;
662  }
663 
664  if (lMedValid && !foundError && lPassedMonitoringFEDcheck && aDoMeds) {
665  //get CM values
666  const sistrip::FEDChannel& lChannel = aBuffer.channel(iCh);
667 
668  HistogramBase::fillHistogram(aMedianHist0, lChannel.cmMedian(0));
669  HistogramBase::fillHistogram(aMedianHist1, lChannel.cmMedian(1));
670  }
671 
672  } //loop on channels
673 
674  return !foundError;
675 }
676 
677 void FEDErrors::fillBadChannelList(const bool doTkHistoMap,
678  TkHistoMap* aTkMapPointer,
679  MonitorElement* aFedIdVsApvId,
680  unsigned int& aNBadChannels,
681  unsigned int& aNBadActiveChannels,
682  unsigned int& aNBadChannels_perFEDID,
683  std::vector<unsigned int>& nTotal,
684  std::vector<unsigned int>& nErrors) {
685  uint32_t lPrevId = 0;
686  uint16_t nBad = 0;
687  uint16_t lPrevTot = 0;
688  bool hasBeenProcessed = false;
689  bool lFailFED = failMonitoringFEDCheck();
690 
691  for (unsigned int iCh = 0; iCh < sistrip::FEDCH_PER_FED; iCh++) { //loop on channels
692 
693  if (!connected_[iCh])
694  continue;
695  if (!detid_[iCh] || detid_[iCh] == sistrip::invalid32_)
696  continue;
697 
698  if (lPrevId == 0) {
699  lPrevId = detid_[iCh];
700  lPrevTot = nChInModule_[iCh];
701  }
702 
703  unsigned int feNumber = static_cast<unsigned int>(iCh / sistrip::FEDCH_PER_FEUNIT);
704 
705  bool isBadFE = false;
706  bool isMissingFE = false;
707  //feErrors vector of FE 0 - 7, each FE has channels 0 -11, 12 .. - ,... - 96
708  for (unsigned int badfe(0); badfe < feErrors_.size(); badfe++) {
709  if ((feErrors_[badfe]).FeID == feNumber) {
710  isBadFE = true;
711  if ((feErrors_[badfe]).Missing)
712  isMissingFE = true;
713  break;
714  }
715  }
716 
717  bool isBadChan = false;
718  bool isActiveChan = false;
719  //FED errors, apv
720  //for (unsigned int badCh(0); badCh<chErrors_.size(); badCh++) {
721  //if (chErrors_[badCh].first == iCh) {
722  //if (chErrors_[badCh].second) isActiveChan = true;
723  //isBadChan = true;
724  //break;
725  //}
726  //}
727 
728  //apvErrors_
729  bool isBadApv1 = false;
730  bool isBadApv2 = false;
731  for (unsigned int badApv(0); badApv < apvErrors_.size(); badApv++) {
732  if ((apvErrors_[badApv]).ChannelID == iCh) {
733  isBadChan = true;
734  if (apvErrors_[badApv].IsActive)
735  isActiveChan = true;
736  }
737  if (apvErrors_[badApv].APVID == 2 * iCh)
738  isBadApv1 = true;
739  if (apvErrors_[badApv].APVID == 2 * iCh + 1) {
740  isBadApv2 = true;
741  break;
742  }
743  }
744 
745  if (detid_[iCh] == lPrevId) {
746  if (hasBeenProcessed)
747  hasBeenProcessed = false;
748  }
749  //fill vector for previous detid
750  if (detid_[iCh] != lPrevId) {
751  processDet(lPrevId, lPrevTot, doTkHistoMap, nBad, aTkMapPointer);
752  lPrevId = detid_[iCh];
753  lPrevTot = nChInModule_[iCh];
754  hasBeenProcessed = true;
755  }
756 
757  bool lHasErr = lFailFED || isBadFE || isBadChan;
758  incrementLumiErrors(lHasErr, subDetId_[feNumber], nTotal, nErrors);
759 
760  if (lHasErr) {
761  nBad++;
762  aNBadChannels++;
763  aNBadChannels_perFEDID = aNBadChannels_perFEDID + 1;
764  //define as active channel if channel locked AND not from an unlocked FE.
765  if ((isBadChan && isActiveChan) || lFailFED || (isBadFE && !isMissingFE))
766  aNBadActiveChannels++;
767  if (isBadApv1 || lFailFED || isBadFE)
768  HistogramBase::fillHistogram(aFedIdVsApvId, 2 * iCh, fedID_);
769  if (isBadApv2 || lFailFED || isBadFE)
770  HistogramBase::fillHistogram(aFedIdVsApvId, 2 * iCh + 1, fedID_);
771  }
772 
773  } //loop on channels
774 
775  if (!hasBeenProcessed) {
776  processDet(lPrevId, lPrevTot, doTkHistoMap, nBad, aTkMapPointer);
777  }
778 }
779 
780 void FEDErrors::fillEventProperties(long long dbx) { eventProp_.deltaBX = dbx; }
781 
782 void FEDErrors::incrementLumiErrors(const bool hasError,
783  const unsigned int aSubDet,
784  std::vector<unsigned int>& nTotal,
785  std::vector<unsigned int>& nErrors) {
786  if (nTotal.empty())
787  return;
788  if (aSubDet >= nTotal.size()) {
789  edm::LogError("SiStripMonitorHardware") << " -- FED " << fedID_ << ", invalid subdetid : " << aSubDet
790  << ", size of lumiErr : " << nTotal.size() << std::endl;
791  } else {
792  if (hasError)
793  nErrors[aSubDet]++;
794  nTotal[aSubDet]++;
795  }
796 }
797 
798 void FEDErrors::processDet(const uint32_t aPrevId,
799  const uint16_t aPrevTot,
800  const bool doTkHistoMap,
801  uint16_t& nBad,
802  TkHistoMap* aTkMapPointer) {
803  if (aPrevTot < nBad) {
804  edm::LogError("SiStripMonitorHardware") << " -- Number of bad channels in det " << aPrevId << " = " << nBad
805  << ", total number of pairs for this det = " << aPrevTot << std::endl;
806  }
807 
808  //tkHistoMap takes a uint & as argument
809  uint32_t lDetid = aPrevId;
810  if (aPrevTot != 0 && doTkHistoMap && aTkMapPointer)
811  HistogramBase::fillTkHistoMap(aTkMapPointer, lDetid, static_cast<float>(nBad) / aPrevTot);
812 
813  nBad = 0;
814 }
815 
816 const bool FEDErrors::failMonitoringFEDCheck() { return (anyFEDErrors() || fedErrors_.CorruptBuffer); }
817 
818 const bool FEDErrors::anyDAQProblems() {
819  return (fedErrors_.DataMissing || fedErrors_.InvalidBuffers || fedErrors_.BadFEDCRCs || fedErrors_.BadDAQCRCs ||
820  fedErrors_.BadIDs || fedErrors_.BadDAQPacket);
821 }
822 
823 const bool FEDErrors::anyFEDErrors() {
824  return (fedErrors_.InvalidBuffers || fedErrors_.BadFEDCRCs || fedErrors_.BadDAQCRCs || fedErrors_.BadIDs ||
825  fedErrors_.BadDAQPacket || fedErrors_.FEsOverflow);
826 }
827 
828 const bool FEDErrors::anyFEProblems() {
829  return (fedErrors_.FEsOverflow || fedErrors_.FEsMissing || fedErrors_.FEsBadMajorityAddress);
830 }
831 
832 const bool FEDErrors::printDebug() {
833  return (anyFEDErrors() || anyFEProblems() || fedErrors_.CorruptBuffer || fedErrors_.BadChannelStatusBit);
834 }
835 
836 const unsigned int FEDErrors::fedID() { return fedID_; }
837 
838 FEDErrors::FEDCounters& FEDErrors::getFEDErrorsCounters() { return lFedCounter_; }
839 
840 FEDErrors::ChannelCounters& FEDErrors::getChannelErrorsCounters() { return lChCounter_; }
841 
842 FEDErrors::FECounters& FEDErrors::getFEErrorsCounters() { return feCounter_; }
843 
844 FEDErrors::FEDLevelErrors& FEDErrors::getFEDLevelErrors() { return fedErrors_; }
845 
846 FEDErrors::EventProperties& FEDErrors::getEventProperties() { return eventProp_; }
847 
848 std::vector<FEDErrors::FELevelErrors>& FEDErrors::getFELevelErrors() { return feErrors_; }
849 
850 std::vector<FEDErrors::ChannelLevelErrors>& FEDErrors::getChannelLevelErrors() { return chErrorsDetailed_; }
851 
852 std::vector<FEDErrors::APVLevelErrors>& FEDErrors::getAPVLevelErrors() { return apvErrors_; }
853 
854 std::vector<std::pair<unsigned int, bool> >& FEDErrors::getBadChannels() { return chErrors_; }
855 
856 void FEDErrors::addBadFE(const FEDErrors::FELevelErrors& aFE) {
857  if (aFE.Overflow) {
858  fedErrors_.FEsOverflow = true;
859  (feCounter_.nFEOverflows)++;
860  } else if (aFE.Missing) {
861  fedErrors_.FEsMissing = true;
862  (feCounter_.nFEMissing)++;
863  feErrors_.push_back(aFE);
864  } else if (aFE.BadMajorityAddress) {
865  fedErrors_.FEsBadMajorityAddress = true;
866  (feCounter_.nFEBadMajorityAddresses)++;
867  feErrors_.push_back(aFE);
868  } else if (aFE.TimeDifference != 0) {
869  feErrors_.push_back(aFE);
870  }
871 }
872 
873 void FEDErrors::addBadChannel(const FEDErrors::ChannelLevelErrors& aChannel) {
874  if (aChannel.Connected)
875  chErrorsDetailed_.push_back(aChannel);
876  incrementChannelCounters(aChannel);
877 }
878 
879 void FEDErrors::addBadAPV(const FEDErrors::APVLevelErrors& aAPV, bool& aFirst) {
880  apvErrors_.push_back(aAPV);
881  incrementAPVCounters(aAPV);
882  if (aAPV.APVStatusBit && aFirst) {
883  fedErrors_.BadChannelStatusBit = true;
884  lFedCounter_.nBadChannels++;
885  chErrors_.push_back(std::pair<unsigned int, bool>(aAPV.ChannelID, aAPV.IsActive));
886  if (aAPV.IsActive) {
887  //print(aAPV);
888  fedErrors_.BadActiveChannelStatusBit = true;
889  lFedCounter_.nBadActiveChannels++;
890  //std::cout << "------ nBadActiveChannels = " << FEDErrors::getFEDErrorsCounters().nBadActiveChannels << std::endl;
891  }
892  aFirst = false;
893  }
894 }
895 
896 void FEDErrors::incrementFEDCounters() {
897  if (fedErrors_.InvalidBuffers || fedErrors_.BadFEDCRCs || fedErrors_.BadDAQCRCs || fedErrors_.BadIDs ||
898  fedErrors_.BadDAQPacket) {
899  lFedCounter_.nDAQProblems++;
900  lFedCounter_.nFEDErrors++;
901  }
902 
903  //FElevel errors
904  if (fedErrors_.FEsOverflow) {
905  lFedCounter_.nFEDsWithFEOverflows++;
906  } else if (fedErrors_.FEsMissing) {
907  lFedCounter_.nFEDsWithMissingFEs++;
908  } else if (fedErrors_.FEsBadMajorityAddress) {
909  lFedCounter_.nFEDsWithFEBadMajorityAddresses++;
910  }
911 
912  if (fedErrors_.FEsOverflow || fedErrors_.FEsBadMajorityAddress || fedErrors_.FEsMissing) {
913  lFedCounter_.nFEDsWithFEProblems++;
914  lFedCounter_.nFEDErrors++;
915  } else if (fedErrors_.CorruptBuffer) {
916  lFedCounter_.nCorruptBuffers++;
917  lFedCounter_.nFEDErrors++;
918  }
919 }
920 
921 void FEDErrors::incrementChannelCounters(const FEDErrors::ChannelLevelErrors& aChannel) {
922  if (aChannel.Unlocked && aChannel.Connected)
923  lChCounter_.nUnlocked++;
924  if (aChannel.OutOfSync && aChannel.Connected)
925  lChCounter_.nOutOfSync++;
926  if (!aChannel.Connected)
927  lChCounter_.nNotConnected++;
928 }
929 
930 void FEDErrors::incrementAPVCounters(const FEDErrors::APVLevelErrors& aAPV) {
931  if (aAPV.Connected && aAPV.IsActive) {
932  if (aAPV.APVStatusBit)
933  lChCounter_.nAPVStatusBit++;
934  if (aAPV.APVAddressError)
935  lChCounter_.nAPVAddressError++;
936  if (aAPV.APVError)
937  lChCounter_.nAPVError++;
938  }
939 }
940 
941 bool FEDErrors::ChannelLevelErrors::operator<(const FEDErrors::ChannelLevelErrors& aErr) const {
942  if (this->ChannelID < aErr.ChannelID)
943  return true;
944  return false;
945 }
946 
947 bool FEDErrors::APVLevelErrors::operator<(const FEDErrors::APVLevelErrors& aErr) const {
948  if (this->ChannelID < aErr.ChannelID)
949  return true;
950  return false;
951 }
952 
953 void FEDErrors::print(const FEDErrors::FEDCounters& aFEDCounter, std::ostream& aOs) {
954  aOs << std::endl;
955  aOs << "[FEDErrors]============================================" << std::endl
956  << "[FEDErrors]==== Printing FEDCounters information : ====" << std::endl
957  << "[FEDErrors]============================================" << std::endl
958  << "[FEDErrors]======== nFEDErrors = " << aFEDCounter.nFEDErrors << std::endl
959  << "[FEDErrors]======== nDAQProblems = " << aFEDCounter.nDAQProblems << std::endl
960  << "[FEDErrors]======== nFEDsWithFEProblems = " << aFEDCounter.nFEDsWithFEProblems << std::endl
961  << "[FEDErrors]======== nCorruptBuffers = " << aFEDCounter.nCorruptBuffers << std::endl
962  << "[FEDErrors]======== nBadChannels = " << aFEDCounter.nBadChannels << std::endl
963  << "[FEDErrors]======== nBadActiveChannels = " << aFEDCounter.nBadActiveChannels << std::endl
964  << "[FEDErrors]======== nFEDsWithFEOverflows = " << aFEDCounter.nFEDsWithFEOverflows << std::endl
965  << "[FEDErrors]======== nFEDsWithFEBadMajorityAddresses = " << aFEDCounter.nFEDsWithFEBadMajorityAddresses
966  << std::endl
967  << "[FEDErrors]======== nFEDsWithMissingFEs = " << aFEDCounter.nFEDsWithMissingFEs << std::endl
968  << "[FEDErrors]======== nTotalBadChannels = " << aFEDCounter.nTotalBadChannels << std::endl
969  << "[FEDErrors]======== nTotalBadActiveChannels = " << aFEDCounter.nTotalBadActiveChannels << std::endl
970  << "[FEDErrors]============================================" << std::endl;
971 }
972 
973 void FEDErrors::print(const FEDErrors::FECounters& aFECounter, std::ostream& aOs) {
974  aOs << std::endl;
975  aOs << "[FEDErrors]============================================" << std::endl
976  << "[FEDErrors]==== Printing FECounters information : ====" << std::endl
977  << "[FEDErrors]============================================" << std::endl
978  << "[FEDErrors]======== nFEOverflows = " << aFECounter.nFEOverflows << std::endl
979  << "[FEDErrors]======== nFEBadMajorityAddresses = " << aFECounter.nFEBadMajorityAddresses << std::endl
980  << "[FEDErrors]======== nFEMissing = " << aFECounter.nFEMissing << std::endl
981  << "[FEDErrors]============================================" << std::endl;
982 }
983 
984 void FEDErrors::print(const FEDErrors::FEDLevelErrors& aFEDErr, std::ostream& aOs) {
985  aOs << std::endl;
986  aOs << "[FEDErrors]============================================" << std::endl
987  << "[FEDErrors]==== Printing FED errors information : ====" << std::endl
988  << "[FEDErrors]============================================" << std::endl
989  << "[FEDErrors]======== HasCabledChannels = " << aFEDErr.HasCabledChannels << std::endl
990  << "[FEDErrors]======== DataPresent = " << aFEDErr.DataPresent << std::endl
991  << "[FEDErrors]======== DataMissing = " << aFEDErr.DataMissing << std::endl
992  << "[FEDErrors]======== InvalidBuffers = " << aFEDErr.InvalidBuffers << std::endl
993  << "[FEDErrors]======== BadFEDCRCs = " << aFEDErr.BadFEDCRCs << std::endl
994  << "[FEDErrors]======== BadDAQCRCs = " << aFEDErr.BadDAQCRCs << std::endl
995  << "[FEDErrors]======== BadIDs = " << aFEDErr.BadIDs << std::endl
996  << "[FEDErrors]======== BadDAQPacket = " << aFEDErr.BadDAQPacket << std::endl
997  << "[FEDErrors]======== CorruptBuffer = " << aFEDErr.CorruptBuffer << std::endl
998  << "[FEDErrors]======== FEOverflows = " << aFEDErr.FEsOverflow << std::endl
999  << "[FEDErrors]======== FEMissing = " << aFEDErr.FEsMissing << std::endl
1000  << "[FEDErrors]======== BadMajorityAddresses = " << aFEDErr.FEsBadMajorityAddress << std::endl
1001  << "[FEDErrors]============================================" << std::endl;
1002 }
1003 
1004 void FEDErrors::print(const FEDErrors::FELevelErrors& aErr, std::ostream& aOs) {
1005  aOs << std::endl;
1006  aOs << "[FEDErrors]============================================" << std::endl
1007  << "[FEDErrors]==== Printing FE errors information : ====" << std::endl
1008  << "[FEDErrors]============================================" << std::endl
1009  << "[FEDErrors]======== FE #" << aErr.FeID << std::endl
1010  << "[FEDErrors]======== subdet " << aErr.SubDetID << std::endl
1011  << "[FEDErrors]======== FEOverflow = " << aErr.Overflow << std::endl
1012  << "[FEDErrors]======== FEMissing = " << aErr.Missing << std::endl
1013  << "[FEDErrors]======== BadMajorityAddresses = " << aErr.BadMajorityAddress << std::endl
1014  << "[FEDErrors]======== TimeDifference = " << aErr.TimeDifference << std::endl
1015  << "[FEDErrors]============================================" << std::endl;
1016 }
1017 
1018 void FEDErrors::print(const FEDErrors::ChannelLevelErrors& aErr, std::ostream& aOs) {
1019  aOs << std::endl;
1020  aOs << "[FEDErrors]=================================================" << std::endl
1021  << "[FEDErrors]==== Printing channel errors information : ====" << std::endl
1022  << "[FEDErrors]=================================================" << std::endl
1023  << "[FEDErrors]============ Channel #" << aErr.ChannelID << std::endl
1024  << "[FEDErrors]============ connected = " << aErr.Connected << std::endl
1025  << "[FEDErrors]============ isActive = " << aErr.IsActive << std::endl
1026  << "[FEDErrors]============ Unlocked = " << aErr.Unlocked << std::endl
1027  << "[FEDErrors]============ OutOfSync = " << aErr.OutOfSync << std::endl
1028  << "[FEDErrors]=================================================" << std::endl;
1029 }
1030 
1031 void FEDErrors::print(const FEDErrors::APVLevelErrors& aErr, std::ostream& aOs) {
1032  aOs << std::endl;
1033  aOs << "[FEDErrors]=================================================" << std::endl
1034  << "[FEDErrors]==== Printing APV errors information : ====" << std::endl
1035  << "[FEDErrors]=================================================" << std::endl
1036  << "[FEDErrors]============ APV #" << aErr.APVID << std::endl
1037  << "[FEDErrors]============ Channel #" << aErr.ChannelID << std::endl
1038  << "[FEDErrors]============ connected = " << aErr.Connected << std::endl
1039  << "[FEDErrors]============ isActive = " << aErr.IsActive << std::endl
1040  << "[FEDErrors]============ APVStatusBit = " << aErr.APVStatusBit << std::endl
1041  << "[FEDErrors]============ APVError = " << aErr.APVError << std::endl
1042  << "[FEDErrors]============ APVAddressError = " << aErr.APVAddressError << std::endl
1043  << "[FEDErrors]=================================================" << std::endl;
1044 }
FEDReadoutMode readoutMode() const
bool checkChannelLengthsMatchBufferLength() const
Log< level::Info, true > LogVerbatim
bool feOverflow(const uint8_t internalFEUnitNum) const
bool operator<(IOVSyncValue const &iLHS, IOVSyncValue const &iRHS)
Definition: IOVSyncValue.h:34
static const uint32_t invalid32_
Definition: Constants.h:15
unsigned int tidSide(const DetId &id) const
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
const FEDFEHeader * feHeader() const
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:48
Log< level::Error, false > LogError
bool checkFEUnitLengths() const
bool majorityAddressErrorForFEUnit(const uint8_t internalFEUnitNum) const
bool feEnabled(const uint8_t internalFEUnitNum) const
bool checkChannelPacketCodes() const
unsigned int tecSide(const DetId &id) const
Class containning control, module, detector and connection information, at the level of a FED channel...
static const uint16_t FEUNITS_PER_FED
void dump(std::ostream &os) const
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
const uint32_t & detId() const
static const uint8_t timeLocation(const uint8_t aPipelineAddress)
uint16_t cmMedian(const uint8_t apvIndex) const
Log< level::Info, false > LogInfo
Definition: DetId.h:17
bool channelGood(const uint8_t internalFEDannelNum, const bool doAPVeCheck) const
static const uint16_t FEDCH_PER_FEUNIT
const FEDChannel & channel(const uint8_t internalFEDChannelNum) const
const uint16_t & nApvPairs() const
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
static const uint16_t FEDCH_PER_FED
bool feGood(const uint8_t internalFEUnitNum) const
FEDBufferStatusCode preconstructCheckFEDBuffer(const FEDRawData &fedBuffer, bool allowBadBuffer=false)
uint8_t feUnitMajorityAddress(const uint8_t internalFEUnitNum) const
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
FEDBufferStatusCode preconstructCheckFEDBufferBase(const FEDRawData &fedBuffer, bool checkRecognizedFormat=true)
FEDChannelStatus getChannelStatus(const uint8_t internalFEDChannelNum) const
Log< level::Warning, false > LogWarning
bool fePresent(uint8_t internalFEUnitNum) const