CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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, 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, 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
uint32_t * beginOfBuffer_
 
bool blockError_
 
uint32_t blockSize_
 
std::string blockString_
 
std::map< std::string, uint32_t > dataFields_
 
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 11 of file DCCTrailerBlock.h.

Member Enumeration Documentation

Enumerator
EOE 

Definition at line 30 of file DCCTrailerBlock.h.

Constructor & Destructor Documentation

DCCTBTrailerBlock::DCCTBTrailerBlock ( DCCTBDataParser parser,
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().

12  : DCCTBBlockPrototype(parser,"DCCTRAILER", buffer, numbBytes,wToEnd, wordEventOffset),
13 expectedLength_(expectedLength){
14 
15  errors_["TRAILER::EVENT LENGTH"] = 0 ;
16  errors_["TRAILER::EOE"] = 0 ;
17  errors_["TRAILER::CRC"] = 0 ;
18  errors_["TRAILER::T"] = 0 ;
19 
20  // Get data fields from the mapper and retrieve data ///////////////////////////////////////////
22  parseData();
24 
25  // check internal data ////
26  dataCheck();
28 
29 }
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * mapperFields_
virtual void parseData()
DCCTBDataParser * parser_
DCCTBBlockPrototype(DCCTBDataParser *parser, std::string name, uint32_t *buffer, uint32_t numbBytes, uint32_t wordsToEndOfEvent, uint32_t wordEventOffset=0)
DCCTBDataMapper * mapper()
std::map< std::string, uint32_t > errors_
uint32_t expectedLength_
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * trailerFields()

Member Function Documentation

void DCCTBTrailerBlock::dataCheck ( )

Definition at line 32 of file DCCTrailerBlock.cc.

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

Referenced by DCCTBTrailerBlock().

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

Member Data Documentation

uint32_t DCCTBTrailerBlock::expectedCRC_
protected

Definition at line 32 of file DCCTrailerBlock.h.

uint32_t DCCTBTrailerBlock::expectedLength_
protected

Definition at line 31 of file DCCTrailerBlock.h.

Referenced by dataCheck().