45 #include "DQM/SiStripMonitorHardware/interface/FEDErrors.hh"
121 : rawDataTag_(iConfig.getParameter<
edm::
InputTag>(
"RawDataTag")),
122 dirName_(iConfig.getUntrackedParameter<
std::
string>(
"DirName",
"SiStrip/FEDIntegrity/")),
123 printDebug_(iConfig.getUntrackedParameter<
bool>(
"PrintDebugMessages",
false)),
124 doPLOTfedsPresent_(iConfig.getParameter<
bool>(
"doPLOTfedsPresent")),
125 doPLOTfedFatalErrors_(iConfig.getParameter<
bool>(
"doPLOTfedFatalErrors")),
126 doPLOTfedNonFatalErrors_(iConfig.getParameter<
bool>(
"doPLOTfedNonFatalErrors")),
127 doPLOTnFEDinVsLS_(iConfig.getParameter<
bool>(
"doPLOTnFEDinVsLS")),
128 doPLOTnFEDinWdataVsLS_(iConfig.getParameter<
bool>(
"doPLOTnFEDinWdataVsLS")),
129 fedsPresent_(nullptr),
130 fedFatalErrors_(nullptr),
131 fedNonFatalErrors_(nullptr),
132 nFEDinVsLS_(nullptr),
133 nFEDinWdataVsLS_(nullptr),
134 updateFrequency_(iConfig.getUntrackedParameter<unsigned
int>(
"HistogramUpdateFrequency", 0)),
135 fedsPresentBinContents_(
FEDNumbering::MAXSiStripFEDID + 1, 0),
136 fedFatalErrorBinContents_(
FEDNumbering::MAXSiStripFEDID + 1, 0),
137 fedNonFatalErrorBinContents_(
FEDNumbering::MAXSiStripFEDID + 1, 0),
139 doPayloadChecks_(iConfig.getUntrackedParameter<
bool>(
"DoPayloadChecks",
true)),
140 checkChannelLengths_(iConfig.getUntrackedParameter<
bool>(
"CheckChannelLengths",
true)),
141 checkPacketCodes_(iConfig.getUntrackedParameter<
bool>(
"CheckChannelPacketCodes",
true)),
142 checkFELengths_(iConfig.getUntrackedParameter<
bool>(
"CheckFELengths",
true)),
143 checkChannelStatusBits_(iConfig.getUntrackedParameter<
bool>(
"CheckChannelStatus",
true)),
144 verbose_(iConfig.getUntrackedParameter<
bool>(
"verbose",
false)),
150 std::stringstream
ss;
151 ss <<
"Payload checks are disabled but individual payload checks have been enabled. The following payload checks "
154 ss <<
"Channel length check, ";
156 ss <<
"Channel packet code check, ";
158 ss <<
"Cabled channel status bits checks, ";
160 ss <<
"FE Unit legnth check";
185 std::cout <<
"[SiStripFEDCheckPlugin::analyze] gotData ? " << (gotData ?
"YES" :
"NOPE") << std::endl;
193 FEDErrors lFedErrors;
197 size_t nFEDinWdata = 0;
206 if (!fedData.
size() || !fedData.
data()) {
215 std::cout <<
" fedData.data(): " << fedData.
data() << std::endl;
218 if (fedData.
size() && fedData.
data())
226 bool hasFatalErrors =
false;
227 float rateNonFatal = 0;
229 std::unique_ptr<const sistrip::FEDBuffer>
buffer;
231 if (!lFedErrors.fillFatalFEDErrors(fedData, 0)) {
232 hasFatalErrors =
true;
238 throw cms::Exception(
"FEDBuffer") << st_buffer <<
" (check debug output for more details)";
240 auto tmp_buffer = std::make_unique<sistrip::FEDBuffer>(fedData,
true);
241 tmp_buffer->findChannels();
247 if (!channelLengthsOK || !channelPacketCodesOK || !feLengthsOK) {
248 hasFatalErrors =
true;
252 rateNonFatal = lFedErrors.fillNonFatalFEDErrors(
buffer.get(),
cabling_);
256 if (hasFatalErrors) {
262 throw cms::Exception(
"FEDBuffer") << st_buffer <<
" (check debug output for more details)";
264 auto tmp_buffer = std::make_unique<sistrip::FEDBuffer>(fedData,
true);
265 tmp_buffer->findChannels();
268 edm::LogInfo(
"SiStripFEDCheck") <<
"Fatal error with FED ID " <<
fedId <<
". Check summary: " << std::endl
269 <<
buffer->checkSummary() << std::endl;
270 std::stringstream
ss;
282 throw cms::Exception(
"FEDBuffer") << st_buffer <<
" (check debug output for more details)";
284 auto tmp_buffer = std::make_unique<sistrip::FEDBuffer>(fedData,
true);
285 tmp_buffer->findChannels();
288 edm::LogInfo(
"SiStripFEDCheck") <<
"Non-fatal error with FED ID " <<
fedId <<
" for " << rateNonFatal
289 <<
" of the channels. Check summary: " << std::endl
290 <<
buffer->checkSummary() << std::endl;
291 std::stringstream
ss;
298 std::cout <<
"nFEDin: " << nFEDin <<
" nFEDinWdata: " << nFEDinWdata << std::endl;
321 ibooker.
book1D(
"FEDEntries",
"Number of times FED buffer is present in data", nFED, xFEDmin, xFEDmax);
326 fedFatalErrors_ = ibooker.
book1D(
"FEDFatal",
"Number of fatal errors in FED buffer", nFED, xFEDmin, xFEDmax);
332 ibooker.
book1D(
"FEDNonFatal",
"Number of non fatal errors in FED buffer", nFED, xFEDmin, xFEDmax);
349 "nFEDinWdataVsLS",
"number of FED in (with data) Vs LS",
LSBin,
LSMin,
LSMax, nFED, xFEDmin, xFEDmax);
385 if (nonFatalError > 0)
388 if (nonFatalError > 0)
405 unsigned int entriesFedsPresent = 0;
406 unsigned int entriesFatalErrors = 0;
407 unsigned int entriesNonFatalErrors = 0;
412 entriesFedsPresent += fedsPresentBin;
416 entriesFatalErrors += fedFatalErrorsBin;
420 entriesNonFatalErrors += fedNonFatalErrorsBin;
439 desc.addUntracked<
unsigned int>(
"HistogramUpdateFrequency", 1000);
441 desc.addUntracked<
bool>(
"PrintDebugMessages",
false);
442 desc.add<
bool>(
"doPLOTfedsPresent",
true);
443 desc.add<
bool>(
"doPLOTfedFatalErrors",
true);
444 desc.add<
bool>(
"doPLOTfedNonFatalErrors",
true);
445 desc.add<
bool>(
"doPLOTnFEDinVsLS",
false);
446 desc.add<
bool>(
"doPLOTnFEDinWdataVsLS",
false);
448 desc.addUntracked<
bool>(
"WriteDQMStore",
false);
450 desc.addUntracked<
bool>(
"DoPayloadChecks",
true);
452 desc.addUntracked<
bool>(
"CheckChannelLengths",
true);
454 desc.addUntracked<
bool>(
"CheckChannelPacketCodes",
true);
456 desc.addUntracked<
bool>(
"CheckFELengths",
true);
458 desc.addUntracked<
bool>(
"CheckChannelStatus",
true);
459 desc.add<
int>(
"LSBin", 5000);
460 desc.add<
double>(
"LSMin", 0.5);
461 desc.add<
double>(
"LSMax", 5000.5);