File indexing completed on 2024-04-06 12:21:02
0001 #include <utility>
0002
0003 #include "L1Trigger/L1TMuonEndCapPhase2/interface/Data/TimeZoneLut.h"
0004
0005 using namespace emtf::phase2::data;
0006
0007
0008 bool TimeZoneLut::in_range(const std::pair<int, int>& range, const int& bx) const {
0009 return range.first <= bx && bx <= range.second;
0010 }
0011
0012
0013 TimeZoneLut::TimeZoneLut() {
0014 lut_[0] = {-1, 0};
0015 lut_[1] = {-1, 0};
0016 lut_[2] = {-1, 0};
0017 lut_[3] = {-1, 0};
0018 lut_[4] = {-1, 0};
0019 lut_[5] = {-1, 0};
0020 lut_[6] = {-1, 0};
0021 lut_[7] = {-1, 0};
0022 lut_[8] = {-1, 0};
0023 lut_[9] = {-1, 0};
0024 lut_[10] = {0, 0};
0025 lut_[11] = {0, 0};
0026 lut_[12] = {-1, 0};
0027 lut_[13] = {0, 0};
0028 lut_[14] = {0, 0};
0029 lut_[15] = {0, 0};
0030 lut_[16] = {0, 0};
0031 lut_[17] = {0, 0};
0032 lut_[18] = {0, 0};
0033 }
0034
0035 TimeZoneLut::~TimeZoneLut() {
0036
0037 }
0038
0039 void TimeZoneLut::update(const edm::Event&, const edm::EventSetup&) {
0040
0041 }
0042
0043 int TimeZoneLut::getTimezones(const int& host, const int& bx) const {
0044 auto found = lut_.find(host);
0045
0046
0047 if (found == lut_.end())
0048 return 0x0;
0049
0050
0051 int word = 0x0;
0052
0053 word |= in_range(found->second, bx) ? 0b001 : 0;
0054 word |= in_range(found->second, bx + 1) ? 0b010 : 0;
0055 word |= in_range(found->second, bx + 2) ? 0b100 : 0;
0056
0057 return word;
0058 }