File indexing completed on 2024-04-06 12:21:40
0001 #include "L1Trigger/RPCTrigger/interface/RPCBasicTrigConfig.h"
0002 #include "L1Trigger/RPCTrigger/interface/RPCException.h"
0003
0004
0005 RPCBasicTrigConfig::RPCBasicTrigConfig(RPCPacManager<RPCPacData>* pacManager) { m_PacManager = pacManager; }
0006
0007
0008 RPCBasicTrigConfig::RPCBasicTrigConfig() { m_PacManager = nullptr; }
0009
0010
0011
0012 int RPCBasicTrigConfig::towNum2TowNum2Comp(int towNum) {
0013 if (towNum >= 0)
0014 return towNum;
0015 else
0016 return 0x3F + towNum + 1;
0017 }
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 int RPCBasicTrigConfig::getTCsCnt() { return m_TRIGGER_CRATES_CNT; }
0030
0031
0032
0033
0034
0035
0036 int RPCBasicTrigConfig::getTBsInTC() { return m_TB_IN_TC_CNT; }
0037
0038
0039
0040
0041
0042
0043
0044 int RPCBasicTrigConfig::getTCNum(const RPCConst::l1RpcConeCrdnts& coneCrdnts) { return coneCrdnts.m_LogSector; }
0045
0046
0047
0048
0049
0050 int RPCBasicTrigConfig::getTowsCntOnTB(int tbNum) { return m_TOWERS_CNT_ON_TB[tbNum]; }
0051
0052
0053
0054 int RPCBasicTrigConfig::towAddr2TowNum(int towAddr) {
0055 if (m_TOW_ADDR_2_TOW_NUM[towAddr] == -99 || towAddr < 0 || towAddr > 35) {
0056 throw RPCException("RPCBasicTrigConfig::towAddr2TowNum - wrong towAddr");
0057
0058 }
0059
0060 return m_TOW_ADDR_2_TOW_NUM[towAddr];
0061 }
0062
0063 int RPCBasicTrigConfig::getTowerNumOnTb(const RPCConst::l1RpcConeCrdnts& coneCrdnts) {
0064 return m_TOWER_ON_TB[RPCConst::ITOW_MAX + coneCrdnts.m_Tower];
0065 }
0066
0067 const RPCPacData* RPCBasicTrigConfig::getPac(const RPCConst::l1RpcConeCrdnts& coneCrdnts) const {
0068 return m_PacManager->getPac(coneCrdnts.m_Tower, coneCrdnts.m_LogSector, coneCrdnts.m_LogSegment);
0069 }
0070
0071 int RPCBasicTrigConfig::getTBNum(const RPCConst::l1RpcConeCrdnts& coneCrdnts) {
0072 return m_TB_NUM_FOR_TOWER[RPCConst::ITOW_MAX + coneCrdnts.m_Tower];
0073 }
0074
0075
0076
0077
0078
0079 const int RPCBasicTrigConfig::m_TRIGGER_CRATES_CNT = 12;
0080
0081 const int RPCBasicTrigConfig::m_TOWER_ON_TB[2 * RPCConst::ITOW_MAX + 1 + 1] = {
0082
0083 0,
0084 1,
0085 2,
0086 3,
0087
0088 0,
0089 1,
0090 2,
0091 3,
0092
0093 0,
0094 1,
0095 2,
0096 3,
0097
0098 0,
0099 1,
0100 2,
0101
0102 0,
0103 1,
0104 2,
0105
0106 0,
0107 1,
0108 2,
0109
0110 0,
0111 1,
0112 2,
0113 3,
0114
0115 0,
0116 1,
0117 2,
0118 3,
0119
0120 0,
0121 1,
0122 2,
0123 3,
0124 0
0125 };
0126
0127 const int RPCBasicTrigConfig::m_TOWERS_CNT_ON_TB[m_TB_IN_TC_CNT] = {4, 4, 4, 3, 3, 3, 4, 4, 4};
0128
0129 const int RPCBasicTrigConfig::m_TB_NUM_FOR_TOWER[2 * RPCConst::ITOW_MAX + 1] = {
0130
0131 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8};
0132
0133 const int RPCBasicTrigConfig::m_TOW_ADDR_2_TOW_NUM[36] = {
0134
0135 -16,
0136 -15,
0137 -14,
0138 -13,
0139 -12,
0140 -11,
0141 -10,
0142 -9,
0143 -8,
0144 -7,
0145 -6,
0146 -5,
0147 -4,
0148 -3,
0149 -2,
0150 -99,
0151 -1,
0152 0,
0153
0154 1,
0155 -99,
0156 2,
0157 3,
0158 4,
0159 -99,
0160 5,
0161 6,
0162 7,
0163 8,
0164 9,
0165 10,
0166 11,
0167 12,
0168 13,
0169 14,
0170 15,
0171 16};