42 #include "DQM/SiStripMonitorHardware/interface/FEDErrors.hh"
63 inline void fillPresent(
unsigned int fedId,
bool present);
104 : rawDataTag_(iConfig.getParameter<edm::InputTag>(
"RawDataTag")),
105 dirName_(iConfig.getUntrackedParameter<std::string>(
"DirName",
"SiStrip/FEDIntegrity/")),
106 printDebug_(iConfig.getUntrackedParameter<bool>(
"PrintDebugMessages",
false)),
107 writeDQMStore_(iConfig.getUntrackedParameter<bool>(
"WriteDQMStore",
false)),
108 updateFrequency_(iConfig.getUntrackedParameter<unsigned int>(
"HistogramUpdateFrequency",0)),
109 fedsPresentBinContents_(
FEDNumbering::MAXSiStripFEDID+1,0),
110 fedFatalErrorBinContents_(
FEDNumbering::MAXSiStripFEDID+1,0),
111 fedNonFatalErrorBinContents_(
FEDNumbering::MAXSiStripFEDID+1,0),
113 doPayloadChecks_(iConfig.getUntrackedParameter<bool>(
"DoPayloadChecks",
true)),
114 checkChannelLengths_(iConfig.getUntrackedParameter<bool>(
"CheckChannelLengths",
true)),
115 checkPacketCodes_(iConfig.getUntrackedParameter<bool>(
"CheckChannelPacketCodes",
true)),
116 checkFELengths_(iConfig.getUntrackedParameter<bool>(
"CheckFELengths",
true)),
117 checkChannelStatusBits_(iConfig.getUntrackedParameter<bool>(
"CheckChannelStatus",
true)),
121 std::stringstream ss;
122 ss <<
"Payload checks are disabled but individual payload checks have been enabled. The following payload checks will be skipped: ";
161 FEDErrors lFedErrors;
164 for (
unsigned int fedId = siStripFedIdMin; fedId <= siStripFedIdMax; fedId++) {
169 lFedErrors.initialiseFED(fedId,
cabling_,
false);
173 if (!fedData.
size() || !fedData.
data()) {
182 bool hasFatalErrors =
false;
183 float rateNonFatal = 0;
185 std::auto_ptr<const sistrip::FEDBuffer> buffer;
187 if (!lFedErrors.fillFatalFEDErrors(fedData,0)) {
188 hasFatalErrors =
true;
197 bool channelLengthsOK =
checkChannelLengths_ ? buffer->checkChannelLengthsMatchBufferLength() :
true;
198 bool channelPacketCodesOK =
checkPacketCodes_ ? buffer->checkChannelPacketCodes() :
true;
199 bool feLengthsOK =
checkFELengths_ ? buffer->checkFEUnitLengths() :
true;
200 if ( !channelLengthsOK ||
201 !channelPacketCodesOK ||
203 hasFatalErrors =
true;
210 if (hasFatalErrors) {
214 edm::LogInfo(
"SiStripFEDCheck") <<
"Fatal error with FED ID " << fedId <<
". Check summary: "
215 << std::endl << buffer->checkSummary() << std::endl;
216 std::stringstream ss;
227 edm::LogInfo(
"SiStripFEDCheck") <<
"Non-fatal error with FED ID " << fedId
228 <<
" for " << rateNonFatal <<
" of the channels. Check summary: "
229 << std::endl << buffer->checkSummary() << std::endl;
230 std::stringstream ss;
254 "Number of times FED buffer is present in data",
255 siStripFedIdMax-siStripFedIdMin+1,
256 siStripFedIdMin-0.5,siStripFedIdMax+0.5);
259 "Number of fatal errors in FED buffer",
260 siStripFedIdMax-siStripFedIdMin+1,
261 siStripFedIdMin-0.5,siStripFedIdMax+0.5);
264 "Number of non fatal errors in FED buffer",
265 siStripFedIdMax-siStripFedIdMin+1,
266 siStripFedIdMin-0.5,siStripFedIdMax+0.5);
337 unsigned int entriesFedsPresent = 0;
338 unsigned int entriesFatalErrors = 0;
339 unsigned int entriesNonFatalErrors = 0;
340 for (
unsigned int fedId = siStripFedIdMin,
bin = 1; fedId < siStripFedIdMax+1; fedId++,
bin++) {
343 entriesFedsPresent += fedsPresentBin;
346 entriesFatalErrors += fedFatalErrorsBin;
349 entriesNonFatalErrors += fedNonFatalErrorsBin;
bool checkChannelLengths_
void fillFatalError(unsigned int fedId, bool fatalError)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
edm::InputTag rawDataTag_
const SiStripFedCabling * cabling_
#define DEFINE_FWK_MODULE(type)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
bool hasNonFatalError(const FEDRawData &fedData, unsigned int fedId) const
MonitorElement * fedNonFatalErrors_
size_t size() const
Lenght of the data buffer in bytes.
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
unsigned int updateFrequency_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< unsigned int > fedFatalErrorBinContents_
std::vector< unsigned int > fedsPresentBinContents_
Constants and enumerated types for FED/FEC systems.
bool hasFatalError(const FEDRawData &fedData, unsigned int fedId) const
T const * product() const
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
virtual void analyze(const edm::Event &, const edm::EventSetup &)
SiStripFEDCheckPlugin(const edm::ParameterSet &)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
void updateCabling(const edm::EventSetup &eventSetup)
MonitorElement * fedFatalErrors_
MonitorElement * fedsPresent_
bool checkChannelStatusBits_
void fillNonFatalError(unsigned int fedId, float nonFatalError)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
std::vector< unsigned int > fedNonFatalErrorBinContents_
void setCurrentFolder(const std::string &fullpath)
void fillPresent(unsigned int fedId, bool present)