CMS 3D CMS Logo

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 ()
 Default constructor. More...
 
 L1GctHfEtSumsLut (const L1GctHfEtSumsLut &lut)
 Copy constructor. More...
 
 L1GctHfEtSumsLut (const L1GctHfEtSumsLut::hfLutType &type)
 Constructor for use with emulator - which type of Lut? More...
 
 L1GctHfEtSumsLut (const L1GctHfEtSumsLut::hfLutType &type, const L1CaloEtScale *const scale)
 Constructor for use with emulator - which type of Lut? 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

◆ hfLutType

Enumerator
bitCountPosEtaRing1 
bitCountPosEtaRing2 
bitCountNegEtaRing1 
bitCountNegEtaRing2 
etSumPosEtaRing1 
etSumPosEtaRing2 
etSumNegEtaRing1 
etSumNegEtaRing2 
numberOfLutTypes 

Definition at line 24 of file L1GctHfEtSumsLut.h.

Constructor & Destructor Documentation

◆ L1GctHfEtSumsLut() [1/4]

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.

11  if (scale != nullptr)
12  m_setupOk = true;
13 }

References L1GctLut< 8, 3 >::m_setupOk, and L1EGammaCrystalsEmulatorProducer_cfi::scale.

◆ L1GctHfEtSumsLut() [2/4]

L1GctHfEtSumsLut::L1GctHfEtSumsLut ( const L1GctHfEtSumsLut::hfLutType type)

Constructor for use with emulator - which type of Lut?

Definition at line 15 of file L1GctHfEtSumsLut.cc.

◆ L1GctHfEtSumsLut() [3/4]

L1GctHfEtSumsLut::L1GctHfEtSumsLut ( )

Default constructor.

Definition at line 18 of file L1GctHfEtSumsLut.cc.

◆ L1GctHfEtSumsLut() [4/4]

L1GctHfEtSumsLut::L1GctHfEtSumsLut ( const L1GctHfEtSumsLut lut)

Copy constructor.

Definition at line 20 of file L1GctHfEtSumsLut.cc.

◆ ~L1GctHfEtSumsLut()

L1GctHfEtSumsLut::~L1GctHfEtSumsLut ( )
override

Destructor.

Definition at line 23 of file L1GctHfEtSumsLut.cc.

23 {}

Member Function Documentation

◆ getThresholdsGct()

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

Definition at line 29 of file L1GctHfEtSumsLut.cc.

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 }

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

◆ getThresholdsGeV()

std::vector< double > L1GctHfEtSumsLut::getThresholdsGeV ( ) const

Get thresholds.

Definition at line 27 of file L1GctHfEtSumsLut.cc.

27 { return m_lutFunction->getThresholds(); }

References L1CaloEtScale::getThresholds(), and m_lutFunction.

◆ lutFunction()

const L1CaloEtScale* L1GctHfEtSumsLut::lutFunction ( ) const
inline

Return the Lut function.

Definition at line 68 of file L1GctHfEtSumsLut.h.

68 { return m_lutFunction; }

References m_lutFunction.

Referenced by L1GctGlobalHfSumAlgos::getThresholds().

◆ lutType()

L1GctHfEtSumsLut::hfLutType L1GctHfEtSumsLut::lutType ( ) const
inline

Return the type of Lut.

Definition at line 65 of file L1GctHfEtSumsLut.h.

65 { return m_lutType; }

References m_lutType.

◆ operator=()

L1GctHfEtSumsLut L1GctHfEtSumsLut::operator= ( const L1GctHfEtSumsLut lut)

Overload = operator.

Definition at line 38 of file L1GctHfEtSumsLut.cc.

38  {
39  const L1GctHfEtSumsLut& temp(lut);
40  return temp;
41 }

References groupFilesInBlocks::temp.

◆ setFunction()

void L1GctHfEtSumsLut::setFunction ( const L1CaloEtScale *const  fn)
inline

Set the function.

Definition at line 57 of file L1GctHfEtSumsLut.h.

57  {
58  if (fn != nullptr) {
59  m_lutFunction = fn;
60  m_setupOk = true;
61  }
62  }

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

◆ value()

