File indexing completed on 2024-04-06 12:19:52
0001 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctHfBitCountsLut.h"
0002
0003
0004 const int L1GctHfBitCountsLut::NAddress = 5;
0005 const int L1GctHfBitCountsLut::NData = 3;
0006
0007 L1GctHfBitCountsLut::L1GctHfBitCountsLut(const L1GctHfEtSumsLut::hfLutType& type)
0008 : L1GctLut<NAddress, NData>(), m_lutType(type) {
0009
0010 m_setupOk = true;
0011 }
0012
0013 L1GctHfBitCountsLut::L1GctHfBitCountsLut() : L1GctLut<NAddress, NData>(), m_lutType() {
0014
0015 m_setupOk = true;
0016 }
0017
0018 L1GctHfBitCountsLut::L1GctHfBitCountsLut(const L1GctHfBitCountsLut& lut)
0019 : L1GctLut<NAddress, NData>(), m_lutType(lut.lutType()) {
0020
0021 m_setupOk = true;
0022 }
0023
0024 L1GctHfBitCountsLut::~L1GctHfBitCountsLut() {}
0025
0026 uint16_t L1GctHfBitCountsLut::value(const uint16_t lutAddress) const {
0027
0028 const int maxOutput = ((1 << NData) - 1);
0029 if (lutAddress > maxOutput)
0030 return maxOutput;
0031 else
0032 return (lutAddress & maxOutput);
0033 }
0034
0035 std::vector<unsigned> L1GctHfBitCountsLut::getThresholdsGct() const {
0036 std::vector<unsigned> result;
0037
0038 for (unsigned add = 1; add < (1 << NData); add++) {
0039 result.push_back(add);
0040 }
0041 return result;
0042 }
0043
0044 L1GctHfBitCountsLut L1GctHfBitCountsLut::operator=(const L1GctHfBitCountsLut& lut) {
0045 const L1GctHfBitCountsLut& temp(lut);
0046 return temp;
0047 }
0048
0049 std::ostream& operator<<(std::ostream& os, const L1GctHfBitCountsLut& lut) {
0050 os << "===L1GctHfBitCountsLut===" << std::endl;
0051 os << "\n===Lookup table contents===\n" << std::endl;
0052 const L1GctLut<L1GctHfBitCountsLut::NAddress, L1GctHfBitCountsLut::NData>* temp = &lut;
0053 os << *temp;
0054 return os;
0055 }
0056
0057 template class L1GctLut<L1GctHfBitCountsLut::NAddress, L1GctHfBitCountsLut::NData>;