CMS 3D CMS Logo

L1GctHfBitCountsLut.cc
Go to the documentation of this file.
2 
3 //DEFINE STATICS
5 const int L1GctHfBitCountsLut::NData = 3;
6 
8  : L1GctLut<NAddress, NData>(), m_lutType(type) {
9  // No setup required
10  m_setupOk = true;
11 }
12 
14  // No setup required
15  m_setupOk = true;
16 }
17 
19  : L1GctLut<NAddress, NData>(), m_lutType(lut.lutType()) {
20  // No setup required
21  m_setupOk = true;
22 }
23 
25 
26 uint16_t L1GctHfBitCountsLut::value(const uint16_t lutAddress) const {
27  // Return "address=data" up to the maximum number of output codes
28  const int maxOutput = ((1 << NData) - 1);
29  if (lutAddress > maxOutput)
30  return maxOutput;
31  else
32  return (lutAddress & maxOutput);
33 }
34 
35 std::vector<unsigned> L1GctHfBitCountsLut::getThresholdsGct() const {
36  std::vector<unsigned> result;
37  // Return "address=data" up to the maximum number of output codes
38  for (unsigned add = 1; add < (1 << NData); add++) {
39  result.push_back(add);
40  }
41  return result;
42 }
43 
45  const L1GctHfBitCountsLut& temp(lut);
46  return temp;
47 }
48 
49 std::ostream& operator<<(std::ostream& os, const L1GctHfBitCountsLut& lut) {
50  os << "===L1GctHfBitCountsLut===" << std::endl;
51  os << "\n===Lookup table contents===\n" << std::endl;
53  os << *temp;
54  return os;
55 }
56 
type
Definition: HCALResponse.h:21
static const int NData
L1GctHfEtSumsLut::hfLutType lutType() const
Return the type of Lut.
Base class for LookUp Tables.
Definition: L1GctLut.h:19
friend std::ostream & operator<<(std::ostream &os, const L1GctHfBitCountsLut &lut)
Overload << operator.
uint16_t value(const uint16_t lutAddress) const override
L1GctHfBitCountsLut operator=(const L1GctHfBitCountsLut &lut)
Overload = operator.
L1GctHfEtSumsLut::hfLutType m_lutType
LUT for compression of HF feature bit counts to output format.
L1GctHfBitCountsLut()
Default constructor.
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
static const int NAddress
~L1GctHfBitCountsLut() override
Destructor.
std::vector< unsigned > getThresholdsGct() const
Get thresholds.