19 uint32_t wordBufferOffset,
20 uint32_t wordEventOffset)
22 dccTrailerBlock_(nullptr),
24 wordBufferOffset_(wordBufferOffset) {
27 errors_[
"DCC::EVENT LENGTH"] = 0;
63 increment(1,
" (while trying to create a SR Block !)");
79 for (uint32_t
i = 1;
i <= 4;
i++) {
102 increment(1,
" (while trying to create a" + tcc +
" Block !)");
121 uint32_t numbChannels;
140 for (uint32_t
i = 1;
i <= numbChannels;
i++) {
176 increment(1,
" (while trying to create a DCC TRAILER Block !)");
192 std::vector<DCCTBTCCBlock *>::iterator it1;
198 std::vector<DCCTBTowerBlock *>::iterator it2;
218 checkErrors +=
res.second;
227 checkErrors +=
res.second;
233 uint32_t dccHeaderWords = 0;
241 for (uint32_t
i = 1;
i <= dccHeaderWords;
i++) {
245 checkErrors +=
res.second;
254 checkErrors +=
res.second;
255 (
errors_[
"DCC::EVENT LENGTH"])++;
259 if (!checkErrors.empty()) {
260 errorString_ +=
"\n ======================================================================\n";
263 errorString_ +=
"\n ======================================================================";
270 <<
" <<<<<<<<<<<<<<<<<<<<" << std::endl;
283 std::vector<DCCTBTCCBlock *>::iterator it1;
285 (*it1)->displayData(os);
289 std::vector<DCCTBTowerBlock *>::iterator it2;
291 (*it2)->displayData(os);
294 std::vector<DCCTBXtalBlock *> &xtalBlocks = (*it2)->xtalBlocks();
295 std::vector<DCCTBXtalBlock *>::iterator it3;
296 for (it3 = xtalBlocks.begin(); it3 != xtalBlocks.end(); it3++) {
297 (*it3)->displayData(os);
312 std::stringstream
out;
321 out <<
"\n =====================================================================" 322 <<
"\n ERROR SR block identified in the ORIGINAL BLOCK ... " 323 <<
"\n ... but the block is not present in the COMPARISION BLOCK !" 324 <<
"\n =====================================================================";
327 out <<
"\n =====================================================================" 328 <<
"\n ERROR SR block identified in the COMPARISION BLOCK ... " 329 <<
"\n ... but the block is not present in the ORIGINAL BLOCK !" 330 <<
"\n =====================================================================";
337 int numbTccBlocks_b =
block->tccBlocks().size();
339 if (numbTccBlocks_a != numbTccBlocks_b) {
341 out <<
"\n =====================================================================" 342 <<
"\n ERROR number of TCC blocks in the ORIGINAL BLOCK( =" << numbTccBlocks_a <<
" )" 343 <<
"\n and in the COMPARISION BLOCK( = " << numbTccBlocks_b <<
" is different !" 344 <<
"\n =====================================================================";
347 std::vector<DCCTBTCCBlock *>::iterator it1Tcc =
tccBlocks_.begin();
348 std::vector<DCCTBTCCBlock *>::iterator it1TccEnd =
tccBlocks_.end();
349 std::vector<DCCTBTCCBlock *>::iterator it2Tcc =
block->tccBlocks().begin();
350 std::vector<DCCTBTCCBlock *>::iterator it2TccEnd =
block->tccBlocks().end();
352 for (; it1Tcc != it1TccEnd && it2Tcc != it2TccEnd; it1Tcc++, it2Tcc++) {
353 std::pair<bool, std::string>
temp((*it1Tcc)->compare(*it2Tcc));
362 int numbTowerBlocks_b =
block->towerBlocks().size();
364 if (numbTowerBlocks_a != numbTowerBlocks_b) {
366 out <<
"\n =====================================================================" 367 <<
"\n ERROR number of Tower blocks in the ORIGINAL BLOCK( =" << numbTowerBlocks_a <<
" )" 368 <<
"\n and in the COMPARISION BLOCK( = " << numbTowerBlocks_b <<
" is different !" 369 <<
"\n =====================================================================";
372 std::vector<DCCTBTowerBlock *>::iterator it1Tower =
towerBlocks_.begin();
373 std::vector<DCCTBTowerBlock *>::iterator it1TowerEnd =
towerBlocks_.end();
374 std::vector<DCCTBTowerBlock *>::iterator it2Tower = (
block->towerBlocks()).begin();
375 std::vector<DCCTBTowerBlock *>::iterator it2TowerEnd = (
block->towerBlocks()).
end();
377 for (; it1Tower != it1TowerEnd && it2Tower != it2TowerEnd; it1Tower++, it2Tower++) {
378 std::pair<bool, std::string>
temp((*it1Tower)->compare(*it2Tower));
383 std::vector<DCCTBXtalBlock *> xtalBlocks1((*it1Tower)->xtalBlocks());
384 std::vector<DCCTBXtalBlock *> xtalBlocks2((*it2Tower)->xtalBlocks());
386 int numbXtalBlocks_a = xtalBlocks1.size();
387 int numbXtalBlocks_b = xtalBlocks2.size();
389 if (numbXtalBlocks_a != numbXtalBlocks_b) {
391 out <<
"\n =====================================================================" 392 <<
"\n ERROR number of Xtal blocks in this TOWER ORIGINAL BLOCK( =" << numbXtalBlocks_a <<
" )" 393 <<
"\n and in the TOWER COMPARISION BLOCK( = " << numbXtalBlocks_b <<
" is different !" 394 <<
"\n =====================================================================";
397 std::vector<DCCTBXtalBlock *>::iterator it1Xtal = xtalBlocks1.begin();
398 std::vector<DCCTBXtalBlock *>::iterator it1XtalEnd = xtalBlocks1.end();
399 std::vector<DCCTBXtalBlock *>::iterator it2Xtal = xtalBlocks1.begin();
400 std::vector<DCCTBXtalBlock *>::iterator it2XtalEnd = xtalBlocks2.end();
402 for (; it1Xtal != it1XtalEnd && it2Xtal != it2XtalEnd; it1Xtal++, it2Xtal++) {
403 std::pair<bool, std::string>
temp((*it1Xtal)->compare(*it2Xtal));
426 std::vector<DCCTBTCCBlock *>::iterator it1;
428 ret |= (*it1)->blockError();
439 std::vector<DCCTBTowerBlock *>::iterator it2;
441 ret |= (*it2)->blockError();
444 std::vector<DCCTBXtalBlock *> &xtalBlocks = (*it2)->xtalBlocks();
445 std::vector<DCCTBXtalBlock *>::iterator it3;
446 for (it3 = xtalBlocks.begin(); it3 != xtalBlocks.end(); it3++) {
447 ret |= (*it3)->blockError();
466 ret +=
"\n ======================================================================\n";
467 ret +=
std::string(
" Event Erros occurred for L1A ( decoded value ) = ");
469 ret +=
"\n ======================================================================";
475 std::vector<DCCTBTCCBlock *>::iterator it1;
477 ret += (*it1)->errorString();
487 std::vector<DCCTBTowerBlock *>::iterator it2;
490 ret += (*it2)->errorString();
493 std::vector<DCCTBXtalBlock *> &xtalBlocks = (*it2)->xtalBlocks();
494 std::vector<DCCTBXtalBlock *>::iterator it3;
497 for (it3 = xtalBlocks.begin(); it3 != xtalBlocks.end(); it3++) {
498 temp += (*it3)->errorString();
502 ret +=
"\n Fine grain data Errors found ...";
522 std::vector<DCCTBTowerBlock *> myVector;
523 std::vector<DCCTBTowerBlock *>::iterator
it;
527 std::pair<bool, std::string> idCheck = (*it)->checkDataField(
"TT/SC ID",
towerId);
530 myVector.push_back((*
it));
virtual std::pair< bool, std::string > checkDataField(std::string name, uint32_t data)
virtual uint32_t getDataField(std::string name)
std::vector< DCCTBTCCBlock * > tccBlocks_
virtual void increment(uint32_t numb, std::string msg="")
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * mapperFields_
ret
prodAgent to be discontinued
DCCTBDataParser * parser_
std::string getDecString(uint32_t data)
std::map< std::string, uint32_t > errors_
DCCTBEventBlock(DCCTBDataParser *parser, const uint32_t *buffer, uint32_t numbBytes, uint32_t wordsToEnd, uint32_t wordBufferOffset=0, uint32_t wordEventOffset=0)
void displayEvent(std::ostream &os=std::cout)
~DCCTBEventBlock() override
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
std::vector< DCCTBTowerBlock * > towerBlocks_
virtual void displayData(std::ostream &os=std::cout)
DCCTBTrailerBlock * trailerBlock()
DCCTBDataMapper * mapper()
std::pair< bool, std::string > compare(DCCTBEventBlock *)
std::vector< DCCTBTowerBlock * > towerBlocksById(uint32_t towerId)
unsigned tccId(DetId const &, EcalElectronicsMapping const *)
std::string eventErrorString()
DCCTBTrailerBlock * dccTrailerBlock_
DCCTBSRPBlock * srpBlock_
virtual std::pair< bool, std::string > compare(DCCTBBlockPrototype *block)
uint32_t wordBufferOffset_
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * emptyEventFields()
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * dccFields()
std::string & errorString()