CMS 3D CMS Logo

OmtfLinkMappingCsc.cc
Go to the documentation of this file.
2 
3 namespace omtf {
4 
7  for (unsigned int fed = 1380; fed <= 1381; fed++) {
8  //Endcap label. 1=forward (+Z); 2=backward (-Z)
9  unsigned int endcap = (fed == 1380) ? 2 : 1;
10  for (unsigned int amc = 1; amc <= 6; amc++) {
11  for (unsigned int link = 0; link <= 34; link++) {
12  unsigned int stat = 0;
13  unsigned int ring = 0;
14  unsigned int cham = 0;
15  switch (link) {
16  case (0): {
17  stat = 1;
18  ring = 2;
19  cham = 3;
20  break;
21  } // (0, 9, 2, 3 ), --channel_0 OV1A_4 chamber_ME1/2/3 layer_9 input 2, 3
22  case (1): {
23  stat = 1;
24  ring = 2;
25  cham = 4;
26  break;
27  } // (1, 9, 4, 5 ), --channel_1 OV1A_5 chamber_ME1/2/4 layer_9 input 4, 5
28  case (2): {
29  stat = 1;
30  ring = 2;
31  cham = 5;
32  break;
33  } // (2, 9, 6, 7 ), --channel_2 OV1A_6 chamber_ME1/2/5 layer_9 input 6, 7
34  case (3): {
35  stat = 1;
36  ring = 3;
37  cham = 3;
38  break;
39  } // (3, 6, 2, 3 ), --channel_3 OV1A_7 chamber_ME1/3/3 layer_6 input 2, 3
40  case (4): {
41  stat = 1;
42  ring = 3;
43  cham = 4;
44  break;
45  } // (4, 6, 4, 5 ), --channel_4 OV1A_8 chamber_ME1/3/4 layer_6 input 4, 5
46  case (5): {
47  stat = 1;
48  ring = 3;
49  cham = 5;
50  break;
51  } // (5, 6, 6, 7 ), --channel_5 OV1A_9 chamber_ME1/3/5 layer_6 input 6, 7
52  case (6): {
53  stat = 1;
54  ring = 2;
55  cham = 6;
56  break;
57  } // (6, 9, 8, 9 ), --channel_6 OV1B_4 chamber_ME1/2/6 layer_9 input 8, 9
58  case (7): {
59  stat = 1;
60  ring = 2;
61  cham = 7;
62  break;
63  } // (7, 9, 10,11), --channel_7 OV1B_5 chamber_ME1/2/7 layer_9 input 10,11
64  case (8): {
65  stat = 1;
66  ring = 2;
67  cham = 8;
68  break;
69  } // (8, 9, 12,13), --channel_8 OV1B_6 chamber_ME1/2/8 layer_9 input 12,13
70  case (9): {
71  stat = 1;
72  ring = 3;
73  cham = 6;
74  break;
75  } // (9, 6, 8, 9 ), --channel_9 OV1B_7 chamber_ME1/3/6 layer_6 input 8, 9
76  case (10): {
77  stat = 1;
78  ring = 3;
79  cham = 7;
80  break;
81  } // (10, 6, 10,11), --channel_10 OV1B_8 chamber_ME1/3/7 layer_6 input 10,11
82  case (11): {
83  stat = 1;
84  ring = 3;
85  cham = 8;
86  break;
87  } // (11, 6, 12,13), --channel_11 OV1B_9 chamber_ME1/3/8 layer_6 input 12,13
88  case (12): {
89  stat = 2;
90  ring = 2;
91  cham = 3;
92  break;
93  } // (12, 7, 2, 3 ), --channel_0 OV2_4 chamber_ME2/2/3 layer_7 input 2, 3
94  case (13): {
95  stat = 2;
96  ring = 2;
97  cham = 4;
98  break;
99  } // (13, 7, 4, 5 ), --channel_1 OV2_5 chamber_ME2/2/4 layer_7 input 4, 5
100  case (14): {
101  stat = 2;
102  ring = 2;
103  cham = 5;
104  break;
105  } // (14, 7, 6, 7 ), --channel_2 OV2_6 chamber_ME2/2/5 layer_7 input 6, 7
106  case (15): {
107  stat = 2;
108  ring = 2;
109  cham = 6;
110  break;
111  } // (15, 7, 8, 9 ), --channel_3 OV2_7 chamber_ME2/2/6 layer_7 input 8, 9
112  case (16): {
113  stat = 2;
114  ring = 2;
115  cham = 7;
116  break;
117  } // (16, 7, 10,11), --channel_4 OV2_8 chamber_ME2/2/7 layer_7 input 10,11
118  case (17): {
119  stat = 2;
120  ring = 2;
121  cham = 8;
122  break;
123  } // (17, 7, 12,13), --channel_5 OV2_9 chamber_ME2/2/8 layer_7 input 12,13
124  case (18): {
125  stat = 3;
126  ring = 2;
127  cham = 3;
128  break;
129  } // (18, 8, 2, 3 ), --channel_6 OV3_4 chamber_ME3/2/3 layer_8 input 2, 3
130  case (19): {
131  stat = 3;
132  ring = 2;
133  cham = 4;
134  break;
135  } // (19, 8, 4, 5 ), --channel_7 OV3_5 chamber_ME3/2/4 layer_8 input 4, 5
136  case (20): {
137  stat = 3;
138  ring = 2;
139  cham = 5;
140  break;
141  } // (20, 8, 6, 7 ), --channel_8 OV3_6 chamber_ME3/2/5 layer_8 input 6, 7
142  case (21): {
143  stat = 3;
144  ring = 2;
145  cham = 6;
146  break;
147  } // (21, 8, 8, 9 ), --channel_9 OV3_7 chamber_ME3/2/6 layer_8 input 8, 9
148  case (22): {
149  stat = 3;
150  ring = 2;
151  cham = 7;
152  break;
153  } // (22, 8, 10,11), --channel_10 OV3_8 chamber_ME3/2/7 layer_8 input 10,11
154  case (23): {
155  stat = 3;
156  ring = 2;
157  cham = 8;
158  break;
159  } // (23, 8, 12,13), --channel_11 OV3_9 chamber_ME3/2/8 layer_8 input 12,13
160  case (24): {
161  stat = 4;
162  ring = 2;
163  cham = 3;
164  break;
165  } //--(24, , ), --channel_3 OV4_4 chamber_ME4/2/3 layer input
166  case (25): {
167  stat = 4;
168  ring = 2;
169  cham = 4;
170  break;
171  } //--(25, , ), --channel_4 OV4_5 chamber_ME4/2/4 layer input
172  case (26): {
173  stat = 4;
174  ring = 2;
175  cham = 5;
176  break;
177  } //--(26, , ), --channel_5 OV4_6 chamber_ME4/2/5 layer input
178  case (27): {
179  stat = 4;
180  ring = 2;
181  cham = 6;
182  break;
183  } //--(27, , ), --channel_7 OV4_7 chamber_ME4/2/6 layer input
184  case (28): {
185  stat = 4;
186  ring = 2;
187  cham = 7;
188  break;
189  } //--(28, , ), --channel_8 OV4_8 chamber_ME4/2/7 layer input
190  case (29): {
191  stat = 4;
192  ring = 2;
193  cham = 8;
194  break;
195  } //--(29, , ), --channel_9 OV4_9 chamber_ME4/2/8 layer input
196  case (30): {
197  stat = 1;
198  ring = 2;
199  cham = 2;
200  break;
201  } // (30, 9, 0, 1 ), --channel_0 OV1B_6 chamber_ME1/2/2 layer_9 input 0, 1
202  case (31): {
203  stat = 1;
204  ring = 3;
205  cham = 2;
206  break;
207  } // (31, 6, 0, 1 ), --channel_1 OV1B_9 chamber_ME1/3/2 layer_6 input 0, 1
208  case (32): {
209  stat = 2;
210  ring = 2;
211  cham = 2;
212  break;
213  } // (32, 7, 0, 1 ), --channel_2 OV2_9 chamber_ME2/2/2 layer_7 input 0, 1
214  case (33): {
215  stat = 3;
216  ring = 2;
217  cham = 2;
218  break;
219  } // (33, 8, 0, 1 ), --channel_3 ON3_9 chamber_ME3/2/2 layer_8 input 0, 1
220  case (34): {
221  stat = 4;
222  ring = 2;
223  cham = 2;
224  break;
225  } //--(34, , ), --channel_4 ON4_9 chamber_ME4/2/2 layer input
226  default: {
227  stat = 0;
228  ring = 0;
229  cham = 0;
230  break;
231  }
232  }
233  if (ring != 0) {
234  int chamber = cham + (amc - 1) * 6;
235  if (chamber > 36)
236  chamber -= 36;
237  CSCDetId cscDetId(endcap, stat, ring, chamber, 0);
238  EleIndex omtfEle(fed, amc, link);
239  result[omtfEle] = cscDetId;
240  }
241  }
242  }
243  }
244  return result;
245  }
246 
250 
251  for (const auto& omtf2csc : omtf2cscs) {
252  uint32_t rawId = omtf2csc.second;
253  auto it = result.find(rawId);
254  if (result.end() == it) {
255  result[rawId] = std::make_pair(omtf2csc.first, EleIndex());
256  } else {
257  it->second.second = omtf2csc.first;
258  }
259  }
260 
261  return result;
262  }
263 
264 } // namespace omtf
MapCscDet2EleIndex mapCscDet2EleIndex()
std::map< uint32_t, std::pair< EleIndex, EleIndex > > MapCscDet2EleIndex
MapEleIndex2CscDet mapEleIndex2CscDet()
std::map< EleIndex, CSCDetId > MapEleIndex2CscDet
Definition: AMCSpec.h:8