45 static const int componentMask = maxComponent-1;
52 int hyCompGct =
static_cast<int>(lutAddress) & componentMask;
55 if (hxCompGct >= maxComponent/2) hxCompGct -= maxComponent;
56 if (hyCompGct >= maxComponent/2) hyCompGct -= maxComponent;
59 double hxCompGeV =
m_componentLsb * (
static_cast<double>(hxCompGct) + 0.5);
60 double hyCompGeV =
m_componentLsb * (
static_cast<double>(hyCompGct) + 0.5);
63 double htMissMag =
sqrt(hxCompGeV * hxCompGeV + hyCompGeV * hyCompGeV);
64 double htMissAng = atan2(hyCompGeV, hxCompGeV);
65 if (htMissAng < 0.0) htMissAng += 2.0*
M_PI;
68 int htMissMagBits =
static_cast<int>(
m_etScale->
rank(htMissMag)) & magnitudeMask;
69 int htMissAngBits =
static_cast<int>(htMissAng*9.0/
M_PI) & angleMask;
87 std::vector<unsigned>
result;
89 for (std::vector<double>::const_iterator thr=thresholdsGeV.begin();
90 thr != thresholdsGeV.end(); thr++) {
104 os <<
"===L1GctHtMissLut===" << std::endl;
106 std::vector<double>::const_iterator thr = thresholds.begin();
107 os <<
"Thresholds are: " << *(thr++);
108 for ( ; thr != thresholds.end(); thr++) {
114 os <<
"LSB used for conversion is " << lut.
m_componentLsb <<
" GeV" << std::endl;
115 os <<
"\n===Lookup table contents===\n" << std::endl;
~L1GctHtMissLut() override
Destructor.
friend std::ostream & operator<<(std::ostream &os, const L1GctHtMissLut &lut)
Overload << operator.
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 double componentLsb() const
const L1CaloEtScale * m_etScale
std::vector< double > getThresholdsGeV() const
Get thresholds.
static const int NAddress
std::vector< unsigned > getThresholdsGct() const
const L1CaloEtScale * etScale() const
Return the Lut functions and parameters.
unsigned linScaleMax() const
L1GctHtMissLut()
Default constructor.
uint16_t value(const uint16_t lutAddress) const override
unsigned rankScaleMax() const