18 template <
int NAddressBits,
int NDataBits>
27 friend std::ostream& operator<<(std::ostream& os, const L1GctLut<NAddressBits, NDataBits>& lut) {
37 for (
int a = 0;
a <= maxAddress;
a += width) {
38 os << lut.printLine(
a);
46 uint16_t
lutValue(
const uint16_t lutAddress)
const;
52 template <
int KAddressBits,
int KDataBits>
58 template <
int KAddressBits,
int KDataBits>
72 virtual uint16_t
value(
const uint16_t lutAddress)
const = 0;
74 template <
int KAddressBits,
int KDataBits>
87 template <
int NAddressBits,
int NDataBits>
89 template <
int NAddressBits,
int NDataBits>
92 template <
int NAddressBits,
int NDataBits>
95 template <
int NAddressBits,
int NDataBits>
98 template <
int NAddressBits,
int NDataBits>
101 template <
int NAddressBits,
int NDataBits>
105 uint16_t address = (lutAddress & MAX_ADDRESS_BITMASK);
106 uint16_t
data = (
value(address) & MAX_DATA_BITMASK);
110 template <
int NAddressBits,
int NDataBits>
111 template <
int KAddressBits,
int KDataBits>
113 if (KAddressBits == NAddressBits && KDataBits == NDataBits) {
115 for (uint16_t address = 0; address <= MAX_ADDRESS_BITMASK; address++) {
116 if (this->lutValue(address) != rhsLut.
lutValue(address)) {
127 template <
int NAddressBits,
int NDataBits>
129 std::stringstream
ss;
130 ss << std::hex << std::showbase;
131 ss << std::setw(8) <<
"|";
132 for (
int a = 0; ((
a < printWidth) && (
a <= MAX_ADDRESS_BITMASK)); ++
a) {
133 ss << std::setw(7) <<
a;
136 ss << std::setfill(
'-') << std::setw(8) <<
"+";
137 for (
int a = 0; ((
a < printWidth) && (
a <= MAX_ADDRESS_BITMASK)); ++
a) {
138 ss << std::setw(7) <<
"-";
145 template <
int NAddressBits,
int NDataBits>
147 std::stringstream
ss;
148 ss << std::hex << std::showbase;
150 ss << std::setw(7) << a <<
"|";
151 for (
int c = 0; ((
c < printWidth) && (a <= MAX_ADDRESS_BITMASK)); ++
c) {
152 uint16_t address =
static_cast<uint16_t
>(a++);
153 ss << std::setw(7) << lutValue(address);
void setVerbose()
control output messages
const edm::EventSetup & c
std::string printLine(const int add) const
virtual uint16_t value(const uint16_t lutAddress) const =0
uint16_t operator[](const uint16_t lutAddress) const
Access the look-up table contents for a given Address.
static const uint16_t MAX_ADDRESS_BITMASK
static const int printWidth
Base class for LookUp Tables.
int operator==(const L1GctLut< KAddressBits, KDataBits > &rhsLut) const
Equality check between look-up tables.
bool equalityCheck(const L1GctLut< KAddressBits, KDataBits > &c) const
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
static const uint16_t MAX_DATA_BITMASK
char data[epos_bytes_allocation]
uint16_t lutValue(const uint16_t lutAddress) const
Access the look-up table contents for a given Address.
int operator!=(const L1GctLut< KAddressBits, KDataBits > &rhsLut) const
Inequality check between look-up tables.
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
std::string printHeader() const