CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TrackId.cc
Go to the documentation of this file.
2 
3 namespace csc
4 {
6  {}
7 
8  L1TrackId::L1TrackId(const unsigned& side, const unsigned& sector)
9  {
11  id_ = CSCDetId(side, 2, 1,
13  0);
14 
15  }
16 
18  {
19  m_rank = id.m_rank;
20  m_mode = id.m_mode;
21  m_erase = id.m_erase;
22  m_overlap = id.m_overlap;
23  id_ = id.id_;
24  //stubs = id.stubs; // add stubs back later
25  }
26 
28  {
29  if(&rhs != this)
30  {
31  m_rank = rhs.m_rank;
32  m_mode = rhs.m_mode;
33  m_erase = rhs.m_erase;
34  m_overlap = rhs.m_overlap;
35  id_ = rhs.id_;
36  //stubs = rhs.stubs;
37  }
38  return *this;
39  }
40 
41  bool L1TrackId::sharesHit(const csc::L1TrackId& a_id) const
42  {
43  return false; // finish later
44  }
45 
46  void L1TrackId::setOverlap(const unsigned& rank)
47  {
48  if ( (rank == 7) || (rank == 8) ||
49  (rank == 9) || (rank == 12) || (rank == 15) ||
50  (rank == 19) || (rank == 20) ||
51  (rank == 24) || (rank == 25) ||
52  (rank == 29) || (rank == 30) ||
53  (rank == 32) || (rank == 34) || (rank == 36) ) {
54  m_overlap = true;
55  }
56  else m_overlap = false;
57  }
58 
59  void L1TrackId::setRank(const unsigned& rank)
60  {
61  if (rank<(1<<kRankBitWidth)) // rank >= 0, since rank is unsigned
62  {
63  m_rank = rank;
64  setOverlap(rank);
65  }
66  else
67  {
68  m_rank = 0;
69  }
70  }
71 
72 
73  // Helper function to determine which 2 segments from overlap region
74  // track participate in 2-stn Pt assignment, and what mode to use,
75  // based on track rank
76  // four modes in this order: B1-E1, B1-E2, B2-E1, B2-E2
77  // Let's include only mode 2, 4 tracks (7-27-00)
78  void L1TrackId::overlapMode(const unsigned& rank, int& mode, int& stnA, int& stnB)
79  {
80  switch (rank)
81  {
82  case 7:
83  stnA = 2; stnB = 1;
84  mode = 4;
85  break;
86  case 8:
87  stnA = 3; stnB = 2;
88  mode = 4;
89  break;
90  case 9:
91  stnA = 2; stnB = 1;
92  mode = 2;
93  break;
94  case 12:
95  stnA = 2; stnB = 1;
96  mode = 2;
97  break;
98  case 15:
99  stnA = 2; stnB = 1;
100  mode = 2;
101  break;
102  case 19:
103  stnA = 3; stnB = 2;
104  mode = 2;
105  break;
106  case 20:
107  stnA = 2; stnB = 1;
108  mode = 2;
109  break;
110  case 24:
111  stnA = 3; stnB = 2;
112  mode = 2;
113  break;
114  case 25:
115  stnA = 2; stnB = 1;
116  mode = 2;
117  break;
118  case 29:
119  stnA = 3; stnB = 2;
120  mode = 2;
121  break;
122  case 30:
123  stnA = 2; stnB = 1;
124  mode = 2;
125  break;
126  case 32:
127  stnA = 3; stnB = 2;
128  mode = 2;
129  break;
130  case 34:
131  stnA = 3; stnB = 2;
132  mode = 2;
133  break;
134  case 36:
135  stnA = 3; stnB = 2;
136  mode = 2;
137  break;
138  default:
139  // standard case for CSC tracks
140  stnA = 1; stnB = 2;
141  mode = 0;
142  }
143  }
144 
145  unsigned L1TrackId::encodeLUTMode(const unsigned& rank) const
146  {
147  int mode;
148  switch (rank)
149  {
150  case 0:
151  mode = 0;
152  break;
153  case 1:
154  mode = 10;
155  break;
156  case 2:
157  mode = 9;
158  break;
159  case 3:
160  mode = 8;
161  break;
162  case 4:
163  mode = 5;
164  break;
165  case 5:
166  mode = 7;
167  break;
168  case 6:
169  mode = 6;
170  break;
171  case 7:
172  mode = 15;
173  break;
174  case 8:
175  mode = 13;
176  break;
177  case 9:
178  mode = 14;
179  break;
180  case 10:
181  mode = 7;
182  break;
183  case 11:
184  mode = 6;
185  break;
186  case 12:
187  mode = 14;
188  break;
189  case 13:
190  mode = 7;
191  break;
192  case 14:
193  mode = 6;
194  break;
195  case 15:
196  mode = 14;
197  break;
198  case 16:
199  mode = 4;
200  break;
201  case 17:
202  mode = 3;
203  break;
204  case 18:
205  mode = 2;
206  break;
207  case 19:
208  mode = 12;
209  break;
210  case 20:
211  mode = 11;
212  break;
213  case 21:
214  mode = 4;
215  break;
216  case 22:
217  mode = 3;
218  break;
219  case 23:
220  mode = 2;
221  break;
222  case 24:
223  mode = 12;
224  break;
225  case 25:
226  mode = 11;
227  break;
228  case 26:
229  mode = 4;
230  break;
231  case 27:
232  mode = 3;
233  break;
234  case 28:
235  mode = 2;
236  break;
237  case 29:
238  mode = 12;
239  break;
240  case 30:
241  mode = 11;
242  break;
243  case 31:
244  mode = 2;
245  break;
246  case 32:
247  mode = 11;
248  break;
249  case 33:
250  mode = 2;
251  break;
252  case 34:
253  mode = 11;
254  break;
255  case 35:
256  mode = 2;
257  break;
258  case 36:
259  mode = 11;
260  break;
261  default:
262  mode = 0;
263  }
264  return mode;
265  }
266 
267  bool L1TrackId::hasME1(const unsigned& rank) const
268  {
269  bool me = false;
270  switch (rank)
271  {
272  case 5:
273  case 6:
274  case 10:
275  case 11:
276  case 12:
277  case 13:
278  case 14:
279  case 16:
280  case 17:
281  case 18:
282  case 21:
283  case 22:
284  case 23:
285  case 26:
286  case 27:
287  case 28:
288  case 31:
289  case 33:
290  case 35:
291  me = true;
292  break;
293  default:
294  me = false;
295  }
296  return me;
297  }
298 
299  bool L1TrackId::hasME2(const unsigned& rank) const
300  {
301  bool me = false;
302  switch (rank)
303  {
304  case 2:
305  case 3:
306  case 4:
307  case 6:
308  case 7:
309  case 8:
310  case 9:
311  case 11:
312  case 12:
313  case 14:
314  case 15:
315  case 17:
316  case 18:
317  case 19:
318  case 20:
319  case 22:
320  case 23:
321  case 24:
322  case 25:
323  case 27:
324  case 28:
325  case 29:
326  case 30:
327  case 31:
328  case 32:
329  case 33:
330  case 34:
331  case 35:
332  case 36:
333  me = true;
334  break;
335  default:
336  me = false;
337  }
338  return me;
339  }
340 
341  bool L1TrackId::hasME3(const unsigned& rank) const
342  {
343  bool me = false;
344  switch (rank)
345  {
346  case 1:
347  case 3:
348  case 4:
349  case 5:
350  case 10:
351  case 13:
352  case 16:
353  case 18:
354  case 21:
355  case 23:
356  case 26:
357  case 28:
358  case 31:
359  case 33:
360  case 35:
361  me = true;
362  break;
363  default:
364  me = false;
365  }
366  return me;
367  }
368 
369  bool L1TrackId::hasME4(const unsigned& rank) const
370  {
371  bool me = false;
372  switch (rank)
373  {
374  case 1:
375  case 2:
376  case 4:
377  case 16:
378  case 17:
379  case 21:
380  case 22:
381  case 26:
382  case 27:
383  case 31:
384  case 33:
385  case 35:
386  me = true;
387  break;
388  default:
389  me = false;
390  }
391  return me;
392  }
393 
394  bool L1TrackId::hasMB1(const unsigned& rank) const
395  {
396  bool mb = false;
397  switch (rank)
398  {
399  case 9:
400  case 12:
401  case 15:
402  case 19:
403  case 20:
404  case 24:
405  case 25:
406  case 29:
407  case 30:
408  case 32:
409  case 34:
410  case 36:
411  mb = true;
412  break;
413  default:
414  mb = false;
415  }
416  return mb;
417  }
418 
419 }
bool sharesHit(const csc::L1TrackId &) const
Definition: L1TrackId.cc:41
unsigned rank() const
Definition: L1TrackId.h:34
void setRank(const unsigned &rank)
Definition: L1TrackId.cc:59
const L1TrackId & operator=(const csc::L1TrackId &)
Definition: L1TrackId.cc:27
void overlapMode(const unsigned &rank, int &mode, int &stnA, int &stnB)
Definition: L1TrackId.cc:78
bool hasME1(const unsigned &rank) const
Functions to determine which stations are in this track.
Definition: L1TrackId.cc:267
bool hasME3(const unsigned &rank) const
Definition: L1TrackId.cc:341
unsigned encodeLUTMode(const unsigned &rank) const
Definition: L1TrackId.cc:145
bool m_overlap
Definition: L1TrackId.h:61
unsigned m_rank
Definition: L1TrackId.h:60
CSCDetId id_
Definition: L1TrackId.h:63
bool hasME2(const unsigned &rank) const
Definition: L1TrackId.cc:299
unsigned m_mode
Definition: L1TrackId.h:60
uint32_t id_
Definition: DetId.h:57
int mode
Definition: AMPTWrapper.h:139
bool hasMB1(const unsigned &rank) const
Definition: L1TrackId.cc:394
bool hasME4(const unsigned &rank) const
Definition: L1TrackId.cc:369
unsigned mode() const
Definition: L1TrackId.h:35
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)
void setOverlap(const unsigned &rank)
Definition: L1TrackId.cc:46