File indexing completed on 2024-04-06 12:10:54
0001 #include "EventFilter/L1TRawToDigi/interface/OmtfLinkMappingCsc.h"
0002
0003 namespace omtf {
0004
0005 MapEleIndex2CscDet mapEleIndex2CscDet() {
0006 MapEleIndex2CscDet result;
0007 for (unsigned int fed = 1380; fed <= 1381; fed++) {
0008
0009 unsigned int endcap = (fed == 1380) ? 2 : 1;
0010 for (unsigned int amc = 1; amc <= 6; amc++) {
0011 for (unsigned int link = 0; link <= 34; link++) {
0012 unsigned int stat = 0;
0013 unsigned int ring = 0;
0014 unsigned int cham = 0;
0015 switch (link) {
0016 case (0): {
0017 stat = 1;
0018 ring = 2;
0019 cham = 3;
0020 break;
0021 }
0022 case (1): {
0023 stat = 1;
0024 ring = 2;
0025 cham = 4;
0026 break;
0027 }
0028 case (2): {
0029 stat = 1;
0030 ring = 2;
0031 cham = 5;
0032 break;
0033 }
0034 case (3): {
0035 stat = 1;
0036 ring = 3;
0037 cham = 3;
0038 break;
0039 }
0040 case (4): {
0041 stat = 1;
0042 ring = 3;
0043 cham = 4;
0044 break;
0045 }
0046 case (5): {
0047 stat = 1;
0048 ring = 3;
0049 cham = 5;
0050 break;
0051 }
0052 case (6): {
0053 stat = 1;
0054 ring = 2;
0055 cham = 6;
0056 break;
0057 }
0058 case (7): {
0059 stat = 1;
0060 ring = 2;
0061 cham = 7;
0062 break;
0063 }
0064 case (8): {
0065 stat = 1;
0066 ring = 2;
0067 cham = 8;
0068 break;
0069 }
0070 case (9): {
0071 stat = 1;
0072 ring = 3;
0073 cham = 6;
0074 break;
0075 }
0076 case (10): {
0077 stat = 1;
0078 ring = 3;
0079 cham = 7;
0080 break;
0081 }
0082 case (11): {
0083 stat = 1;
0084 ring = 3;
0085 cham = 8;
0086 break;
0087 }
0088 case (12): {
0089 stat = 2;
0090 ring = 2;
0091 cham = 3;
0092 break;
0093 }
0094 case (13): {
0095 stat = 2;
0096 ring = 2;
0097 cham = 4;
0098 break;
0099 }
0100 case (14): {
0101 stat = 2;
0102 ring = 2;
0103 cham = 5;
0104 break;
0105 }
0106 case (15): {
0107 stat = 2;
0108 ring = 2;
0109 cham = 6;
0110 break;
0111 }
0112 case (16): {
0113 stat = 2;
0114 ring = 2;
0115 cham = 7;
0116 break;
0117 }
0118 case (17): {
0119 stat = 2;
0120 ring = 2;
0121 cham = 8;
0122 break;
0123 }
0124 case (18): {
0125 stat = 3;
0126 ring = 2;
0127 cham = 3;
0128 break;
0129 }
0130 case (19): {
0131 stat = 3;
0132 ring = 2;
0133 cham = 4;
0134 break;
0135 }
0136 case (20): {
0137 stat = 3;
0138 ring = 2;
0139 cham = 5;
0140 break;
0141 }
0142 case (21): {
0143 stat = 3;
0144 ring = 2;
0145 cham = 6;
0146 break;
0147 }
0148 case (22): {
0149 stat = 3;
0150 ring = 2;
0151 cham = 7;
0152 break;
0153 }
0154 case (23): {
0155 stat = 3;
0156 ring = 2;
0157 cham = 8;
0158 break;
0159 }
0160 case (24): {
0161 stat = 4;
0162 ring = 2;
0163 cham = 3;
0164 break;
0165 }
0166 case (25): {
0167 stat = 4;
0168 ring = 2;
0169 cham = 4;
0170 break;
0171 }
0172 case (26): {
0173 stat = 4;
0174 ring = 2;
0175 cham = 5;
0176 break;
0177 }
0178 case (27): {
0179 stat = 4;
0180 ring = 2;
0181 cham = 6;
0182 break;
0183 }
0184 case (28): {
0185 stat = 4;
0186 ring = 2;
0187 cham = 7;
0188 break;
0189 }
0190 case (29): {
0191 stat = 4;
0192 ring = 2;
0193 cham = 8;
0194 break;
0195 }
0196 case (30): {
0197 stat = 1;
0198 ring = 2;
0199 cham = 2;
0200 break;
0201 }
0202 case (31): {
0203 stat = 1;
0204 ring = 3;
0205 cham = 2;
0206 break;
0207 }
0208 case (32): {
0209 stat = 2;
0210 ring = 2;
0211 cham = 2;
0212 break;
0213 }
0214 case (33): {
0215 stat = 3;
0216 ring = 2;
0217 cham = 2;
0218 break;
0219 }
0220 case (34): {
0221 stat = 4;
0222 ring = 2;
0223 cham = 2;
0224 break;
0225 }
0226 default: {
0227 stat = 0;
0228 ring = 0;
0229 cham = 0;
0230 break;
0231 }
0232 }
0233 if (ring != 0) {
0234 int chamber = cham + (amc - 1) * 6;
0235 if (chamber > 36)
0236 chamber -= 36;
0237 CSCDetId cscDetId(endcap, stat, ring, chamber, 0);
0238 EleIndex omtfEle(fed, amc, link);
0239 result[omtfEle] = cscDetId;
0240 }
0241 }
0242 }
0243 }
0244 return result;
0245 }
0246
0247 MapCscDet2EleIndex mapCscDet2EleIndex() {
0248 MapCscDet2EleIndex result;
0249 MapEleIndex2CscDet omtf2cscs = mapEleIndex2CscDet();
0250
0251 for (const auto& omtf2csc : omtf2cscs) {
0252 uint32_t rawId = omtf2csc.second;
0253 auto it = result.find(rawId);
0254 if (result.end() == it) {
0255 result[rawId] = std::make_pair(omtf2csc.first, EleIndex());
0256 } else {
0257 it->second.second = omtf2csc.first;
0258 }
0259 }
0260
0261 return result;
0262 }
0263
0264 }