CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
DCCTBSRPBlock Class Reference

#include <DCCSRPBlock.h>

Inheritance diagram for DCCTBSRPBlock:
DCCTBBlockPrototype

Public Member Functions

 DCCTBSRPBlock (DCCTBEventBlock *dccBlock, DCCTBDataParser *parser, const uint32_t *buffer, uint32_t numbBytes, uint32_t wordsToEnd, uint32_t wordEventOffset)
 
- Public Member Functions inherited from DCCTBBlockPrototype
bool blockError ()
 
virtual std::pair< bool, std::string > checkDataField (std::string name, uint32_t data)
 
virtual std::pair< bool, std::string > compare (DCCTBBlockPrototype *block)
 
 DCCTBBlockPrototype (DCCTBDataParser *parser, std::string name, const uint32_t *buffer, uint32_t numbBytes, uint32_t wordsToEndOfEvent, uint32_t wordEventOffset=0)
 
virtual void displayData (std::ostream &os=std::cout)
 
std::map< std::string, uint32_t > & errorCounters ()
 
std::string & errorString ()
 
virtual uint32_t getDataField (std::string name)
 
virtual uint32_t getDataWord (uint32_t wordPosition, uint32_t bitPosition, uint32_t mask)
 
DCCTBDataParsergetParser ()
 
virtual void increment (uint32_t numb, std::string msg="")
 
std::string name ()
 
virtual void parseData ()
 
virtual void seeIfIsPossibleToIncrement (uint32_t numb, std::string msg="")
 
virtual void setDataField (std::string name, uint32_t data)
 
uint32_t size ()
 
uint32_t wOffset ()
 
virtual ~DCCTBBlockPrototype ()
 

Protected Types

enum  srpFields { BXMASK = 0xFFF, L1MASK = 0xFFF, BPOSITION_BLOCKID = 29, BLOCKID = 4 }
 

Protected Member Functions

void dataCheck ()
 
void increment (uint32_t numb)
 
virtual void increment (uint32_t numb, std::string msg="")
 
- Protected Member Functions inherited from DCCTBBlockPrototype
std::string formatString (std::string myString, uint32_t minPositions)
 

Protected Attributes

DCCTBEventBlockdccBlock_
 
- Protected Attributes inherited from DCCTBBlockPrototype
const uint32_t * beginOfBuffer_
 
bool blockError_
 
uint32_t blockSize_
 
std::string blockString_
 
std::map< std::string, uint32_t > dataFields_
 
const uint32_t * dataP_
 
std::map< std::string, uint32_t > errors_
 
std::string errorString_
 
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * mapperFields_
 
std::string name_
 
DCCTBDataParserparser_
 
std::string processingString_
 
uint32_t wordCounter_
 
uint32_t wordEventOffset_
 
uint32_t wordsToEndOfEvent_
 

Detailed Description

Definition at line 19 of file DCCSRPBlock.h.

Member Enumeration Documentation

◆ srpFields

enum DCCTBSRPBlock::srpFields
protected
Enumerator
BXMASK 
L1MASK 
BPOSITION_BLOCKID 
BLOCKID 

Definition at line 33 of file DCCSRPBlock.h.

33 { BXMASK = 0xFFF, L1MASK = 0xFFF, BPOSITION_BLOCKID = 29, BLOCKID = 4 };

Constructor & Destructor Documentation

◆ DCCTBSRPBlock()

DCCTBSRPBlock::DCCTBSRPBlock ( DCCTBEventBlock dccBlock,
DCCTBDataParser parser,
const uint32_t *  buffer,
uint32_t  numbBytes,
uint32_t  wordsToEnd,
uint32_t  wordEventOffset 
)

Definition at line 6 of file DCCSRPBlock.cc.

