#include <L1Trigger/GlobalCaloTrigger/interface/L1GctJetEtCalibrationLut.h>
Public Member Functions | |
unsigned | etaBin () const |
const L1GctJetEtCalibrationFunction * | getFunction () const |
const L1CaloEtScale * | getOutputEtScale () const |
L1GctJetEtCalibrationLut () | |
void | setEtaBin (const unsigned eta) |
void | setFunction (const L1GctJetEtCalibrationFunction *const lutfn) |
void | setOutputEtScale (const L1CaloEtScale *const scale) |
virtual | ~L1GctJetEtCalibrationLut () |
Static Public Attributes | |
static const unsigned | JET_ENERGY_BITWIDTH = 10 |
Input bitwidth of jet energy; must be 10 or more. | |
static const int | NAddress = JET_ET_CAL_LUT_ADD_BITS |
static const int | NData = JET_ET_CAL_LUT_DAT_BITS |
Protected Member Functions | |
virtual uint16_t | value (const uint16_t lutAddress) const |
Private Attributes | |
uint8_t | m_etaBin |
const L1GctJetEtCalibrationFunction * | m_lutFunction |
const L1CaloEtScale * | m_outputEtScale |
Friends | |
std::ostream & | operator<< (std::ostream &os, const L1GctJetEtCalibrationLut &lut) |
Overload << operator. |
Modified March 2007 to remove the actual calculation to a separate class Modified October 2008 to have separate LUTs for each eta, as in the firmware
Definition at line 28 of file L1GctJetEtCalibrationLut.h.
L1GctJetEtCalibrationLut::L1GctJetEtCalibrationLut | ( | ) |
Definition at line 12 of file L1GctJetEtCalibrationLut.cc.
00012 : 00013 L1GctLut<NAddress,NData>() 00014 { 00015 }
L1GctJetEtCalibrationLut::~L1GctJetEtCalibrationLut | ( | ) | [virtual] |
unsigned L1GctJetEtCalibrationLut::etaBin | ( | ) | const [inline] |
Definition at line 46 of file L1GctJetEtCalibrationLut.h.
References m_etaBin.
Referenced by operator<<(), and value().
00046 { return static_cast<unsigned>(m_etaBin); }
const L1GctJetEtCalibrationFunction* L1GctJetEtCalibrationLut::getFunction | ( | ) | const [inline] |
Definition at line 44 of file L1GctJetEtCalibrationLut.h.
References m_lutFunction.
Referenced by operator<<().
00044 { return m_lutFunction; }
const L1CaloEtScale* L1GctJetEtCalibrationLut::getOutputEtScale | ( | ) | const [inline] |
Definition at line 45 of file L1GctJetEtCalibrationLut.h.
References m_outputEtScale.
00045 { return m_outputEtScale; }
void L1GctJetEtCalibrationLut::setEtaBin | ( | const unsigned | eta | ) |
Definition at line 32 of file L1GctJetEtCalibrationLut.cc.
References m_etaBin.
00032 { 00033 static const unsigned nEtaBits = 4; 00034 static const uint8_t etaMask = static_cast<uint8_t>((1 << nEtaBits) - 1); 00035 m_etaBin = static_cast<uint8_t>(eta) & etaMask; 00036 }
void L1GctJetEtCalibrationLut::setFunction | ( | const L1GctJetEtCalibrationFunction *const | lutfn | ) |
Definition at line 22 of file L1GctJetEtCalibrationLut.cc.
References m_lutFunction, and L1GctLut< JET_ET_CAL_LUT_ADD_BITS, JET_ET_CAL_LUT_DAT_BITS >::m_setupOk.
00023 { 00024 m_lutFunction = lutfn; 00025 m_setupOk = (lutfn!=0); 00026 }
void L1GctJetEtCalibrationLut::setOutputEtScale | ( | const L1CaloEtScale *const | scale | ) |
Definition at line 28 of file L1GctJetEtCalibrationLut.cc.
References m_outputEtScale.
00028 { 00029 m_outputEtScale = scale; 00030 }
uint16_t L1GctJetEtCalibrationLut::value | ( | const uint16_t | lutAddress | ) | const [protected, virtual] |
Implements L1GctLut< JET_ET_CAL_LUT_ADD_BITS, JET_ET_CAL_LUT_DAT_BITS >.
Definition at line 38 of file L1GctJetEtCalibrationLut.cc.
References L1GctJetEtCalibrationFunction::calibratedEt(), L1GctJetEtCalibrationFunction::correctedEt(), etaBin(), JET_ENERGY_BITWIDTH, L1CaloEtScale::linearLsb(), m_lutFunction, m_outputEtScale, and L1CaloEtScale::rank().
00039 { 00040 static const uint16_t maxEtMask = static_cast<uint16_t>((1 << JET_ENERGY_BITWIDTH) - 1); 00041 static const uint16_t tauBitMask = static_cast<uint16_t>( 1 << (JET_ENERGY_BITWIDTH)); 00042 static const uint16_t ovrFlowOut = 0xffff; 00043 uint16_t jetEt = lutAddress & maxEtMask; 00044 // Check for saturation 00045 if (jetEt == maxEtMask) { 00046 return ovrFlowOut; 00047 } else { 00048 double uncoEt = static_cast<double>(jetEt) * m_outputEtScale->linearLsb(); 00049 bool tauVeto = ((lutAddress & tauBitMask)==0); 00050 00051 double corrEt = m_lutFunction->correctedEt(uncoEt, etaBin(), tauVeto); 00052 return m_lutFunction->calibratedEt(corrEt) | (m_outputEtScale->rank(corrEt) << JET_ENERGY_BITWIDTH); 00053 } 00054 }
std::ostream& operator<< | ( | std::ostream & | os, | |
const L1GctJetEtCalibrationLut & | lut | |||
) | [friend] |
Overload << operator.
Definition at line 56 of file L1GctJetEtCalibrationLut.cc.
00057 { 00058 os << std::endl; 00059 os << "==================================================" << std::endl; 00060 os << "===Level-1 Trigger: GCT Jet Et Calibration Lut===" << std::endl; 00061 os << "==================================================" << std::endl; 00062 os << "===Parameter settings for eta bin " << lut.etaBin() << "===" << std::endl; 00063 os << *lut.getFunction() << std::endl; 00064 os << "\n===Lookup table contents===\n" << std::endl; 00065 const L1GctLut<L1GctJetEtCalibrationLut::NAddress,L1GctJetEtCalibrationLut::NData>* temp=&lut; 00066 os << *temp; 00067 return os; 00068 }
const unsigned L1GctJetEtCalibrationLut::JET_ENERGY_BITWIDTH = 10 [static] |
Input bitwidth of jet energy; must be 10 or more.
Definition at line 33 of file L1GctJetEtCalibrationLut.h.
Referenced by L1GctJet::calibratedEt(), L1GctJet::lutValue(), L1GctJet::rank(), and value().
uint8_t L1GctJetEtCalibrationLut::m_etaBin [private] |
const L1GctJetEtCalibrationFunction* L1GctJetEtCalibrationLut::m_lutFunction [private] |
Definition at line 58 of file L1GctJetEtCalibrationLut.h.
Referenced by getFunction(), setFunction(), and value().
const L1CaloEtScale* L1GctJetEtCalibrationLut::m_outputEtScale [private] |
Definition at line 59 of file L1GctJetEtCalibrationLut.h.
Referenced by getOutputEtScale(), setOutputEtScale(), and value().
const int L1GctJetEtCalibrationLut::NAddress = JET_ET_CAL_LUT_ADD_BITS [static] |
Definition at line 31 of file L1GctJetEtCalibrationLut.h.
const int L1GctJetEtCalibrationLut::NData = JET_ET_CAL_LUT_DAT_BITS [static] |
Definition at line 32 of file L1GctJetEtCalibrationLut.h.