CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | Friends
L1GctHfEtSumsLut Class Reference

LUT for compression of HF Et sum to output format. More...

#include <L1GctHfEtSumsLut.h>

Inheritance diagram for L1GctHfEtSumsLut:
L1GctLut< 8, 3 >

Public Types

enum  hfLutType {
  bitCountPosEtaRing1, bitCountPosEtaRing2, bitCountNegEtaRing1, bitCountNegEtaRing2,
  etSumPosEtaRing1, etSumPosEtaRing2, etSumNegEtaRing1, etSumNegEtaRing2,
  numberOfLutTypes
}
 

Public Member Functions

std::vector< unsigned > getThresholdsGct () const
 
std::vector< double > getThresholdsGeV () const
 Get thresholds. More...
 
 L1GctHfEtSumsLut (const L1GctHfEtSumsLut::hfLutType &type, const L1CaloEtScale *const scale)
 Constructor for use with emulator - which type of Lut? More...
 
 L1GctHfEtSumsLut (const L1GctHfEtSumsLut::hfLutType &type)
 Constructor for use with emulator - which type of Lut? More...
 
 L1GctHfEtSumsLut ()
 Default constructor. More...
 
 L1GctHfEtSumsLut (const L1GctHfEtSumsLut &lut)
 Copy constructor. More...
 
const L1CaloEtScalelutFunction () const
 Return the Lut function. More...
 
L1GctHfEtSumsLut::hfLutType lutType () const
 Return the type of Lut. More...
 
L1GctHfEtSumsLut operator= (const L1GctHfEtSumsLut &lut)
 Overload = operator. More...
 
void setFunction (const L1CaloEtScale *const fn)
 Set the function. More...
 
 ~L1GctHfEtSumsLut () override
 Destructor. More...
 
- Public Member Functions inherited from L1GctLut< 8, 3 >
uint16_t lutValue (const uint16_t lutAddress) const
 Access the look-up table contents for a given Address. More...
 
int operator!= (const L1GctLut< KAddressBits, KDataBits > &rhsLut) const
 Inequality check between look-up tables. More...
 
int operator== (const L1GctLut< KAddressBits, KDataBits > &rhsLut) const
 Equality check between look-up tables. More...
 
uint16_t operator[] (const uint16_t lutAddress) const
 Access the look-up table contents for a given Address. More...
 
void setTerse ()
 
bool setupOk ()
 
void setVerbose ()
 control output messages More...
 
virtual ~L1GctLut ()
 

Static Public Attributes

static const int NAddress = 8
 
static const int NData = 3
 
- Static Public Attributes inherited from L1GctLut< 8, 3 >
static const uint16_t MAX_ADDRESS_BITMASK
 
static const uint16_t MAX_DATA_BITMASK
 

Protected Member Functions

uint16_t value (const uint16_t lutAddress) const override
 
- Protected Member Functions inherited from L1GctLut< 8, 3 >
bool equalityCheck (const L1GctLut< KAddressBits, KDataBits > &c) const
 
 L1GctLut ()
 

Private Attributes

const L1CaloEtScalem_lutFunction
 
L1GctHfEtSumsLut::hfLutType m_lutType
 

Friends

std::ostream & operator<< (std::ostream &os, const L1GctHfEtSumsLut &lut)
 Overload << operator. More...
 

Additional Inherited Members

- Protected Attributes inherited from L1GctLut< 8, 3 >
bool m_setupOk
 
bool m_verbose
 

Detailed Description

LUT for compression of HF Et sum to output format.

Author
Greg Heath
Date
September 2008

Definition at line 20 of file L1GctHfEtSumsLut.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

L1GctHfEtSumsLut::L1GctHfEtSumsLut ( const L1GctHfEtSumsLut::hfLutType type,
const L1CaloEtScale *const  scale 
)

Constructor for use with emulator - which type of Lut?

Definition at line 9 of file L1GctHfEtSumsLut.cc.

References L1GctLut< 8, 3 >::m_setupOk.

11  if (scale != nullptr)
12  m_setupOk = true;
13 }
const L1CaloEtScale * m_lutFunction
Base class for LookUp Tables.
Definition: L1GctLut.h:19
L1GctHfEtSumsLut::hfLutType m_lutType
L1GctHfEtSumsLut::L1GctHfEtSumsLut ( const L1GctHfEtSumsLut::hfLutType type)

Constructor for use with emulator - which type of Lut?

Definition at line 15 of file L1GctHfEtSumsLut.cc.

const L1CaloEtScale * m_lutFunction
Base class for LookUp Tables.
Definition: L1GctLut.h:19
L1GctHfEtSumsLut::hfLutType m_lutType
L1GctHfEtSumsLut::L1GctHfEtSumsLut ( )

