00001 #include "L1Trigger/RPCTrigger/interface/RPCBasicTrigConfig.h"
00002 #include "L1Trigger/RPCTrigger/interface/RPCException.h"
00003
00005 RPCBasicTrigConfig::RPCBasicTrigConfig(RPCPacManager<RPCPacData>* pacManager) {
00006 m_PacManager = pacManager;
00007 }
00008
00010 RPCBasicTrigConfig::RPCBasicTrigConfig() {
00011 m_PacManager = 0;
00012 }
00013
00016 int RPCBasicTrigConfig::towNum2TowNum2Comp(int towNum) {
00017 if(towNum >= 0)
00018 return towNum;
00019 else
00020 return 0x3F + towNum + 1;
00021 }
00022
00023
00024
00025
00026
00027
00033 int RPCBasicTrigConfig::getTCsCnt() { return m_TRIGGER_CRATES_CNT; }
00034
00040 int RPCBasicTrigConfig::getTBsInTC() { return m_TB_IN_TC_CNT; }
00041
00048 int RPCBasicTrigConfig::getTCNum(const RPCConst::l1RpcConeCrdnts& coneCrdnts) {
00049 return coneCrdnts.m_LogSector;
00050 }
00056 int RPCBasicTrigConfig::getTowsCntOnTB(int tbNum) {
00057 return m_TOWERS_CNT_ON_TB[tbNum];
00058 }
00062 int RPCBasicTrigConfig::towAddr2TowNum(int towAddr) {
00063
00064 if (m_TOW_ADDR_2_TOW_NUM[towAddr] == -99 || towAddr < 0 || towAddr > 35){
00065 throw RPCException("RPCBasicTrigConfig::towAddr2TowNum - wrong towAddr");
00066
00067 }
00068
00069
00070 return m_TOW_ADDR_2_TOW_NUM[towAddr];
00071 }
00072
00073 int RPCBasicTrigConfig::getTowerNumOnTb(const RPCConst::l1RpcConeCrdnts& coneCrdnts) {
00074 return m_TOWER_ON_TB[RPCConst::ITOW_MAX + coneCrdnts.m_Tower];
00075 }
00076
00077 const RPCPacData* RPCBasicTrigConfig::getPac(const RPCConst::l1RpcConeCrdnts& coneCrdnts) const {
00078 return m_PacManager->getPac(coneCrdnts.m_Tower, coneCrdnts.m_LogSector, coneCrdnts.m_LogSegment);
00079 }
00080
00081 int RPCBasicTrigConfig::getTBNum(const RPCConst::l1RpcConeCrdnts& coneCrdnts) {
00082 return m_TB_NUM_FOR_TOWER[RPCConst::ITOW_MAX + coneCrdnts.m_Tower];
00083 }
00084
00085
00086
00087
00088
00089 const int RPCBasicTrigConfig::m_TRIGGER_CRATES_CNT = 12;
00090
00091 const int RPCBasicTrigConfig::m_TOWER_ON_TB[2 * RPCConst::ITOW_MAX + 1 +1] = {
00092
00093 0, 1, 2, 3,
00094
00095 0, 1, 2, 3,
00096
00097 0, 1, 2, 3,
00098
00099 0, 1, 2,
00100
00101 0, 1, 2,
00102
00103 0, 1, 2,
00104
00105 0, 1, 2, 3,
00106
00107 0, 1, 2, 3,
00108
00109 0, 1, 2, 3,
00110 0
00111 };
00112
00113 const int RPCBasicTrigConfig::m_TOWERS_CNT_ON_TB[m_TB_IN_TC_CNT] = {
00114 4, 4, 4, 3, 3, 3, 4, 4, 4
00115 };
00116
00117 const int RPCBasicTrigConfig::m_TB_NUM_FOR_TOWER[2 * RPCConst::ITOW_MAX + 1] = {
00118
00119 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
00120 };
00121
00122 const int RPCBasicTrigConfig::m_TOW_ADDR_2_TOW_NUM[36] = {
00123
00124 -16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5, -4, -3, -2,-99, -1, 0,
00125
00126 1,-99, 2, 3, 4,-99, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
00127 };