CMS 3D CMS Logo

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

#include <DCCEventBlock.h>

Inheritance diagram for DCCTBEventBlock:
DCCTBBlockPrototype

Public Member Functions

virtual std::pair< bool, std::string > compare (DCCTBBlockPrototype *block)
 
std::pair< bool, std::string > compare (DCCTBEventBlock *)
 
void dataCheck ()
 
 DCCTBEventBlock (DCCTBDataParser *parser, const uint32_t *buffer, uint32_t numbBytes, uint32_t wordsToEnd, uint32_t wordBufferOffset=0, uint32_t wordEventOffset=0)
 
void displayEvent (std::ostream &os=std::cout)
 
std::string eventErrorString ()
 
bool eventHasErrors ()
 
DCCTBSRPBlocksrpBlock ()
 
std::vector< DCCTBTCCBlock * > & tccBlocks ()
 
std::vector< DCCTBTowerBlock * > & towerBlocks ()
 
std::vector< DCCTBTowerBlock * > towerBlocksById (uint32_t towerId)
 
DCCTBTrailerBlocktrailerBlock ()
 
 ~DCCTBEventBlock () override
 
- 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  dccFields {
  PHYSICTRIGGER = 1, CALIBRATIONTRIGGER = 2, TESTTRIGGER = 3, TECHNICALTRIGGER = 4,
  CH_ENABLED = 0, CH_DISABLED = 1, CH_TIMEOUT = 2, CH_SUPPRESS = 7,
  SR_NREAD = 0, BOE = 0x5, DCCERROR_EMPTYEVENT = 0x1, TOWERHEADER_SIZE = 8,
  TRAILER_SIZE = 8
}
 

Protected Attributes

DCCTBTrailerBlockdccTrailerBlock_
 
bool emptyEvent
 
DCCTBSRPBlocksrpBlock_
 
std::vector< DCCTBTCCBlock * > tccBlocks_
 
std::vector< DCCTBTowerBlock * > towerBlocks_
 
uint32_t wordBufferOffset_
 
- 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 16 of file DCCEventBlock.h.

Member Enumeration Documentation

◆ dccFields

Enumerator
PHYSICTRIGGER 
CALIBRATIONTRIGGER 
TESTTRIGGER 
TECHNICALTRIGGER 
CH_ENABLED 
CH_DISABLED 
CH_TIMEOUT 
CH_SUPPRESS 
SR_NREAD 
BOE 
DCCERROR_EMPTYEVENT 
TOWERHEADER_SIZE 
TRAILER_SIZE 

Definition at line 42 of file DCCEventBlock.h.

42  {
43 
44  PHYSICTRIGGER = 1,
46  TESTTRIGGER = 3,
47  TECHNICALTRIGGER = 4,
48 
49  CH_ENABLED = 0,
50  CH_DISABLED = 1,
51  CH_TIMEOUT = 2,
52  CH_SUPPRESS = 7,
53 
54  SR_NREAD = 0,
55 
56  BOE = 0x5,
57 
58  DCCERROR_EMPTYEVENT = 0x1,
59 
60  TOWERHEADER_SIZE = 8,
61  TRAILER_SIZE = 8
62 
63  };

Constructor & Destructor Documentation

◆ DCCTBEventBlock()

DCCTBEventBlock::DCCTBEventBlock ( DCCTBDataParser parser,
const uint32_t *  buffer,
uint32_t  numbBytes,
uint32_t  wordsToEnd,
uint32_t  wordBufferOffset = 0,
uint32_t  wordEventOffset = 0 
)

Definition at line 15 of file DCCEventBlock.cc.

