CMS 3D CMS Logo

Public Types | Public Member Functions | Public Attributes | 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 >

List of all members.

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.
 L1GctHfEtSumsLut (const L1GctHfEtSumsLut::hfLutType &type)
 Constructor for use with emulator - which type of Lut?
 L1GctHfEtSumsLut (const L1GctHfEtSumsLut &lut)
 Copy constructor.
 L1GctHfEtSumsLut (const L1GctHfEtSumsLut::hfLutType &type, const L1CaloEtScale *const scale)
 Constructor for use with emulator - which type of Lut?
 L1GctHfEtSumsLut ()
 Default constructor.
const L1CaloEtScalelutFunction () const
 Return the Lut function.
L1GctHfEtSumsLut::hfLutType lutType () const
 Return the type of Lut.
L1GctHfEtSumsLut operator= (const L1GctHfEtSumsLut &lut)
 Overload = operator.
void setFunction (const L1CaloEtScale *const fn)
 Set the function.
virtual ~L1GctHfEtSumsLut ()
 Destructor.

Public Attributes

static const int NData = 3

Static Public Attributes

static const int NAddress = 8

Protected Member Functions

virtual uint16_t value (const uint16_t lutAddress) const

Private Attributes

const L1CaloEtScalem_lutFunction
L1GctHfEtSumsLut::hfLutType m_lutType

Friends

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

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

Enumerator:
bitCountPosEtaRing1 
bitCountPosEtaRing2 
bitCountNegEtaRing1 
bitCountNegEtaRing2 
etSumPosEtaRing1 
etSumPosEtaRing2 
etSumNegEtaRing1 
etSumNegEtaRing2 
numberOfLutTypes 

Definition at line 26 of file L1GctHfEtSumsLut.h.


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.

                                                                                                          :
  L1GctLut<NAddress,NData>(),
  m_lutFunction(scale),
  m_lutType(type)
{
  if (scale != 0) m_setupOk = true;
}
L1GctHfEtSumsLut::L1GctHfEtSumsLut ( const L1GctHfEtSumsLut::hfLutType type)

Constructor for use with emulator - which type of Lut?

Definition at line 17 of file L1GctHfEtSumsLut.cc.

L1GctHfEtSumsLut::L1GctHfEtSumsLut ( )

Default constructor.

Definition at line 24 of file L1GctHfEtSumsLut.cc.

L1GctHfEtSumsLut::L1GctHfEtSumsLut ( const L1GctHfEtSumsLut lut)

Copy constructor.

Definition at line 31 of file L1GctHfEtSumsLut.cc.

L1GctHfEtSumsLut::~L1GctHfEtSumsLut ( ) [virtual]

Destructor.

Definition at line 38 of file L1GctHfEtSumsLut.cc.

{
}

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.

{
 std::vector<unsigned> result;
 std::vector<double> thresholdsGeV = m_lutFunction->getThresholds();
 for (std::vector<double>::const_iterator thr=thresholdsGeV.begin();
        thr != thresholdsGeV.end(); thr++) {
   result.push_back(static_cast<unsigned>((*thr)/(m_lutFunction->linearLsb())));
 }
 return result;
}
std::vector< double > L1GctHfEtSumsLut::getThresholdsGeV ( ) const

Get thresholds.

Definition at line 48 of file L1GctHfEtSumsLut.cc.

References L1CaloEtScale::getThresholds(), and m_lutFunction.

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().

{ return m_lutFunction; }
L1GctHfEtSumsLut::hfLutType L1GctHfEtSumsLut::lutType ( ) const [inline]

Return the type of Lut.

Definition at line 60 of file L1GctHfEtSumsLut.h.

References m_lutType.

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

Overload = operator.

Definition at line 64 of file L1GctHfEtSumsLut.cc.

References cond::rpcobtemp::temp.

{
  L1GctHfEtSumsLut temp(lut);
  return temp;
}
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.

{ if (fn != 0) { m_lutFunction = fn; m_setupOk = true; } }
uint16_t L1GctHfEtSumsLut::value ( const uint16_t  lutAddress) const [protected, virtual]

Implements L1GctLut< 8, 3 >.

Definition at line 43 of file L1GctHfEtSumsLut.cc.

References m_lutFunction, and L1CaloEtScale::rank().

{
  return m_lutFunction->rank(lutAddress) ;
}

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.

{
  os << "===L1GctHfEtSumsLut===" << std::endl;
  std::vector<double> thresholds = lut.m_lutFunction->getThresholds();
  std::vector<double>::const_iterator thr = thresholds.begin();
  os << "Thresholds are: " << *(thr++);
  for ( ; thr != thresholds.end(); thr++) {
    os << ", " << *thr;
  }
  os << std::endl;
  os << "\n===Lookup table contents===\n" << std::endl;
  const L1GctLut<L1GctHfEtSumsLut::NAddress,L1GctHfEtSumsLut::NData>* temp=&lut;
  os << *temp;
  return os;
}

Member Data Documentation

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

Definition at line 37 of file L1GctHfEtSumsLut.h.