Default constructor.

Definition at line 18 of file L1GctHfEtSumsLut.cc.

const L1CaloEtScale * m_lutFunction
Base class for LookUp Tables.
Definition: L1GctLut.h:19
L1GctHfEtSumsLut::hfLutType m_lutType
L1GctHfEtSumsLut::L1GctHfEtSumsLut ( const L1GctHfEtSumsLut lut)

Copy constructor.

Definition at line 20 of file L1GctHfEtSumsLut.cc.

const L1CaloEtScale * m_lutFunction
L1GctHfEtSumsLut::hfLutType lutType() const
Return the type of Lut.
const L1CaloEtScale * lutFunction() const
Return the Lut function.
Base class for LookUp Tables.
Definition: L1GctLut.h:19
L1GctHfEtSumsLut::hfLutType m_lutType
L1GctHfEtSumsLut::~L1GctHfEtSumsLut ( )
override

Destructor.

Definition at line 23 of file L1GctHfEtSumsLut.cc.

23 {}

Member Function Documentation

std::vector< unsigned > L1GctHfEtSumsLut::getThresholdsGct ( ) const

Definition at line 29 of file L1GctHfEtSumsLut.cc.

References L1CaloEtScale::getThresholds(), L1CaloEtScale::linearLsb(), m_lutFunction, and mps_fire::result.

29  {
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 }
const L1CaloEtScale * m_lutFunction
double linearLsb() const
get LSB of linear input scale
Definition: L1CaloEtScale.h:54
tuple result
Definition: mps_fire.py:311
const std::vector< double > & getThresholds() const
get thresholds
Definition: L1CaloEtScale.h:66
std::vector< double > L1GctHfEtSumsLut::getThresholdsGeV ( ) const

Get thresholds.

Definition at line 27 of file L1GctHfEtSumsLut.cc.

References L1CaloEtScale::getThresholds(), and m_lutFunction.

27 { return m_lutFunction->getThresholds(); }
const L1CaloEtScale * m_lutFunction
const std::vector< double > & getThresholds() const
get thresholds
Definition: L1CaloEtScale.h:66
const L1CaloEtScale* L1GctHfEtSumsLut::lutFunction ( ) const
inline

Return the Lut function.

Definition at line 68 of file L1GctHfEtSumsLut.h.

References m_lutFunction.

Referenced by L1GctGlobalHfSumAlgos::getThresholds().

68 { return m_lutFunction; }
const L1CaloEtScale * m_lutFunction
L1GctHfEtSumsLut::hfLutType L1GctHfEtSumsLut::lutType ( ) const
inline

Return the type of Lut.

Definition at line 65 of file L1GctHfEtSumsLut.h.

References m_lutType.

65 { return m_lutType; }
L1GctHfEtSumsLut::hfLutType m_lutType
L1GctHfEtSumsLut L1GctHfEtSumsLut::operator= ( const L1GctHfEtSumsLut lut)

Overload = operator.

Definition at line 38 of file L1GctHfEtSumsLut.cc.

References groupFilesInBlocks::temp.

38  {
39  const L1GctHfEtSumsLut& temp(lut);
40  return temp;
41 }
LUT for compression of HF Et sum to output format.
void L1GctHfEtSumsLut::setFunction ( const L1CaloEtScale *const  fn)
inline

Set the function.

Definition at line 57 of file L1GctHfEtSumsLut.h.

References personalPlayback::fn, m_lutFunction, and L1GctLut< 8, 3 >::m_setupOk.

57  {
58  if (fn != nullptr) {
59  m_lutFunction = fn;
60  m_setupOk = true;
61  }
62  }
const L1CaloEtScale * m_lutFunction
uint16_t L1GctHfEtSumsLut::value ( const uint16_t  lutAddress) const
overrideprotectedvirtual

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const L1GctHfEtSumsLut lut 
)
friend

Overload << operator.

Definition at line 43 of file L1GctHfEtSumsLut.cc.

43  {
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 }
const L1CaloEtScale * m_lutFunction
Base class for LookUp Tables.
Definition: L1GctLut.h:19
const std::vector< double > & getThresholds() const
get thresholds
Definition: L1CaloEtScale.h:66

Member Data Documentation

const L1CaloEtScale* L1GctHfEtSumsLut::m_lutFunction
private
L1GctHfEtSumsLut::hfLutType L1GctHfEtSumsLut::m_lutType
private

Definition at line 79 of file L1GctHfEtSumsLut.h.

Referenced by lutType().

const int L1GctHfEtSumsLut::NAddress = 8
static

Definition at line 37 of file L1GctHfEtSumsLut.h.

const int L1GctHfEtSumsLut::NData = 3
static

Definition at line 37 of file L1GctHfEtSumsLut.h.