30 if (lutAddress != 0) {
32 static const int componentMask = maxComponent - 1;
39 int hyCompGct =
static_cast<int>(lutAddress) & componentMask;
42 if (hxCompGct >= maxComponent / 2)
43 hxCompGct -= maxComponent;
44 if (hyCompGct >= maxComponent / 2)
45 hyCompGct -= maxComponent;
48 double hxCompGeV =
m_componentLsb * (
static_cast<double>(hxCompGct) + 0.5);
49 double hyCompGeV =
m_componentLsb * (
static_cast<double>(hyCompGct) + 0.5);
52 double htMissMag =
sqrt(hxCompGeV * hxCompGeV + hyCompGeV * hyCompGeV);
53 double htMissAng = atan2(hyCompGeV, hxCompGeV);
55 htMissAng += 2.0 *
M_PI;
58 int htMissMagBits =
static_cast<int>(
m_etScale->
rank(htMissMag)) & magnitudeMask;
59 int htMissAngBits =
static_cast<int>(htMissAng * 9.0 /
M_PI) & angleMask;
71 std::vector<unsigned>
result;
73 for (std::vector<double>::const_iterator thr = thresholdsGeV.begin(); thr != thresholdsGeV.end(); thr++) {
85 os <<
"===L1GctHtMissLut===" << std::endl;
87 std::vector<double>::const_iterator thr =
thresholds.begin();
88 os <<
"Thresholds are: " << *(thr++);
95 os <<
"LSB used for conversion is " << lut.
m_componentLsb <<
" GeV" << std::endl;
96 os <<
"\n===Lookup table contents===\n" << std::endl;
uint16_t value(const uint16_t lutAddress) const override
const std::vector< double > & getThresholds() const
get thresholds
~L1GctHtMissLut() override
Destructor.
std::ostream & operator<<(std::ostream &os, const L1GctHtMissLut &lut)
std::vector< double > getThresholdsGeV() const
Get thresholds.
LUT for conversion of Ht components x and y to magnitude and angle.
Base class for LookUp Tables.
unsigned linScaleMax() const
L1GctHtMissLut operator=(const L1GctHtMissLut &lut)
Overload = operator.
std::vector< unsigned > getThresholdsGct() const
const L1CaloEtScale * m_etScale
static const int NAddress
uint16_t rank(const uint16_t linear) const
convert from linear Et scale to rank scale
unsigned rankScaleMax() const
L1GctHtMissLut()
Default constructor.