00001 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctHfEtSumsLut.h"
00002
00003
00004 const int L1GctHfEtSumsLut::NAddress=L1GctHfLutSetup::kHfEtSumBits;
00005 const int L1GctHfEtSumsLut::NData =L1GctHfLutSetup::kHfOutputBits;
00006
00007 L1GctHfEtSumsLut::L1GctHfEtSumsLut(const L1GctHfLutSetup::hfLutType& type, const L1GctHfLutSetup* const fn) :
00008 L1GctLut<NAddress,NData>(),
00009 m_lutFunction(fn),
00010 m_lutType(type)
00011 {
00012 if (fn != 0) m_setupOk = true;
00013 }
00014
00015 L1GctHfEtSumsLut::L1GctHfEtSumsLut(const L1GctHfLutSetup::hfLutType& type) :
00016 L1GctLut<NAddress,NData>(),
00017 m_lutFunction(0),
00018 m_lutType(type)
00019 {
00020 }
00021
00022 L1GctHfEtSumsLut::L1GctHfEtSumsLut() :
00023 L1GctLut<NAddress,NData>(),
00024 m_lutFunction(0),
00025 m_lutType()
00026 {
00027 }
00028
00029 L1GctHfEtSumsLut::L1GctHfEtSumsLut(const L1GctHfEtSumsLut& lut) :
00030 L1GctLut<NAddress,NData>(),
00031 m_lutFunction(lut.lutFunction()),
00032 m_lutType(lut.lutType())
00033 {
00034 }
00035
00036 L1GctHfEtSumsLut::~L1GctHfEtSumsLut()
00037 {
00038 }
00039
00040 L1GctHfEtSumsLut L1GctHfEtSumsLut::operator= (const L1GctHfEtSumsLut& lut)
00041 {
00042 L1GctHfEtSumsLut temp(lut);
00043 return temp;
00044 }
00045
00046 std::ostream& operator << (std::ostream& os, const L1GctHfEtSumsLut& lut)
00047 {
00048 os << "===L1GctHfEtSumsLut===" << std::endl;
00049 std::vector<unsigned> thresholds = lut.m_lutFunction->getThresholds(lut.m_lutType);
00050 std::vector<unsigned>::const_iterator thr = thresholds.begin();
00051 os << "Thresholds are: " << *(thr++);
00052 for ( ; thr != thresholds.end(); thr++) {
00053 os << ", " << *thr;
00054 }
00055 os << std::endl;
00056 os << "\n===Lookup table contents===\n" << std::endl;
00057 const L1GctLut<L1GctHfEtSumsLut::NAddress,L1GctHfEtSumsLut::NData>* temp=&lut;
00058 os << *temp;
00059 return os;
00060 }
00061
00062 template class L1GctLut<L1GctHfEtSumsLut::NAddress,L1GctHfEtSumsLut::NData>;
00063
00064
00065 uint16_t L1GctHfEtSumsLut::value (const uint16_t lutAddress) const
00066 {
00067 return m_lutFunction->outputValue(m_lutType, lutAddress) ;
00068 }
00069