CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/L1Trigger/GlobalCaloTrigger/src/L1GctHfBitCountsLut.cc

Go to the documentation of this file.
00001 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctHfBitCountsLut.h"
00002 
00003 //DEFINE STATICS
00004 const int L1GctHfBitCountsLut::NAddress=5;
00005 const int L1GctHfBitCountsLut::NData   =3;
00006 
00007 L1GctHfBitCountsLut::L1GctHfBitCountsLut(const L1GctHfEtSumsLut::hfLutType& type) :
00008   L1GctLut<NAddress,NData>(),
00009   m_lutType(type)
00010 {
00011   // No setup required
00012   m_setupOk = true;
00013 }
00014 
00015 L1GctHfBitCountsLut::L1GctHfBitCountsLut() :
00016   L1GctLut<NAddress,NData>(),
00017   m_lutType()
00018 {
00019   // No setup required
00020   m_setupOk = true;
00021 }
00022 
00023 L1GctHfBitCountsLut::L1GctHfBitCountsLut(const L1GctHfBitCountsLut& lut) :
00024   L1GctLut<NAddress,NData>(),
00025   m_lutType(lut.lutType())
00026 {
00027   // No setup required
00028   m_setupOk = true;
00029 }
00030 
00031 L1GctHfBitCountsLut::~L1GctHfBitCountsLut()
00032 {
00033 }
00034 
00035 uint16_t L1GctHfBitCountsLut::value (const uint16_t lutAddress) const
00036 {
00037   // Return "address=data" up to the maximum number of output codes
00038   const int maxOutput = ((1<<NData)-1);
00039   if (lutAddress > maxOutput) return maxOutput;
00040   else return (lutAddress & maxOutput);
00041 }
00042 
00043 std::vector<unsigned> L1GctHfBitCountsLut::getThresholdsGct() const
00044 {
00045   std::vector<unsigned> result;
00046   // Return "address=data" up to the maximum number of output codes
00047   for (unsigned add=1; add<(1<<NData); add++) {
00048     result.push_back(add);
00049   }
00050   return result;
00051 }
00052 
00053 L1GctHfBitCountsLut L1GctHfBitCountsLut::operator= (const L1GctHfBitCountsLut& lut)
00054 {
00055   L1GctHfBitCountsLut temp(lut);
00056   return temp;
00057 }
00058 
00059 std::ostream& operator << (std::ostream& os, const L1GctHfBitCountsLut& lut)
00060 {
00061   os << "===L1GctHfBitCountsLut===" << std::endl;
00062   os << "\n===Lookup table contents===\n" << std::endl;
00063   const L1GctLut<L1GctHfBitCountsLut::NAddress,L1GctHfBitCountsLut::NData>* temp=&lut;
00064   os << *temp;
00065   return os;
00066 }
00067 
00068 template class L1GctLut<L1GctHfBitCountsLut::NAddress,L1GctHfBitCountsLut::NData>;
00069