37 std::set<DCCTBDataField *,DCCTBDataFieldComparator>::iterator it;
58 uint32_t
data =
getDataWord( (*it)->wordPosition() , (*it)->bitPosition(),(*it)->mask());
65 localString +=
"\n ======================================================================\n";
67 localString +=
"\n Word position inside block : " +
parser_->
getDecString( (*it)->wordPosition() );
70 localString +=
"\n Action -> Stop parsing this block !";
71 localString +=
"\n ======================================================================";
81 error += outputErrorString;
134 error +=
"\n Decoded fields untill error : ";
136 std::ostringstream
a;
142 outputErrorString = a.str();
143 error += outputErrorString;
156 std::set<DCCTBDataField *,DCCTBDataFieldComparator>::iterator it;
159 os <<
"\n ======================================================================\n";
161 long currentPosition(0),
position(-1);
166 dataFieldName = (*it)->name();
167 currentPosition = (*it)->wordPosition();
168 if( currentPosition != position ){
169 os <<
"\n W["<<std::setw(5)<<std::setfill(
'0')<<currentPosition<<
"]" ;
170 position = currentPosition;
175 os<<
"\n ======================================================================\n";
186 std::pair<bool,std::string>
res;
187 bool errorFound(
false);
189 if( parsedData != data){
199 res.first = !errorFound;
208 std::map<std::string,uint32_t>::iterator it =
dataFields_.find(name);
222 uint32_t stringSize = ret.size();
223 if( minPositions > stringSize ){
224 for(uint32_t
i=0;
i< minPositions-stringSize;
i++){ ret+=
" ";}
236 std::set<DCCTBDataField *,DCCTBDataFieldComparator>::iterator it;
237 bool fieldFound(
false);
239 if( ! ((*it)->name()).
compare(name) ){ fieldFound =
true; }
257 std::pair<bool,std::string> ret(
true,
"");
260 std::set<DCCTBDataField *,DCCTBDataFieldComparator>::iterator it;
261 std::stringstream
out;
265 out<<
"\n ======================================================================";
266 out<<
"\n ORIGINAL BLOCK : ";
268 out<<
"\n COMPARISION BLOCK : ";
269 out<<
"\n Block name : "<<(block->
name())<<
", size : "<<
std::dec<<(block->
size())<<
" bytes, event WOffset : "<<(block->
wOffset());
270 out<<
"\n =====================================================================";
275 out<<
"\n ERROR >> It is not possible to compare blocks with different names ! ";
276 ret.second += out.str();
282 out<<
"\n WARNING >> Blocks have different sizes " 283 <<
"\n WARNING >> Comparision will be carried on untill possible";
289 out<<
"\n WARNING >> Blocks have different word offset within the event ";
297 dataFieldName = (*it)->name();
299 uint32_t aValue, bValue;
306 out<<
"\n ERROR ON ORIGINAL BLOCK unable to get data field :"<<dataFieldName;
307 out<<
"\n Comparision was stoped ! ";
308 ret.second += out.str();
317 out<<
"\n ERROR ON COMPARISION BLOCK unable to get data field :"<<dataFieldName
318 <<
"\n Comparision was stoped ! ";
319 ret.second += out.str();
332 if( aValue != bValue ){
334 out<<
"\n Data Field : "<<dataFieldName
335 <<
"\n ORIGINAL BLOCK value : "<<
std::dec<<std::setw(5)<<aValue<<
" , COMPARISION BLOCK value : "<<
std::dec<<std::setw(5)<<bValue;
339 out<<
"\n ======================================================================\n";
340 ret.second = out.str();
virtual std::pair< bool, std::string > checkDataField(std::string name, uint32_t data)
virtual uint32_t getDataField(std::string name)
std::set< DCCTBDataField *, DCCTBDataFieldComparator > * mapperFields_
virtual void increment(uint32_t numb, std::string msg="")
DCCTBDataParser * parser_
std::map< std::string, uint32_t > dataFields_
std::string getDecString(uint32_t data)
virtual uint32_t getDataWord(uint32_t wordPosition, uint32_t bitPosition, uint32_t mask)
uint32_t wordEventOffset_
virtual void displayData(std::ostream &os=std::cout)
const uint32_t * beginOfBuffer_
uint32_t wordsToEndOfEvent_
char data[epos_bytes_allocation]
static int position[264][3]
DCCTBBlockPrototype(DCCTBDataParser *parser, std::string name, const uint32_t *buffer, uint32_t numbBytes, uint32_t wordsToEndOfEvent, uint32_t wordEventOffset=0)
virtual void seeIfIsPossibleToIncrement(uint32_t numb, std::string msg="")
virtual void setDataField(std::string name, uint32_t data)
virtual std::pair< bool, std::string > compare(DCCTBBlockPrototype *block)
std::string formatString(std::string myString, uint32_t minPositions)