CMS 3D CMS Logo

L1GctHfEtSumsLut.cc
Go to the documentation of this file.
2 
4 
5 //DEFINE STATICS
6 const int L1GctHfEtSumsLut::NAddress = 8;
7 const int L1GctHfEtSumsLut::NData = 3;
8 
10  : L1GctLut<NAddress, NData>(), m_lutFunction(scale), m_lutType(type) {
11  if (scale != nullptr)
12  m_setupOk = true;
13 }
14 
16  : L1GctLut<NAddress, NData>(), m_lutFunction(nullptr), m_lutType(type) {}
17 
18 L1GctHfEtSumsLut::L1GctHfEtSumsLut() : L1GctLut<NAddress, NData>(), m_lutFunction(nullptr), m_lutType() {}
19 
21  : L1GctLut<NAddress, NData>(), m_lutFunction(lut.lutFunction()), m_lutType(lut.lutType()) {}
22 
24 
25 uint16_t L1GctHfEtSumsLut::value(const uint16_t lutAddress) const { return m_lutFunction->rank(lutAddress); }
26 
27 std::vector<double> L1GctHfEtSumsLut::getThresholdsGeV() const { return m_lutFunction->getThresholds(); }
28 
29 std::vector<unsigned> L1GctHfEtSumsLut::getThresholdsGct() const {
30  std::vector<unsigned> result;
31  std::vector<double> thresholdsGeV = m_lutFunction->getThresholds();
32  for (std::vector<double>::const_iterator thr = thresholdsGeV.begin(); thr != thresholdsGeV.end(); thr++) {
33  result.push_back(static_cast<unsigned>((*thr) / (m_lutFunction->linearLsb())));
34  }
35  return result;
36 }
37 
39  const L1GctHfEtSumsLut& temp(lut);
40  return temp;
41 }
42 
43 std::ostream& operator<<(std::ostream& os, const L1GctHfEtSumsLut& lut) {
44  os << "===L1GctHfEtSumsLut===" << std::endl;
45  std::vector<double> thresholds = lut.m_lutFunction->getThresholds();
46  std::vector<double>::const_iterator thr = thresholds.begin();
47  os << "Thresholds are: " << *(thr++);
48  for (; thr != thresholds.end(); thr++) {
49  os << ", " << *thr;
50  }
51  os << std::endl;
52  os << "\n===Lookup table contents===\n" << std::endl;
54  os << *temp;
55  return os;
56 }
57 
const std::vector< double > & getThresholds() const
get thresholds
Definition: L1CaloEtScale.h:66
static const int NData
const L1CaloEtScale * m_lutFunction
std::ostream & operator<<(std::ostream &os, const L1GctHfEtSumsLut &lut)
std::vector< unsigned > getThresholdsGct() const
Base class for LookUp Tables.
Definition: L1GctLut.h:19
static const int NAddress
~L1GctHfEtSumsLut() override
Destructor.
double linearLsb() const
get LSB of linear input scale
Definition: L1CaloEtScale.h:54
LUT for compression of HF Et sum to output format.
L1GctHfEtSumsLut()
Default constructor.
uint16_t rank(const uint16_t linear) const
convert from linear Et scale to rank scale
std::vector< double > getThresholdsGeV() const
Get thresholds.
L1GctHfEtSumsLut operator=(const L1GctHfEtSumsLut &lut)
Overload = operator.
uint16_t value(const uint16_t lutAddress) const override