12 :
L1GctLut<NAddress, NData>(), m_etScale(scale), m_componentLsb(lsb) {
20 :
L1GctLut<NAddress, NData>(), m_etScale(lut.etScale()), m_componentLsb(lut.componentLsb()) {
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++) {
74 result.push_back(static_cast<unsigned>((*thr) / (
m_componentLsb)));
85 os <<
"===L1GctHtMissLut===" << std::endl;
87 std::vector<double>::const_iterator thr = thresholds.begin();
88 os <<
"Thresholds are: " << *(thr++);
89 for (; thr != thresholds.end(); 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
~L1GctHtMissLut() override
Destructor.
std::ostream & operator<<(std::ostream &out, const ALILine &li)
LUT for conversion of Ht components x and y to magnitude and angle.
Base class for LookUp Tables.
uint16_t rank(const uint16_t linear) const
convert from linear Et scale to rank scale
L1GctHtMissLut operator=(const L1GctHtMissLut &lut)
Overload = operator.
const std::vector< double > & getThresholds() const
get thresholds
const L1CaloEtScale * m_etScale
std::vector< double > getThresholdsGeV() const
Get thresholds.
static const int NAddress
std::vector< unsigned > getThresholdsGct() const
unsigned linScaleMax() const
L1GctHtMissLut()
Default constructor.
unsigned rankScaleMax() const