46 void EventProcessor::processEvent(
const char*
data,
const int32_t dataSize,
const uint32_t errorStat,
const int32_t nodeNumber)
58 me->
Fill(nodeNumber, 1);
59 for (
unsigned int i = 0;
i < 16;
i++)
61 if ((errorStat >>
i) & 0x1)
63 me->
Fill(nodeNumber,
i + 2);
69 me->
Fill(nodeNumber, 0);
73 bool eventDenied =
false;
74 if (((uint32_t) errorStat &
config->getDDU_CHECK_MASK()) > 0)
79 const uint16_t *
tmp =
reinterpret_cast<const uint16_t *
>(
data);
80 const uint16_t tmpSize = dataSize /
sizeof(short);
89 if (
config->getBINCHECKER_OUTPUT())
102 if (binChecker.
check(tmp, tmpSize) < 0)
106 const uint16_t dduTrailer[4] = { 0x8000, 0x8000, 0xFFFF, 0x8000 };
107 const uint16_t *tmp = dduTrailer;
108 binChecker.
check(tmp, uint32_t(4));
125 if (
config->getPROCESS_DDU())
155 LOG_WARN <<
"No product: " << inputTag <<
" in stream";
159 bCSCEventCounted =
false;
160 size_t eventSize = 0;
165 int nDDUs_out_of_sync = 0;
166 int nDDUs_with_CSC_data_out_of_sync = 0;
167 bool fGlobal_DCC_DDU_L1A_mismatch =
false;
168 bool fGlobal_DCC_DDU_L1A_mismatch_with_CSC_data =
false;
169 MonitorObject* mo = 0;
187 const FEDRawData& fedData = rawdata->FEDData(
id);
190 if (fedData.
size() >= 32)
193 eventSize += fedData.
size();
196 if (!bCSCEventCounted)
199 bCSCEventCounted =
true;
203 if (
getEMUHisto(h::EMU_FED_ENTRIES, mo)) mo->Fill(
id);
205 if (
getEMUHisto(h::EMU_FED_BUFFER_SIZE, mo)) mo->Fill(
id, log10((
double)fedData.
size()));
209 const uint16_t *data = (uint16_t *) fedData.
data();
210 const size_t dataSize = fedData.
size() / 2;
211 const short unsigned int* udata = (
short unsigned int*) fedData.
data();
220 if (
config->getBINCHECKER_OUTPUT())
233 if (binChecker.
check(data, dataSize) < 0)
235 if (
getEMUHisto(h::EMU_FED_FATAL, mo)) mo->Fill(
id);
250 uint32_t errs = binChecker.
errors();
254 for (
int i = 0;
i < 29;
i++)
256 if ((errs >>
i) & 0x1 )
275 if (
getEMUHisto(h::EMU_FED_NONFATAL, mo)) mo->Fill(
id);
278 if (
config->getPROCESS_DDU())
281 CSCDCCEventData dccData(const_cast<short unsigned int*>(udata), &binChecker);
282 const std::vector<CSCDDUEventData> & dduData = dccData.dduData();
285 bool fDCC_DDU_L1A_mismatch =
false;
286 bool fDCC_DDU_L1A_mismatch_with_CSC_data =
false;
287 int DCC_L1A = dccData.dccHeader().getCDFEventNumber();
288 for (
int ddu = 0; ddu < (int)dduData.size(); ddu++)
290 if (DCC_L1A != dduData[ddu].
header().lvl1num())
292 fDCC_DDU_L1A_mismatch =
true;
293 fGlobal_DCC_DDU_L1A_mismatch =
true;
297 if (dduData[ddu].sizeInWords() > 24) {
298 fDCC_DDU_L1A_mismatch_with_CSC_data =
true;
299 fGlobal_DCC_DDU_L1A_mismatch_with_CSC_data =
true;
300 nDDUs_with_CSC_data_out_of_sync++;
314 if (fDCC_DDU_L1A_mismatch &&
getEMUHisto(h::EMU_FED_DDU_L1A_MISMATCH, mo)) mo->Fill(
id);
315 if (fDCC_DDU_L1A_mismatch_with_CSC_data
316 &&
getEMUHisto(h::EMU_FED_DDU_L1A_MISMATCH_WITH_CSC_DATA, mo)) mo->Fill(
id);
324 if (
getEMUHisto(h::EMU_FED_FORMAT_FATAL, mo)) mo->Fill(
id);
334 if (fGlobal_DCC_DDU_L1A_mismatch &&
getEMUHisto(h::EMU_FED_DDU_L1A_MISMATCH_CNT, mo)) mo->Fill(nDDUs_out_of_sync);
335 if (fGlobal_DCC_DDU_L1A_mismatch &&
getEMUHisto(h::EMU_FED_DDU_L1A_MISMATCH_WITH_CSC_DATA_CNT, mo))
336 mo->Fill(nDDUs_with_CSC_data_out_of_sync);
341 if (fGlobal_DCC_DDU_L1A_mismatch) mo->Fill(1);
342 if (fGlobal_DCC_DDU_L1A_mismatch_with_CSC_data) mo->Fill(2);
345 if (
getEMUHisto(h::EMU_FED_EVENT_SIZE, mo)) mo->Fill(eventSize/1024.);
void crcCFEB(bool enable)
uint32_t cntCFEBs
Total Number of DMBs per event from DDU Header DAV.
void preProcessEvent()
Common Local and Global DQM function to be called before processing Event.
void modeDDU(bool enable)
virtual void Fill(float x)=0
Monitoring Object interface used to cover Root object and provide common interface to EventProcessor ...
ExaminerStatusType errors(void) const
void crcALCT(bool enable)
size_t size() const
Lenght of the data buffer in bytes.
ExaminerStatusType warnings(void) const
uint32_t cntTMBs
Total Number of ALCTs per event from DMB DAV.
std::map< CSCIdType, ExaminerStatusType > errorsDetailed(void) const
uint32_t cntALCTs
Total Number of CFEBs per event from DMB DAV.
void processDDU(const CSCDDUEventData &data, const CSCDCCExaminer &binChecker)
Process DDU output and fill MOs.
bool processExaminer(const CSCDCCExaminer &binChecker)
std::map< CSCIdType, ExaminerStatusType > statusDetailed(void) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
ExaminerMaskType getMask() const
int32_t check(const uint16_t *&buffer, int32_t length)
std::vector< std::vector< double > > tmp
const bool getFEDHisto(const HistoId &histo, const HwId &fedID, MonitorObject *&me)
Get FED Level Monitoring Object.
std::map< CSCIdType, ExaminerStatusType > payloadDetailed(void) const
char data[epos_bytes_allocation]
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
std::map< DDUIdType, ExaminerStatusType > errorsDetailedDDU(void) const
bool EmuEventDisplayWasReset
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.
void setMask(ExaminerMaskType mask)