CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/EventFilter/EcalTBRawToDigi/src/DCCTrailerBlock.cc

Go to the documentation of this file.
00001 #include "DCCTrailerBlock.h"
00002 #include "DCCDataParser.h"
00003 #include "DCCDataMapper.h"
00004 DCCTBTrailerBlock::DCCTBTrailerBlock(
00005         DCCTBDataParser * parser, 
00006         uint32_t * buffer, 
00007         uint32_t numbBytes,  
00008         uint32_t wToEnd,
00009         uint32_t wordEventOffset,
00010         uint32_t expectedLength,
00011         uint32_t expectedCRC
00012 ) : DCCTBBlockPrototype(parser,"DCCTRAILER", buffer, numbBytes,wToEnd, wordEventOffset),
00013 expectedLength_(expectedLength){
00014         
00015         errors_["TRAILER::EVENT LENGTH"] = 0 ;
00016         errors_["TRAILER::EOE"]    = 0 ; 
00017         errors_["TRAILER::CRC"]    = 0 ;
00018         errors_["TRAILER::T"]      = 0 ;
00019         
00020         // Get data fields from the mapper and retrieve data ///////////////////////////////////////////
00021         mapperFields_ = parser_->mapper()->trailerFields();
00022         parseData();
00024 
00025         // check internal data ////
00026         dataCheck();
00028 
00029 }
00030 
00031 
00032 void DCCTBTrailerBlock::dataCheck(){
00033         
00034         std::string checkErrors("");
00035         
00036         std::pair<bool,std::string> res;
00037         
00038         res = checkDataField("EVENT LENGTH",expectedLength_);
00039         if(!res.first){ checkErrors += res.second; (errors_["TRAILER::EVENT LENGTH"])++; }
00040         
00041         res = checkDataField("EOE",EOE);
00042         if(!res.first){ checkErrors += res.second; (errors_["TRAILER::EOE"])++; }
00043         
00044         res = checkDataField("T",0);
00045         if(!res.first){ checkErrors += res.second; (errors_["TRAILER::T"])++; }
00046         
00047         //checkErrors += checkDataField("CRC",expectedCRC_);
00048         
00049         if(checkErrors!=""){
00050                 errorString_ +="\n ======================================================================\n";           
00051                 errorString_ += std::string(" ") + name_ + std::string(" data fields checks errors : ") ;
00052                 errorString_ += checkErrors ;
00053                 errorString_ += "\n ======================================================================";
00054                 blockError_ = true;     
00055         }
00056 }
00057