#include <CondFormats/L1TObjects/interface/L1GctHfLutSetup.h>
Public Types | |
enum | hfLutType { bitCountPosEtaRing1, bitCountPosEtaRing2, bitCountNegEtaRing1, bitCountNegEtaRing2, etSumPosEtaRing1, etSumPosEtaRing2, etSumNegEtaRing1, etSumNegEtaRing2, numberOfLutTypes } |
Define the different types of Lut. More... | |
enum | numberOfCountBits { kHfCountBits = 5, kHfCountNumValues = 1 << kHfCountBits, kHfCountMaxValue = kHfCountNumValues - 1 } |
enum | numberOfEtSumBits { kHfEtSumBits = 8, kHfEtSumNumValues = 1 << kHfEtSumBits, kHfEtSumMaxValue = kHfEtSumNumValues - 1 } |
Define the numbers of input and output bits. More... | |
enum | numberOfOutputBits { kHfOutputBits = 3, kHfOutputNumValues = 1 << kHfOutputBits, kHfOutputMaxValue = kHfOutputNumValues - 1 } |
Public Member Functions | |
std::vector< unsigned > | getCountThresholdsNegEtaRing1 () const |
std::vector< unsigned > | getCountThresholdsNegEtaRing2 () const |
std::vector< unsigned > | getCountThresholdsPosEtaRing1 () const |
std::vector< unsigned > | getCountThresholdsPosEtaRing2 () const |
std::vector< unsigned > | getEtSumThresholdsNegEtaRing1 () const |
std::vector< unsigned > | getEtSumThresholdsNegEtaRing2 () const |
std::vector< unsigned > | getEtSumThresholdsPosEtaRing1 () const |
std::vector< unsigned > | getEtSumThresholdsPosEtaRing2 () const |
std::vector< unsigned > | getThresholds (const hfLutType type) const |
L1GctHfLutSetup () | |
uint16_t | outputValue (const hfLutType type, const uint16_t inputValue) const |
void | setThresholds (const hfLutType type, const std::vector< unsigned > thr) |
~L1GctHfLutSetup () | |
Private Attributes | |
std::map< hfLutType, std::vector< uint16_t > > | m_thresholds |
============================================================================
Definition at line 24 of file L1GctHfLutSetup.h.
Define the different types of Lut.
bitCountPosEtaRing1 | |
bitCountPosEtaRing2 | |
bitCountNegEtaRing1 | |
bitCountNegEtaRing2 | |
etSumPosEtaRing1 | |
etSumPosEtaRing2 | |
etSumNegEtaRing1 | |
etSumNegEtaRing2 | |
numberOfLutTypes |
Definition at line 29 of file L1GctHfLutSetup.h.
00029 { bitCountPosEtaRing1, bitCountPosEtaRing2, bitCountNegEtaRing1, bitCountNegEtaRing2, 00030 etSumPosEtaRing1, etSumPosEtaRing2, etSumNegEtaRing1, etSumNegEtaRing2, 00031 numberOfLutTypes};
Definition at line 39 of file L1GctHfLutSetup.h.
00039 { 00040 kHfCountBits = 5, 00041 kHfCountNumValues = 1 << kHfCountBits, 00042 kHfCountMaxValue = kHfCountNumValues - 1 00043 };
Define the numbers of input and output bits.
Definition at line 33 of file L1GctHfLutSetup.h.
00033 { 00034 kHfEtSumBits = 8, 00035 kHfEtSumNumValues = 1 << kHfEtSumBits, 00036 kHfEtSumMaxValue = kHfEtSumNumValues - 1 00037 };
Definition at line 45 of file L1GctHfLutSetup.h.
00045 { 00046 kHfOutputBits = 3, 00047 kHfOutputNumValues = 1 << kHfOutputBits, 00048 kHfOutputMaxValue = kHfOutputNumValues - 1 00049 };
L1GctHfLutSetup::L1GctHfLutSetup | ( | ) |
L1GctHfLutSetup::~L1GctHfLutSetup | ( | ) |
std::vector<unsigned> L1GctHfLutSetup::getCountThresholdsNegEtaRing1 | ( | ) | const [inline] |
Definition at line 63 of file L1GctHfLutSetup.h.
References bitCountNegEtaRing1, and getThresholds().
00063 { return getThresholds(bitCountNegEtaRing1); }
std::vector<unsigned> L1GctHfLutSetup::getCountThresholdsNegEtaRing2 | ( | ) | const [inline] |
Definition at line 64 of file L1GctHfLutSetup.h.
References bitCountNegEtaRing2, and getThresholds().
00064 { return getThresholds(bitCountNegEtaRing2); }
std::vector<unsigned> L1GctHfLutSetup::getCountThresholdsPosEtaRing1 | ( | ) | const [inline] |
Definition at line 61 of file L1GctHfLutSetup.h.
References bitCountPosEtaRing1, and getThresholds().
00061 { return getThresholds(bitCountPosEtaRing1); }
std::vector<unsigned> L1GctHfLutSetup::getCountThresholdsPosEtaRing2 | ( | ) | const [inline] |
Definition at line 62 of file L1GctHfLutSetup.h.
References bitCountPosEtaRing2, and getThresholds().
00062 { return getThresholds(bitCountPosEtaRing2); }
std::vector<unsigned> L1GctHfLutSetup::getEtSumThresholdsNegEtaRing1 | ( | ) | const [inline] |
Definition at line 67 of file L1GctHfLutSetup.h.
References etSumNegEtaRing1, and getThresholds().
00067 { return getThresholds(etSumNegEtaRing1); }
std::vector<unsigned> L1GctHfLutSetup::getEtSumThresholdsNegEtaRing2 | ( | ) | const [inline] |
Definition at line 68 of file L1GctHfLutSetup.h.
References etSumNegEtaRing2, and getThresholds().
00068 { return getThresholds(etSumNegEtaRing2); }
std::vector<unsigned> L1GctHfLutSetup::getEtSumThresholdsPosEtaRing1 | ( | ) | const [inline] |
Definition at line 65 of file L1GctHfLutSetup.h.
References etSumPosEtaRing1, and getThresholds().
00065 { return getThresholds(etSumPosEtaRing1); }
std::vector<unsigned> L1GctHfLutSetup::getEtSumThresholdsPosEtaRing2 | ( | ) | const [inline] |
Definition at line 66 of file L1GctHfLutSetup.h.
References etSumPosEtaRing2, and getThresholds().
00066 { return getThresholds(etSumPosEtaRing2); }
std::vector< unsigned > L1GctHfLutSetup::getThresholds | ( | const hfLutType | type | ) | const |
Definition at line 27 of file L1GctHfLutSetup.cc.
References m_thresholds, and HLT_VtxMuL3::result.
Referenced by getCountThresholdsNegEtaRing1(), getCountThresholdsNegEtaRing2(), getCountThresholdsPosEtaRing1(), getCountThresholdsPosEtaRing2(), getEtSumThresholdsNegEtaRing1(), getEtSumThresholdsNegEtaRing2(), getEtSumThresholdsPosEtaRing1(), getEtSumThresholdsPosEtaRing2(), L1GctGlobalHfSumAlgos::getThresholds(), and operator<<().
00028 { 00029 std::vector<unsigned> result; 00030 std::map<hfLutType, std::vector<uint16_t> >::const_iterator thrList = m_thresholds.find(type); 00031 if (thrList != m_thresholds.end()) { 00032 for (std::vector<uint16_t>::const_iterator thr = thrList->second.begin(); 00033 thr != thrList->second.end(); thr++) { 00034 result.push_back(static_cast<unsigned>(*thr)); 00035 } 00036 } 00037 return result; 00038 }
uint16_t L1GctHfLutSetup::outputValue | ( | const hfLutType | type, | |
const uint16_t | inputValue | |||
) | const |
Definition at line 40 of file L1GctHfLutSetup.cc.
References i, kHfOutputMaxValue, m_thresholds, and HLT_VtxMuL3::result.
Referenced by L1GctHfBitCountsLut::value(), and L1GctHfEtSumsLut::value().
00041 { 00042 // Calculate Lut contents by comparison against a set of thresholds. 00043 // Check that the Lut type requested has actually been setup - otherwise 00044 // we return the max possible output value 00045 uint16_t result = kHfOutputMaxValue; 00046 std::map<hfLutType, std::vector<uint16_t> >::const_iterator thrList = m_thresholds.find(type); 00047 if (thrList != m_thresholds.end()) { 00048 for (unsigned i=0; i<kHfOutputMaxValue; ++i) { 00049 if (inputValue < (thrList->second).at(i)) { 00050 result = i; 00051 break; 00052 } 00053 } 00054 } 00055 return result; 00056 }
Definition at line 11 of file L1GctHfLutSetup.cc.
References i, kHfEtSumMaxValue, kHfOutputMaxValue, and m_thresholds.
00012 { 00013 // Set thresholds for a particular Lut type. 00014 // Thresholds should (of course) be ordered - but no check is performed. 00015 // The number of thresholds is one fewer than the number of possible 00016 // output codes (e.g. 3 bits -> 7 thresholds) 00017 m_thresholds[type].resize(kHfOutputMaxValue); 00018 for (unsigned i=0; i<kHfOutputMaxValue; ++i) { 00019 if (i<thr.size()) { 00020 m_thresholds[type].at(i) = static_cast<uint16_t>(thr.at(i)); 00021 } else { 00022 m_thresholds[type].at(i) = kHfEtSumMaxValue; 00023 } 00024 } 00025 }
std::map<hfLutType, std::vector<uint16_t> > L1GctHfLutSetup::m_thresholds [private] |
Definition at line 75 of file L1GctHfLutSetup.h.
Referenced by getThresholds(), outputValue(), and setThresholds().