ATLAS Offline Software
Loading...
Searching...
No Matches
L1Topo/L1TopoRDO/L1TopoRDO/Header.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef L1TOPORDO_HEADER_H
6#define L1TOPORDO_HEADER_H
7
8#include <iostream>
9#include <cstdint>
10#include <utility>
11
12namespace L1Topo {
13
18 class Header {
19 public:
21 Header(const uint32_t version, const uint32_t active_fibres, const uint32_t payload_crc, const uint32_t fpga, const uint32_t last_block, const uint32_t bcn_sign, const uint32_t bcn_offset);
23 Header(uint32_t word);
25 uint32_t version() const;
27 uint32_t active_fibres() const;
29 uint32_t payload_crc() const;
31 uint32_t fpga() const;
33 uint32_t last_block() const;
35 uint32_t bcn_sign() const;
37 uint32_t bcn_offset() const;
39 int bcn() const;
41 uint32_t word() const;
42 protected:
44 void decode();
46 void encode();
47 private:
48 uint32_t m_version;
49 uint32_t m_active_fibres;
50 uint32_t m_payload_crc;
51 uint32_t m_fpga;
52 uint32_t m_last_block;
53 uint32_t m_bcn_sign;
54 uint32_t m_bcn_offset;
55 int m_bcn;
56 uint32_t m_word;
57 };
58
60 int signedBCN(const uint32_t sign, uint32_t offset);
61
63 std::pair<uint32_t,uint32_t> signAndOffsetBCN(const int bcn);
64
66 std::ostream& operator<<(std::ostream&, const Header&);
67
68} // namespace L1Topo
69
70
71
72#endif // L1TOPORDO_HEADER_H
int sign(int a)
Represents the L1Topo header word of the L1Topo DAQ data, with decoder and encoder.
uint32_t payload_crc() const
access method
uint32_t fpga() const
access method
Header(const uint32_t version, const uint32_t active_fibres, const uint32_t payload_crc, const uint32_t fpga, const uint32_t last_block, const uint32_t bcn_sign, const uint32_t bcn_offset)
Construct from contents and encode word.
uint32_t word() const
access method
uint32_t active_fibres() const
access method
void encode()
method used by constructor to encode word
uint32_t bcn_offset() const
access method
uint32_t last_block() const
access method
void decode()
method used by constructor to decode word
uint32_t version() const
access method
uint32_t bcn_sign() const
access method
int bcn() const
access method
std::pair< uint32_t, uint32_t > signAndOffsetBCN(const int bcn)
reverse helper function to return the sign and offset bits given a relative bunch crossing number
std::ostream & operator<<(std::ostream &, const Error)
Helper to print errors as text rather than numbers.
Definition Error.cxx:8
int signedBCN(const uint32_t sign, uint32_t offset)
helper function to return a relative bunch crossing as a signed integer, given the sign bit and offse...