CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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...
 
virtual ~L1GctHfEtSumsLut ()
 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

virtual uint16_t value (const uint16_t lutAddress) const
 
- 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 21 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.

9  :
11  m_lutFunction(scale),
13 {
14  if (scale != 0) m_setupOk = true;
15 }
type
Definition: HCALResponse.h:21
const L1CaloEtScale * m_lutFunction
Base class for LookUp Tables.
Definition: L1GctLut.h:20
L1GctHfEtSumsLut::hfLutType m_lutType
L1GctHfEtSumsLut::L1GctHfEtSumsLut ( const L1GctHfEtSumsLut::hfLutType type)

Constructor for use with emulator - which type of Lut?

Definition at line 17 of file L1GctHfEtSumsLut.cc.

17  :
19  m_lutFunction(0),
21 {
22 }
type
Definition: HCALResponse.h:21
const L1CaloEtScale * m_lutFunction
Base class for LookUp Tables.
Definition: L1GctLut.h:20
L1GctHfEtSumsLut::hfLutType m_lutType
L1GctHfEtSumsLut::L1GctHfEtSumsLut ( )

Default constructor.

Definition at line 24 of file L1GctHfEtSumsLut.cc.

24  :
26  m_lutFunction(0),
27  m_lutType()
28 {
29 }
const L1CaloEtScale * m_lutFunction
Base class for LookUp Tables.
Definition: L1GctLut.h:20
L1GctHfEtSumsLut::hfLutType m_lutType
L1GctHfEtSumsLut::L1GctHfEtSumsLut ( const L1GctHfEtSumsLut lut)

Copy constructor.

Definition at line 31 of file L1GctHfEtSumsLut.cc.

31  :
34  m_lutType(lut.lutType())
35 {
36 }
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:20
L1GctHfEtSumsLut::hfLutType m_lutType
L1GctHfEtSumsLut::~L1GctHfEtSumsLut ( )
virtual

Destructor.

Definition at line 38 of file L1GctHfEtSumsLut.cc.

39 {
40 }

Member Function Documentation

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

Definition at line 53 of file L1GctHfEtSumsLut.cc.

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

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 }
const L1CaloEtScale * m_lutFunction
double linearLsb() const
get LSB of linear input scale
Definition: L1CaloEtScale.h:51
const std::vector< double > & getThresholds() const
get thresholds
Definition: L1CaloEtScale.h:63
tuple result
Definition: query.py:137
std::vector< double > L1GctHfEtSumsLut::getThresholdsGeV ( ) const

Get thresholds.

Definition at line 48 of file L1GctHfEtSumsLut.cc.

References L1CaloEtScale::getThresholds(), and m_lutFunction.

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

Return the Lut function.

Definition at line 63 of file L1GctHfEtSumsLut.h.

References m_lutFunction.

Referenced by L1GctGlobalHfSumAlgos::getThresholds().

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

Return the type of Lut.

Definition at line 60 of file L1GctHfEtSumsLut.h.

References m_lutType.

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

Overload = operator.

Definition at line 64 of file L1GctHfEtSumsLut.cc.

References groupFilesInBlocks::temp.

65 {
67  return temp;
68 }
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 m_lutFunction, and L1GctLut< 8, 3 >::m_setupOk.

57 { if (fn != 0) { m_lutFunction = fn; m_setupOk = true; } }
const L1CaloEtScale * m_lutFunction
uint16_t L1GctHfEtSumsLut::value ( const uint16_t  lutAddress) const
protectedvirtual

Implements L1GctLut< 8, 3 >.

Definition at line 43 of file L1GctHfEtSumsLut.cc.

References m_lutFunction, and L1CaloEtScale::rank().

44 {
45  return m_lutFunction->rank(lutAddress) ;
46 }
const L1CaloEtScale * m_lutFunction
uint16_t rank(const uint16_t linear) const
convert from linear Et scale to rank scale

Friends And Related Function Documentation

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

Overload << operator.

Definition at line 70 of file L1GctHfEtSumsLut.cc.

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 }
const L1CaloEtScale * m_lutFunction
Base class for LookUp Tables.
Definition: L1GctLut.h:20
const std::vector< double > & getThresholds() const
get thresholds
Definition: L1CaloEtScale.h:63
tuple lut
Definition: lumiPlot.py:244

Member Data Documentation

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

Definition at line 77 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.