CMS 3D CMS Logo

L1GctHfEtSumsLut.cc
Go to the documentation of this file.
2 
4 
5 //DEFINE STATICS
7 const int L1GctHfEtSumsLut::NData =3;
8 
10  L1GctLut<NAddress,NData>(),
11  m_lutFunction(scale),
12  m_lutType(type)
13 {
14  if (scale != nullptr) m_setupOk = true;
15 }
16 
20  m_lutType(type)
21 {
22 }
23 
27  m_lutType()
28 {
29 }
30 
34  m_lutType(lut.lutType())
35 {
36 }
37 
39 {
40 }
41 
42 
43 uint16_t L1GctHfEtSumsLut::value (const uint16_t lutAddress) const
44 {
45  return m_lutFunction->rank(lutAddress) ;
46 }
47 
48 std::vector<double> L1GctHfEtSumsLut::getThresholdsGeV() const
49 {
50  return m_lutFunction->getThresholds();
51 }
52 
53 std::vector<unsigned> L1GctHfEtSumsLut::getThresholdsGct() const
54 {
55  std::vector<unsigned> result;
56  std::vector<double> thresholdsGeV = m_lutFunction->getThresholds();
57  for (std::vector<double>::const_iterator thr=thresholdsGeV.begin();
58  thr != thresholdsGeV.end(); thr++) {
59  result.push_back(static_cast<unsigned>((*thr)/(m_lutFunction->linearLsb())));
60  }
61  return result;
62 }
63 
65 {
66  const L1GctHfEtSumsLut& temp(lut);
67  return temp;
68 }
69 
70 std::ostream& operator << (std::ostream& os, const L1GctHfEtSumsLut& lut)
71 {
72  os << "===L1GctHfEtSumsLut===" << std::endl;
73  std::vector<double> thresholds = lut.m_lutFunction->getThresholds();
74  std::vector<double>::const_iterator thr = thresholds.begin();
75  os << "Thresholds are: " << *(thr++);
76  for ( ; thr != thresholds.end(); thr++) {
77  os << ", " << *thr;
78  }
79  os << std::endl;
80  os << "\n===Lookup table contents===\n" << std::endl;
82  os << *temp;
83  return os;
84 }
85 
87 
88 
type
Definition: HCALResponse.h:21
static const int NData
const L1CaloEtScale * m_lutFunction
#define nullptr
L1GctHfEtSumsLut::hfLutType lutType() const
Return the type of Lut.
const L1CaloEtScale * lutFunction() const
Return the Lut function.
double linearLsb() const
get LSB of linear input scale
Definition: L1CaloEtScale.h:53
Base class for LookUp Tables.
Definition: L1GctLut.h:20
uint16_t rank(const uint16_t linear) const
convert from linear Et scale to rank scale
static const int NAddress
~L1GctHfEtSumsLut() override
Destructor.
const std::vector< double > & getThresholds() const
get thresholds
Definition: L1CaloEtScale.h:65
LUT for compression of HF Et sum to output format.
uint16_t value(const uint16_t lutAddress) const override
L1GctHfEtSumsLut()
Default constructor.
friend std::ostream & operator<<(std::ostream &os, const L1GctHfEtSumsLut &lut)
Overload << operator.
std::vector< unsigned > getThresholdsGct() const
std::vector< double > getThresholdsGeV() const
Get thresholds.
L1GctHfEtSumsLut operator=(const L1GctHfEtSumsLut &lut)
Overload = operator.
L1GctHfEtSumsLut::hfLutType m_lutType