uint16_t L1GctHfEtSumsLut::value ( const uint16_t  lutAddress) const
overrideprotectedvirtual

Implements L1GctLut< 8, 3 >.

Definition at line 25 of file L1GctHfEtSumsLut.cc.

25 { return m_lutFunction->rank(lutAddress); }

References m_lutFunction, and L1CaloEtScale::rank().

Referenced by average.Average::average().

Friends And Related Function Documentation

◆ operator<<

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 }

Member Data Documentation

◆ m_lutFunction

const L1CaloEtScale* L1GctHfEtSumsLut::m_lutFunction
private

◆ m_lutType

L1GctHfEtSumsLut::hfLutType L1GctHfEtSumsLut::m_lutType
private

Definition at line 79 of file L1GctHfEtSumsLut.h.

Referenced by lutType().

◆ NAddress

const int L1GctHfEtSumsLut::NAddress = 8
static

Definition at line 37 of file L1GctHfEtSumsLut.h.

◆ NData

const int L1GctHfEtSumsLut::NData = 3
static

Definition at line 37 of file L1GctHfEtSumsLut.h.

L1EGammaCrystalsEmulatorProducer_cfi.scale
scale
Definition: L1EGammaCrystalsEmulatorProducer_cfi.py:10
particleFlowZeroSuppressionECAL_cff.thresholds
thresholds
Definition: particleFlowZeroSuppressionECAL_cff.py:31
L1GctHfEtSumsLut::bitCountPosEtaRing1
Definition: L1GctHfEtSumsLut.h:25
L1GctHfEtSumsLut::m_lutFunction
const L1CaloEtScale * m_lutFunction
Definition: L1GctHfEtSumsLut.h:78
L1GctHfEtSumsLut::etSumNegEtaRing1
Definition: L1GctHfEtSumsLut.h:31
L1GctHfEtSumsLut::etSumPosEtaRing1
Definition: L1GctHfEtSumsLut.h:29
L1GctHfEtSumsLut
LUT for compression of HF Et sum to output format.
Definition: L1GctHfEtSumsLut.h:20
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
L1GctHfEtSumsLut::lutFunction
const L1CaloEtScale * lutFunction() const
Return the Lut function.
Definition: L1GctHfEtSumsLut.h:68
L1GctHfEtSumsLut::bitCountNegEtaRing1
Definition: L1GctHfEtSumsLut.h:27
L1GctLut< 8, 3 >::m_setupOk
bool m_setupOk
Definition: L1GctLut.h:77
L1CaloEtScale::linearLsb
double linearLsb() const
get LSB of linear input scale
Definition: L1CaloEtScale.h:54
L1GctHfEtSumsLut::lutType
L1GctHfEtSumsLut::hfLutType lutType() const
Return the type of Lut.
Definition: L1GctHfEtSumsLut.h:65
L1GctHfEtSumsLut::bitCountPosEtaRing2
Definition: L1GctHfEtSumsLut.h:26
L1GctHfEtSumsLut::numberOfLutTypes
Definition: L1GctHfEtSumsLut.h:33
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
L1CaloEtScale::rank
uint16_t rank(const uint16_t linear) const
convert from linear Et scale to rank scale
Definition: L1CaloEtScale.cc:52
L1CaloEtScale::getThresholds
const std::vector< double > & getThresholds() const
get thresholds
Definition: L1CaloEtScale.h:66
L1GctLut
Base class for LookUp Tables.
Definition: L1GctLut.h:19
L1GctHfEtSumsLut::bitCountNegEtaRing2
Definition: L1GctHfEtSumsLut.h:28
L1GctHfEtSumsLut::etSumPosEtaRing2
Definition: L1GctHfEtSumsLut.h:30
personalPlayback.fn
fn
Definition: personalPlayback.py:515
mps_fire.result
result
Definition: mps_fire.py:311
L1GctHfEtSumsLut::m_lutType
L1GctHfEtSumsLut::hfLutType m_lutType
Definition: L1GctHfEtSumsLut.h:79
L1GctHfEtSumsLut::etSumNegEtaRing2
Definition: L1GctHfEtSumsLut.h:32