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>(),
9  m_lutType(type)
10 {
11  // No setup required
12  m_setupOk = true;
13 }
14 
17  m_lutType()
18 {
19  // No setup required
20  m_setupOk = true;
21 }
22 
25  m_lutType(lut.lutType())
26 {
27  // No setup required
28  m_setupOk = true;
29 }
30 
32 {
33 }
34 
35 uint16_t L1GctHfBitCountsLut::value (const uint16_t lutAddress) const
36 {
37  // Return "address=data" up to the maximum number of output codes
38  const int maxOutput = ((1<<NData)-1);
39  if (lutAddress > maxOutput) return maxOutput;
40  else return (lutAddress & maxOutput);
41 }
42 
43 std::vector<unsigned> L1GctHfBitCountsLut::getThresholdsGct() const
44 {
45  std::vector<unsigned> result;
46  // Return "address=data" up to the maximum number of output codes
47  for (unsigned add=1; add<(1<<NData); add++) {
48  result.push_back(add);
49  }
50  return result;
51 }
52 
54 {
55  const L1GctHfBitCountsLut& temp(lut);
56  return temp;
57 }
58 
59 std::ostream& operator << (std::ostream& os, const L1GctHfBitCountsLut& lut)
60 {
61  os << "===L1GctHfBitCountsLut===" << std::endl;
62  os << "\n===Lookup table contents===\n" << std::endl;
64  os << *temp;
65  return os;
66 }
67 
69 
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:20
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.