ATLAS Offline Software
Loading...
Searching...
No Matches
SubBlockHeader.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "SubBlockHeader.h"
6
7#include "WordDecoder.h"
8
9using namespace LVL1BS;
10
11namespace {
12 const WordDecoder subBlockHeaderDecoder(
13 {
14 BitField("Type", 28, 4),
15 BitField("Version", 25, 3),
16 BitField("Format", 22, 3),
17 BitField("SeqNum", 16, 6),
18 BitField("Crate", 12, 4),
19 BitField("Module", 8, 4),
20 BitField("nSlice2", 3, 5),
21 BitField("nSlice1", 0, 3)
22 });
23}
24
25
26
30
31
32uint8_t SubBlockHeader::type() const {
33 return ::subBlockHeaderDecoder.get<uint8_t>(m_header, 0); }
34
35uint8_t SubBlockHeader::version() const {
36 return ::subBlockHeaderDecoder.get<uint8_t>(m_header, 1);
37}
38uint8_t SubBlockHeader::format() const {
39 return ::subBlockHeaderDecoder.get<uint8_t>(m_header,2);
40}
41uint8_t SubBlockHeader::seqNum() const {
42 return ::subBlockHeaderDecoder.get<uint8_t>(m_header, 3);
43}
44uint8_t SubBlockHeader::crate() const {
45 return ::subBlockHeaderDecoder.get<uint8_t>(m_header, 4);
46}
47uint8_t SubBlockHeader::module() const {
48 return ::subBlockHeaderDecoder.get<uint8_t>(m_header, 5);
49}
50uint8_t SubBlockHeader::nSlice2() const {
51 return ::subBlockHeaderDecoder.get<uint8_t>(m_header, 6);
52}
53uint8_t SubBlockHeader::nSlice1() const {
54 return ::subBlockHeaderDecoder.get<uint8_t>(m_header, 7);
55}
56
58 return (type() & 0xc) == 0xc;
59}
60
62 return SubBlockHeader(word).isSubBlockHeader();
63}
64
66 return (type() & 0xe) == 0xc;
67}
68
69
SubBlockHeader(uint32_t header=0x0)
Constructor - default just sets word ID and number of header words.