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, 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, 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)
 
- Protected Member Functions inherited from DCCTBBlockPrototype
std::string formatString (std::string myString, uint32_t minPositions)
 

Protected Attributes

DCCTBEventBlockdccBlock_
 
- 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_
 

Detailed Description

Definition at line 21 of file DCCSRPBlock.h.

Member Enumeration Documentation

enum DCCTBSRPBlock::srpFields
protected
Enumerator
BXMASK 
L1MASK 
BPOSITION_BLOCKID 
BLOCKID 

Definition at line 42 of file DCCSRPBlock.h.

Constructor & Destructor Documentation

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

Definition at line 6 of file DCCSRPBlock.cc.

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

13  : DCCTBBlockPrototype(parser,"SRP", buffer, numbBytes,wordsToEnd,wordEventOffset), dccBlock_(dccBlock){
14 
15  //Reset error counters ///////
16  errors_["SRP::HEADER"] = 0;
17  errors_["SRP::BLOCKID"] = 0;
19 
20  // Get data fields from the mapper and retrieve data /////////////////////////////////////
21  if( parser_->numbSRF() == 68){ mapperFields_ = parser_->mapper()->srp68Fields();}
22  else if( parser_->numbSRF() == 32){ mapperFields_ = parser_->mapper()->srp32Fields();}
23  else if( parser_->numbSRF() == 16){ mapperFields_ = parser_->mapper()->srp16Fields();}
24  parseData();
26 
27  // check internal data ////////////
28  if(parser_->debug()){ dataCheck();}
30 
31 }
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * mapperFields_
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * srp32Fields()
virtual void parseData()
DCCTBDataParser * parser_
DCCTBBlockPrototype(DCCTBDataParser *parser, std::string name, uint32_t *buffer, uint32_t numbBytes, uint32_t wordsToEndOfEvent, uint32_t wordEventOffset=0)
DCCTBEventBlock * dccBlock_
Definition: DCCSRPBlock.h:49
void dataCheck()
Definition: DCCSRPBlock.cc:35
DCCTBDataMapper * mapper()
std::map< std::string, uint32_t > errors_
uint32_t numbSRF()
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * srp16Fields()
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * srp68Fields()

Member Function Documentation

void DCCTBSRPBlock::dataCheck ( )
protected

Definition at line 35 of file DCCSRPBlock.cc.

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

35  {
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){ checkErrors += res.second; (errors_["SRP::HEADER"])++; }
43  res = checkDataField("LV1", L1MASK & (dccBlock_->getDataField("LV1")));
44  if(!res.first){ checkErrors += res.second; (errors_["SRP::HEADER"])++; }
45 
46 
47  res = checkDataField("SRP ID",parser_->srpId());
48  if(!res.first){ checkErrors += res.second; (errors_["SRP::HEADER"])++; }
49 
50 
51  if(checkErrors!=""){
52  errorString_ +="\n ======================================================================\n";
53  errorString_ += std::string(" ") + name_ + std::string(" data fields checks errors : ") ;
54  errorString_ += checkErrors ;
55  errorString_ += "\n ======================================================================";
56  blockError_ = true;
57  }
58 
59 
60 }
virtual std::pair< bool, std::string > checkDataField(std::string name, uint32_t data)
virtual uint32_t getDataField(std::string name)
DCCTBDataParser * parser_
Definition: Electron.h:4
DCCTBEventBlock * dccBlock_
Definition: DCCSRPBlock.h:49
std::map< std::string, uint32_t > errors_
uint32_t srpId()
void DCCTBSRPBlock::increment ( uint32_t  numb)
protected

Definition at line 63 of file DCCSRPBlock.cc.

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

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

Member Data Documentation

DCCTBEventBlock* DCCTBSRPBlock::dccBlock_
protected

Definition at line 49 of file DCCSRPBlock.h.

Referenced by dataCheck().