CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GctJetEtCalibrationLut.cc
Go to the documentation of this file.
1 
3 
6 
7 //DEFINE STATICS
11 
13  L1GctLut<NAddress,NData>()
14 {
15 }
16 
17 
19 {
20 }
21 
23 {
24  m_lutFunction = lutfn;
25  m_setupOk = (lutfn!=0);
26 }
27 
30 }
31 
33  static const unsigned nEtaBits = 4;
34  static const uint8_t etaMask = static_cast<uint8_t>((1 << nEtaBits) - 1);
35  m_etaBin = static_cast<uint8_t>(eta) & etaMask;
36 }
37 
38 uint16_t L1GctJetEtCalibrationLut::value (const uint16_t lutAddress) const
39 {
40  static const uint16_t maxEtMask = static_cast<uint16_t>((1 << JET_ENERGY_BITWIDTH) - 1);
41  static const uint16_t tauBitMask = static_cast<uint16_t>( 1 << (JET_ENERGY_BITWIDTH));
42  static const uint16_t ovrFlowOut = 0x3f;
43  uint16_t jetEt = lutAddress & maxEtMask;
44  // Check for saturation
45  if (jetEt == maxEtMask) {
46  return ovrFlowOut;
47  } else {
48  double uncoEt = static_cast<double>(jetEt) * m_outputEtScale->linearLsb();
49  bool tauVeto = ((lutAddress & tauBitMask)==0);
50 
51  double corrEt = m_lutFunction->correctedEtGeV(uncoEt, etaBin(), tauVeto);
52  return m_outputEtScale->rank(corrEt);
53  }
54 }
55 
56 std::ostream& operator << (std::ostream& os, const L1GctJetEtCalibrationLut& lut)
57 {
58  os << std::endl;
59  os << "==================================================" << std::endl;
60  os << "===Level-1 Trigger: GCT Jet Et Calibration Lut===" << std::endl;
61  os << "==================================================" << std::endl;
62  os << "===Parameter settings for eta bin " << lut.etaBin() << "===" << std::endl;
63  os << *lut.getFunction() << std::endl;
64  os << "\n===Lookup table contents===\n" << std::endl;
66  os << *temp;
67  return os;
68 }
69 
71 
Jet Et calibration LUT.
const L1GctJetFinderParams * getFunction() const
T eta() const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
void setFunction(const L1GctJetFinderParams *const lutfn)
double linearLsb() const
get LSB of linear input scale
Definition: L1CaloEtScale.h:51
Base class for LookUp Tables.
Definition: L1GctLut.h:21
#define JET_ET_CAL_LUT_ADD_BITS
void setOutputEtScale(const L1CaloEtScale *const scale)
uint16_t rank(const uint16_t linear) const
convert from linear Et scale to rank scale
const L1CaloEtScale * m_outputEtScale
double correctedEtGeV(const double et, const unsigned eta, const bool tauVeto) const
Eta takes a value from 0-10, corresponding to jet regions running from eta=0.0 to eta=5...
tuple lut
Definition: lumiPlot.py:244
#define JET_ET_CAL_LUT_DAT_BITS
static const unsigned JET_ENERGY_BITWIDTH
Input bitwidth of jet energy; must be 10 or more.
const L1GctJetFinderParams * m_lutFunction
virtual uint16_t value(const uint16_t lutAddress) const
void setEtaBin(const unsigned eta)