|
|
Go to the documentation of this file.
25 LogTrace(
"L1T") <<
"Writing MP7 link header";
29 LogTrace(
"L1T") <<
"Writing CTP7 link header";
36 LogTrace(
"L1T") <<
"Writing meaningless link header";
44 unsigned int wordsPerBx = payloadWordsPerBx;
49 unsigned int nBxBlocks =
payload_.size() / wordsPerBx;
50 for (
size_t bxCtr = 0; bxCtr < nBxBlocks; ++bxCtr) {
51 size_t startIdx = bxCtr * wordsPerBx;
52 auto startBxBlock =
payload_.cbegin() + startIdx;
55 bxBlocks.emplace_back(startBxBlock, startBxBlock + wordsPerBx);
57 bxBlocks.emplace_back(bxCtr, nBxBlocks, startBxBlock, startBxBlock + wordsPerBx);
66 LogDebug(
"L1T") <<
"Reached end of payload";
67 return std::unique_ptr<Block>();
70 if (
data_[0] == 0xffffffff) {
71 LogDebug(
"L1T") <<
"Skipping padding word";
80 <<
" words remaining";
81 return std::unique_ptr<Block>();
84 LogTrace(
"L1T") <<
"Creating block with size " <<
header.getSize();
106 LogTrace(
"L1T") <<
"Getting header from " << std::hex << std::setw(8) << *
data_;
112 const uint16_t* data16 = reinterpret_cast<const uint16_t*>(
data);
113 const uint16_t* end16 = reinterpret_cast<const uint16_t*>(
end);
116 edm::LogError(
"L1T") <<
"MTF7 payload smaller than allowed!";
119 ((data16[0] >> 12) != 0x9) || ((data16[1] >> 12) != 0x9) || ((data16[2] >> 12) != 0x9) ||
120 ((data16[3] >> 12) != 0x9) || ((data16[4] >> 12) != 0xA) || ((data16[5] >> 12) != 0xA) ||
121 ((data16[6] >> 12) != 0xA) || ((data16[7] >> 12) != 0xA) || ((data16[8] >> 15) != 0
x1) ||
122 ((data16[9] >> 15) != 0x0) || ((data16[10] >> 15) != 0x0) || ((data16[11] >> 15) != 0x0)) {
126 ((data16[12] >> 15) != 0) || ((data16[13] >> 15) != 1) || ((data16[14] >> 15) != 0) ||
127 ((data16[15] >> 15) != 0)) {
128 edm::LogError(
"L1T") <<
"MTF7 payload has invalid counter block!";
137 if (((data16[4 *
i + 0] >> 12) == 0xF) && ((data16[4 *
i + 1] >> 12) == 0xF) &&
138 ((data16[4 *
i + 2] >> 12) == 0xF) && ((data16[4 *
i + 3] >> 12) == 0xF) &&
139 ((data16[4 *
i + 4] >> 12) == 0xE) && ((data16[4 *
i + 5] >> 12) == 0xE) &&
140 ((data16[4 *
i + 6] >> 12) == 0xE) &&
141 ((data16[4 *
i + 7] >> 12) == 0xE)) {
142 algo_ = (((data16[4 *
i + 2] >> 4) & 0x3F) << 9);
143 algo_ |= (((data16[4 *
i + 2] >> 0) & 0x0F) << 5);
144 algo_ |= (((data16[4 *
i + 4] >> 0) & 0x1F) << 0);
149 edm::LogError(
"L1T") <<
"MTF7 payload has no valid EMTF firmware version!";
155 unsigned int mask = 0;
156 for (; length > 0; length--)
157 mask = (mask << 4) | 0xf;
175 return std::unique_ptr<Block>();
177 const uint16_t* data16 = reinterpret_cast<const uint16_t*>(
data_);
178 const uint16_t* end16 = reinterpret_cast<const uint16_t*>(
end_);
186 for (
int j = 0;
j < 4; ++
j) {
198 return std::unique_ptr<Block>();
207 if (not(*
data_ == 0xA110CA7E)) {
224 unsigned blockId = 0;
235 LogDebug(
"L1T") <<
"Reached end of payload";
236 return std::unique_ptr<Block>();
239 edm::LogWarning(
"L1T") <<
"CTP7 with more bunch crossings than expected";
246 <<
" words remaining";
247 return std::unique_ptr<Block>();
250 LogTrace(
"L1T") <<
"Creating block with size " <<
header.getSize();
RPC Data Record : block->header().getID() = 4.
ME0 Data Record : block->header().getID() = 6.
MTF7Payload(const uint32_t *data, const uint32_t *end)
static constexpr unsigned PAYLOAD_MAX_SIZE
Maximum number of 64-bit words in the EMTF payload.
MP7Payload(const uint32_t *data, const uint32_t *end, bool legacy_mc=false)
Block of Counters : block->header().getID() = 2.
unsigned getHeaderSize() const override
static constexpr unsigned trailer_size
static const std::vector< unsigned int > block_patterns_
bit patterns of the first bits (of 16bit words)
virtual std::unique_ptr< Block > getBlock()
BlockHeader getHeader() override
static constexpr unsigned counter_size
std::unique_ptr< Block > getBlock() override
Log< level::Info, false > LogInfo
Log< level::Warning, false > LogWarning
ME Data Record : block->header().getID() = 3.
virtual BlockHeader getHeader()=0
virtual unsigned getHeaderSize() const =0
static constexpr unsigned DAQ_PAYLOAD_OFFSET
Start of the EMTF DAQ payload, in number of 64-bit words.
int count(unsigned int pattern, unsigned int length) const
GEM Data Record : block->header().getID() = 7.
std::unique_ptr< Block > getBlock() override
static constexpr unsigned max_block_length_
maximum of the block length (64bits)
BlockHeader getHeader() override
bool valid(unsigned int pattern) const
Log< level::Error, false > LogError
BxBlocks getBxBlocks(unsigned int payloadWordsPerBx, bool bxHeader) const
static constexpr unsigned header_size
char data[epos_bytes_allocation]
SP Output Data Record : block->header().getID() = 101.
std::vector< uint32_t > payload_
CTP7Payload(const uint32_t *data, const uint32_t *end, amc::Header amcHeader)
Event Record Header : block->header().getID() = 511.
Event Record Trailer : block->header().getID() = 255.
std::vector< BxBlock > BxBlocks