21  : DCCTBBlockPrototype(parser, "DCCHEADER", buffer, numbBytes, wordsToEnd),
22  dccTrailerBlock_(nullptr),
23  srpBlock_(nullptr),
24  wordBufferOffset_(wordBufferOffset) {
25  //Reset error counters ////
26  errors_["DCC::HEADER"] = 0;
27  errors_["DCC::EVENT LENGTH"] = 0;
29 
30  uint32_t wToEnd(0);
31 
32  try {
33  // Get data fields from the mapper and retrieve data ///
34  if (numbBytes == DCCTBDataParser::EMPTYEVENTSIZE) {
36  emptyEvent = true;
37  } else {
39  emptyEvent = false;
40  }
41 
42  try {
43  parseData();
44  } catch (ECALTBParserBlockException &e) { /*ignore*/
45  }
47 
48  // Check internal data //////////////
49  if (parser_->debug()) {
50  dataCheck();
51  }
53 
54  // Check if empty event was produced /////////////////////////////////////////////////////////////////
55 
56  if (!emptyEvent && getDataField("DCC ERRORS") != DCCERROR_EMPTYEVENT) {
57  // Build the SRP block ////////////////////////////////////////////////////////////////////////////////////
58 
59  bool srp(false);
60  uint32_t sr_ch = getDataField("SR_CHSTATUS");
61  if (sr_ch != CH_TIMEOUT && sr_ch != CH_DISABLED) {
62  //Go to the begining of the block
63  increment(1, " (while trying to create a SR Block !)");
64  wToEnd = numbBytes / 4 - wordCounter_ - 1;
65 
66  // Build SRP Block //////////////////////////////////////////////////////////////////////
69 
70  increment((parser_->srpBlockSize()) / 4 - 1);
71  if (getDataField("SR")) {
72  srp = true;
73  }
74  }
75 
77 
78  // Build TCC blocks ////////////////////////////////////////////////////////////////////////////////////////
79  for (uint32_t i = 1; i <= 4; i++) {
80  uint32_t tcc_ch = 0;
81  uint32_t tccId = 0;
82  if (i == 1) {
83  tccId = parser_->tcc1Id();
84  }
85  if (i == 2) {
86  tccId = parser_->tcc2Id();
87  }
88  if (i == 3) {
89  tccId = parser_->tcc3Id();
90  }
91  if (i == 4) {
92  tccId = parser_->tcc4Id();
93  }
94 
95  std::string tcc = std::string("TCC_CHSTATUS#") + parser_->getDecString(i);
96  tcc_ch = getDataField(tcc);
97 
98  if (tcc_ch != CH_TIMEOUT && tcc_ch != CH_DISABLED) {
99  //std::cout<<"\n debug:Building TCC Block, channel enabled without errors"<<std::endl;
100 
101  // Go to the begining of the block
102  increment(1, " (while trying to create a" + tcc + " Block !)");
103 
104  wToEnd = numbBytes / 4 - wordCounter_ - 1;
105  //wToEnd or wordsToEnd ????????????????????????????????????????
106 
107  // Build TCC Block /////////////////////////////////////////////////////////////////////////////////
108  tccBlocks_.push_back(
111 
112  increment((parser_->tccBlockSize()) / 4 - 1);
113  }
114  }
116 
117  // Build channel data //////////////////////////////////////////////////////////////////////////////////////////////////////
118  // See number of channels that we need according to the trigger type //
119  // TODO : WHEN IN LOCAL MODE WE SHOULD CHECK RUN TYPE
120  uint32_t triggerType = getDataField("TRIGGER TYPE");
121  uint32_t numbChannels;
122  if (triggerType == PHYSICTRIGGER) {
123  numbChannels = 68;
124  } else if (triggerType == CALIBRATIONTRIGGER) {
125  numbChannels = 70;
126  }
127  // TODO :: implement other triggers
128  else {
129  std::string error = std::string("\n DCC::HEADER TRIGGER TYPE = ") + parser_->getDecString(triggerType) +
130  std::string(" is not a valid type !");
132  throw a;
133  }
135 
136  // uint32_t chStatus;
137  uint32_t srFlag;
138  bool suppress(false);
139 
140  for (uint32_t i = 1; i <= numbChannels; i++) {
141  std::string chStatusId = std::string("FE_CHSTATUS#") + parser_->getDecString(i);
142  uint32_t chStatus = getDataField(chStatusId);
143 
144  // If srp is on, we need to check if channel was suppressed ////////////////////
145  if (srp) {
146  srFlag = srpBlock_->getDataField(std::string("SR#") + parser_->getDecString(i));
147  if (srFlag == SR_NREAD) {
148  suppress = true;
149  } else {
150  suppress = false;
151  }
152  }
154 
155  if (chStatus != CH_TIMEOUT && chStatus != CH_DISABLED && !suppress && chStatus != CH_SUPPRESS) {
156  //Go to the begining of the block ///////////////////////////////////////////////////////////////////////
157  increment(1, " (while trying to create a TOWERHEADER Block for channel " + parser_->getDecString(i) + " !)");
159 
160  // Instantiate a new tower block//////////////////////////////////////////////////////////////////////////
161  wToEnd = numbBytes / 4 - wordCounter_ - 1;
162  DCCTBTowerBlock *towerBlock =
164  towerBlocks_.push_back(towerBlock);
165  towerBlock->parseXtalData();
167 
168  //go to the end of the block ///////////////////////////////
169  increment((towerBlock->getDataField("BLOCK LENGTH")) * 2 - 1);
171  }
172  }
174 
175  // go to the begining of the block ////////////////////////////////////////////////////////////////////
176  increment(1, " (while trying to create a DCC TRAILER Block !)");
177  wToEnd = numbBytes / 4 - wordCounter_ - 1;
180  }
181 
182  } catch (ECALTBParserException &e) {
183  } catch (ECALTBParserBlockException &e) {
184  // uint32_t nEv = (parser_->dccEvents()).size() +1;
185  errorString_ += std::string(e.what());
186  blockError_ = true;
187  //std::cout<<"cout"<<e.what();
188  }
189 }

References a, DCCTBBlockPrototype::blockError_, DCCTBBlockPrototype::blockSize_, CALIBRATIONTRIGGER, CH_DISABLED, CH_SUPPRESS, CH_TIMEOUT, dataCheck(), DCCTBBlockPrototype::dataP_, DCCERROR_EMPTYEVENT, DCCTBDataMapper::dccFields(), dccTrailerBlock_, DCCTBDataParser::debug(), MillePedeFileConverter_cfg::e, emptyEvent, DCCTBDataMapper::emptyEventFields(), DCCTBDataParser::EMPTYEVENTSIZE, relativeConstraints::error, DCCTBBlockPrototype::errors_, DCCTBBlockPrototype::errorString_, DCCTBBlockPrototype::getDataField(), DCCTBDataParser::getDecString(), mps_fire::i, DCCTBBlockPrototype::increment(), DCCTBDataParser::mapper(), DCCTBBlockPrototype::mapperFields_, DCCTBBlockPrototype::parseData(), DCCTBBlockPrototype::parser_, DCCTBTowerBlock::parseXtalData(), PHYSICTRIGGER, SR_NREAD, srpBlock_, DCCTBDataParser::srpBlockSize(), AlCaHLTBitMon_QueryRunRegistry::string, suppress, DCCTBDataParser::tcc1Id(), DCCTBDataParser::tcc2Id(), DCCTBDataParser::tcc3Id(), DCCTBDataParser::tcc4Id(), tccBlocks_, DCCTBDataParser::tccBlockSize(), ecaldqm::tccId(), towerBlocks_, TOWERHEADER_SIZE, TRAILER_SIZE, HLT_FULL_cff::triggerType, and DCCTBBlockPrototype::wordCounter_.

◆ ~DCCTBEventBlock()

DCCTBEventBlock::~DCCTBEventBlock ( )
override

Definition at line 191 of file DCCEventBlock.cc.

191  {
192  std::vector<DCCTBTCCBlock *>::iterator it1;
193  for (it1 = tccBlocks_.begin(); it1 != tccBlocks_.end(); it1++) {
194  delete (*it1);
195  }
196  tccBlocks_.clear();
197 
198  std::vector<DCCTBTowerBlock *>::iterator it2;
199  for (it2 = towerBlocks_.begin(); it2 != towerBlocks_.end(); it2++) {
200  delete (*it2);
201  }
202  towerBlocks_.clear();
203 
204  if (srpBlock_ != nullptr) {
205  delete srpBlock_;
206  }
207  if (dccTrailerBlock_ != nullptr) {
208  delete dccTrailerBlock_;
209  }
210 }

References dccTrailerBlock_, srpBlock_, tccBlocks_, and towerBlocks_.

Member Function Documentation

◆ compare() [1/2]

std::pair< bool, std::string > DCCTBBlockPrototype::compare

Definition at line 233 of file DCCBlockPrototype.cc.

233  {
234  std::pair<bool, std::string> ret(true, "");
235 
236  std::set<DCCTBDataField *, DCCTBDataFieldComparator>::iterator it;
237  std::stringstream out;
238 
239  out << "\n ======================================================================";
240  out << "\n ORIGINAL BLOCK : ";
241  out << "\n Block name : " << name_ << ", size : " << std::dec << blockSize_
242  << " bytes, event WOffset : " << wordEventOffset_;
243  out << "\n COMPARISION BLOCK : ";
244  out << "\n Block name : " << (block->name()) << ", size : " << std::dec << (block->size())
245  << " bytes, event WOffset : " << (block->wOffset());
246  out << "\n =====================================================================";
247 
248  if (block->name() != name_) {
249  ret.first = false;
250  out << "\n ERROR >> It is not possible to compare blocks with different names ! ";
251  ret.second += out.str();
252  return ret;
253  }
254 
255  if (block->size() != blockSize_) {
256  ret.first = false;
257  out << "\n WARNING >> Blocks have different sizes "
258  << "\n WARNING >> Comparision will be carried on untill possible";
259  }
260 
261  if (block->wOffset() != wordEventOffset_) {
262  ret.first = false;
263  out << "\n WARNING >> Blocks have different word offset within the event ";
264  }
265 
266  std::string dataFieldName;
267 
268  for (it = mapperFields_->begin(); it != mapperFields_->end(); it++) {
269  dataFieldName = (*it)->name();
270 
271  uint32_t aValue, bValue;
272 
273  //Access original block data fields /////////////////////////////////////////////////////
274  try {
275  aValue = getDataField(dataFieldName);
276  }
277 
278  catch (ECALTBParserBlockException &e) {
279  ret.first = false;
280  out << "\n ERROR ON ORIGINAL BLOCK unable to get data field :" << dataFieldName;
281  out << "\n Comparision was stoped ! ";
282  ret.second += out.str();
283  return ret;
284  }
286 
287  //Access comparision block data fields ///////////////////////////////////////////////////////
288  try {
289  bValue = block->getDataField(dataFieldName);
290  } catch (ECALTBParserBlockException &e) {
291  ret.first = false;
292  out << "\n ERROR ON COMPARISION BLOCK unable to get data field :" << dataFieldName
293  << "\n Comparision was stoped ! ";
294  ret.second += out.str();
295  return ret;
296  }
298 
299  //std::cout<<"\n data Field name "<<dataFieldName<<std::endl;
300  //std::cout<<"\n aValue "<<std::dec<<aValue<<std::endl;
301  //std::cout<<"\n bValue "<<std::dec<<bValue<<std::endl;
302 
303  // Compare values
304  if (aValue != bValue) {
305  ret.first = false;
306  out << "\n Data Field : " << dataFieldName << "\n ORIGINAL BLOCK value : " << std::dec << std::setw(5) << aValue
307  << " , COMPARISION BLOCK value : " << std::dec << std::setw(5) << bValue;
308  //std::cout<<"\n debug... "<<out<<std::endl;
309  }
310  }
311  out << "\n ======================================================================\n";
312  ret.second = out.str();
313 
314  return ret;
315 }

◆ compare() [2/2]

std::pair< bool, std::string > DCCTBEventBlock::compare ( DCCTBEventBlock block)

Definition at line 307 of file DCCEventBlock.cc.

307  {
308  // DCC Header comparision ///////////////////////////////
309  std::pair<bool, std::string> ret(DCCTBBlockPrototype::compare(block));
311 
312  std::stringstream out;
313 
314  // Selective readout processor block comparision ////////////////////////////////////////////
315  if (srpBlock_ && block->srpBlock()) {
316  std::pair<bool, std::string> temp(srpBlock_->compare(block->srpBlock()));
317  ret.first = ret.first & temp.first;
318  out << temp.second;
319  } else if (!srpBlock_ && block->srpBlock()) {
320  ret.first = false;
321  out << "\n ====================================================================="
322  << "\n ERROR SR block identified in the ORIGINAL BLOCK ... "
323  << "\n ... but the block is not present in the COMPARISION BLOCK !"
324  << "\n =====================================================================";
325  } else if (srpBlock_ && !(block->srpBlock())) {
326  ret.first = false;
327  out << "\n ====================================================================="
328  << "\n ERROR SR block identified in the COMPARISION BLOCK ... "
329  << "\n ... but the block is not present in the ORIGINAL BLOCK !"
330  << "\n =====================================================================";
331  }
333 
334  // TCC Blocks comparision ////////////////////////////////////////////////////////
335  // check number of TCC blocks
336  int numbTccBlocks_a = tccBlocks_.size();
337  int numbTccBlocks_b = block->tccBlocks().size();
338 
339  if (numbTccBlocks_a != numbTccBlocks_b) {
340  ret.first = false;
341  out << "\n ====================================================================="
342  << "\n ERROR number of TCC blocks in the ORIGINAL BLOCK( =" << numbTccBlocks_a << " )"
343  << "\n and in the COMPARISION BLOCK( = " << numbTccBlocks_b << " is different !"
344  << "\n =====================================================================";
345  }
346 
347  std::vector<DCCTBTCCBlock *>::iterator it1Tcc = tccBlocks_.begin();
348  std::vector<DCCTBTCCBlock *>::iterator it1TccEnd = tccBlocks_.end();
349  std::vector<DCCTBTCCBlock *>::iterator it2Tcc = block->tccBlocks().begin();
350  std::vector<DCCTBTCCBlock *>::iterator it2TccEnd = block->tccBlocks().end();
351 
352  for (; it1Tcc != it1TccEnd && it2Tcc != it2TccEnd; it1Tcc++, it2Tcc++) {
353  std::pair<bool, std::string> temp((*it1Tcc)->compare(*it2Tcc));
354  ret.first = ret.first & temp.first;
355  out << temp.second;
356  }
358 
359  // FE Blocks comparision ////////////////////////////////////////////////////////
360  // check number of FE blocks
361  int numbTowerBlocks_a = towerBlocks_.size();
362  int numbTowerBlocks_b = block->towerBlocks().size();
363 
364  if (numbTowerBlocks_a != numbTowerBlocks_b) {
365  ret.first = false;
366  out << "\n ====================================================================="
367  << "\n ERROR number of Tower blocks in the ORIGINAL BLOCK( =" << numbTowerBlocks_a << " )"
368  << "\n and in the COMPARISION BLOCK( = " << numbTowerBlocks_b << " is different !"
369  << "\n =====================================================================";
370  }
371 
372  std::vector<DCCTBTowerBlock *>::iterator it1Tower = towerBlocks_.begin();
373  std::vector<DCCTBTowerBlock *>::iterator it1TowerEnd = towerBlocks_.end();
374  std::vector<DCCTBTowerBlock *>::iterator it2Tower = (block->towerBlocks()).begin();
375  std::vector<DCCTBTowerBlock *>::iterator it2TowerEnd = (block->towerBlocks()).end();
376 
377  for (; it1Tower != it1TowerEnd && it2Tower != it2TowerEnd; it1Tower++, it2Tower++) {
378  std::pair<bool, std::string> temp((*it1Tower)->compare(*it2Tower));
379  ret.first = ret.first & temp.first;
380  out << temp.second;
381 
382  // Xtal Block comparision ////////////////////////////
383  std::vector<DCCTBXtalBlock *> xtalBlocks1((*it1Tower)->xtalBlocks());
384  std::vector<DCCTBXtalBlock *> xtalBlocks2((*it2Tower)->xtalBlocks());
385  // check number of xtal blocks
386  int numbXtalBlocks_a = xtalBlocks1.size();
387  int numbXtalBlocks_b = xtalBlocks2.size();
388 
389  if (numbXtalBlocks_a != numbXtalBlocks_b) {
390  ret.first = false;
391  out << "\n ====================================================================="
392  << "\n ERROR number of Xtal blocks in this TOWER ORIGINAL BLOCK( =" << numbXtalBlocks_a << " )"
393  << "\n and in the TOWER COMPARISION BLOCK( = " << numbXtalBlocks_b << " is different !"
394  << "\n =====================================================================";
395  }
396 
397  std::vector<DCCTBXtalBlock *>::iterator it1Xtal = xtalBlocks1.begin();
398  std::vector<DCCTBXtalBlock *>::iterator it1XtalEnd = xtalBlocks1.end();
399  std::vector<DCCTBXtalBlock *>::iterator it2Xtal = xtalBlocks1.begin();
400  std::vector<DCCTBXtalBlock *>::iterator it2XtalEnd = xtalBlocks2.end();
401 
402  for (; it1Xtal != it1XtalEnd && it2Xtal != it2XtalEnd; it1Xtal++, it2Xtal++) {
403  std::pair<bool, std::string> temp((*it1Xtal)->compare(*it2Xtal));
404  ret.first = ret.first & temp.first;
405  out << temp.second;
406  }
407  }
408 
409  // Trailer block comparision ////////////////////////////////////////////
410  if (block->trailerBlock() && trailerBlock()) {
411  std::pair<bool, std::string> temp(trailerBlock()->compare(block->trailerBlock()));
412  ret.first = ret.first & temp.first;
413  out << temp.second;
414  }
415 
416  ret.second += out.str();
417 
418  return ret;
419 }

References groupFilesInBlocks::block, DCCTBBlockPrototype::compare(), mps_fire::end, MillePedeFileConverter_cfg::out, runTheMatrix::ret, srpBlock_, tccBlocks_, groupFilesInBlocks::temp, towerBlocks_, and trailerBlock().

◆ dataCheck()

void DCCTBEventBlock::dataCheck ( )

Definition at line 212 of file DCCEventBlock.cc.

212  {
213  std::string checkErrors("");
214 
215  // Check BOE field/////////////////////////////////////////////////////
216  std::pair<bool, std::string> res = checkDataField("BOE", BOE);
217  if (!res.first) {
218  checkErrors += res.second;
219  (errors_["DCC::HEADER"])++;
220  }
222 
223  // Check H Field //////////////////////////////////////////////////////
224  std::string hField = std::string("H");
225  res = checkDataField(hField, 1);
226  if (!res.first) {
227  checkErrors += res.second;
228  (errors_["DCC::HEADER"])++;
229  }
231 
232  // Check Headers //////////////////////////////////////////////////////////
233  uint32_t dccHeaderWords = 0;
234 
235  if (emptyEvent) {
236  dccHeaderWords = 2;
237  } else if (!emptyEvent) {
238  dccHeaderWords = 7;
239  }
240 
241  for (uint32_t i = 1; i <= dccHeaderWords; i++) {
244  if (!res.first) {
245  checkErrors += res.second;
246  (errors_["DCC::HEADER"])++;
247  }
248  }
250 
251  // Check event length ///////////////////////////////////////////////////////
252  res = checkDataField("EVENT LENGTH", blockSize_ / 8);
253  if (!res.first) {
254  checkErrors += res.second;
255  (errors_["DCC::EVENT LENGTH"])++;
256  }
258 
259  if (!checkErrors.empty()) {
260  errorString_ += "\n ======================================================================\n";
261  errorString_ += std::string(" ") + name_ + std::string(" data fields checks errors : ");
262  errorString_ += checkErrors;
263  errorString_ += "\n ======================================================================";
264  blockError_ = true;
265  }
266 }

References DCCTBBlockPrototype::blockError_, DCCTBBlockPrototype::blockSize_, BOE, DCCTBBlockPrototype::checkDataField(), emptyEvent, DCCTBBlockPrototype::errors_, DCCTBBlockPrototype::errorString_, DCCTBDataParser::getDecString(), RecoTauValidation_cfi::header, mps_fire::i, DCCTBBlockPrototype::name_, DCCTBBlockPrototype::parser_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by DCCTBEventBlock().

◆ displayEvent()

void DCCTBEventBlock::displayEvent ( std::ostream &  os = std::cout)

Definition at line 268 of file DCCEventBlock.cc.

268  {
269  os << "\n\n\n\n\n >>>>>>>>>>>>>>>>>>>> Event started at word position " << std::dec << wordBufferOffset_
270  << " <<<<<<<<<<<<<<<<<<<<" << std::endl;
271 
272  // Display DCC Header ///
273  displayData(os);
275 
276  // Display SRP Block Contents //////////////
277  if (srpBlock_) {
278  srpBlock_->displayData(os);
279  }
281 
282  // Display TCC Block Contents ///////////////////////////////
283  std::vector<DCCTBTCCBlock *>::iterator it1;
284  for (it1 = tccBlocks_.begin(); it1 != tccBlocks_.end(); it1++) {
285  (*it1)->displayData(os);
286  }
287 
288  // Display Towers Blocks /////////////////////////////////////
289  std::vector<DCCTBTowerBlock *>::iterator it2;
290  for (it2 = towerBlocks_.begin(); it2 != towerBlocks_.end(); it2++) {
291  (*it2)->displayData(os);
292 
293  // Display Xtal Data /////////////////////////////////////
294  std::vector<DCCTBXtalBlock *> &xtalBlocks = (*it2)->xtalBlocks();
295  std::vector<DCCTBXtalBlock *>::iterator it3;
296  for (it3 = xtalBlocks.begin(); it3 != xtalBlocks.end(); it3++) {
297  (*it3)->displayData(os);
298  }
299  }
300 
301  // Display Trailer Block Contents /////////////////////////
302  if (dccTrailerBlock_) {
304  }
305 }

References dccTrailerBlock_, TauDecayModes::dec, DCCTBBlockPrototype::displayData(), srpBlock_, tccBlocks_, towerBlocks_, and wordBufferOffset_.

◆ eventErrorString()

std::string DCCTBEventBlock::eventErrorString ( )

Definition at line 462 of file DCCEventBlock.cc.

462  {
463  std::string ret("");
464 
465  if (eventHasErrors()) {
466  ret += "\n ======================================================================\n";
467  ret += std::string(" Event Erros occurred for L1A ( decoded value ) = ");
468  ret += parser_->getDecString(getDataField("LV1"));
469  ret += "\n ======================================================================";
470 
471  ret += errorString();
472 
473  // TODO ::
474  // See if we have errors in the TCC Block Contents /////////////
475  std::vector<DCCTBTCCBlock *>::iterator it1;
476  for (it1 = tccBlocks_.begin(); it1 != tccBlocks_.end(); it1++) {
477  ret += (*it1)->errorString();
478  }
480  // See if we have errors in the SRP Block ////
481  if (srpBlock_) {
482  ret += srpBlock_->errorString();
483  }
485 
486  // See if we have errors in the Tower Blocks ///////////////////////////////////////////////////
487  std::vector<DCCTBTowerBlock *>::iterator it2;
488 
489  for (it2 = towerBlocks_.begin(); it2 != towerBlocks_.end(); it2++) {
490  ret += (*it2)->errorString();
491 
492  // See if we have errors in the Xtal Data /////////////////
493  std::vector<DCCTBXtalBlock *> &xtalBlocks = (*it2)->xtalBlocks();
494  std::vector<DCCTBXtalBlock *>::iterator it3;
495 
497  for (it3 = xtalBlocks.begin(); it3 != xtalBlocks.end(); it3++) {
498  temp += (*it3)->errorString();
499  }
500 
501  if (!temp.empty()) {
502  ret += "\n Fine grain data Errors found ...";
503  ret += "\n( Tower ID = " + parser_->getDecString((*it2)->getDataField("TT/SC ID"));
504  ret += ", LV1 = " + parser_->getDecString((*it2)->getDataField("LV1"));
505  ret += ", BX = " + parser_->getDecString((*it2)->getDataField("BX")) + " )";
506  ret += temp;
507  }
509  }
510 
511  // See if we have errors in the trailler ////////////////////
512  if (dccTrailerBlock_) {
514  }
516  }
517 
518  return ret;
519 }

References dccTrailerBlock_, DCCTBBlockPrototype::errorString(), eventHasErrors(), DCCTBBlockPrototype::getDataField(), DCCTBDataParser::getDecString(), DCCTBBlockPrototype::parser_, runTheMatrix::ret, srpBlock_, AlCaHLTBitMon_QueryRunRegistry::string, tccBlocks_, groupFilesInBlocks::temp, and towerBlocks_.

◆ eventHasErrors()

bool DCCTBEventBlock::eventHasErrors ( )

Definition at line 421 of file DCCEventBlock.cc.

421  {
422  bool ret(false);
423  ret = blockError();
424 
425  // See if we have errors in the TCC Block Contents ///////////////////////////////
426  std::vector<DCCTBTCCBlock *>::iterator it1;
427  for (it1 = tccBlocks_.begin(); it1 != tccBlocks_.end(); it1++) {
428  ret |= (*it1)->blockError();
429  }
431 
432  // See if we have errors in the SRP Block /////////
433  if (srpBlock_) {
434  ret |= srpBlock_->blockError();
435  }
437 
438  // See if we have errors in the Trigger Blocks ///////////////
439  std::vector<DCCTBTowerBlock *>::iterator it2;
440  for (it2 = towerBlocks_.begin(); it2 != towerBlocks_.end(); it2++) {
441  ret |= (*it2)->blockError();
442 
443  // See if we have errors in the Xtal Data /////////////////
444  std::vector<DCCTBXtalBlock *> &xtalBlocks = (*it2)->xtalBlocks();
445  std::vector<DCCTBXtalBlock *>::iterator it3;
446  for (it3 = xtalBlocks.begin(); it3 != xtalBlocks.end(); it3++) {
447  ret |= (*it3)->blockError();
448  }
450  }
452 
453  // See if we have errors in the trailler ///////////////////
454  if (dccTrailerBlock_) {
456  }
458 
459  return ret;
460 }

References DCCTBBlockPrototype::blockError(), dccTrailerBlock_, runTheMatrix::ret, srpBlock_, tccBlocks_, and towerBlocks_.

Referenced by eventErrorString().

◆ srpBlock()

DCCTBSRPBlock * DCCTBEventBlock::srpBlock ( )
inline

Definition at line 75 of file DCCEventBlock.h.

75 { return srpBlock_; }

References srpBlock_.

◆ tccBlocks()

std::vector< DCCTBTCCBlock * > & DCCTBEventBlock::tccBlocks ( )
inline

Definition at line 74 of file DCCEventBlock.h.

74 { return tccBlocks_; }

References tccBlocks_.

◆ towerBlocks()

std::vector< DCCTBTowerBlock * > & DCCTBEventBlock::towerBlocks ( )
inline

Definition at line 73 of file DCCEventBlock.h.

73 { return towerBlocks_; }

References towerBlocks_.

◆ towerBlocksById()

std::vector< DCCTBTowerBlock * > DCCTBEventBlock::towerBlocksById ( uint32_t  towerId)

Definition at line 521 of file DCCEventBlock.cc.

521  {
522  std::vector<DCCTBTowerBlock *> myVector;
523  std::vector<DCCTBTowerBlock *>::iterator it;
524 
525  for (it = towerBlocks_.begin(); it != towerBlocks_.end(); it++) {
526  try {
527  std::pair<bool, std::string> idCheck = (*it)->checkDataField("TT/SC ID", towerId);
528 
529  if (idCheck.first) {
530  myVector.push_back((*it));
531  }
532  } catch (ECALTBParserBlockException &e) { /*ignore*/
533  }
534  }
535 
536  return myVector;
537 }

References MillePedeFileConverter_cfg::e, towerBlocks_, and ecaldqm::towerId().

◆ trailerBlock()

DCCTBTrailerBlock * DCCTBEventBlock::trailerBlock ( )
inline

Definition at line 76 of file DCCEventBlock.h.

76 { return dccTrailerBlock_; }

References dccTrailerBlock_.

Referenced by compare().

Member Data Documentation

◆ dccTrailerBlock_

DCCTBTrailerBlock* DCCTBEventBlock::dccTrailerBlock_
protected

◆ emptyEvent

bool DCCTBEventBlock::emptyEvent
protected

Definition at line 70 of file DCCEventBlock.h.

Referenced by dataCheck(), and DCCTBEventBlock().

◆ srpBlock_

DCCTBSRPBlock* DCCTBEventBlock::srpBlock_
protected

◆ tccBlocks_

std::vector<DCCTBTCCBlock*> DCCTBEventBlock::tccBlocks_
protected

◆ towerBlocks_

std::vector<DCCTBTowerBlock*> DCCTBEventBlock::towerBlocks_
protected

◆ wordBufferOffset_

uint32_t DCCTBEventBlock::wordBufferOffset_
protected

Definition at line 69 of file DCCEventBlock.h.

Referenced by displayEvent().

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:367
DCCTBEventBlock::compare
std::pair< bool, std::string > compare(DCCTBEventBlock *)
Definition: DCCEventBlock.cc:307
DCCTBTCCBlock
Definition: DCCTCCBlock.h:23
DCCTBBlockPrototype::mapperFields_
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * mapperFields_
Definition: DCCBlockPrototype.h:86
DCCTBEventBlock::TESTTRIGGER
Definition: DCCEventBlock.h:46
ecaldqm::tccId
unsigned tccId(DetId const &)
Definition: EcalDQMCommonUtils.cc:56
mps_fire.i
i
Definition: mps_fire.py:428
DCCTBEventBlock::CH_ENABLED
Definition: DCCEventBlock.h:49
DCCTBDataParser::srpBlockSize
uint32_t srpBlockSize()
Definition: DCCDataParser.h:191
ECALTBParserException
Definition: ECALParserException.h:10
DCCTBEventBlock::eventHasErrors
bool eventHasErrors()
Definition: DCCEventBlock.cc:421
DCCTBBlockPrototype::blockError
bool blockError()
Definition: DCCBlockPrototype.h:56
DCCTBBlockPrototype::blockSize_
uint32_t blockSize_
Definition: DCCBlockPrototype.h:69
DCCTBDataMapper::dccFields
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * dccFields()
Definition: DCCDataMapper.h:104
DCCTBEventBlock::dataCheck
void dataCheck()
Definition: DCCEventBlock.cc:212
DCCTBDataMapper::emptyEventFields
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * emptyEventFields()
Definition: DCCDataMapper.h:105
DCCTBDataParser::EMPTYEVENTSIZE
Definition: DCCDataParser.h:133
writedatasetfile.parser
parser
Definition: writedatasetfile.py:7
DCCTBDataParser::tcc4Id
uint32_t tcc4Id()
Definition: DCCDataParser.h:184
DCCTBEventBlock::CH_DISABLED
Definition: DCCEventBlock.h:50
DCCTBBlockPrototype::checkDataField
virtual std::pair< bool, std::string > checkDataField(std::string name, uint32_t data)
Definition: DCCBlockPrototype.cc:173
DCCTBBlockPrototype::wordCounter_
uint32_t wordCounter_
Definition: DCCBlockPrototype.h:70
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
relativeConstraints.error
error
Definition: relativeConstraints.py:53
DCCTBDataParser::debug
bool debug()
Definition: DCCDataParser.h:194
DCCTBEventBlock::trailerBlock
DCCTBTrailerBlock * trailerBlock()
Definition: DCCEventBlock.h:76
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
DCCTBTowerBlock::parseXtalData
void parseXtalData()
Definition: DCCTowerBlock.cc:31
suppress
Definition: GenABIO.cc:168
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
DCCTBDataParser::tcc1Id
uint32_t tcc1Id()
Definition: DCCDataParser.h:181
DCCTBBlockPrototype::errors_
std::map< std::string, uint32_t > errors_
Definition: DCCBlockPrototype.h:84
DCCTBSRPBlock
Definition: DCCSRPBlock.h:19
DCCTBEventBlock::wordBufferOffset_
uint32_t wordBufferOffset_
Definition: DCCEventBlock.h:69
DCCTBBlockPrototype::parser_
DCCTBDataParser * parser_
Definition: DCCBlockPrototype.h:81
mps_fire.end
end
Definition: mps_fire.py:242
DCCTBBlockPrototype::increment
virtual void increment(uint32_t numb, std::string msg="")
Definition: DCCBlockPrototype.cc:113
DCCTBEventBlock::srpBlock_
DCCTBSRPBlock * srpBlock_
Definition: DCCEventBlock.h:68
DCCTBTowerBlock
Definition: DCCTowerBlock.h:19
DCCTBBlockPrototype::getDataField
virtual uint32_t getDataField(std::string name)
Definition: DCCBlockPrototype.cc:194
DCCTBDataParser::tcc2Id
uint32_t tcc2Id()
Definition: DCCDataParser.h:182
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DCCTBEventBlock::BOE
Definition: DCCEventBlock.h:56
DCCTBEventBlock::CH_SUPPRESS
Definition: DCCEventBlock.h:52
a
double a
Definition: hdecay.h:119
DCCTBBlockPrototype::parseData
virtual void parseData()
Definition: DCCBlockPrototype.cc:38
DCCTBEventBlock::TRAILER_SIZE
Definition: DCCEventBlock.h:61
DCCTBEventBlock::CH_TIMEOUT
Definition: DCCEventBlock.h:51
DCCTBEventBlock::SR_NREAD
Definition: DCCEventBlock.h:54
DCCTBBlockPrototype::displayData
virtual void displayData(std::ostream &os=std::cout)
Definition: DCCBlockPrototype.cc:146
DCCTBBlockPrototype::blockError_
bool blockError_
Definition: DCCBlockPrototype.h:74
DCCTBBlockPrototype::errorString
std::string & errorString()
Definition: DCCBlockPrototype.h:51
groupFilesInBlocks.block
block
Definition: groupFilesInBlocks.py:150
HLT_FULL_cff.triggerType
triggerType
Definition: HLT_FULL_cff.py:8822
DCCTBEventBlock::emptyEvent
bool emptyEvent
Definition: DCCEventBlock.h:70
res
Definition: Electron.h:6
DCCTBDataParser::tcc3Id
uint32_t tcc3Id()
Definition: DCCDataParser.h:183
DCCTBBlockPrototype::errorString_
std::string errorString_
Definition: DCCBlockPrototype.h:77
ecaldqm::towerId
unsigned towerId(DetId const &)
Definition: EcalDQMCommonUtils.cc:79
DCCTBDataParser::tccBlockSize
uint32_t tccBlockSize()
Definition: DCCDataParser.h:192
DCCTBBlockPrototype::dataP_
const uint32_t * dataP_
Definition: DCCBlockPrototype.h:66
DCCTBTrailerBlock
Definition: DCCTrailerBlock.h:10
DCCTBEventBlock::TECHNICALTRIGGER
Definition: DCCEventBlock.h:47
DCCTBEventBlock::dccTrailerBlock_
DCCTBTrailerBlock * dccTrailerBlock_
Definition: DCCEventBlock.h:67
DCCTBEventBlock::towerBlocks_
std::vector< DCCTBTowerBlock * > towerBlocks_
Definition: DCCEventBlock.h:65
DCCTBEventBlock::DCCERROR_EMPTYEVENT
Definition: DCCEventBlock.h:58
DCCTBEventBlock::tccBlocks_
std::vector< DCCTBTCCBlock * > tccBlocks_
Definition: DCCEventBlock.h:66
DCCTBEventBlock::PHYSICTRIGGER
Definition: DCCEventBlock.h:44
DCCTBDataParser::mapper
DCCTBDataMapper * mapper()
Definition: DCCDataParser.h:172
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:292
DCCTBBlockPrototype::name_
std::string name_
Definition: DCCBlockPrototype.h:76
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
DCCTBEventBlock::CALIBRATIONTRIGGER
Definition: DCCEventBlock.h:45
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
DCCTBBlockPrototype::wordEventOffset_
uint32_t wordEventOffset_
Definition: DCCBlockPrototype.h:71
DCCTBEventBlock::TOWERHEADER_SIZE
Definition: DCCEventBlock.h:60
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
DCCTBBlockPrototype::compare
virtual std::pair< bool, std::string > compare(DCCTBBlockPrototype *block)
Definition: DCCBlockPrototype.cc:233
ECALTBParserBlockException
Definition: ECALParserBlockException.h:10