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

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 17 of file DCCEventBlock.h.

Member Enumeration Documentation

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 48 of file DCCEventBlock.h.

Constructor & Destructor Documentation

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.

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, ECALTBParserBlockException::what(), and DCCTBBlockPrototype::wordCounter_.

22  :
23 DCCTBBlockPrototype(parser,"DCCHEADER", buffer, numbBytes,wordsToEnd)
24 ,dccTrailerBlock_(nullptr),srpBlock_(nullptr),wordBufferOffset_(wordBufferOffset) {
25 
26 
27  //Reset error counters ////
28  errors_["DCC::HEADER"] = 0;
29  errors_["DCC::EVENT LENGTH"] = 0;
31 
32  uint32_t wToEnd(0);
33 
34  try{
35 
36  // Get data fields from the mapper and retrieve data ///
37  if(numbBytes == DCCTBDataParser::EMPTYEVENTSIZE ){
39  emptyEvent = true;
40  }else{
42  emptyEvent = false;
43  }
44 
45  try{ parseData(); }
46  catch (ECALTBParserBlockException &e){/*ignore*/}
48 
49 
50 
51  // Check internal data //////////////
52  if(parser_->debug()){ dataCheck(); }
54 
55 
56  // Check if empty event was produced /////////////////////////////////////////////////////////////////
57 
58  if( !emptyEvent && getDataField("DCC ERRORS")!= DCCERROR_EMPTYEVENT ){
59 
60  // Build the SRP block ////////////////////////////////////////////////////////////////////////////////////
61 
62  bool srp(false);
63  uint32_t sr_ch = getDataField("SR_CHSTATUS");
64  if( sr_ch!=CH_TIMEOUT && sr_ch != CH_DISABLED ){
65 
66  //Go to the begining of the block
67  increment(1," (while trying to create a SR Block !)");
68  wToEnd = numbBytes/4-wordCounter_-1;
69 
70  // Build SRP Block //////////////////////////////////////////////////////////////////////
73 
74  increment((parser_->srpBlockSize())/4-1);
75  if(getDataField("SR")){ srp=true; }
76  }
77 
79 
80 
81  // Build TCC blocks ////////////////////////////////////////////////////////////////////////////////////////
82  for(uint32_t i=1; i<=4;i++){
83  uint32_t tcc_ch=0; uint32_t tccId=0;
84  if( i == 1){ tccId = parser_->tcc1Id();}
85  if( i == 2){ tccId = parser_->tcc2Id();}
86  if( i == 3){ tccId = parser_->tcc3Id();}
87  if( i == 4){ tccId = parser_->tcc4Id();}
88 
89  std::string tcc = std::string("TCC_CHSTATUS#") + parser_->getDecString(i);
90  tcc_ch = getDataField(tcc);
91 
92  if( tcc_ch != CH_TIMEOUT && tcc_ch != CH_DISABLED){
93 
94  //std::cout<<"\n debug:Building TCC Block, channel enabled without errors"<<std::endl;
95 
96  // Go to the begining of the block
97  increment(1," (while trying to create a"+tcc+" Block !)");
98 
99  wToEnd = numbBytes/4-wordCounter_-1;
100  //wToEnd or wordsToEnd ????????????????????????????????????????
101 
102 
103 
104  // Build TCC Block /////////////////////////////////////////////////////////////////////////////////
105  tccBlocks_.push_back( new DCCTBTCCBlock( this, parser_, dataP_,parser_->tccBlockSize(), wToEnd,wordCounter_, tccId));
107 
108  increment((parser_->tccBlockSize())/4-1);
109  }
110  }
112 
113 
114 
115  // Build channel data //////////////////////////////////////////////////////////////////////////////////////////////////////
116  // See number of channels that we need according to the trigger type //
117  // TODO : WHEN IN LOCAL MODE WE SHOULD CHECK RUN TYPE
118  uint32_t triggerType = getDataField("TRIGGER TYPE");
119  uint32_t numbChannels;
120  if( triggerType == PHYSICTRIGGER ) { numbChannels = 68; }
121  else if (triggerType == CALIBRATIONTRIGGER ){ numbChannels = 70; }
122  // TODO :: implement other triggers
123  else{
124  std::string error = std::string("\n DCC::HEADER TRIGGER TYPE = ")+parser_->getDecString(triggerType)+std::string(" is not a valid type !");
126  throw a;
127  }
129 
130 
131 
132 // uint32_t chStatus;
133  uint32_t srFlag;
134  bool suppress(false);
135 
136  for( uint32_t i=1; i<=numbChannels; i++){
137 
138  std::string chStatusId = std::string("FE_CHSTATUS#") + parser_->getDecString(i);
139  uint32_t chStatus = getDataField(chStatusId);
140 
141  // If srp is on, we need to check if channel was suppressed ////////////////////
142  if(srp){
143  srFlag = srpBlock_->getDataField( std::string("SR#") + parser_->getDecString(i));
144  if(srFlag == SR_NREAD){ suppress = true; }
145  else{ suppress = false; }
146  }
148 
149 
150  if( chStatus != CH_TIMEOUT && chStatus != CH_DISABLED && !suppress && chStatus !=CH_SUPPRESS){
151 
152 
153  //Go to the begining of the block ///////////////////////////////////////////////////////////////////////
154  increment(1," (while trying to create a TOWERHEADER Block for channel "+parser_->getDecString(i)+" !)" );
156 
157 
158  // Instantiate a new tower block//////////////////////////////////////////////////////////////////////////
159  wToEnd = numbBytes/4-wordCounter_-1;
161  towerBlocks_.push_back (towerBlock);
162  towerBlock->parseXtalData();
164 
165 
166  //go to the end of the block ///////////////////////////////
167  increment((towerBlock->getDataField("BLOCK LENGTH"))*2 - 1);
169 
170  }
171  }
173 
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 
183  }catch( ECALTBParserException & e){}
184  catch( ECALTBParserBlockException & e){
185  // uint32_t nEv = (parser_->dccEvents()).size() +1;
186  errorString_ += std::string(e.what());
187  blockError_=true;
188  //std::cout<<"cout"<<e.what();
189  }
190 
191 
192 
193 }
uint32_t tcc3Id()
virtual uint32_t getDataField(std::string name)
uint32_t tccBlockSize()
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * mapperFields_
virtual void increment(uint32_t numb, std::string msg="")
const uint32_t * dataP_
virtual void parseData()
std::vector< DCCTBTCCBlock * > tccBlocks_
Definition: DCCEventBlock.h:74
DCCTBDataParser * parser_
unsigned tccId(DetId const &)
std::string getDecString(uint32_t data)
uint32_t srpBlockSize()
uint32_t tcc2Id()
DCCTBDataMapper * mapper()
std::map< std::string, uint32_t > errors_
uint32_t tcc1Id()
std::vector< DCCTBTowerBlock * > towerBlocks_
Definition: DCCEventBlock.h:73
double a
Definition: hdecay.h:121
DCCTBBlockPrototype(DCCTBDataParser *parser, std::string name, const uint32_t *buffer, uint32_t numbBytes, uint32_t wordsToEndOfEvent, uint32_t wordEventOffset=0)
DCCTBTrailerBlock * dccTrailerBlock_
Definition: DCCEventBlock.h:75
DCCTBSRPBlock * srpBlock_
Definition: DCCEventBlock.h:76
uint32_t tcc4Id()
uint32_t wordBufferOffset_
Definition: DCCEventBlock.h:77
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * emptyEventFields()
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * dccFields()
DCCTBEventBlock::~DCCTBEventBlock ( )
override

Definition at line 197 of file DCCEventBlock.cc.

References dccTrailerBlock_, srpBlock_, tccBlocks_, and towerBlocks_.

197  {
198 
199  std::vector<DCCTBTCCBlock *>::iterator it1;
200  for(it1=tccBlocks_.begin();it1!=tccBlocks_.end();it1++){ delete (*it1);}
201  tccBlocks_.clear();
202 
203  std::vector<DCCTBTowerBlock *>::iterator it2;
204  for(it2=towerBlocks_.begin();it2!=towerBlocks_.end();it2++){ delete (*it2);}
205  towerBlocks_.clear();
206 
207  if(srpBlock_ != nullptr ) { delete srpBlock_; }
208  if(dccTrailerBlock_ != nullptr ) { delete dccTrailerBlock_;}
209 
210 }
std::vector< DCCTBTCCBlock * > tccBlocks_
Definition: DCCEventBlock.h:74
std::vector< DCCTBTowerBlock * > towerBlocks_
Definition: DCCEventBlock.h:73
DCCTBTrailerBlock * dccTrailerBlock_
Definition: DCCEventBlock.h:75
DCCTBSRPBlock * srpBlock_
Definition: DCCEventBlock.h:76

Member Function Documentation

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

Definition at line 307 of file DCCEventBlock.cc.

References begin, DCCTBBlockPrototype::compare(), end, MillePedeFileConverter_cfg::out, srpBlock(), srpBlock_, tccBlocks(), tccBlocks_, groupFilesInBlocks::temp, towerBlocks(), towerBlocks_, and trailerBlock().

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

Definition at line 214 of file DCCEventBlock.cc.

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

214  {
215 
216 
217  std::string checkErrors("");
218 
219 
220  // Check BOE field/////////////////////////////////////////////////////
221  std::pair<bool,std::string> res = checkDataField("BOE",BOE);
222  if(!res.first){ checkErrors += res.second; (errors_["DCC::HEADER"])++; }
224 
225 
226  // Check H Field //////////////////////////////////////////////////////
227  std::string hField= std::string("H");
228  res = checkDataField(hField,1);
229  if(!res.first){ checkErrors += res.second; (errors_["DCC::HEADER"])++; }
231 
232 
233  // Check Headers //////////////////////////////////////////////////////////
234  uint32_t dccHeaderWords = 0;
235 
236  if(emptyEvent){ dccHeaderWords = 2;}
237  else if(!emptyEvent){ dccHeaderWords = 7;}
238 
239  for(uint32_t i = 1; i<=dccHeaderWords ; i++){
240 
242  res = checkDataField(header,i);
243  if(!res.first){ checkErrors += res.second; (errors_["DCC::HEADER"])++; }
244  }
246 
247 
248  // Check event length ///////////////////////////////////////////////////////
249  res = checkDataField("EVENT LENGTH",blockSize_/8);
250  if(!res.first){ checkErrors += res.second; (errors_["DCC::EVENT LENGTH"])++; }
252 
253 
254  if(checkErrors!=""){
255  errorString_ +="\n ======================================================================\n";
256  errorString_ += std::string(" ") + name_ + std::string(" data fields checks errors : ") ;
257  errorString_ += checkErrors ;
258  errorString_ += "\n ======================================================================";
259  blockError_ = true;
260  }
261 
262 
263 }
virtual std::pair< bool, std::string > checkDataField(std::string name, uint32_t data)
DCCTBDataParser * parser_
std::string getDecString(uint32_t data)
Definition: Electron.h:6
std::map< std::string, uint32_t > errors_
void DCCTBEventBlock::displayEvent ( std::ostream &  os = std::cout)

Definition at line 267 of file DCCEventBlock.cc.

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

267  {
268 
269  os << "\n\n\n\n\n >>>>>>>>>>>>>>>>>>>> Event started at word position " << std::dec << wordBufferOffset_ <<" <<<<<<<<<<<<<<<<<<<<"<<std::endl;
270 
271  // Display DCC Header ///
272  displayData(os);
274 
275 
276  // Display SRP Block Contents //////////////
277  if(srpBlock_){ srpBlock_->displayData(os);}
279 
280 
281  // Display TCC Block Contents ///////////////////////////////
282  std::vector<DCCTBTCCBlock *>::iterator it1;
283  for( it1 = tccBlocks_.begin(); it1!= tccBlocks_.end(); it1++){
284  (*it1)->displayData(os);
285  }
286 
287  // Display Towers Blocks /////////////////////////////////////
288  std::vector<DCCTBTowerBlock *>::iterator it2;
289  for(it2 = towerBlocks_.begin();it2!=towerBlocks_.end();it2++){
290 
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 /////////////////////////
303 
304 }
std::vector< DCCTBTCCBlock * > tccBlocks_
Definition: DCCEventBlock.h:74
virtual void displayData(std::ostream &os=std::cout)
std::vector< DCCTBTowerBlock * > towerBlocks_
Definition: DCCEventBlock.h:73
DCCTBTrailerBlock * dccTrailerBlock_
Definition: DCCEventBlock.h:75
DCCTBSRPBlock * srpBlock_
Definition: DCCEventBlock.h:76
uint32_t wordBufferOffset_
Definition: DCCEventBlock.h:77
std::string DCCTBEventBlock::eventErrorString ( )

Definition at line 481 of file DCCEventBlock.cc.

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

481  {
482 
483  std::string ret("");
484 
485  if( eventHasErrors() ){
486 
487 
488  ret +="\n ======================================================================\n";
489  ret += std::string(" Event Erros occurred for L1A ( decoded value ) = ") ;
490  ret += parser_->getDecString(getDataField("LV1"));
491  ret += "\n ======================================================================";
492 
493 
494  ret += errorString();
495 
496  // TODO ::
497  // See if we have errors in the TCC Block Contents /////////////
498  std::vector<DCCTBTCCBlock *>::iterator it1;
499  for( it1 = tccBlocks_.begin(); it1!= tccBlocks_.end(); it1++){
500  ret += (*it1)->errorString();
501  }
503  // See if we have errors in the SRP Block ////
504  if(srpBlock_){ ret += srpBlock_->errorString(); }
506 
507 
508  // See if we have errors in the Tower Blocks ///////////////////////////////////////////////////
509  std::vector<DCCTBTowerBlock *>::iterator it2;
510 
511  for(it2 = towerBlocks_.begin();it2!=towerBlocks_.end();it2++){
512 
513  ret += (*it2)->errorString();
514 
515  // See if we have errors in the Xtal Data /////////////////
516  std::vector<DCCTBXtalBlock * > & xtalBlocks = (*it2)->xtalBlocks();
517  std::vector<DCCTBXtalBlock * >::iterator it3;
518 
519 
521  for(it3 = xtalBlocks.begin();it3!=xtalBlocks.end();it3++){ temp += (*it3)->errorString();}
522 
523  if(temp!=""){
524  ret += "\n Fine grain data Errors found ...";
525  ret += "\n( Tower ID = " + parser_->getDecString( (*it2)->getDataField("TT/SC ID"));
526  ret += ", LV1 = " + parser_->getDecString( (*it2)->getDataField("LV1"));
527  ret += ", BX = " + parser_->getDecString( (*it2)->getDataField("BX")) + " )";
528  ret += temp;
529  }
531 
532  }
533 
534 
535  // See if we have errors in the trailler ////////////////////
538 
539  }
540 
541  return ret;
542 
543 }
virtual uint32_t getDataField(std::string name)
std::vector< DCCTBTCCBlock * > tccBlocks_
Definition: DCCEventBlock.h:74
DCCTBDataParser * parser_
std::string getDecString(uint32_t data)
std::vector< DCCTBTowerBlock * > towerBlocks_
Definition: DCCEventBlock.h:73
DCCTBTrailerBlock * dccTrailerBlock_
Definition: DCCEventBlock.h:75
DCCTBSRPBlock * srpBlock_
Definition: DCCEventBlock.h:76
std::string & errorString()
bool DCCTBEventBlock::eventHasErrors ( )

Definition at line 436 of file DCCEventBlock.cc.

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

Referenced by eventErrorString().

436  {
437 
438  bool ret(false);
439  ret = blockError() ;
440 
441 
442  // See if we have errors in the TCC Block Contents ///////////////////////////////
443  std::vector<DCCTBTCCBlock *>::iterator it1;
444  for( it1 = tccBlocks_.begin(); it1!= tccBlocks_.end(); it1++){
445  ret |= (*it1)->blockError();
446  }
448 
449  // See if we have errors in the SRP Block /////////
450  if(srpBlock_){ ret |= srpBlock_->blockError(); }
452 
453 
454  // See if we have errors in the Trigger Blocks ///////////////
455  std::vector<DCCTBTowerBlock *>::iterator it2;
456  for(it2 = towerBlocks_.begin();it2!=towerBlocks_.end();it2++){
457 
458  ret |= (*it2)->blockError();
459 
460  // See if we have errors in the Xtal Data /////////////////
461  std::vector<DCCTBXtalBlock * > & xtalBlocks = (*it2)->xtalBlocks();
462  std::vector<DCCTBXtalBlock * >::iterator it3;
463  for(it3 = xtalBlocks.begin();it3!=xtalBlocks.end();it3++){
464  ret |= (*it3)->blockError();
465  }
467  }
469 
470 
471  // See if we have errors in the trailler ///////////////////
474 
475 
476  return ret;
477 
478 }
std::vector< DCCTBTCCBlock * > tccBlocks_
Definition: DCCEventBlock.h:74
std::vector< DCCTBTowerBlock * > towerBlocks_
Definition: DCCEventBlock.h:73
DCCTBTrailerBlock * dccTrailerBlock_
Definition: DCCEventBlock.h:75
DCCTBSRPBlock * srpBlock_
Definition: DCCEventBlock.h:76
DCCTBSRPBlock * DCCTBEventBlock::srpBlock ( )
inline

Definition at line 84 of file DCCEventBlock.h.

References srpBlock_.

Referenced by compare().

84 { return srpBlock_; }
DCCTBSRPBlock * srpBlock_
Definition: DCCEventBlock.h:76
std::vector< DCCTBTCCBlock * > & DCCTBEventBlock::tccBlocks ( )
inline

Definition at line 83 of file DCCEventBlock.h.

References tccBlocks_.

Referenced by compare().

83 { return tccBlocks_; }
std::vector< DCCTBTCCBlock * > tccBlocks_
Definition: DCCEventBlock.h:74
std::vector< DCCTBTowerBlock * > & DCCTBEventBlock::towerBlocks ( )
inline

Definition at line 82 of file DCCEventBlock.h.

References towerBlocks_.

Referenced by compare().

82 { return towerBlocks_; }
std::vector< DCCTBTowerBlock * > towerBlocks_
Definition: DCCEventBlock.h:73
std::vector< DCCTBTowerBlock * > DCCTBEventBlock::towerBlocksById ( uint32_t  towerId)

Definition at line 548 of file DCCEventBlock.cc.

References MillePedeFileConverter_cfg::e, and towerBlocks_.

548  {
549  std::vector<DCCTBTowerBlock *> myVector;
550  std::vector<DCCTBTowerBlock *>::iterator it;
551 
552  for( it = towerBlocks_.begin(); it!= towerBlocks_.end(); it++ ){
553  try{
554 
555  std::pair<bool,std::string> idCheck = (*it)->checkDataField("TT/SC ID",towerId);
556 
557  if(idCheck.first ){ myVector.push_back( (*it) ); }
558  }catch (ECALTBParserBlockException &e){/*ignore*/}
559  }
560 
561  return myVector;
562 }
l1t::HGCalTowerID towerId
Definition: classes.h:34
std::vector< DCCTBTowerBlock * > towerBlocks_
Definition: DCCEventBlock.h:73
DCCTBTrailerBlock * DCCTBEventBlock::trailerBlock ( )
inline

Definition at line 85 of file DCCEventBlock.h.

References dccTrailerBlock_.

Referenced by compare().

85 { return dccTrailerBlock_; }
DCCTBTrailerBlock * dccTrailerBlock_
Definition: DCCEventBlock.h:75

Member Data Documentation

DCCTBTrailerBlock* DCCTBEventBlock::dccTrailerBlock_
protected
bool DCCTBEventBlock::emptyEvent
protected

Definition at line 78 of file DCCEventBlock.h.

Referenced by dataCheck(), and DCCTBEventBlock().

DCCTBSRPBlock* DCCTBEventBlock::srpBlock_
protected
std::vector< DCCTBTCCBlock * > DCCTBEventBlock::tccBlocks_
protected
std::vector< DCCTBTowerBlock * > DCCTBEventBlock::towerBlocks_
protected
uint32_t DCCTBEventBlock::wordBufferOffset_
protected

Definition at line 77 of file DCCEventBlock.h.

Referenced by displayEvent().