|
ATLAS Offline Software
|
#include <TGC_RodDecoderReadout.h>
|
void | getCollection (const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &robFrag, TgcRdo *rdo) const |
| Retrieve header of ROBFragment. More...
|
|
void | byteStream2Rdo (OFFLINE_FRAGMENTS_NAMESPACE::PointerType bs, TgcRdo *rdo, uint32_t source_id) const |
| Convert data contents of ROBFragment to RDO. More...
|
|
void | byteStreamSrod2Rdo (OFFLINE_FRAGMENTS_NAMESPACE::PointerType bs, TgcRdo *rdo, uint32_t source_id, uint32_t ndata) 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. More...
|
|
A tool to decode a TGC ROB fragment written in the readout format into TGC RDO.
- Author
- Zvi Tarem zvi@c.nosp@m.alip.nosp@m.er.co.nosp@m..il
The previous class name was TGC_RodDecoder.
Definition at line 28 of file TGC_RodDecoderReadout.h.
◆ TGC_RodDecoderReadout()
Muon::TGC_RodDecoderReadout::TGC_RodDecoderReadout |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~TGC_RodDecoderReadout()
Muon::TGC_RodDecoderReadout::~TGC_RodDecoderReadout |
( |
| ) |
|
|
virtualdefault |
◆ byteStream2Rdo()
Convert data contents of ROBFragment to RDO.
Definition at line 177 of file TGC_RodDecoderReadout.cxx.
181 ATH_MSG_DEBUG(
"Muon::TGC_RodDecoderReadout::byteStream2Rdo" );
189 ATH_MSG_DEBUG(
"Error: input TgcRdo id does not match bytestream id" );
196 {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {0, 8}, {0, 9}
201 for(
int iCnt = 0; iCnt < 7; iCnt++)
204 if(
counter.id == counters[iCnt].id)
212 for(
int iCnt = 0; iCnt < 7; iCnt++)
214 if(counters[iCnt].
count == 0)
216 switch(counters[iCnt].
id)
221 " " << counters[iCnt].
count <<
"words" );
222 for(
unsigned iFrag = 0; iFrag < counters[iCnt].
count; iFrag++)
224 ATH_MSG_DEBUG(
"WORD" << iFrag <<
":" << MSG::hex << bs[iBs] );
232 " " << counters[iCnt].
count <<
"words" );
234 for(
unsigned iFrag = 0; iFrag < counters[iCnt].
count; iFrag++)
236 ATH_MSG_DEBUG(
"WORD" << iFrag <<
":" << MSG::hex << bs[iBs] );
240 <<
" rdo.rodId():" <<rdo->
rodId()
241 <<
" roh.ldbId:" <<roh.
ldbId
242 <<
" roh.sbId:" <<roh.
sbId
243 <<
" rdo.l1Id():"<<rdo->
l1Id()
244 <<
" rdo.bcId():"<<rdo->
bcId() );
256 else slbId = (roh.
sbId-8)*2+1;
292 " " << counters[iCnt].
count <<
"words" );
295 for(
unsigned iFrag = 0; iFrag < counters[iCnt].
count; iFrag++)
297 ATH_MSG_DEBUG(
"WORD" << iFrag <<
":" << MSG::hex << bs[iBs] );
329 if(rotrk.
sbId<8) slbId = rotrk.
sbId *2;
330 else slbId = (rotrk.
sbId-8)*2+1;
369 " " << counters[iCnt].
count <<
"words" );
372 for(
unsigned iFrag = 0; iFrag < counters[iCnt].
count; iFrag++)
374 ATH_MSG_DEBUG(
"WORD" << iFrag <<
":" << MSG::hex << bs[iBs] );
421 " " << counters[iCnt].
count <<
"words" );
423 for(
unsigned iFrag = 0; iFrag < counters[iCnt].
count; iFrag++)
425 ATH_MSG_DEBUG(
"WORD" << iFrag <<
":" << MSG::hex << bs[iBs] );
434 static_cast<bool>(sl.
fwd),
447 ATH_MSG_DEBUG(
"Error: Muon::TGC_RodDecoderReadout::byteStream2Rdo Unsupported fragment type "
448 << counters[iCnt].
id );
454 ATH_MSG_DEBUG(
"Muon::TGC_RodDecoderReadout::byteStream2Rdo done" );
◆ byteStreamSrod2Rdo()
Definition at line 459 of file TGC_RodDecoderReadout.cxx.
464 ATH_MSG_DEBUG(
"Muon::TGC_RodDecoderReadout::byteStreamSrod2Rdo" );
473 ATH_MSG_DEBUG(
"Error: input TgcRdo id does not match bytestream id" );
478 for(
uint32_t iBs = 0; iBs < ndata; iBs++){
479 ATH_MSG_DEBUG(
"WORD" << iBs <<
":" << MSG::hex << bs[iBs] );
492 static_cast<bool>(roi.
fwd),
496 static_cast<bool>(roi.
charge),
511 static_cast<bool>(
hipt.strip),
512 static_cast<bool>(
hipt.fwd),
516 static_cast<bool>(
hipt.hipt),
528 for (
int isector = 0; isector < 2; isector++ ){
534 static_cast<bool>(eifi.
fwd),
547 for (
int isector = 0; isector < 2; isector++ ){
554 tmdb.sector + isector,
568 if (nswang.
type != 5){
586 for (
int isector = 0; isector < 2; isector++ ){
592 static_cast<bool>(nswpos.
fwd),
612 if (rpccoin.
type != 7){
629 for (
int isector = 0; isector < 2; isector++ ){
635 static_cast<bool>(rpcpos.
fwd),
650 ATH_MSG_DEBUG(
"Muon::TGC_RodDecoderReadout::byteStreamSrod2Rdo done" );
◆ fillCollection()
Convert ROBFragment to RDO.
Definition at line 77 of file TGC_RodDecoderReadout.cxx.
84 return StatusCode::SUCCESS;
89 uint32_t source_id = robFrag.rod_source_id();
90 SourceIdentifier sid(source_id);
95 int idHash = rdoIdHash(rdoId);
98 std::unique_ptr<TgcRdo> rdo(
nullptr);
101 ATH_MSG_DEBUG (
" TGC RDO collection already exist with collection hash = "
102 << idHash <<
", ID = " << sid.human() <<
" - converting is skipped!");
106 ATH_MSG_DEBUG(
" Created new collection with ID = " << sid.human() <<
", hash = " << idHash );
109 rdo = std::make_unique<TgcRdo>(rdoId, idHash);
112 robFrag.rod_data(bs);
116 if (sid.module_id()<13){
118 }
else if (sid.module_id()>16){
122 return StatusCode::FAILURE;
127 if(status_lock != StatusCode::SUCCESS){
128 ATH_MSG_ERROR(
" Failed to add TGC RDO collection to container with hash " << idHash );
131 ATH_MSG_DEBUG(
" Adding TgcRdo collection with hash " << idHash <<
", source id = " << sid.human() <<
" to the TgcRdo Container");
135 return StatusCode::SUCCESS;
◆ finalize()
StatusCode Muon::TGC_RodDecoderReadout::finalize |
( |
| ) |
|
|
overridevirtual |
◆ getCollection()
Retrieve header of ROBFragment.
Definition at line 139 of file TGC_RodDecoderReadout.cxx.
142 uint32_t source_id = robFrag.rod_source_id();
143 SourceIdentifier sid(source_id);
147 int idHash = rdoIdHash(rdoId);
149 rdo->
setL1Id(robFrag.rod_lvl1_id());
150 rdo->
setBcId(robFrag.rod_bc_id());
152 rdo->
setOnlineId(sid.subdetector_id(), sid.module_id());
154 uint32_t nstatus = robFrag.rod_nstatus();
157 robFrag.rod_status(
status);
158 if (nstatus == 5 && sid.module_id() < 13){
163 }
else if (nstatus == 3 && sid.module_id() > 16){
◆ initialize()
StatusCode Muon::TGC_RodDecoderReadout::initialize |
( |
| ) |
|
|
overridevirtual |
Standard AlgTool method.
Definition at line 44 of file TGC_RodDecoderReadout.cxx.
48 if(
sc.isFailure())
return sc;
54 return StatusCode::FAILURE;
58 return StatusCode::SUCCESS;
◆ showStatusWords()
void Muon::TGC_RodDecoderReadout::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 654 of file TGC_RodDecoderReadout.cxx.
656 static const unsigned int maxNStatus = 5;
657 static const std::string statusDataWord[maxNStatus] = {
658 "First status word specific|generic:",
659 "TGC ROD event status :",
660 "ROD VME fileter bits | SSW timeout:",
661 "Local status word | presence :",
665 static const unsigned int maxFirstStatus = 5;
666 static const std::string firstStatus[maxFirstStatus] = {
669 "Timeout occurred in at least one of the FE links. Fragment is incomplete.",
670 "Data may be incorrect, see TGC ROD event status word",
671 "An overflow in one of the ROD internal buffers has occurred. The fragment is incomplete."
674 static const unsigned int maxTgcRodEventStatus = 31;
675 static const std::string tgcRodEventStatus[maxTgcRodEventStatus] = {
676 "EC_RXsend : Error in request to send an event via RXlink",
677 "EC_FELdown : A Front End link has gone down - abandoned",
678 "EC_frame : Invalid FE link framing words",
679 "EC_Glnk : Front End link G-link error",
680 "EC_xor : Invalid XOR event checksum",
681 "EC_ovfl : Input FE event is too long or FE FIFO overflow",
682 "EC_timeout : Timeout expired for at least one FE link",
683 "EC_xormezz : Bad XOR checksum from mezz board",
684 "EC_wc0 : Event has WC=0 or WX>max WC",
685 "EC_L1ID : L1ID mismatch (TTC EVID FIFO vs local).",
686 "EC_nohdr : First word is not header",
687 "EC_rectype : Unrecognized record type",
688 "EC_null : Unexpected nulls in FE input",
689 "EC_order : Word is out of order",
690 "EC_LDB : Invalid or unexpected Star Switch ID",
691 "EC_RXovfl : RXfifo has overflowed",
692 "EC_SSWerr : SSW reports T1C, NRC, T2C, or GlinkNoLock error",
693 "EC_sbid : SBid does not match SBinfo table",
694 "EC_SBtype : SBtype does not match SBinfo table",
695 "EC_duprx : RX ID is duplicated in the event",
696 "EC_ec4 : Unexpected SB L1 Event ID(lo 4)",
697 "EC_bc : Unexpected SB BCID",
698 "EC_celladr : Invalid cell address",
699 "EC_hitovfl : Too many hits in event",
700 "EC_trgbit : Unexpected trigger bits",
701 "EC_badEoE : Bad End-of-event marker received, not 0xFCA",
702 "EC_endWCnot0 : WC not 0 after End-of-event marker",
703 "EC_noEoE : No End-of-event marker received",
704 "EC_SLGlink : Sector Logic reports G-Link error",
705 "EC_SLbc : Sector Logic BCID[2:0] does not match its SB BCID",
706 "EC_unxrxid : Data from disabled SSW RX ID"
709 static const unsigned int maxSSWs = 12;
711 static const unsigned int maxPresence = 10;
712 static const std::string presence[maxPresence] = {
715 "hits in readout fmt",
716 "tracklets in readout fmt",
717 "hits in chamber fmt",
718 "tracklets in chamber fmt",
725 static const unsigned int maxLocalStatus = 16;
726 static const std::string localStatus[maxLocalStatus] = {
727 "hit BCs are merged",
728 "tracklet BCs are merged",
730 "tracklets are sorted",
741 "ROI in this fragment",
742 "no L1AID, BCID check wrt ROD"
746 <<
"source_id=0x" << source_id <<
", "
747 <<
"rdoId=0x" << rdoId << (rdoId<16 ?
" , " :
", ")
748 <<
"idHash=0x" << idHash << (idHash<16 ?
" , " :
", ")
749 << (idHash<12 ?
"A" :
"C") << (idHash%12+1<10 ?
"0" :
"") << std::dec << idHash%12+1
751 ATH_MSG_INFO(
"***** Based on http://cern.ch/atlas-tgc/doc/ROBformat.pdf ****************************");
758 for(
unsigned int j=0; j<maxFirstStatus; j++) {
760 ATH_MSG_INFO(std::dec << std::setw(3) << j <<
" : " << firstStatus[j]);
765 for(
unsigned int j=0; j<maxTgcRodEventStatus; j++) {
767 ATH_MSG_INFO(std::dec << std::setw(3) << j <<
" : " << tgcRodEventStatus[j]);
772 for(
unsigned int j=0; j<maxSSWs; j++) {
774 ATH_MSG_INFO(std::dec << std::setw(3) << j <<
" : " <<
"time-out for SSW" << j);
777 for(
unsigned int j=0+16; j<=maxSSWs+16; j++) {
779 ATH_MSG_INFO(std::dec << std::setw(3) << j <<
" : " <<
"data from SSW" << j-16 <<
" gave filter \"accept\"");
784 for(
unsigned int j=0; j<maxPresence; j++) {
785 if(j==0 || j==6 || j==7)
continue;
787 ATH_MSG_INFO(std::dec << std::setw(3) << j <<
" : " << presence[j]);
792 for(
unsigned int j=0+16; j<maxLocalStatus+16; j++) {
793 if((j>=4+16 && j<=13+16))
continue;
795 ATH_MSG_INFO(std::dec << std::setw(3) << j <<
" : " << localStatus[j-16]);
801 ATH_MSG_INFO(
"**************************************************************************************");
◆ m_nCache
std::atomic<unsigned int> Muon::TGC_RodDecoderReadout::m_nCache = 0 |
|
mutableprivate |
◆ m_nNotCache
std::atomic<unsigned int> Muon::TGC_RodDecoderReadout::m_nNotCache = 0 |
|
mutableprivate |
◆ m_showStatusWords
bool Muon::TGC_RodDecoderReadout::m_showStatusWords |
|
private |
◆ m_skipCoincidence
bool Muon::TGC_RodDecoderReadout::m_skipCoincidence |
|
private |
◆ m_tgcIdHelper
The documentation for this class was generated from the following files:
uint16_t identify() const
def retrieve(aClass, aKey=None)
static constexpr uint32_t NSW_INPUT_BITSHIFT
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
static uint16_t calculateOnlineId(uint16_t subDetectorId, uint16_t rodId)
void setRodStatus(uint32_t data)
IDC_WriteHandle getWriteHandle(IdentifierHash hash)
void byteStream2Rdo(OFFLINE_FRAGMENTS_NAMESPACE::PointerType bs, TgcRdo *rdo, uint32_t source_id) const
Convert data contents of ROBFragment to RDO.
static constexpr uint32_t NSW_BCID_BITSHIFT
static constexpr uint32_t NSW_CAND_BITSHIFT
void setTriggerType(uint16_t v)
const TgcIdHelper * m_tgcIdHelper
TGC ID helper.
std::atomic< unsigned int > m_nCache
void byteStreamSrod2Rdo(OFFLINE_FRAGMENTS_NAMESPACE::PointerType bs, TgcRdo *rdo, uint32_t source_id, uint32_t ndata) const
The struct for triplet strip in ByteStream.
void setErrors(uint16_t data)
std::atomic< unsigned int > m_nNotCache
The struct for tracklet in ByteStream.
bool m_showStatusWords
Flag for showStatusWords.
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)
::StatusCode StatusCode
StatusCode definition for legacy code.
static constexpr uint32_t RPC_FLAG_BITSHIFT
void fromBS32(uint32_t data, T &s)
The struct for hit in ByteStream.
The struct for Inner trigger bits in ByteStream.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
void setOnlineId(uint16_t subDetectorId, uint16_t rodId)
StatusCode addOrDelete(std::unique_ptr< T > ptr)
bool m_skipCoincidence
Flag for skipping coincidence objects (for TrigT1TGC running on data)
The struct for SL in ByteStream.
#define ATH_MSG_WARNING(x)
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.
An unit object of TGC ROD output.
unsigned bcTag(unsigned bcBitMap)
static constexpr uint32_t RPC_CAND_BITSHIFT
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
static constexpr uint32_t RPC_BCID_BITSHIFT
The struct for fragment count in ByteStream.
size_type size() const noexcept
Returns the number of elements in the collection.
void getCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &robFrag, TgcRdo *rdo) const
Retrieve header of ROBFragment.