Base class for LookUp Tables. More...
#include <L1GctLut.h>
Public Member Functions | |
uint16_t | lutValue (const uint16_t lutAddress) const |
Access the look-up table contents for a given Address. | |
template<int KAddressBits, int KDataBits> | |
int | operator!= (const L1GctLut< KAddressBits, KDataBits > &rhsLut) const |
Inequality check between look-up tables. | |
template<int KAddressBits, int KDataBits> | |
int | operator== (const L1GctLut< KAddressBits, KDataBits > &rhsLut) const |
Equality check between look-up tables. | |
uint16_t | operator[] (const uint16_t lutAddress) const |
Access the look-up table contents for a given Address. | |
void | setTerse () |
bool | setupOk () |
void | setVerbose () |
control output messages | |
virtual | ~L1GctLut () |
Static Public Attributes | |
static const uint16_t | MAX_ADDRESS_BITMASK = (1 << NAddressBits) - 1 |
static const uint16_t | MAX_DATA_BITMASK = (1 << NDataBits) - 1 |
Protected Member Functions | |
template<int KAddressBits, int KDataBits> | |
bool | equalityCheck (const L1GctLut< KAddressBits, KDataBits > &c) const |
L1GctLut () | |
virtual uint16_t | value (const uint16_t lutAddress) const =0 |
Protected Attributes | |
bool | m_setupOk |
bool | m_verbose |
Private Member Functions | |
std::string | printHeader () const |
std::string | printLine (const int add) const |
Static Private Attributes | |
static const int | printWidth = 16 |
Friends | |
std::ostream & | operator<< (std::ostream &os, const L1GctLut< NAddressBits, NDataBits > &lut) |
Overload << operator. |
Base class for LookUp Tables.
Definition at line 20 of file L1GctLut.h.
L1GctLut< NAddressBits, NDataBits >::~L1GctLut | ( | ) | [virtual] |
Definition at line 101 of file L1GctLut.h.
{}
L1GctLut< NAddressBits, NDataBits >::L1GctLut | ( | ) | [protected] |
Definition at line 98 of file L1GctLut.h.
: m_setupOk(false) {}
bool L1GctLut< NAddressBits, NDataBits >::equalityCheck | ( | const L1GctLut< KAddressBits, KDataBits > & | c | ) | const [protected] |
Definition at line 114 of file L1GctLut.h.
References L1GctLut< NAddressBits, NDataBits >::lutValue(), and match().
Referenced by L1GctLut< 16, 12 >::operator!=(), and L1GctLut< 16, 12 >::operator==().
uint16_t L1GctLut< NAddressBits, NDataBits >::lutValue | ( | const uint16_t | lutAddress | ) | const |
Access the look-up table contents for a given Address.
Definition at line 104 of file L1GctLut.h.
References data, and relativeConstraints::value.
Referenced by L1GctLut< NAddressBits, NDataBits >::equalityCheck(), L1GctLut< 16, 12 >::operator[](), and L1GctMet::useHtMissLutAlgo().
{ if (!m_setupOk) return (uint16_t) 0; uint16_t address=(lutAddress & MAX_ADDRESS_BITMASK); uint16_t data=(value(address) & MAX_DATA_BITMASK); return data; }
int L1GctLut< NAddressBits, NDataBits >::operator!= | ( | const L1GctLut< KAddressBits, KDataBits > & | rhsLut | ) | const [inline] |
Inequality check between look-up tables.
Definition at line 60 of file L1GctLut.h.
{ return !equalityCheck(rhsLut); }
int L1GctLut< NAddressBits, NDataBits >::operator== | ( | const L1GctLut< KAddressBits, KDataBits > & | rhsLut | ) | const [inline] |
Equality check between look-up tables.
Definition at line 56 of file L1GctLut.h.
{ return equalityCheck(rhsLut); }
uint16_t L1GctLut< NAddressBits, NDataBits >::operator[] | ( | const uint16_t | lutAddress | ) | const [inline] |
Access the look-up table contents for a given Address.
Definition at line 52 of file L1GctLut.h.
{ return lutValue(lutAddress); }
std::string L1GctLut< NAddressBits, NDataBits >::printHeader | ( | ) | const [private] |
Definition at line 128 of file L1GctLut.h.
References a.
{ std::stringstream ss; ss << std::hex << std::showbase; ss << std::setw(8) << "|"; for (int a=0; ((a<printWidth) && (a<=MAX_ADDRESS_BITMASK)); ++a) { ss << std::setw(7) << a; } ss << std::endl; ss << std::setfill('-') << std::setw(8) << "+"; for (int a=0; ((a<printWidth) && (a<=MAX_ADDRESS_BITMASK)); ++a) { ss << std::setw(7) << "-"; } ss << std::endl; return ss.str(); }
std::string L1GctLut< NAddressBits, NDataBits >::printLine | ( | const int | add | ) | const [private] |
Definition at line 147 of file L1GctLut.h.
References a, Clusterizer1DCommons::add(), and trackerHits::c.
{ std::stringstream ss; ss << std::hex << std::showbase; int a=add; ss << std::setw(7) << a << "|"; for (int c=0; ((c<printWidth) && (a<=MAX_ADDRESS_BITMASK)); ++c) { uint16_t address = static_cast<uint16_t>(a++); ss << std::setw(7) << lutValue(address); } ss << std::endl; return ss.str(); }
void L1GctLut< NAddressBits, NDataBits >::setTerse | ( | ) | [inline] |
Definition at line 66 of file L1GctLut.h.
{ m_verbose = false; }
bool L1GctLut< NAddressBits, NDataBits >::setupOk | ( | ) | [inline] |
Definition at line 62 of file L1GctLut.h.
{ return m_setupOk; }
void L1GctLut< NAddressBits, NDataBits >::setVerbose | ( | ) | [inline] |
virtual uint16_t L1GctLut< NAddressBits, NDataBits >::value | ( | const uint16_t | lutAddress | ) | const [protected, pure virtual] |
Implemented in L1GctHfBitCountsLut, L1GctHfEtSumsLut, L1GctHtMissLut, and L1GctJetEtCalibrationLut.
std::ostream& operator<< | ( | std::ostream & | os, |
const L1GctLut< NAddressBits, NDataBits > & | lut | ||
) | [friend] |
Overload << operator.
Definition at line 29 of file L1GctLut.h.
{ //---------------------------------------------------------------------------------------- // Define the code here for the friend template function to get around // compiler/linker problems when instantiating the template class. // See http://www.parashift.com/c++-faq-lite/templates.html#faq-35.16 static const int maxAddress=L1GctLut<NAddressBits, NDataBits>::MAX_ADDRESS_BITMASK; static const int width=L1GctLut<NAddressBits, NDataBits>::printWidth; os << lut.printHeader(); for (int a=0; a<=maxAddress; a += width) { os << lut.printLine(a); } return os; // End of friend function definition //---------------------------------------------------------------------------------------- }
bool L1GctLut< NAddressBits, NDataBits >::m_setupOk [protected] |
Definition at line 77 of file L1GctLut.h.
Referenced by L1GctLut< 16, 12 >::setupOk().
bool L1GctLut< NAddressBits, NDataBits >::m_verbose [protected] |
Definition at line 78 of file L1GctLut.h.
Referenced by L1GctLut< 16, 12 >::setTerse(), and L1GctLut< 16, 12 >::setVerbose().
const uint16_t L1GctLut< NAddressBits, NDataBits >::MAX_ADDRESS_BITMASK = (1 << NAddressBits) - 1 [static] |
Definition at line 23 of file L1GctLut.h.
const uint16_t L1GctLut< NAddressBits, NDataBits >::MAX_DATA_BITMASK = (1 << NDataBits) - 1 [static] |
Definition at line 24 of file L1GctLut.h.
const int L1GctLut< NAddressBits, NDataBits >::printWidth = 16 [static, private] |
Definition at line 83 of file L1GctLut.h.