Decode BS to RDO container.
286 uint32_t sizeReadOutFormatTracklet=0;
293 bool isHeaderOK =
true;
295 unsigned int vDataIndex;
296 for(vDataIndex=0; isHeaderOK; vDataIndex++){
301 if(rawdata_flag==0xFF)
break;
311 sizeReadOutFormatHit =
counter;
314 sizeReadOutFormatTracklet =
counter;
341 unsigned int tmpRodId = rodId + (subDetectorId==
CSIDE ?
NROD/2 : 0);
346 <<
"Corrupted data, Skip decoding of this ROD data"
347 <<
" TgcRODReadout : ROD ID= " << rodId
348 <<
" RawData Size= " << sizeRawData
351 <<
"ReadOut Hit Size= " << sizeReadOutFormatHit
352 <<
" ReadOut Tracklet= " << sizeReadOutFormatTracklet
353 <<
" ReadOut SL= " << sizeSectorLogicWord
354 <<
" vDataIndex = " << vDataIndex
355 <<
" HipT = " << sizeHipTWord
360 return StatusCode::SUCCESS;
365 <<
"TgcRODReadout : ROD ID=" << rodId
366 <<
" RawData Size=" << sizeRawData
367 <<
" ReadOut Hit Size= " << sizeReadOutFormatHit
368 <<
" ReadOut Tracklet= " << sizeReadOutFormatTracklet
369 <<
" ReadOut SL= " << sizeSectorLogicWord
373 uint32_t firstRawDataIndex=vDataIndex;
376 std::vector<TgcRawData *> vCh;
388 TgcSlbData* slb =
nullptr;
391 for(; vDataIndex < firstRawDataIndex+sizeRawData; ++vDataIndex){
394 <<
"Tgc BS Raw:" << vDataIndex
395 <<
": " << std::hex << vData[vDataIndex]
403 if((rawdata_flag == 0xff) || (rawdata_flag == 0xfc)){
410 rec_type = (vData[vDataIndex] & 0x18000000) >> 27;
413 <<
"Rec Type " << rec_type <<
" is not supproted "
414 <<
" Skip decoding of remaining hits of this event..."
416 return StatusCode::SUCCESS;
422 sswId = (vData[vDataIndex] & 0x0F0000) >> 16;
423 }
else if (rec_type ==1) {
425 sswId = (vData[vDataIndex] & 0x07800000) >> 23;
434 delete slb; slb =
nullptr;
437 fe_l1Id = (vData[vDataIndex] & 0x0000F000) >> 12;
438 fe_bcId = vData[vDataIndex] & 0x00000FFF;
439 slbId = (vData[vDataIndex] & 0x1F000000) >> 24;
443 mod = (vData[vDataIndex] & 0x00070000) >> 16;
444 rxId = (vData[vDataIndex] & 0x00F80000) >> 19;
445 }
else if (rec_type ==1) {
447 mod = (vData[vDataIndex] & 0x000E0000) >> 17;
450 if(fe_l1Id != l1Id) {
453 <<
"l1Id in SLB Header is different from l1Id in ROD "
454 <<
" for rodId:" << rodId
455 <<
" slbId:" << slbId
456 <<
" l1Id, bcId (SLB):" << fe_l1Id <<
", " << fe_bcId
457 <<
" l1Id, bcId (ROD):" << l1Id <<
", " <<
bcId
466 if(vData[vDataIndex] & 0x10000000){
469 b_error = vData[vDataIndex] & 0x0FFF;
474 rxId = (vData[vDataIndex] & 0x7C00000) >> 22;
487 slb =
new TgcSlbData(
bcId, l1Id, sswId, slbId);
489 if(!
setSbLoc(subDetectorId, rodId, slb, rxId) ){
490 unsigned int tmpRodId = rodId + (subDetectorId==
CSIDE ?
NROD/2 : 0);
495 <<
" Fail to set sbLoc"
496 <<
" :rodId=" << rodId
497 <<
" :sswId=" << sswId
498 <<
" :slbAddress= " << slbId
499 <<
" : rxId= " << rxId
502 <<
"Corrupted data, Skip decoding of remaining hits of this event..."
506 delete slb; slb =
nullptr;
507 return StatusCode::SUCCESS;
510 unsigned int tmpRodId = rodId + (subDetectorId==
CSIDE ?
NROD/2 : 0);
515 <<
" Fail to set Module Type"
516 <<
" :rodId=" << rodId
517 <<
" :sswId=" << sswId
518 <<
" :slbAddress= " << slbId
521 <<
"Corrupted data, Skip decoding of remaining hits of this event..."
525 delete slb; slb =
nullptr;
526 return StatusCode::SUCCESS;
529 slb->setError(b_error);
533 <<
"TgcRODReadout : slb =" << slb
534 <<
" : rodId=" << rodId
535 <<
" : sswId=" << sswId
536 <<
" : slbAddress= " << slbId
537 <<
" : rxId= "<< rxId
544 for(
int iHL=0; iHL<32; iHL+=16) {
545 uint32_t vd = vData[vDataIndex] << iHL;
556 slb->setError(vData[vDataIndex] & 0x0FFF);
562 unsigned long cellAddr = (vd & 0x1F000000) >> 24;
563 unsigned long cellBitMap = (vd & 0x00FF0000) >> 16;
567 slb->setBitmap(
bcTag, cellAddr, cellBitMap);
576 uint32_t error_context = (vData[vDataIndex] & 0x00FFFFFF);
577 uint16_t error_id = (vData[vDataIndex] & 0x01F000000)>>24;
578 if((t_debug && (error_context!=0))) {
580 <<
"TgcRODReadout : Error Report "
581 <<
" : error id =" << error_id
582 <<
" : context =" << error_context
595 delete slb; slb =
nullptr;
599 uint32_t firstROHitIndex=vDataIndex;
600 for(; vDataIndex < firstROHitIndex+sizeReadOutFormatHit; ++vDataIndex){
602 <<
"Tgc BS Readout HIT:" << vDataIndex
603 <<
": " << std::hex << vData[vDataIndex] <<
endmsg;
605 uint32_t firstROTrackletIndex=vDataIndex;
606 for(; vDataIndex < firstROTrackletIndex+sizeReadOutFormatTracklet; ++vDataIndex){
608 <<
"Tgc BS Readout HIT:" << vDataIndex
609 <<
": " << std::hex << vData[vDataIndex] <<
endmsg;
622 for(; ith!=ith_e; ++ith){
631 << n_vCh <<
"words of were recorded in TgcRdo container"
635 return StatusCode::SUCCESS;