CMS 3D CMS Logo

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

#include <DCCTCCBlock.h>

Inheritance diagram for DCCTBTCCBlock:
DCCTBBlockPrototype

Public Member Functions

 DCCTBTCCBlock (DCCTBEventBlock *dccBlock, DCCTBDataParser *parser, const uint32_t *buffer, uint32_t numbBytes, uint32_t wordsToEnd, uint32_t wordEventOffset, uint32_t expectedId)
 
std::vector< int > triggerFlags ()
 
std::vector< std::pair< int, bool > > triggerSamples ()
 
- 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  tccFields {
  BXMASK = 0xFFF, L1MASK = 0xFFF, BPOSITION_BLOCKID = 29, BLOCKID = 3,
  BPOSITION_FGVB = 8, ETMASK = 0xFF
}
 

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_
 
uint32_t expectedId_
 
- 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 23 of file DCCTCCBlock.h.

Member Enumeration Documentation

◆ tccFields

enum DCCTBTCCBlock::tccFields
protected

Define TCC block fields BXMASK (mask for BX, 12bit) L1MASK (mask for LV1, 12 bit) BPOSITION_BLOCKID (bit position for TCC block id, bit=61/29 for 64/32bit words BLOCKID (TCC block id B'011' = 3)

Enumerator
BXMASK 
L1MASK 
BPOSITION_BLOCKID 
BLOCKID 
BPOSITION_FGVB 
ETMASK 

Definition at line 59 of file DCCTCCBlock.h.

59  {
60  BXMASK = 0xFFF,
61  L1MASK = 0xFFF,
62  BPOSITION_BLOCKID = 29,
63  BLOCKID = 3,
64  BPOSITION_FGVB = 8,
65  ETMASK = 0xFF
66  };

Constructor & Destructor Documentation

◆ DCCTBTCCBlock()

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

Class constructor

Definition at line 13 of file DCCTCCBlock.cc.

20  : DCCTBBlockPrototype(parser, "TCC", buffer, numbBytes, wordsToEnd, wordEventOffset),
21  dccBlock_(dccBlock),
22  expectedId_(expectedId) {
23  //Reset error counters
24  errors_["TCC::HEADER"] = 0;
25  errors_["TCC::BLOCKID"] = 0;
26 
27  //Get data fields from the mapper and retrieve data
28  if (parser_->numbTTs() == 68) {
30  } else if (parser_->numbTTs() == 32) {
32  } else if (parser_->numbTTs() == 16) {
34  }
35 
36  parseData();
37 
38  // check internal data
39  if (parser_->debug())
40  dataCheck();
41 }

References dataCheck(), DCCTBDataParser::debug(), DCCTBBlockPrototype::errors_, DCCTBDataParser::mapper(), DCCTBBlockPrototype::mapperFields_, DCCTBDataParser::numbTTs(), DCCTBBlockPrototype::parseData(), DCCTBBlockPrototype::parser_, DCCTBDataMapper::tcc16Fields(), DCCTBDataMapper::tcc32Fields(), and DCCTBDataMapper::tcc68Fields().

Member Function Documentation

◆ dataCheck()

void DCCTBTCCBlock::dataCheck ( )
protected

Checks header's data

Definition at line 47 of file DCCTCCBlock.cc.

47  {
48  std::pair<bool, std::string> res; //check result
49  std::string checkErrors(""); //error string
50 
51  //check BX(LOCAL) field (1st word bit 16)
52  res = checkDataField("BX", BXMASK & (dccBlock_->getDataField("BX")));
53  if (!res.first) {
54  checkErrors += res.second;
55  (errors_["TCC::HEADER"])++;
56  }
57 
58  //check LV1(LOCAL) field (1st word bit 32)
59  res = checkDataField("LV1", L1MASK & (dccBlock_->getDataField("LV1")));
60  if (!res.first) {
61  checkErrors += res.second;
62  (errors_["TCC::HEADER"])++;
63  }
64 
65  //check TCC ID field (1st word bit 0)
66  res = checkDataField("TCC ID", expectedId_);
67  if (!res.first) {
68  checkErrors += res.second;
69  (errors_["TCC::HEADER"])++;
70  }
71 
72  if (!checkErrors.empty()) {
73  blockError_ = true;
74  errorString_ += "\n ======================================================================\n";
75  errorString_ += std::string(" ") + name_ + std::string("( ID = ") + parser_->getDecString((uint32_t)(expectedId_)) +
76  std::string(" ) errors : ");
77  errorString_ += checkErrors;
78  errorString_ += "\n ======================================================================";
79  }
80 }

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

Referenced by DCCTBTCCBlock().

◆ increment() [1/2]

void DCCTBTCCBlock::increment ( uint32_t  numb)
protected

Definition at line 87 of file DCCTCCBlock.cc.

87  {
88  //if no debug is required increments the number of blocks
89  //otherwise checks if block id is really B'011'=3
90  if (!parser_->debug()) {
92  } else {
93  for (uint32_t counter = 0; counter < numb; counter++, dataP_++, wordCounter_++) {
94  uint32_t blockID = (*dataP_) >> BPOSITION_BLOCKID;
95  if (blockID != BLOCKID) {
96  (errors_["TCC::BLOCKID"])++;
97  //errorString_ += std::string("\n") + parser_->index(nunb)+(" blockId has value ") + parser_->getDecString(blockID);
98  //errorString += std::string(", while ")+parser_->getDecString(BLOCKID)+std::string(" is expected");
99  }
100  }
101  }
102 }

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

◆ increment() [2/2]

void DCCTBBlockPrototype::increment
protected

Adds a new TCC block

Definition at line 113 of file DCCBlockPrototype.cc.

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

◆ triggerFlags()

std::vector< int > DCCTBTCCBlock::triggerFlags ( )

Definition at line 117 of file DCCTCCBlock.cc.

117  {
118  std::vector<int> data;
119 
120  for (unsigned int i = 1; i <= parser_->numbTTs(); i++) {
122 
123  data.push_back(getDataField(name));
124  }
125 
126  return data;
127 }

References data, DCCTBBlockPrototype::getDataField(), DCCTBDataParser::getDecString(), mps_fire::i, DCCTBBlockPrototype::name(), DCCTBDataParser::numbTTs(), DCCTBBlockPrototype::parser_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ triggerSamples()

std::vector< std::pair< int, bool > > DCCTBTCCBlock::triggerSamples ( )

Definition at line 104 of file DCCTCCBlock.cc.

104  {
105  std::vector<std::pair<int, bool> > data;
106 
107  for (unsigned int i = 1; i <= parser_->numbTTs(); i++) {
109  int tpgValue = getDataField(name);
110  std::pair<int, bool> tpg(tpgValue & ETMASK, bool(tpgValue >> BPOSITION_FGVB));
111  data.push_back(tpg);
112  }
113 
114  return data;
115 }

References BPOSITION_FGVB, data, ETMASK, DCCTBBlockPrototype::getDataField(), DCCTBDataParser::getDecString(), mps_fire::i, DCCTBBlockPrototype::name(), DCCTBDataParser::numbTTs(), DCCTBBlockPrototype::parser_, and AlCaHLTBitMon_QueryRunRegistry::string.

Member Data Documentation

◆ dccBlock_

DCCTBEventBlock* DCCTBTCCBlock::dccBlock_
protected

Definition at line 68 of file DCCTCCBlock.h.

Referenced by dataCheck().

◆ expectedId_

uint32_t DCCTBTCCBlock::expectedId_
protected

Definition at line 69 of file DCCTCCBlock.h.

Referenced by dataCheck().

DCCTBTCCBlock::BPOSITION_BLOCKID
Definition: DCCTCCBlock.h:62
counter
Definition: counter.py:1
DCCTBBlockPrototype::mapperFields_
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * mapperFields_
Definition: DCCBlockPrototype.h:86
mps_fire.i
i
Definition: mps_fire.py:428
DCCTBDataMapper::tcc16Fields
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * tcc16Fields()
Definition: DCCDataMapper.h:108
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
DCCTBDataParser::getDecString
std::string getDecString(uint32_t data)
Definition: DCCDataParser.cc:290
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
DCCTBDataMapper::tcc68Fields
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * tcc68Fields()
Definition: DCCDataMapper.h:106
DCCTBBlockPrototype::parser_
DCCTBDataParser * parser_
Definition: DCCBlockPrototype.h:81
DCCTBTCCBlock::BLOCKID
Definition: DCCTCCBlock.h:63
DCCTBBlockPrototype::increment
virtual void increment(uint32_t numb, std::string msg="")
Definition: DCCBlockPrototype.cc:113
DCCTBTCCBlock::expectedId_
uint32_t expectedId_
Definition: DCCTCCBlock.h:69
DCCTBTCCBlock::L1MASK
Definition: DCCTCCBlock.h:61
DCCTBBlockPrototype::name
std::string name()
Definition: DCCBlockPrototype.h:46
DCCTBTCCBlock::ETMASK
Definition: DCCTCCBlock.h:65
DCCTBBlockPrototype::getDataField
virtual uint32_t getDataField(std::string name)
Definition: DCCBlockPrototype.cc:194
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DCCTBBlockPrototype::parseData
virtual void parseData()
Definition: DCCBlockPrototype.cc:38
DCCTBTCCBlock::dccBlock_
DCCTBEventBlock * dccBlock_
Definition: DCCTCCBlock.h:68
DCCTBBlockPrototype::seeIfIsPossibleToIncrement
virtual void seeIfIsPossibleToIncrement(uint32_t numb, std::string msg="")
Definition: DCCBlockPrototype.cc:119
DCCTBTCCBlock::BXMASK
Definition: DCCTCCBlock.h:60
DCCTBBlockPrototype::blockError_
bool blockError_
Definition: DCCBlockPrototype.h:74
DCCTBDataParser::numbTTs
uint32_t numbTTs()
Definition: DCCDataParser.h:177
DCCTBTCCBlock::dataCheck
void dataCheck()
Definition: DCCTCCBlock.cc:47
res
Definition: Electron.h:6
DCCTBBlockPrototype::errorString_
std::string errorString_
Definition: DCCBlockPrototype.h:77
DCCTBDataMapper::tcc32Fields
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * tcc32Fields()
Definition: DCCDataMapper.h:107
DCCTBBlockPrototype::dataP_
const uint32_t * dataP_
Definition: DCCBlockPrototype.h:66
DCCTBDataParser::mapper
DCCTBDataMapper * mapper()
Definition: DCCDataParser.h:172
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
DCCTBBlockPrototype::name_
std::string name_
Definition: DCCBlockPrototype.h:76
DCCTBTCCBlock::BPOSITION_FGVB
Definition: DCCTCCBlock.h:64