12  : DCCTBBlockPrototype(parser, "SRP", buffer, numbBytes, wordsToEnd, wordEventOffset), dccBlock_(dccBlock) {
13  //Reset error counters ///////
14  errors_["SRP::HEADER"] = 0;
15  errors_["SRP::BLOCKID"] = 0;
17 
18  // Get data fields from the mapper and retrieve data /////////////////////////////////////
19  if (parser_->numbSRF() == 68) {
21  } else if (parser_->numbSRF() == 32) {
23  } else if (parser_->numbSRF() == 16) {
25  }
26  parseData();
28 
29  // check internal data ////////////
30  if (parser_->debug()) {
31  dataCheck();
32  }
34 }

References dataCheck(), DCCTBDataParser::debug(), DCCTBBlockPrototype::errors_, DCCTBDataParser::mapper(), DCCTBBlockPrototype::mapperFields_, DCCTBDataParser::numbSRF(), DCCTBBlockPrototype::parseData(), DCCTBBlockPrototype::parser_, DCCTBDataMapper::srp16Fields(), DCCTBDataMapper::srp32Fields(), and DCCTBDataMapper::srp68Fields().

Member Function Documentation

◆ dataCheck()

void DCCTBSRPBlock::dataCheck ( )
protected

Definition at line 36 of file DCCSRPBlock.cc.

36  {
37  std::string checkErrors("");
38 
39  std::pair<bool, std::string> res;
40 
41  res = checkDataField("BX", BXMASK & (dccBlock_->getDataField("BX")));
42  if (!res.first) {
43  checkErrors += res.second;
44  (errors_["SRP::HEADER"])++;
45  }
46  res = checkDataField("LV1", L1MASK & (dccBlock_->getDataField("LV1")));
47  if (!res.first) {
48  checkErrors += res.second;
49  (errors_["SRP::HEADER"])++;
50  }
51 
52  res = checkDataField("SRP ID", parser_->srpId());
53  if (!res.first) {
54  checkErrors += res.second;
55  (errors_["SRP::HEADER"])++;
56  }
57 
58  if (!checkErrors.empty()) {
59  errorString_ += "\n ======================================================================\n";
60  errorString_ += std::string(" ") + name_ + std::string(" data fields checks errors : ");
61  errorString_ += checkErrors;
62  errorString_ += "\n ======================================================================";
63  blockError_ = true;
64  }
65 }

