CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 != 0) m_setupOk = true;
15 }
16 
18  L1GctLut<NAddress,NData>(),
19  m_lutFunction(0),
20  m_lutType(type)
21 {
22 }
23 
25  L1GctLut<NAddress,NData>(),
26  m_lutFunction(0),
27  m_lutType()
28 {
29 }
30 
32  L1GctLut<NAddress,NData>(),
33  m_lutFunction(lut.lutFunction()),
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 {
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:22
static const int NData
const L1CaloEtScale * m_lutFunction
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
double linearLsb() const
get LSB of linear input scale
Definition: L1CaloEtScale.h:51
Base class for LookUp Tables.
Definition: L1GctLut.h:21
uint16_t rank(const uint16_t linear) const
convert from linear Et scale to rank scale
static const int NAddress
const std::vector< double > & getThresholds() const
get thresholds
Definition: L1CaloEtScale.h:63
tuple result
Definition: query.py:137
LUT for compression of HF Et sum to output format.
virtual ~L1GctHfEtSumsLut()
Destructor.
tuple lut
Definition: lumiPlot.py:244
L1GctHfEtSumsLut()
Default constructor.
virtual uint16_t value(const uint16_t lutAddress) const
std::vector< unsigned > getThresholdsGct() const
std::vector< double > getThresholdsGeV() const
Get thresholds.
L1GctHfEtSumsLut operator=(const L1GctHfEtSumsLut &lut)
Overload = operator.