|
ATLAS Offline Software
|
#include <TGC_RodDecoderRawdata.h>
A tool to decode a TGC ROB fragment written in the raw data format into TGC RDO.
- Author
- Susumu Oda Susum.nosp@m.u.Od.nosp@m.a@cer.nosp@m.n.ch
-
Hisaya Kurashige
This class was originally developed by Tadashi Maeno based on RpcROD_Decoder written by Ketevi A. Assamagan. Hisaya Kurashige removed TGC ROD Encoder from this and updated decodeRodToRdo in January 2008. Takashi Kubota migrated to MuonTGC_CnvTools package in July 2008. The previous class name was TgcROD_Decoder.
Definition at line 31 of file TGC_RodDecoderRawdata.h.
◆ TGC_RodDecoderRawdata()
Muon::TGC_RodDecoderRawdata::TGC_RodDecoderRawdata |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~TGC_RodDecoderRawdata()
Muon::TGC_RodDecoderRawdata::~TGC_RodDecoderRawdata |
( |
| ) |
|
|
virtualdefault |
◆ byteStream2Rdo()
Convert data contents of ROBFragment to RDO The same byteStream2Rdo method in TGC_RodDecoderReadout is used for checking conversion validation.
Definition at line 159 of file TGC_RodDecoderRawdata.cxx.
171 ATH_MSG_DEBUG(
"Error: input TgcRdo id does not match bytestream id" );
178 {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {0, 8}, {0, 9}
183 for(
int iCnt = 0; iCnt < 7; iCnt++)
186 if(
counter.id == counters[iCnt].id)
194 for(
int iCnt = 0; iCnt < 7; iCnt++)
196 if(counters[iCnt].
count == 0)
198 switch(counters[iCnt].
id)
203 " " << counters[iCnt].
count <<
"words" );
204 for(
unsigned iFrag = 0; iFrag < counters[iCnt].
count; iFrag++)
214 " " << counters[iCnt].
count <<
"words" );
217 for(
unsigned iFrag = 0; iFrag < counters[iCnt].
count; iFrag++)
223 <<
" rdo.rodId():" <<rdo.
rodId()
224 <<
" roh.ldbId:" <<roh.
ldbId
225 <<
" roh.sbId:" <<roh.
sbId
226 <<
" rdo.l1Id():"<<rdo.
l1Id()
227 <<
" rdo.bcId():"<<rdo.
bcId() );
239 else slbId = (roh.
sbId-8)*2+1;
273 " " << counters[iCnt].
count <<
"words" );
276 for(
unsigned iFrag = 0; iFrag < counters[iCnt].
count; iFrag++)
334 " " << counters[iCnt].
count <<
"words" );
337 for(
unsigned iFrag = 0; iFrag < counters[iCnt].
count; iFrag++)
385 " " << counters[iCnt].
count <<
"words" );
387 for(
unsigned iFrag = 0; iFrag < counters[iCnt].
count; iFrag++)
398 static_cast<bool>(sl.
fwd),
411 ATH_MSG_VERBOSE(
"Error: Muon::TGC_RodDecoder::byteStream2Rdo Unsupported fragment type "
412 << counters[iCnt].
id);
◆ fillCollection()
Convert ROBFragment to RDO.
Definition at line 62 of file TGC_RodDecoderRawdata.cxx.
69 return StatusCode::SUCCESS;
72 uint32_t source_id = robFrag.rod_source_id();
73 SourceIdentifier sid(robFrag.rod_source_id());
78 int idHash = rdoIdHash(rdoId);
87 ATH_MSG_WARNING(
"Pointer of RDO is NULL. Skip decoding of this ROD in this event..." );
88 return StatusCode::SUCCESS;
94 ATH_MSG_WARNING(
" Can't Check the contents of TgcRdo: Skip decoding of remaining hits of this event..." );
95 return StatusCode::SUCCESS;
99 ATH_MSG_WARNING(
" Can't Convert the TGC BS to Rdo: Skip decoding of remaining hits of this event..." );
100 return StatusCode::SUCCESS;
107 <<
"already found into the container; do not convert" );
110 return StatusCode::SUCCESS;
◆ finalize()
StatusCode Muon::TGC_RodDecoderRawdata::finalize |
( |
| ) |
|
|
overridevirtual |
◆ getCollection()
Retrieve header of ROBFragment.
Definition at line 115 of file TGC_RodDecoderRawdata.cxx.
117 TgcRdo* theColl =
nullptr;
119 uint32_t source_id = robFrag.rod_source_id();
120 SourceIdentifier sid(source_id);
124 int idHash = rdoIdHash(rdoId);
126 ATH_MSG_DEBUG(
" Created new Collection ID = " << sid.human() <<
" Hash = " << idHash );
129 theColl =
new TgcRdo(rdoId, idHash);
134 delete theColl; theColl =
nullptr;
137 theColl->
setL1Id(robFrag.rod_lvl1_id());
138 theColl->
setBcId(robFrag.rod_bc_id());
140 theColl->
setOnlineId(sid.subdetector_id(), sid.module_id());
142 uint32_t nstatus = robFrag.rod_nstatus();
144 robFrag.rod_status(
status);
◆ initialize()
StatusCode Muon::TGC_RodDecoderRawdata::initialize |
( |
| ) |
|
|
overridevirtual |
◆ showStatusWords()
void Muon::TGC_RodDecoderRawdata::showStatusWords |
( |
const uint32_t |
source_id, |
|
|
const uint16_t |
rdoId, |
|
|
const int |
idHash, |
|
|
const uint32_t |
nstatus, |
|
|
const uint32_t * |
status |
|
) |
| const |
|
private |
Show status words.
Definition at line 421 of file TGC_RodDecoderRawdata.cxx.
423 static const unsigned int maxNStatus = 5;
424 static const std::string statusDataWord[maxNStatus] = {
425 "First status word specific|generic:",
426 "TGC ROD event status :",
427 "ROD VME fileter bits | SSW timeout:",
428 "Local status word | presence :",
432 static const unsigned int maxFirstStatus = 5;
433 static const std::string firstStatus[maxFirstStatus] = {
436 "Timeout occurred in at least one of the FE links. Fragment is incomplete.",
437 "Data may be incorrect, see TGC ROD event status word",
438 "An overflow in one of the ROD internal buffers has occurred. The fragment is incomplete."
441 static const unsigned int maxTgcRodEventStatus = 31;
442 static const std::string tgcRodEventStatus[maxTgcRodEventStatus] = {
443 "EC_RXsend : Error in request to send an event via RXlink",
444 "EC_FELdown : A Front End link has gone down - abandoned",
445 "EC_frame : Invalid FE link framing words",
446 "EC_Glnk : Front End link G-link error",
447 "EC_xor : Invalid XOR event checksum",
448 "EC_ovfl : Input FE event is too long or FE FIFO overflow",
449 "EC_timeout : Timeout expired for at least one FE link",
450 "EC_xormezz : Bad XOR checksum from mezz board",
451 "EC_wc0 : Event has WC=0 or WX>max WC",
452 "EC_L1ID : L1ID mismatch (TTC EVID FIFO vs local).",
453 "EC_nohdr : First word is not header",
454 "EC_rectype : Unrecognized record type",
455 "EC_null : Unexpected nulls in FE input",
456 "EC_order : Word is out of order",
457 "EC_LDB : Invalid or unexpected Star Switch ID",
458 "EC_RXovfl : RXfifo has overflowed",
459 "EC_SSWerr : SSW reports T1C, NRC, T2C, or GlinkNoLock error",
460 "EC_sbid : SBid does not match SBinfo table",
461 "EC_SBtype : SBtype does not match SBinfo table",
462 "EC_duprx : RX ID is duplicated in the event",
463 "EC_ec4 : Unexpected SB L1 Event ID(lo 4)",
464 "EC_bc : Unexpected SB BCID",
465 "EC_celladr : Invalid cell address",
466 "EC_hitovfl : Too many hits in event",
467 "EC_trgbit : Unexpected trigger bits",
468 "EC_badEoE : Bad End-of-event marker received, not 0xFCA",
469 "EC_endWCnot0 : WC not 0 after End-of-event marker",
470 "EC_noEoE : No End-of-event marker received",
471 "EC_SLGlink : Sector Logic reports G-Link error",
472 "EC_SLbc : Sector Logic BCID[2:0] does not match its SB BCID",
473 "EC_unxrxid : Data from disabled SSW RX ID"
476 static const unsigned int maxSSWs = 12;
478 static const unsigned int maxPresence = 10;
479 static const std::string presence[maxPresence] = {
482 "hits in readout fmt",
483 "tracklets in readout fmt",
484 "hits in chamber fmt",
485 "tracklets in chamber fmt",
492 static const unsigned int maxLocalStatus = 16;
493 static const std::string localStatus[maxLocalStatus] = {
494 "hit BCs are merged",
495 "tracklet BCs are merged",
497 "tracklets are sorted",
508 "ROI in this fragment",
509 "no L1AID, BCID check wrt ROD"
513 <<
"source_id=0x" << source_id <<
", "
514 <<
"rdoId=0x" << rdoId << (rdoId<16 ?
" , " :
", ")
515 <<
"idHash=0x" << idHash << (idHash<16 ?
" , " :
", ")
516 << (idHash<12 ?
"A" :
"C") << (idHash%12+1<10 ?
"0" :
"") << std::dec << idHash%12+1
518 ATH_MSG_INFO(
"***** Based on http://cern.ch/atlas-tgc/doc/ROBformat.pdf ****************************");
525 for(
unsigned int j=0; j<maxFirstStatus; j++) {
527 ATH_MSG_INFO(std::dec << std::setw(3) << j <<
" : " << firstStatus[j]);
532 for(
unsigned int j=0; j<maxTgcRodEventStatus; j++) {
534 ATH_MSG_INFO(std::dec << std::setw(3) << j <<
" : " << tgcRodEventStatus[j]);
539 for(
unsigned int j=0; j<maxSSWs; j++) {
541 ATH_MSG_INFO(std::dec << std::setw(3) << j <<
" : " <<
"time-out for SSW" << j);
544 for(
unsigned int j=0+16; j<=maxSSWs+16; j++) {
546 ATH_MSG_INFO(std::dec << std::setw(3) << j <<
" : " <<
"data from SSW" << j-16 <<
" gave filter \"accept\"");
551 for(
unsigned int j=0; j<maxPresence; j++) {
552 if(j==0 || j==6 || j==7)
continue;
554 ATH_MSG_INFO(std::dec << std::setw(3) << j <<
" : " << presence[j]);
559 for(
unsigned int j=0+16; j<maxLocalStatus+16; j++) {
560 if((j>=4+16 && j<=13+16))
continue;
562 ATH_MSG_INFO(std::dec << std::setw(3) << j <<
" : " << localStatus[j-16]);
568 ATH_MSG_INFO(
"**************************************************************************************");
◆ m_cablingSvc
◆ m_checkRawData
bool Muon::TGC_RodDecoderRawdata::m_checkRawData |
|
private |
◆ m_readSlbHeaderId
bool Muon::TGC_RodDecoderRawdata::m_readSlbHeaderId |
|
private |
◆ m_showStatusWords
bool Muon::TGC_RodDecoderRawdata::m_showStatusWords |
|
private |
◆ m_tgcRODReadOut
The documentation for this class was generated from the following files:
uint16_t identify() const
void showStatusWords(const uint32_t source_id, const uint16_t rdoId, const int idHash, const uint32_t nstatus, const uint32_t *status) const
Show status words.
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Old TgcRdo
static uint16_t calculateOnlineId(uint16_t subDetectorId, uint16_t rodId)
void setRodStatus(uint32_t data)
virtual StatusCode addCollection(const T *coll, IdentifierHash hashId) override final
insert collection into container with id hash if IDC should not take ownership of collection,...
bool m_readSlbHeaderId
Switch for reading IDs in SLB Header or ROD Header.
void setTriggerType(uint16_t v)
#define ATH_MSG_VERBOSE(x)
bool m_showStatusWords
Flag for showStatusWords.
ServiceHandle< MuonTGC_CablingSvc > m_cablingSvc
The struct for triplet strip in ByteStream.
void setErrors(uint16_t data)
The struct for tracklet in ByteStream.
const DataType * PointerType
The struct for HiPt in ByteStream.
uint16_t subDetectorId() const
The struct for source ID in ByteStream.
void setOrbit(uint32_t orbit)
TgcRdo * getCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &robFrag, TgcRdoContainer &rdoIdc) const
Retrieve header of ROBFragment.
::StatusCode StatusCode
StatusCode definition for legacy code.
void fromBS32(uint32_t data, T &s)
TgcRODReadOut * m_tgcRODReadOut
RawData format converter.
The struct for hit in ByteStream.
The struct for Inner trigger bits in ByteStream.
void byteStream2Rdo(OFFLINE_FRAGMENTS_NAMESPACE::PointerType bs, TgcRdo &rdo, uint32_t source_id) const
Convert data contents of ROBFragment to RDO The same byteStream2Rdo method in TGC_RodDecoderReadout i...
bool m_checkRawData
Switch for checking rawdata format with readout format.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode byteStream2Rdo(const ByteStream &bs, TgcRdo &tgcRdo, uint32_t source_id) const
Convert BS (ROB fragment) to RDO.
void setOnlineId(uint16_t subDetectorId, uint16_t rodId)
virtual const T * indexFindPtr(IdentifierHash hashId) const override final
return pointer on the found entry or null if out of range using hashed index - fast version,...
The struct for SL in ByteStream.
#define ATH_MSG_WARNING(x)
An unit object of TGC ROD output.
unsigned bcTag(unsigned bcBitMap)
void setLocalStatus(uint32_t data)
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current TgcRawData
The struct for fragment count in ByteStream.
size_type size() const noexcept
Returns the number of elements in the collection.
StatusCode check(const ByteStream &bs, TgcRdo &tgcRdo, uint32_t source_id) const
Convert BS (ROB fragment) to RDO and compare decoded RDO container and another RDO container decoded ...