CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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.

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.

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

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 }
virtual void parseData()
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * mapperFields_
DCCTBDataParser * parser_
std::map< std::string, uint32_t > errors_
DCCTBDataMapper * mapper()
uint32_t expectedLength_
DCCTBBlockPrototype(DCCTBDataParser *parser, std::string name, const uint32_t *buffer, uint32_t numbBytes, uint32_t wordsToEndOfEvent, uint32_t wordEventOffset=0)
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * trailerFields()

Member Function Documentation

◆ dataCheck()

void DCCTBTrailerBlock::dataCheck ( )

Definition at line 28 of file DCCTrailerBlock.cc.

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

Referenced by DCCTBTrailerBlock().

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 }
virtual std::pair< bool, std::string > checkDataField(std::string name, uint32_t data)
std::map< std::string, uint32_t > errors_
Definition: Electron.h:6
uint32_t expectedLength_

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().