ATLAS Offline Software
Loading...
Searching...
No Matches
TgcRODReadOut.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONTGC_CNVTOOLS_TGCRODREADOUT_H
6#define MUONTGC_CNVTOOLS_TGCRODREADOUT_H
7
8
10#include "MuonRDO/TgcRdo.h"
12#include "TgcSlbDataHelper.h"
13
14#include <inttypes.h>
15#include <vector>
16#include <memory>
17#include <array>
18#include <atomic>
19
20class MsgStream;
21namespace Muon {
22class TgcSlbData;
24
38
40 private:
42
43 public:
45 TgcRODReadOut() = default;
47 virtual ~TgcRODReadOut();
48
50 StatusCode byteStream2Rdo(const ByteStream& bs, TgcRdo& tgcRdo,
51 uint32_t source_id, const TgcCablingMap& cabling,
52 MsgStream& log) const;
55 bool check(const ByteStream& bs, const TgcRdo& tgcRdo, uint32_t source_id,
56 const TgcCablingMap& cabling,
57
58 MsgStream& log) const;
60 void compare(const TgcRdo& rdo, const TgcRdo& newRdo, MsgStream& msg) const;
62 static bool isMatched(const TgcRawData& rdo1, const TgcRawData& rdo2);
64 StatusCode decodeRodToRdo(TgcRdo& tgcRdo, const ByteStream& vData,
65 uint16_t subDetectorId, uint16_t rodId,
66 uint32_t l1Id, uint16_t bcId,
67 const TgcCablingMap& cabling,
68 MsgStream& log) const;
69
70 protected:
71 enum {
72 RawDataFragMask = 0xFF000000, // RawData Fragment HEADER Mask
73 FragmentIdMask = 0xFF000000, // Fragmen ID Mask
74 FragmentCountMask = 0x00FFFFFF, // Fragmen ID Mask
75 HeaderMask = 0xE0000000, //
76 HeaderEvent = 0x00000000, // Event Header
77 HeaderError = 0x20000000, // Error Report
78 HeaderSLB10 = 0x40000000, // SLB Header 10
79 HeaderSLB11 = 0x60000000, // SLB Header 11
80 HeaderSLBC = 0x80000000, // central bunch
81 HeaderSLBP = 0xA0000000, // previous bunch
82 HeaderSLBN = 0xC0000000, // next bunch
83 HeaderTrailer = 0x70000000, // SLB Header 11
84
85 ROD_START = 0xEE1234EE,
88 };
89
91 bool setSbLoc(uint16_t subDetectorId, uint16_t rodId, TgcSlbData* slb,
92 int rxId, const TgcCablingMap& cabling, MsgStream& log) const;
93
94 private:
96 enum NROD_SIDE {
97 NROD = 24 + 1,
98 NSROD = 6 + 1,
99 ASIDE = 0x67, // 103
100 CSIDE = 0x68 // 104
101 };
102
103 mutable std::array<std::atomic<unsigned int>, NROD + 1>
104 m_failedDecodeRodToRdo ATLAS_THREAD_SAFE{};
106 mutable std::array<std::atomic<unsigned int>, NROD + 1>
107 m_failedHeaderSizeRawData ATLAS_THREAD_SAFE{};
109 mutable std::array<std::atomic<unsigned int>, NROD + 1> m_failedSetSbLoc
112 mutable std::array<std::atomic<unsigned int>, NROD + 1> m_failedSetType
115 mutable std::array<std::atomic<unsigned int>, NROD + 1>
116 m_failedGetSLBIDfromRxID ATLAS_THREAD_SAFE{};
118 mutable std::array<std::atomic<unsigned int>, NROD + 1>
119 m_failedGetReadoutIDfromSLBID ATLAS_THREAD_SAFE{};
120
122 std::unique_ptr<TgcSlbDataHelper> m_tgcSlbDataHelper{
123 std::make_unique<TgcSlbDataHelper>()};
124};
125
126} // namespace Muon
127
128#endif // MUONTGC_CNVTOOLS_TGCRODREADOUT_H
uint16_t bcId(uint32_t data)
StatusCode byteStream2Rdo(const ByteStream &bs, TgcRdo &tgcRdo, uint32_t source_id, const TgcCablingMap &cabling, MsgStream &log) const
Convert BS (ROB fragment) to RDO.
TgcRODReadOut()=default
Constructor.
void compare(const TgcRdo &rdo, const TgcRdo &newRdo, MsgStream &msg) const
Compare two RDO containers.
NROD_SIDE
The number of RODs (1-24 for 12-fold)
bool check(const ByteStream &bs, const TgcRdo &tgcRdo, uint32_t source_id, const TgcCablingMap &cabling, MsgStream &log) const
Convert BS (ROB fragment) to RDO and compare decoded RDO container and another RDO container decoded ...
bool setSbLoc(uint16_t subDetectorId, uint16_t rodId, TgcSlbData *slb, int rxId, const TgcCablingMap &cabling, MsgStream &log) const
Set sbLoc.
virtual ~TgcRODReadOut()
Destructor.
static bool isMatched(const TgcRawData &rdo1, const TgcRawData &rdo2)
Compare two RDOs.
OFFLINE_FRAGMENTS_NAMESPACE::PointerType ByteStream
std::unique_ptr< TgcSlbDataHelper > m_tgcSlbDataHelper
TGC SLB data helper.
StatusCode decodeRodToRdo(TgcRdo &tgcRdo, const ByteStream &vData, uint16_t subDetectorId, uint16_t rodId, uint32_t l1Id, uint16_t bcId, const TgcCablingMap &cabling, MsgStream &log) const
Decode BS to RDO container.
std::array< std::atomic< unsigned int >, NROD+1 > m_failedDecodeRodToRdo ATLAS_THREAD_SAFE
The number of failures on decodeRodToRdo.
This is the SLB data helper class which stores bit map, reconstructs to hits and coincidences,...
This is the SLB data class which represents an SLB block.
Definition TgcSlbData.h:20
An unit object of TGC ROD output.
Definition TgcRawData.h:23
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
const DataType * PointerType
Definition RawEvent.h:25
MsgStream & msg
Definition testRead.cxx:32