CMS 3D CMS Logo

L1GctJetEtCalibrationLut.cc
Go to the documentation of this file.
1 
3 
6 
7 //DEFINE STATICS
11 
13 
15 
17  m_lutFunction = lutfn;
18  m_setupOk = (lutfn != nullptr);
19 }
20 
22 
24  static const unsigned nEtaBits = 4;
25  static const uint8_t etaMask = static_cast<uint8_t>((1 << nEtaBits) - 1);
26  m_etaBin = static_cast<uint8_t>(eta) & etaMask;
27 }
28 
29 uint16_t L1GctJetEtCalibrationLut::value(const uint16_t lutAddress) const {
30  static const uint16_t maxEtMask = static_cast<uint16_t>((1 << JET_ENERGY_BITWIDTH) - 1);
31  static const uint16_t tauBitMask = static_cast<uint16_t>(1 << (JET_ENERGY_BITWIDTH));
32  static const uint16_t ovrFlowOut = 0x3f;
33  uint16_t jetEt = lutAddress & maxEtMask;
34  // Check for saturation
35  if (jetEt == maxEtMask) {
36  return ovrFlowOut;
37  } else {
38  double uncoEt = static_cast<double>(jetEt) * m_outputEtScale->linearLsb();
39  bool tauVeto = ((lutAddress & tauBitMask) == 0);
40 
41  double corrEt = m_lutFunction->correctedEtGeV(uncoEt, etaBin(), tauVeto);
42  return m_outputEtScale->rank(corrEt);
43  }
44 }
45 
46 std::ostream& operator<<(std::ostream& os, const L1GctJetEtCalibrationLut& lut) {
47  os << std::endl;
48  os << "==================================================" << std::endl;
49  os << "===Level-1 Trigger: GCT Jet Et Calibration Lut===" << std::endl;
50  os << "==================================================" << std::endl;
51  os << "===Parameter settings for eta bin " << lut.etaBin() << "===" << std::endl;
52  os << *lut.getFunction() << std::endl;
53  os << "\n===Lookup table contents===\n" << std::endl;
55  os << *temp;
56  return os;
57 }
58 
L1GctJetEtCalibrationLut::NAddress
static const int NAddress
Definition: L1GctJetEtCalibrationLut.h:30
L1GctJetEtCalibrationLut.h
L1GctJetEtCalibrationLut::value
uint16_t value(const uint16_t lutAddress) const override
Definition: L1GctJetEtCalibrationLut.cc:29
L1GctJetEtCalibrationLut::m_etaBin
uint8_t m_etaBin
Definition: L1GctJetEtCalibrationLut.h:57
L1EGammaCrystalsEmulatorProducer_cfi.scale
scale
Definition: L1EGammaCrystalsEmulatorProducer_cfi.py:10
L1GctJetEtCalibrationLut::setFunction
void setFunction(const L1GctJetFinderParams *const lutfn)
Definition: L1GctJetEtCalibrationLut.cc:16
L1GctJetEtCalibrationLut::setOutputEtScale
void setOutputEtScale(const L1CaloEtScale *const scale)
Definition: L1GctJetEtCalibrationLut.cc:21
L1GctJetFinderParams.h
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
L1GctJetEtCalibrationLut::~L1GctJetEtCalibrationLut
~L1GctJetEtCalibrationLut() override
Definition: L1GctJetEtCalibrationLut.cc:14
L1GctJetEtCalibrationLut::JET_ENERGY_BITWIDTH
static const unsigned JET_ENERGY_BITWIDTH
Input bitwidth of jet energy; must be 10 or more.
Definition: L1GctJetEtCalibrationLut.h:32
L1GctJetEtCalibrationLut
Jet Et calibration LUT.
Definition: L1GctJetEtCalibrationLut.h:28
PVValHelper::eta
Definition: PVValidationHelpers.h:70
L1GctLut< 11, 6 >::m_setupOk
bool m_setupOk
Definition: L1GctLut.h:77
L1GctJetFinderParams::correctedEtGeV
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....
Definition: L1GctJetFinderParams.cc:177
L1CaloEtScale::linearLsb
double linearLsb() const
get LSB of linear input scale
Definition: L1CaloEtScale.h:54
JET_ET_CAL_LUT_ADD_BITS
#define JET_ET_CAL_LUT_ADD_BITS
Definition: L1GctJetEtCalibrationLut.h:4
L1GctJetFinderParams
Definition: L1GctJetFinderParams.h:10
hgcalConcentratorProducer_cfi.NData
NData
Definition: hgcalConcentratorProducer_cfi.py:82
JET_ET_CAL_LUT_DAT_BITS
#define JET_ET_CAL_LUT_DAT_BITS
Definition: L1GctJetEtCalibrationLut.h:5
L1CaloEtScale
Definition: L1CaloEtScale.h:29
L1GctJetEtCalibrationLut::getFunction
const L1GctJetFinderParams * getFunction() const
Definition: L1GctJetEtCalibrationLut.h:43
L1CaloEtScale::rank
uint16_t rank(const uint16_t linear) const
convert from linear Et scale to rank scale
Definition: L1CaloEtScale.cc:52
L1GctJetEtCalibrationLut::setEtaBin
void setEtaBin(const unsigned eta)
Definition: L1GctJetEtCalibrationLut.cc:23
L1GctJetEtCalibrationLut::m_lutFunction
const L1GctJetFinderParams * m_lutFunction
Definition: L1GctJetEtCalibrationLut.h:54
L1CaloEtScale.h
L1GctLut
Base class for LookUp Tables.
Definition: L1GctLut.h:19
L1GctJetEtCalibrationLut::NData
static const int NData
Definition: L1GctJetEtCalibrationLut.h:31
operator<<
std::ostream & operator<<(std::ostream &os, const L1GctJetEtCalibrationLut &lut)
Definition: L1GctJetEtCalibrationLut.cc:46
L1GctJetEtCalibrationLut::etaBin
unsigned etaBin() const
Definition: L1GctJetEtCalibrationLut.h:45
L1GctJetEtCalibrationLut::L1GctJetEtCalibrationLut
L1GctJetEtCalibrationLut()
Definition: L1GctJetEtCalibrationLut.cc:12
L1GctJetEtCalibrationLut::m_outputEtScale
const L1CaloEtScale * m_outputEtScale
Definition: L1GctJetEtCalibrationLut.h:55