44 #include "DQM/SiStripMonitorHardware/interface/FEDErrors.hh"
66 inline void fillPresent(
unsigned int fedId,
bool present);
107 : rawDataTag_(iConfig.getParameter<edm::InputTag>(
"RawDataTag")),
108 dirName_(iConfig.getUntrackedParameter<std::
string>(
"DirName",
"SiStrip/FEDIntegrity/")),
109 printDebug_(iConfig.getUntrackedParameter<bool>(
"PrintDebugMessages",
false)),
110 writeDQMStore_(iConfig.getUntrackedParameter<bool>(
"WriteDQMStore",
false)),
111 updateFrequency_(iConfig.getUntrackedParameter<unsigned int>(
"HistogramUpdateFrequency",0)),
112 fedsPresentBinContents_(
FEDNumbering::MAXSiStripFEDID+1,0),
113 fedFatalErrorBinContents_(
FEDNumbering::MAXSiStripFEDID+1,0),
114 fedNonFatalErrorBinContents_(
FEDNumbering::MAXSiStripFEDID+1,0),
116 doPayloadChecks_(iConfig.getUntrackedParameter<bool>(
"DoPayloadChecks",
true)),
117 checkChannelLengths_(iConfig.getUntrackedParameter<bool>(
"CheckChannelLengths",
true)),
118 checkPacketCodes_(iConfig.getUntrackedParameter<bool>(
"CheckChannelPacketCodes",
true)),
119 checkFELengths_(iConfig.getUntrackedParameter<bool>(
"CheckFELengths",
true)),
120 checkChannelStatusBits_(iConfig.getUntrackedParameter<bool>(
"CheckChannelStatus",
true)),
124 std::stringstream ss;
125 ss <<
"Payload checks are disabled but individual payload checks have been enabled. The following payload checks will be skipped: ";
169 FEDErrors lFedErrors;
172 for (
unsigned int fedId = siStripFedIdMin; fedId <= siStripFedIdMax; fedId++) {
177 lFedErrors.initialiseFED(fedId,
cabling_,tTopo,
false);
181 if (!fedData.
size() || !fedData.
data()) {
190 bool hasFatalErrors =
false;
191 float rateNonFatal = 0;
193 std::auto_ptr<const sistrip::FEDBuffer> buffer;
195 if (!lFedErrors.fillFatalFEDErrors(fedData,0)) {
196 hasFatalErrors =
true;
205 bool channelLengthsOK =
checkChannelLengths_ ? buffer->checkChannelLengthsMatchBufferLength() :
true;
206 bool channelPacketCodesOK =
checkPacketCodes_ ? buffer->checkChannelPacketCodes() :
true;
207 bool feLengthsOK =
checkFELengths_ ? buffer->checkFEUnitLengths() :
true;
208 if ( !channelLengthsOK ||
209 !channelPacketCodesOK ||
211 hasFatalErrors =
true;
218 if (hasFatalErrors) {
222 edm::LogInfo(
"SiStripFEDCheck") <<
"Fatal error with FED ID " << fedId <<
". Check summary: "
223 << std::endl << buffer->checkSummary() << std::endl;
224 std::stringstream ss;
235 edm::LogInfo(
"SiStripFEDCheck") <<
"Non-fatal error with FED ID " << fedId
236 <<
" for " << rateNonFatal <<
" of the channels. Check summary: "
237 << std::endl << buffer->checkSummary() << std::endl;
238 std::stringstream ss;
262 "Number of times FED buffer is present in data",
263 siStripFedIdMax-siStripFedIdMin+1,
264 siStripFedIdMin-0.5,siStripFedIdMax+0.5);
267 "Number of fatal errors in FED buffer",
268 siStripFedIdMax-siStripFedIdMin+1,
269 siStripFedIdMin-0.5,siStripFedIdMax+0.5);
272 "Number of non fatal errors in FED buffer",
273 siStripFedIdMax-siStripFedIdMin+1,
274 siStripFedIdMin-0.5,siStripFedIdMax+0.5);
345 unsigned int entriesFedsPresent = 0;
346 unsigned int entriesFatalErrors = 0;
347 unsigned int entriesNonFatalErrors = 0;
348 for (
unsigned int fedId = siStripFedIdMin,
bin = 1; fedId < siStripFedIdMax+1; fedId++,
bin++) {
351 entriesFedsPresent += fedsPresentBin;
354 entriesFatalErrors += fedFatalErrorsBin;
357 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)