CMS 3D CMS Logo

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

#include <DCCTrailerBlock.h>

Inheritance diagram for DCCTBTrailerBlock:
DCCTBBlockPrototype

Public Member Functions

void dataCheck ()
 
 DCCTBTrailerBlock (DCCTBDataParser *parser, const uint32_t *buffer, uint32_t numbBytes, uint32_t wToEnd, uint32_t wordEventOffset, uint32_t expectedLength, uint32_t expectedCRC)
 
- 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  traillerFields { EOE = 0xA }
 

Protected Attributes

uint32_t expectedCRC_
 
uint32_t expectedLength_
 
- 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_
 

Additional Inherited Members

- Protected Member Functions inherited from DCCTBBlockPrototype
std::string formatString (std::string myString, uint32_t minPositions)
 

Detailed Description

Definition at line 10 of file DCCTrailerBlock.h.

Member Enumeration Documentation

◆ traillerFields

Enumerator
EOE 

Definition at line 23 of file DCCTrailerBlock.h.

23 { EOE = 0xA };

Constructor & Destructor Documentation

◆ DCCTBTrailerBlock()

DCCTBTrailerBlock::DCCTBTrailerBlock ( DCCTBDataParser parser,
const uint32_t *  buffer,
uint32_t  numbBytes,
uint32_t  wToEnd,
uint32_t  wordEventOffset,
uint32_t  expectedLength,
uint32_t  expectedCRC 
)

Definition at line 4 of file DCCTrailerBlock.cc.

11  : DCCTBBlockPrototype(parser, "DCCTRAILER", buffer, numbBytes, wToEnd, wordEventOffset),
12  expectedLength_(expectedLength) {
13  errors_["TRAILER::EVENT LENGTH"] = 0;
14  errors_["TRAILER::EOE"] = 0;
15  errors_["TRAILER::CRC"] = 0;
16  errors_["TRAILER::T"] = 0;
17 
18  // Get data fields from the mapper and retrieve data ///////////////////////////////////////////
20  parseData();
22 
23  // check internal data ////
24  dataCheck();
26 }

References dataCheck(), DCCTBBlockPrototype::errors_, DCCTBDataParser::mapper(), DCCTBBlockPrototype::mapperFields_, DCCTBBlockPrototype::parseData(), DCCTBBlockPrototype::parser_, and DCCTBDataMapper::trailerFields().

Member Function Documentation

◆ dataCheck()

void DCCTBTrailerBlock::dataCheck ( )

Definition at line 28 of file DCCTrailerBlock.cc.

28  {
29  std::string checkErrors("");
30 
31  std::pair<bool, std::string> res;
32 
33  res = checkDataField("EVENT LENGTH", expectedLength_);
34  if (!res.first) {
35  checkErrors += res.second;
36  (errors_["TRAILER::EVENT LENGTH"])++;
37  }
38 
39  res = checkDataField("EOE", EOE);
40  if (!res.first) {
41  checkErrors += res.second;
42  (errors_["TRAILER::EOE"])++;
43  }
44 
45  res = checkDataField("T", 0);
46  if (!res.first) {
47  checkErrors += res.second;
48  (errors_["TRAILER::T"])++;
49  }
50 
51  //checkErrors += checkDataField("CRC",expectedCRC_);
52 
53  if (!checkErrors.empty()) {
54  errorString_ += "\n ======================================================================\n";
55  errorString_ += std::string(" ") + name_ + std::string(" data fields checks errors : ");
56  errorString_ += checkErrors;
57  errorString_ += "\n ======================================================================";
58  blockError_ = true;
59  }
60 }

References DCCTBBlockPrototype::blockError_, DCCTBBlockPrototype::checkDataField(), EOE, DCCTBBlockPrototype::errors_, DCCTBBlockPrototype::errorString_, expectedLength_, DCCTBBlockPrototype::name_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by DCCTBTrailerBlock().

Member Data Documentation

◆ expectedCRC_

uint32_t DCCTBTrailerBlock::expectedCRC_
protected

Definition at line 25 of file DCCTrailerBlock.h.

◆ expectedLength_

uint32_t DCCTBTrailerBlock::expectedLength_
protected

Definition at line 24 of file DCCTrailerBlock.h.

Referenced by dataCheck().

DCCTBBlockPrototype::mapperFields_
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * mapperFields_
Definition: DCCBlockPrototype.h:86
writedatasetfile.parser
parser
Definition: writedatasetfile.py:7
DCCTBTrailerBlock::EOE
Definition: DCCTrailerBlock.h:23
DCCTBBlockPrototype::checkDataField
virtual std::pair< bool, std::string > checkDataField(std::string name, uint32_t data)
Definition: DCCBlockPrototype.cc:173
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
DCCTBTrailerBlock::dataCheck
void dataCheck()
Definition: DCCTrailerBlock.cc:28
DCCTBBlockPrototype::errors_
std::map< std::string, uint32_t > errors_
Definition: DCCBlockPrototype.h:84
DCCTBBlockPrototype::parser_
DCCTBDataParser * parser_
Definition: DCCBlockPrototype.h:81
DCCTBTrailerBlock::expectedLength_
uint32_t expectedLength_
Definition: DCCTrailerBlock.h:24
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DCCTBBlockPrototype::parseData
virtual void parseData()
Definition: DCCBlockPrototype.cc:38
DCCTBDataMapper::trailerFields
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * trailerFields()
Definition: DCCDataMapper.h:114
DCCTBBlockPrototype::blockError_
bool blockError_
Definition: DCCBlockPrototype.h:74
res
Definition: Electron.h:6
DCCTBBlockPrototype::errorString_
std::string errorString_
Definition: DCCBlockPrototype.h:77
DCCTBDataParser::mapper
DCCTBDataMapper * mapper()
Definition: DCCDataParser.h:172
DCCTBBlockPrototype::name_
std::string name_
Definition: DCCBlockPrototype.h:76