References DCCTBBlockPrototype::blockError_, BXMASK, DCCTBBlockPrototype::checkDataField(), dccBlock_, DCCTBBlockPrototype::errors_, DCCTBBlockPrototype::errorString_, DCCTBBlockPrototype::getDataField(), L1MASK, DCCTBBlockPrototype::name_, DCCTBBlockPrototype::parser_, DCCTBDataParser::srpId(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by DCCTBSRPBlock().

◆ increment() [1/2]

void DCCTBSRPBlock::increment ( uint32_t  numb)
protected

Definition at line 67 of file DCCSRPBlock.cc.

67  {
68  if (!parser_->debug()) {
70  } else {
71  for (uint32_t counter = 0; counter < numb; counter++, dataP_++, wordCounter_++) {
72  uint32_t blockID = (*dataP_) >> BPOSITION_BLOCKID;
73  if (blockID != BLOCKID) {
74  (errors_["SRP::BLOCKID"])++;
75  //errorString_ += std::string("\n") + parser_->index(nunb)+(" blockId has value ") + parser_->getDecString(blockID);
76  //errorString += std::string(", while ")+parser_->getDecString(BLOCKID)+std::string(" is expected");
77  }
78  }
79  }
80 }

References BLOCKID, BPOSITION_BLOCKID, DCCTBBlockPrototype::dataP_, DCCTBDataParser::debug(), DCCTBBlockPrototype::errors_, DCCTBBlockPrototype::increment(), DCCTBBlockPrototype::parser_, and DCCTBBlockPrototype::wordCounter_.

◆ increment() [2/2]

void DCCTBBlockPrototype::increment
protected

Definition at line 113 of file DCCBlockPrototype.cc.

113  {
115  dataP_ += numb;
116  wordCounter_ += numb;
117 }

Member Data Documentation

◆ dccBlock_

DCCTBEventBlock* DCCTBSRPBlock::dccBlock_
protected

Definition at line 35 of file DCCSRPBlock.h.

Referenced by dataCheck().

counter
Definition: counter.py:1
DCCTBBlockPrototype::mapperFields_
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * mapperFields_
Definition: DCCBlockPrototype.h:86
DCCTBDataParser::numbSRF
uint32_t numbSRF()
Definition: DCCDataParser.h:178
DCCTBSRPBlock::BPOSITION_BLOCKID
Definition: DCCSRPBlock.h:33
DCCTBDataMapper::srp68Fields
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * srp68Fields()
Definition: DCCDataMapper.h:109
writedatasetfile.parser
parser
Definition: writedatasetfile.py:7
mps_check.msg
tuple msg
Definition: mps_check.py:285
DCCTBBlockPrototype::wordCounter_
uint32_t wordCounter_
Definition: DCCBlockPrototype.h:70
DCCTBBlockPrototype::checkDataField
virtual std::pair< bool, std::string > checkDataField(std::string name, uint32_t data)
Definition: DCCBlockPrototype.cc:173
DCCTBDataParser::debug
bool debug()
Definition: DCCDataParser.h:194
DCCTBBlockPrototype::DCCTBBlockPrototype
DCCTBBlockPrototype(DCCTBDataParser *parser, std::string name, const uint32_t *buffer, uint32_t numbBytes, uint32_t wordsToEndOfEvent, uint32_t wordEventOffset=0)
Definition: DCCBlockPrototype.cc:9
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
DCCTBBlockPrototype::errors_
std::map< std::string, uint32_t > errors_
Definition: DCCBlockPrototype.h:84
DCCTBSRPBlock::L1MASK
Definition: DCCSRPBlock.h:33
DCCTBBlockPrototype::parser_
DCCTBDataParser * parser_
Definition: DCCBlockPrototype.h:81
DCCTBSRPBlock::BXMASK
Definition: DCCSRPBlock.h:33
DCCTBDataParser::srpId
uint32_t srpId()
Definition: DCCDataParser.h:180
DCCTBBlockPrototype::increment
virtual void increment(uint32_t numb, std::string msg="")
Definition: DCCBlockPrototype.cc:113
DCCTBSRPBlock::BLOCKID
Definition: DCCSRPBlock.h:33
DCCTBBlockPrototype::getDataField
virtual uint32_t getDataField(std::string name)
Definition: DCCBlockPrototype.cc:194
DCCTBDataMapper::srp16Fields
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * srp16Fields()
Definition: DCCDataMapper.h:111
DCCTBBlockPrototype::parseData
virtual void parseData()
Definition: DCCBlockPrototype.cc:38
DCCTBBlockPrototype::seeIfIsPossibleToIncrement
virtual void seeIfIsPossibleToIncrement(uint32_t numb, std::string msg="")
Definition: DCCBlockPrototype.cc:119
DCCTBBlockPrototype::blockError_
bool blockError_
Definition: DCCBlockPrototype.h:74
res
Definition: Electron.h:6
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DCCTBBlockPrototype::errorString_
std::string errorString_
Definition: DCCBlockPrototype.h:77
DCCTBBlockPrototype::dataP_
const uint32_t * dataP_
Definition: DCCBlockPrototype.h:66
DCCTBDataParser::mapper
DCCTBDataMapper * mapper()
Definition: DCCDataParser.h:172
DCCTBDataMapper::srp32Fields
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * srp32Fields()
Definition: DCCDataMapper.h:110
DCCTBBlockPrototype::name_
std::string name_
Definition: DCCBlockPrototype.h:76
DCCTBSRPBlock::dccBlock_
DCCTBEventBlock * dccBlock_
Definition: DCCSRPBlock.h:35
DCCTBSRPBlock::dataCheck
void dataCheck()
Definition: DCCSRPBlock.cc:36