CMS 3D CMS Logo

PrimitiveSelection.cc
Go to the documentation of this file.
2 
9 
10 #include "helper.h" // merge_map_into_map, assert_no_abort
11 
12 // 18 in ME1; 9x3 in ME2,3,4; 9 from neighbor sector.
13 // Arranged in FW as 6 stations, 9 chambers per station.
14 #define NUM_CSC_CHAMBERS 6 * 9
15 // 6x2 in RE1,2; 12x2 in RE3,4; 6 from neighbor sector.
16 // Arranged in FW as 7 stations, 6 chambers per station. (8 with iRPC)
17 #define NUM_RPC_CHAMBERS 7 * 8
18 // 6 in GE1/1; 3 in GE2/1; 2 from neighbor sector.
19 // Arranged in FW as 6 stations, 9 chambers per station, mimicking CSC. (unconfirmed!)
20 #define NUM_GEM_CHAMBERS 6 * 9
21 
23  int endcap,
24  int sector,
25  int bx,
26  int bxShiftCSC,
27  int bxShiftRPC,
28  int bxShiftGEM,
29  bool includeNeighbor,
30  bool duplicateTheta,
31  bool bugME11Dupes) {
32  verbose_ = verbose;
33  endcap_ = endcap;
34  sector_ = sector;
35  bx_ = bx;
36 
37  bxShiftCSC_ = bxShiftCSC;
38  bxShiftRPC_ = bxShiftRPC;
39  bxShiftGEM_ = bxShiftGEM;
40 
41  includeNeighbor_ = includeNeighbor;
42  duplicateTheta_ = duplicateTheta;
43  bugME11Dupes_ = bugME11Dupes;
44 }
45 
46 // _____________________________________________________________________________
47 // Specialized process() for CSC
48 template <>
50  const TriggerPrimitiveCollection& muon_primitives,
51  std::map<int, TriggerPrimitiveCollection>& selected_csc_map) const {
52  TriggerPrimitiveCollection::const_iterator tp_it = muon_primitives.begin();
53  TriggerPrimitiveCollection::const_iterator tp_end = muon_primitives.end();
54 
55  for (; tp_it != tp_end; ++tp_it) {
56  TriggerPrimitive new_tp = *tp_it; // make a copy and apply patches to this copy
57 
58  // Patch the CLCT pattern number
59  // It should be 0-10, see: L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc
60  bool patchPattern = true;
61  if (patchPattern && new_tp.subsystem() == TriggerPrimitive::kCSC) {
62  if (new_tp.getCSCData().pattern == 11 || new_tp.getCSCData().pattern == 12 || new_tp.getCSCData().pattern == 13 ||
63  new_tp.getCSCData().pattern == 14) { // 11, 12, 13, 14 -> 10
64  edm::LogWarning("L1T") << "EMTF patching corrupt CSC LCT pattern: changing " << new_tp.getCSCData().pattern
65  << " to 10";
66  new_tp.accessCSCData().pattern = 10;
67  }
68  }
69 
70  // Patch the LCT quality number
71  // It should be 1-15, see: L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc
72  bool patchQuality = true;
73  if (patchQuality && new_tp.subsystem() == TriggerPrimitive::kCSC) {
74  if (new_tp.getCSCData().quality == 0) { // 0 -> 1
75  edm::LogWarning("L1T") << "EMTF patching corrupt CSC LCT quality: changing " << new_tp.getCSCData().quality
76  << " to 1";
77  new_tp.accessCSCData().quality = 1;
78  }
79  }
80 
81  int selected_csc = select_csc(new_tp); // Returns CSC "link" index (0 - 53)
82 
83  if (selected_csc >= 0) {
84  if (not(selected_csc < NUM_CSC_CHAMBERS)) {
85  edm::LogError("L1T") << "selected_csc = " << selected_csc << ", NUM_CSC_CHAMBERS = " << NUM_CSC_CHAMBERS;
86  return;
87  }
88 
89  if (selected_csc_map[selected_csc].size() < 2) {
90  selected_csc_map[selected_csc].push_back(new_tp);
91  } else {
92  edm::LogWarning("L1T") << "\n******************* EMTF EMULATOR: SUPER-BIZZARE CASE *******************";
93  edm::LogWarning("L1T") << "Found 3 CSC trigger primitives in the same chamber";
94  for (int ii = 0; ii < 3; ii++) {
95  TriggerPrimitive tp_err = (ii < 2 ? selected_csc_map[selected_csc].at(ii) : new_tp);
96  edm::LogWarning("L1T") << "LCT #" << ii + 1 << ": BX " << tp_err.getBX() << ", endcap "
97  << tp_err.detId<CSCDetId>().endcap() << ", sector "
98  << tp_err.detId<CSCDetId>().triggerSector() << ", station "
99  << tp_err.detId<CSCDetId>().station() << ", ring " << tp_err.detId<CSCDetId>().ring()
100  << ", chamber " << tp_err.detId<CSCDetId>().chamber() << ", CSC ID "
101  << tp_err.getCSCData().cscID << ": strip " << tp_err.getStrip() << ", wire "
102  << tp_err.getWire();
103  }
104  edm::LogWarning("L1T") << "************************* ONLY KEEP FIRST TWO *************************\n\n";
105  }
106 
107  } // End conditional: if (selected_csc >= 0)
108  } // End loop: for (; tp_it != tp_end; ++tp_it)
109 
110  // Duplicate CSC muon primitives
111  // If there are 2 LCTs in the same chamber with (strip, wire) = (s1, w1) and (s2, w2)
112  // make all combinations with (s1, w1), (s2, w1), (s1, w2), (s2, w2)
113  if (duplicateTheta_) {
114  std::map<int, TriggerPrimitiveCollection>::iterator map_tp_it = selected_csc_map.begin();
115  std::map<int, TriggerPrimitiveCollection>::iterator map_tp_end = selected_csc_map.end();
116 
117  for (; map_tp_it != map_tp_end; ++map_tp_it) {
118  int selected = map_tp_it->first;
119  TriggerPrimitiveCollection& tmp_primitives = map_tp_it->second; // pass by reference
120 
121  if (tmp_primitives.size() >= 4) {
122  edm::LogWarning("L1T") << "EMTF found 4 or more CSC LCTs in one chamber: keeping only two";
123  tmp_primitives.erase(tmp_primitives.begin() + 4, tmp_primitives.end()); // erase 5th element++
124  tmp_primitives.erase(tmp_primitives.begin() + 2); // erase 3rd element
125  tmp_primitives.erase(tmp_primitives.begin() + 1); // erase 2nd element
126  } else if (tmp_primitives.size() == 3) {
127  edm::LogWarning("L1T") << "EMTF found 3 CSC LCTs in one chamber: keeping only two";
128  tmp_primitives.erase(tmp_primitives.begin() + 2); // erase 3rd element
129  }
130  if (not(tmp_primitives.size() <= 2)) // at most 2 hits
131  {
132  edm::LogError("L1T") << "tmp_primitives.size() = " << tmp_primitives.size();
133  return;
134  }
135 
136  if (tmp_primitives.size() == 2) {
137  if ((tmp_primitives.at(0).getStrip() != tmp_primitives.at(1).getStrip()) &&
138  (tmp_primitives.at(0).getWire() != tmp_primitives.at(1).getWire())) {
139  // Swap wire numbers
140  TriggerPrimitive tp0 = tmp_primitives.at(0); // (s1,w1)
141  TriggerPrimitive tp1 = tmp_primitives.at(1); // (s2,w2)
142  uint16_t tmp_keywire = tp0.accessCSCData().keywire;
143  tp0.accessCSCData().keywire = tp1.accessCSCData().keywire; // (s1,w2)
144  tp1.accessCSCData().keywire = tmp_keywire; // (s2,w1)
145 
146  tmp_primitives.insert(tmp_primitives.begin() + 1, tp1); // (s2,w1) at 2nd pos
147  tmp_primitives.insert(tmp_primitives.begin() + 2, tp0); // (s1,w2) at 3rd pos
148  }
149 
150  const bool is_csc_me11 = (0 <= selected && selected <= 2) || (9 <= selected && selected <= 11) ||
151  (selected == 45); // ME1/1 sub 1 or ME1/1 sub 2 or ME1/1 from neighbor
152 
153  if (bugME11Dupes_ && is_csc_me11) {
154  // For ME1/1, always make 4 LCTs without checking strip & wire combination
155  if (tmp_primitives.size() == 2) {
156  // Swap wire numbers
157  TriggerPrimitive tp0 = tmp_primitives.at(0); // (s1,w1)
158  TriggerPrimitive tp1 = tmp_primitives.at(1); // (s2,w2)
159  uint16_t tmp_keywire = tp0.accessCSCData().keywire;
160  tp0.accessCSCData().keywire = tp1.accessCSCData().keywire; // (s1,w2)
161  tp1.accessCSCData().keywire = tmp_keywire; // (s2,w1)
162 
163  tmp_primitives.insert(tmp_primitives.begin() + 1, tp1); // (s2,w1) at 2nd pos
164  tmp_primitives.insert(tmp_primitives.begin() + 2, tp0); // (s1,w2) at 3rd pos
165  }
166  if (not(tmp_primitives.size() == 1 || tmp_primitives.size() == 4)) {
167  edm::LogError("L1T") << "tmp_primitives.size() = " << tmp_primitives.size();
168  return;
169  }
170  }
171 
172  } // end if tmp_primitives.size() == 2
173  } // end loop over selected_csc_map
174  } // end if duplicate theta
175 }
176 
177 // _____________________________________________________________________________
178 // Specialized process() for RPC
179 template <>
181  const TriggerPrimitiveCollection& muon_primitives,
182  std::map<int, TriggerPrimitiveCollection>& selected_rpc_map) const {
183  TriggerPrimitiveCollection::const_iterator tp_it = muon_primitives.begin();
184  TriggerPrimitiveCollection::const_iterator tp_end = muon_primitives.end();
185 
186  for (; tp_it != tp_end; ++tp_it) {
187  int selected_rpc = select_rpc(*tp_it); // Returns RPC "link" index (0 - 41)
188 
189  if (selected_rpc >= 0) {
190  if (not(selected_rpc < NUM_RPC_CHAMBERS)) {
191  edm::LogError("L1T") << "selected_rpc = " << selected_rpc << ", NUM_RPC_CHAMBERS = " << NUM_RPC_CHAMBERS;
192  return;
193  }
194  selected_rpc_map[selected_rpc].push_back(*tp_it);
195  }
196  }
197 
198  // Apply truncation as in firmware: keep first 2 clusters, max cluster
199  // size = 3 strips.
200  // According to Karol Bunkowski, for one chamber (so 3 eta rolls) only up
201  // to 2 hits (cluster centres) are produced. First two 'first' clusters are
202  // chosen, and only after the cut on the cluster size is applied. So if
203  // there are 1 large cluster and 2 small clusters, it is possible that
204  // one of the two small clusters is discarded first, and the large cluster
205  // then is removed by the cluster size cut, leaving only one cluster.
206  bool apply_truncation = true;
207  if (apply_truncation) {
208  struct {
210  bool operator()(const value_type& x) const {
211  int sz = x.getRPCData().strip_hi - x.getRPCData().strip_low + 1;
212  return sz > 3;
213  }
214  } cluster_size_cut;
215 
216  std::map<int, TriggerPrimitiveCollection>::iterator map_tp_it = selected_rpc_map.begin();
217  std::map<int, TriggerPrimitiveCollection>::iterator map_tp_end = selected_rpc_map.end();
218 
219  for (; map_tp_it != map_tp_end; ++map_tp_it) {
220  //int selected = map_tp_it->first;
221  TriggerPrimitiveCollection& tmp_primitives = map_tp_it->second; // pass by reference
222 
223  // Check to see if unpacked CPPF digis have <= 2 digis per chamber, as expected
224  if (tmp_primitives.size() > 2 && tmp_primitives.at(0).getRPCData().isCPPF) {
225  edm::LogWarning("L1T") << "\n******************* EMTF EMULATOR: SUPER-BIZZARE CASE *******************";
226  edm::LogWarning("L1T") << "Found " << tmp_primitives.size() << " CPPF digis in the same chamber";
227  for (const auto& tp : tmp_primitives)
228  tp.print(std::cout);
229  edm::LogWarning("L1T") << "************************* ONLY KEEP FIRST TWO *************************\n\n";
230  }
231 
232  // Keep the first two clusters
233  if (tmp_primitives.size() > 2)
234  tmp_primitives.erase(tmp_primitives.begin() + 2, tmp_primitives.end());
235 
236  // Skip cluster size cut if primitives are from CPPF emulator or EMTF unpacker (already clustered)
237  if (!tmp_primitives.empty() && tmp_primitives.at(0).getRPCData().isCPPF)
238  break;
239 
240  // Apply cluster size cut
241  tmp_primitives.erase(std::remove_if(tmp_primitives.begin(), tmp_primitives.end(), cluster_size_cut),
242  tmp_primitives.end());
243  }
244  } // end if apply_truncation
245 
246  // Map RPC subsector and chamber to CSC chambers
247  // Note: RE3/2 & RE3/3 are considered as one chamber; RE4/2 & RE4/3 too.
248  bool map_rpc_to_csc = true;
249  if (map_rpc_to_csc) {
250  std::map<int, TriggerPrimitiveCollection> tmp_selected_rpc_map;
251 
252  std::map<int, TriggerPrimitiveCollection>::iterator map_tp_it = selected_rpc_map.begin();
253  std::map<int, TriggerPrimitiveCollection>::iterator map_tp_end = selected_rpc_map.end();
254 
255  for (; map_tp_it != map_tp_end; ++map_tp_it) {
256  int selected = map_tp_it->first;
257  TriggerPrimitiveCollection& tmp_primitives = map_tp_it->second; // pass by reference
258 
259  int rpc_sub = selected / 8;
260  int rpc_chm = selected % 8;
261 
262  int pc_station = -1;
263  int pc_chamber = -1;
264 
265  if (rpc_sub != 6) { // native
266  if (rpc_chm == 0) { // RE1/2
267  if (0 <= rpc_sub && rpc_sub < 3) {
268  pc_station = 0;
269  pc_chamber = 3 + rpc_sub;
270  } else if (3 <= rpc_sub && rpc_sub < 6) {
271  pc_station = 1;
272  pc_chamber = 3 + (rpc_sub - 3);
273  }
274  } else if (rpc_chm == 1) { // RE2/2
275  pc_station = 2;
276  pc_chamber = 3 + rpc_sub;
277  } else if (2 <= rpc_chm && rpc_chm <= 3) { // RE3/2, RE3/3
278  pc_station = 3;
279  pc_chamber = 3 + rpc_sub;
280  } else if (4 <= rpc_chm && rpc_chm <= 5) { // RE4/2, RE4/3
281  pc_station = 4;
282  pc_chamber = 3 + rpc_sub;
283  }
284 
285  } else { // neighbor
286  pc_station = 5;
287  if (rpc_chm == 0) { // RE1/2
288  pc_chamber = 1;
289  } else if (rpc_chm == 1) { // RE2/2
290  pc_chamber = 4;
291  } else if (2 <= rpc_chm && rpc_chm <= 3) { // RE3/2, RE3/3
292  pc_chamber = 6;
293  } else if (4 <= rpc_chm && rpc_chm <= 5) { // RE4/2, RE4/3
294  pc_chamber = 8;
295  }
296  }
297 
298  if (not(pc_station != -1 && pc_chamber != -1)) {
299  edm::LogError("L1T") << "pc_station = " << pc_station << ", pc_chamber = " << pc_chamber;
300  return;
301  }
302 
303  selected = (pc_station * 9) + pc_chamber;
304 
305  bool ignore_this_rpc_chm = false;
306  if (rpc_chm == 3 || rpc_chm == 5) { // special case of RE3,4/2 and RE3,4/3 chambers
307  // if RE3,4/2 exists, ignore RE3,4/3. In C++, this assumes that the loop
308  // over selected_rpc_map will always find RE3,4/2 before RE3,4/3
309  if (tmp_selected_rpc_map.find(selected) != tmp_selected_rpc_map.end())
310  ignore_this_rpc_chm = true;
311  }
312 
313  if (ignore_this_rpc_chm) {
314  // Set RPC stubs as invalid
315  for (auto&& tp : tmp_primitives) {
316  tp.accessRPCData().valid = 0;
317  }
318  }
319 
320  if (tmp_selected_rpc_map.find(selected) == tmp_selected_rpc_map.end()) {
321  tmp_selected_rpc_map[selected] = tmp_primitives;
322  } else {
323  tmp_selected_rpc_map[selected].insert(
324  tmp_selected_rpc_map[selected].end(), tmp_primitives.begin(), tmp_primitives.end());
325  }
326  } // end loop over selected_rpc_map
327 
328  std::swap(selected_rpc_map, tmp_selected_rpc_map); // replace the original map
329  } // end if map_rpc_to_csc
330 }
331 
332 // _____________________________________________________________________________
333 // Specialized process() for GEM
334 template <>
336  const TriggerPrimitiveCollection& muon_primitives,
337  std::map<int, TriggerPrimitiveCollection>& selected_gem_map) const {
338  TriggerPrimitiveCollection::const_iterator tp_it = muon_primitives.begin();
339  TriggerPrimitiveCollection::const_iterator tp_end = muon_primitives.end();
340 
341  for (; tp_it != tp_end; ++tp_it) {
342  int selected_gem = select_gem(*tp_it); // Returns GEM "link" index (0 - 53)
343 
344  if (selected_gem >= 0) {
345  if (not(selected_gem < NUM_GEM_CHAMBERS)) {
346  edm::LogError("L1T") << "selected_gem = " << selected_gem << ", NUM_GEM_CHAMBERS = " << NUM_GEM_CHAMBERS;
347  return;
348  }
349  selected_gem_map[selected_gem].push_back(*tp_it);
350  }
351  }
352 
353  // Apply truncation: max cluster size = 8 pads, keep first 8 clusters.
354  bool apply_truncation = true;
355  if (apply_truncation) {
356  struct {
358  bool operator()(const value_type& x) const {
359  int sz = x.getGEMData().pad_hi - x.getGEMData().pad_low + 1;
360  return sz > 8;
361  }
362  } cluster_size_cut;
363 
364  std::map<int, TriggerPrimitiveCollection>::iterator map_tp_it = selected_gem_map.begin();
365  std::map<int, TriggerPrimitiveCollection>::iterator map_tp_end = selected_gem_map.end();
366 
367  for (; map_tp_it != map_tp_end; ++map_tp_it) {
368  //int selected = map_tp_it->first;
369  TriggerPrimitiveCollection& tmp_primitives = map_tp_it->second; // pass by reference
370 
371  // Apply cluster size cut
372  tmp_primitives.erase(std::remove_if(tmp_primitives.begin(), tmp_primitives.end(), cluster_size_cut),
373  tmp_primitives.end());
374 
375  // Keep the first 8 clusters
376  if (tmp_primitives.size() > 8)
377  tmp_primitives.erase(tmp_primitives.begin() + 8, tmp_primitives.end());
378  }
379  } // end if apply_truncation
380 }
381 
382 // _____________________________________________________________________________
383 // Put the hits from CSC, RPC, GEM together in one collection
384 
385 // Notes from Alex (2017-03-28):
386 //
387 // The RPC inclusion logic is very simple currently:
388 // - each CSC is analyzed for having track stubs in each BX
389 // - IF a CSC chamber is missing at least one track stub,
390 // AND there is an RPC overlapping with it in phi and theta,
391 // AND that RPC has hits,
392 // THEN RPC hit is inserted instead of missing CSC stub.
393 //
394 // This is done at the output of coord_delay module, so such
395 // inserted RPC hits can be matched to patterns by match_ph_segments
396 // module, just like any CSC stubs. Note that substitution of missing
397 // CSC stubs with RPC hits happens regardless of what's going on in
398 // other chambers, regardless of whether a pattern has been detected
399 // or not, basically regardless of anything. RPCs are treated as a
400 // supplemental source of stubs for CSCs.
401 
402 void PrimitiveSelection::merge(const std::map<int, TriggerPrimitiveCollection>& selected_csc_map,
403  const std::map<int, TriggerPrimitiveCollection>& selected_rpc_map,
404  const std::map<int, TriggerPrimitiveCollection>& selected_gem_map,
405  std::map<int, TriggerPrimitiveCollection>& selected_prim_map) const {
406  // First, put CSC hits
407  std::map<int, TriggerPrimitiveCollection>::const_iterator map_tp_it = selected_csc_map.begin();
408  std::map<int, TriggerPrimitiveCollection>::const_iterator map_tp_end = selected_csc_map.end();
409 
410  for (; map_tp_it != map_tp_end; ++map_tp_it) {
411  int selected_csc = map_tp_it->first;
412  const TriggerPrimitiveCollection& csc_primitives = map_tp_it->second;
413  if (not(csc_primitives.size() <= 4)) // at most 4 hits, including duplicated hits
414  {
415  edm::LogError("L1T") << "csc_primitives.size() = " << csc_primitives.size();
416  return;
417  }
418 
419  // Insert all CSC hits
420  selected_prim_map[selected_csc] = csc_primitives;
421  }
422 
423  // Second, insert GEM stubs if there is no CSC hits
424  map_tp_it = selected_gem_map.begin();
425  map_tp_end = selected_gem_map.end();
426 
427  for (; map_tp_it != map_tp_end; ++map_tp_it) {
428  int selected_gem = map_tp_it->first;
429  const TriggerPrimitiveCollection& gem_primitives = map_tp_it->second;
430  if (gem_primitives.empty())
431  continue;
432  if (not(gem_primitives.size() <= 8)) // at most 8 hits
433  {
434  edm::LogError("L1T") << "gem_primitives.size() = " << gem_primitives.size();
435  return;
436  }
437 
438  bool found = (selected_prim_map.find(selected_gem) != selected_prim_map.end());
439  if (!found) {
440  // No CSC hits, insert all GEM hits
441  selected_prim_map[selected_gem] = gem_primitives;
442 
443  } else {
444  // Do nothing
445  }
446  }
447 
448  // Third, insert RPC stubs if there is no CSC/GEM hits
449  map_tp_it = selected_rpc_map.begin();
450  map_tp_end = selected_rpc_map.end();
451 
452  for (; map_tp_it != map_tp_end; ++map_tp_it) {
453  int selected_rpc = map_tp_it->first;
454  const TriggerPrimitiveCollection& rpc_primitives = map_tp_it->second;
455  if (rpc_primitives.empty())
456  continue;
457  if (not(rpc_primitives.size() <= 4)) // at most 4 hits
458  {
459  edm::LogError("L1T") << "rpc_primitives.size() = " << rpc_primitives.size();
460  return;
461  }
462 
463  bool found = (selected_prim_map.find(selected_rpc) != selected_prim_map.end());
464  if (!found) {
465  // No CSC/GEM hits, insert all RPC hits
466  //selected_prim_map[selected_rpc] = rpc_primitives;
467 
468  // No CSC/GEM hits, insert the valid RPC hits
469  TriggerPrimitiveCollection tmp_rpc_primitives;
470  for (const auto& tp : rpc_primitives) {
471  if (tp.getRPCData().valid != 0) {
472  tmp_rpc_primitives.push_back(tp);
473  }
474  }
475  if (not(tmp_rpc_primitives.size() <= 2)) // at most 2 hits
476  {
477  edm::LogError("L1T") << "tmp_rpc_primitives.size() = " << tmp_rpc_primitives.size();
478  return;
479  }
480 
481  selected_prim_map[selected_rpc] = tmp_rpc_primitives;
482 
483  } else {
484  // Initial FW in 2017; was disabled on June 7.
485  // If only one CSC/GEM hit, insert the first RPC hit
486  //TriggerPrimitiveCollection& tmp_primitives = selected_prim_map[selected_rpc]; // pass by reference
487 
488  //if (tmp_primitives.size() < 2) {
489  // tmp_primitives.push_back(rpc_primitives.front());
490  //}
491  }
492  }
493 }
494 
495 void PrimitiveSelection::merge_no_truncate(const std::map<int, TriggerPrimitiveCollection>& selected_csc_map,
496  const std::map<int, TriggerPrimitiveCollection>& selected_rpc_map,
497  const std::map<int, TriggerPrimitiveCollection>& selected_gem_map,
498  std::map<int, TriggerPrimitiveCollection>& selected_prim_map) const {
499  // First, put CSC hits
500  merge_map_into_map(selected_csc_map, selected_prim_map);
501 
502  // Second, insert GEM hits
503  merge_map_into_map(selected_gem_map, selected_prim_map);
504 
505  // Third, insert RPC hits
506  merge_map_into_map(selected_rpc_map, selected_prim_map);
507 }
508 
509 // _____________________________________________________________________________
510 // CSC functions
511 int PrimitiveSelection::select_csc(const TriggerPrimitive& muon_primitive) const {
512  int selected = -1;
513 
514  if (muon_primitive.subsystem() == TriggerPrimitive::kCSC) {
515  const CSCDetId& tp_detId = muon_primitive.detId<CSCDetId>();
516  const CSCData& tp_data = muon_primitive.getCSCData();
517 
518  int tp_endcap = tp_detId.endcap();
519  int tp_sector = tp_detId.triggerSector();
520  int tp_station = tp_detId.station();
521  int tp_ring = tp_detId.ring();
522  int tp_chamber = tp_detId.chamber();
523 
524  int tp_bx = tp_data.bx;
525  int tp_csc_ID = tp_data.cscID;
526 
527  if (!(emtf::MIN_ENDCAP <= tp_endcap && tp_endcap <= emtf::MAX_ENDCAP)) {
528  edm::LogWarning("L1T") << "EMTF CSC format error: tp_endcap = " << tp_endcap;
529  return selected;
530  }
531  if (!(emtf::MIN_TRIGSECTOR <= tp_sector && tp_sector <= emtf::MAX_TRIGSECTOR)) {
532  edm::LogWarning("L1T") << "EMTF CSC format error: tp_sector = " << tp_sector;
533  return selected;
534  }
535  if (!(1 <= tp_station && tp_station <= 4)) {
536  edm::LogWarning("L1T") << "EMTF CSC format error: tp_station = " << tp_station;
537  return selected;
538  }
539  if (!(1 <= tp_csc_ID && tp_csc_ID <= 9)) {
540  edm::LogWarning("L1T") << "EMTF CSC format error: tp_csc_ID = " << tp_csc_ID;
541  return selected;
542  }
543  if (!(tp_data.valid == true)) {
544  edm::LogWarning("L1T") << "EMTF CSC format error: tp_data.valid = " << tp_data.valid;
545  return selected;
546  }
547  if (!(tp_data.pattern <= 10)) {
548  edm::LogWarning("L1T") << "EMTF CSC format error: tp_data.pattern = " << tp_data.pattern;
549  return selected;
550  }
551  if (!(tp_data.quality > 0)) {
552  edm::LogWarning("L1T") << "EMTF CSC format error: tp_data.quality = " << tp_data.quality;
553  return selected;
554  }
555 
556  int max_strip = 0;
557  int max_wire = 0;
558  if (tp_station == 1 && tp_ring == 4) { // ME1/1a
559  max_strip = 96;
560  max_wire = 48;
561  } else if (tp_station == 1 && tp_ring == 1) { // ME1/1b
562  max_strip = 128;
563  max_wire = 48;
564  } else if (tp_station == 1 && tp_ring == 2) { // ME1/2
565  max_strip = 160;
566  max_wire = 64;
567  } else if (tp_station == 1 && tp_ring == 3) { // ME1/3
568  max_strip = 128;
569  max_wire = 32;
570  } else if (tp_station == 2 && tp_ring == 1) { // ME2/1
571  max_strip = 160;
572  max_wire = 112;
573  } else if (tp_station >= 3 && tp_ring == 1) { // ME3/1, ME4/1
574  max_strip = 160;
575  max_wire = 96;
576  } else if (tp_station >= 2 && tp_ring == 2) { // ME2/2, ME3/2, ME4/2
577  max_strip = 160;
578  max_wire = 64;
579  }
580 
581  if (!(tp_data.strip < max_strip)) {
582  edm::LogWarning("L1T") << "EMTF CSC format error in station " << tp_station << ", ring " << tp_ring
583  << ": tp_data.strip = " << tp_data.strip << " (max = " << max_strip - 1 << ")"
584  << std::endl;
585  return selected;
586  }
587  if (!(tp_data.keywire < max_wire)) {
588  edm::LogWarning("L1T") << "EMTF CSC format error in station " << tp_station << ", ring " << tp_ring
589  << ": tp_data.keywire = " << tp_data.keywire << " (max = " << max_wire - 1 << ")"
590  << std::endl;
591  return selected;
592  }
593 
594  // station 1 --> subsector 1 or 2
595  // station 2,3,4 --> subsector 0
596  int tp_subsector = (tp_station != 1) ? 0 : ((tp_chamber % 6 > 2) ? 1 : 2);
597 
598  // Selection
599  if (is_in_bx_csc(tp_bx)) {
600  if (is_in_sector_csc(tp_endcap, tp_sector)) {
601  selected = get_index_csc(tp_subsector, tp_station, tp_csc_ID, false);
602  } else if (is_in_neighbor_sector_csc(tp_endcap, tp_sector, tp_subsector, tp_station, tp_csc_ID)) {
603  selected = get_index_csc(tp_subsector, tp_station, tp_csc_ID, true);
604  }
605  }
606  }
607  return selected;
608 }
609 
610 bool PrimitiveSelection::is_in_sector_csc(int tp_endcap, int tp_sector) const {
611  return ((endcap_ == tp_endcap) && (sector_ == tp_sector));
612 }
613 
615  int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const {
616  auto get_neighbor = [](int sector) { return (sector == 1) ? 6 : sector - 1; };
617 
618  if (includeNeighbor_) {
619  if ((endcap_ == tp_endcap) && (get_neighbor(sector_) == tp_sector)) {
620  if (tp_station == 1) {
621  if ((tp_subsector == 2) && (tp_csc_ID == 3 || tp_csc_ID == 6 || tp_csc_ID == 9))
622  return true;
623 
624  } else {
625  if (tp_csc_ID == 3 || tp_csc_ID == 9)
626  return true;
627  }
628  }
629  }
630  return false;
631 }
632 
633 bool PrimitiveSelection::is_in_bx_csc(int tp_bx) const {
634  tp_bx += bxShiftCSC_;
635  return (bx_ == tp_bx);
636 }
637 
638 // Returns CSC input "link". Index used by FW for unique chamber identification.
639 int PrimitiveSelection::get_index_csc(int tp_subsector, int tp_station, int tp_csc_ID, bool is_neighbor) const {
640  int selected = -1;
641 
642  if (!is_neighbor) {
643  if (tp_station == 1) { // ME1: 0 - 8, 9 - 17
644  selected = (tp_subsector - 1) * 9 + (tp_csc_ID - 1);
645  } else { // ME2,3,4: 18 - 26, 27 - 35, 36 - 44
646  selected = (tp_station)*9 + (tp_csc_ID - 1);
647  }
648 
649  } else {
650  if (tp_station == 1) { // ME1: 45 - 47
651  selected = (5) * 9 + (tp_csc_ID - 1) / 3;
652  } else { // ME2,3,4: 48 - 53
653  selected = (5) * 9 + (tp_station)*2 - 1 + (tp_csc_ID - 1 < 3 ? 0 : 1);
654  }
655  }
656  return selected;
657 }
658 
659 // _____________________________________________________________________________
660 // RPC functions
661 int PrimitiveSelection::select_rpc(const TriggerPrimitive& muon_primitive) const {
662  int selected = -1;
663 
664  if (muon_primitive.subsystem() == TriggerPrimitive::kRPC) {
665  const RPCDetId& tp_detId = muon_primitive.detId<RPCDetId>();
666  const RPCData& tp_data = muon_primitive.getRPCData();
667 
668  int tp_region = tp_detId.region(); // 0 for Barrel, +/-1 for +/- Endcap
669  int tp_endcap = (tp_region == -1) ? 2 : tp_region;
670  int tp_sector = tp_detId.sector(); // 1 - 6 (60 degrees in phi, sector 1 begins at -5 deg)
671  int tp_subsector = tp_detId.subsector(); // 1 - 6 (10 degrees in phi; staggered in z)
672  int tp_station = tp_detId.station(); // 1 - 4
673  int tp_ring = tp_detId.ring(); // 2 - 3 (increasing theta)
674  int tp_roll = tp_detId.roll(); // 1 - 3 (decreasing theta; aka A - C; space between rolls is 9 - 15 in theta_fp)
675  //int tp_layer = tp_detId.layer();
676 
677  int tp_bx = tp_data.bx;
678  int tp_strip = tp_data.strip;
679  int tp_emtf_sect = tp_data.emtf_sector;
680  bool tp_CPPF = tp_data.isCPPF;
681 
682  // In neighbor chambers, have two separate CPPFDigis for the two EMTF sectors
683  if (tp_CPPF && (tp_emtf_sect != sector_))
684  return selected;
685 
686  if (!(tp_region != 0)) {
687  edm::LogWarning("L1T") << "EMTF RPC format error: tp_region = " << tp_region;
688  return selected;
689  }
690  if (!(emtf::MIN_ENDCAP <= tp_endcap && tp_endcap <= emtf::MAX_ENDCAP)) {
691  edm::LogWarning("L1T") << "EMTF RPC format error: tp_endcap = " << tp_endcap;
692  return selected;
693  }
694  if (!(emtf::MIN_TRIGSECTOR <= tp_sector && tp_sector <= emtf::MAX_TRIGSECTOR)) {
695  edm::LogWarning("L1T") << "EMTF RPC format error: tp_sector = " << tp_sector;
696  return selected;
697  }
698  if (!(1 <= tp_subsector && tp_subsector <= 6)) {
699  edm::LogWarning("L1T") << "EMTF RPC format error: tp_subsector = " << tp_subsector;
700  return selected;
701  }
702  if (!(1 <= tp_station && tp_station <= 4)) {
703  edm::LogWarning("L1T") << "EMTF RPC format error: tp_station = " << tp_station;
704  return selected;
705  }
706  if (!(2 <= tp_ring && tp_ring <= 3)) {
707  edm::LogWarning("L1T") << "EMTF RPC format error: tp_ring = " << tp_ring;
708  return selected;
709  }
710  if (!(1 <= tp_roll && tp_roll <= 3)) {
711  edm::LogWarning("L1T") << "EMTF RPC format error: tp_roll = " << tp_roll;
712  return selected;
713  }
714  if (!(tp_CPPF || (1 <= tp_strip && tp_strip <= 32))) {
715  edm::LogWarning("L1T") << "EMTF RPC format error: tp_data.strip = " << tp_data.strip;
716  return selected;
717  }
718  if (!(tp_station > 2 || tp_ring != 3)) {
719  edm::LogWarning("L1T") << "EMTF RPC format error: tp_station = " << tp_station << ", tp_ring = " << tp_ring;
720  return selected;
721  }
722 
723  // Selection
724  if (is_in_bx_rpc(tp_bx)) {
725  if (is_in_sector_rpc(tp_endcap, tp_station, tp_ring, tp_sector, tp_subsector)) {
726  selected = get_index_rpc(tp_station, tp_ring, tp_subsector, false);
727  } else if (is_in_neighbor_sector_rpc(tp_endcap, tp_station, tp_ring, tp_sector, tp_subsector)) {
728  selected = get_index_rpc(tp_station, tp_ring, tp_subsector, true);
729  }
730  }
731  }
732  return selected;
733 }
734 
736  int tp_endcap, int tp_station, int tp_ring, int tp_sector, int tp_subsector) const {
737  // RPC sector X, subsectors 1-2 corresponds to CSC sector X-1
738  // RPC sector X, subsectors 3-6 corresponds to CSC sector X
739  auto get_csc_sector = [](int tp_station, int tp_ring, int tp_sector, int tp_subsector) {
740  // 10 degree chamber
741  int corr = (tp_subsector < 3) ? (tp_sector == 1 ? +5 : -1) : 0;
742  return tp_sector + corr;
743  };
744  return ((endcap_ == tp_endcap) && (sector_ == get_csc_sector(tp_station, tp_ring, tp_sector, tp_subsector)));
745 }
746 
748  int tp_endcap, int tp_station, int tp_ring, int tp_sector, int tp_subsector) const {
749  auto get_csc_neighbor_subsector = [](int tp_station, int tp_ring) {
750  // 10 degree chamber
751  return 2;
752  };
753  return (includeNeighbor_ && (endcap_ == tp_endcap) && (sector_ == tp_sector) &&
754  (tp_subsector == get_csc_neighbor_subsector(tp_station, tp_ring)));
755 }
756 
757 bool PrimitiveSelection::is_in_bx_rpc(int tp_bx) const {
758  tp_bx += bxShiftRPC_;
759  return (bx_ == tp_bx);
760 }
761 
762 int PrimitiveSelection::get_index_rpc(int tp_station, int tp_ring, int tp_subsector, bool is_neighbor) const {
763  int selected = -1;
764 
765  // CPPF RX data come in 3 frames x 64 bits, for 7 links. Each 64-bit data
766  // carry 2 words of 32 bits. Each word carries phi (11 bits) and theta (5 bits)
767  // of 2 segments (x2).
768  //
769  // Firmware uses 'rpc_sub' as RPC subsector index and 'rpc_chm' as RPC chamber index
770  // rpc_sub [0,6] = RPC subsector 3, 4, 5, 6, 1 from neighbor, 2 from neighbor, 2. They correspond to
771  // CSC sector phi 0-10 deg, 10-20, 20-30, 30-40, 40-50, 50-60, 50-60 from neighbor
772  // rpc_chm [0,5] = RPC chamber RE1/2, RE2/2, RE3/2, RE3/3, RE4/2, RE4/3
773  //
774  int rpc_sub = -1;
775  int rpc_chm = -1;
776 
777  if (!is_neighbor) {
778  rpc_sub = ((tp_subsector + 3) % 6);
779  } else {
780  rpc_sub = 6;
781  }
782 
783  if (tp_station <= 2) {
784  rpc_chm = (tp_station - 1);
785  } else {
786  rpc_chm = 2 + (tp_station - 3) * 2 + (tp_ring - 2);
787  }
788 
789  if (not(rpc_sub != -1 && rpc_chm != -1)) {
790  edm::LogError("L1T") << "rpc_sub = " << rpc_sub << ", rpc_chm = " << rpc_chm;
791  return selected;
792  }
793 
794  selected = (rpc_sub * 8) + rpc_chm;
795  return selected;
796 }
797 
798 // _____________________________________________________________________________
799 // GEM functions
800 int PrimitiveSelection::select_gem(const TriggerPrimitive& muon_primitive) const {
801  int selected = -1;
802 
803  if (muon_primitive.subsystem() == TriggerPrimitive::kGEM) {
804  const EMTFGEMDetId& tp_detId = emtf::construct_EMTFGEMDetId(muon_primitive);
805  const GEMData& tp_data = muon_primitive.getGEMData();
806 
807  int tp_region = tp_detId.region(); // 0 for Barrel, +/-1 for +/- Endcap
808  int tp_endcap = (tp_region == -1) ? 2 : tp_region;
809  int tp_station = tp_detId.station();
810  int tp_ring = tp_detId.ring();
811  int tp_roll = tp_detId.roll();
812  int tp_layer = tp_detId.layer();
813  int tp_chamber = tp_detId.chamber();
814 
815  int tp_bx = tp_data.bx;
816  int tp_pad = tp_data.pad;
817 
818  // Use CSC trigger sector definitions
819  // Code copied from DataFormats/MuonDetId/src/CSCDetId.cc
820  auto get_trigger_sector = [](int ring, int station, int chamber) {
821  int result = 0;
822  if (station > 1 && ring > 1) {
823  result = ((static_cast<unsigned>(chamber - 3) & 0x7f) / 6) + 1; // ch 3-8->1, 9-14->2, ... 1,2 -> 6
824  } else if (station == 1 && ring != 4) {
825  result = ((static_cast<unsigned>(chamber - 3) & 0x7f) / 6) + 1; // ch 3-8->1, 9-14->2, ... 1,2 -> 6
826  } else {
827  result = ((static_cast<unsigned>(chamber - 2) & 0x1f) / 3) + 1; // ch 2-4-> 1, 5-7->2, ...
828  }
829  return (result <= 6)
830  ? result
831  : 6; // max sector is 6, some calculations give a value greater than six but this is expected.
832  };
833 
834  // Use CSC trigger "CSC ID" definitions
835  // Code copied from DataFormats/MuonDetId/src/CSCDetId.cc
836  auto get_trigger_csc_ID = [](int ring, int station, int chamber) {
837  int result = 0;
838  if (station == 1) {
839  result = (chamber) % 3 + 1; // 1,2,3
840  switch (ring) {
841  case 1:
842  break;
843  case 2:
844  result += 3; // 4,5,6
845  break;
846  case 3:
847  result += 6; // 7,8,9
848  break;
849  }
850  } else {
851  if (ring == 1) {
852  result = (chamber + 1) % 3 + 1; // 1,2,3
853  } else {
854  result = (chamber + 3) % 6 + 4; // 4,5,6,7,8,9
855  }
856  }
857  return result;
858  };
859 
860  int tp_sector = get_trigger_sector(tp_ring, tp_station, tp_chamber);
861  int tp_csc_ID = get_trigger_csc_ID(tp_ring, tp_station, tp_chamber);
862 
863  // station 1 --> subsector 1 or 2
864  // station 2,3,4 --> subsector 0
865  int tp_subsector = (tp_station != 1) ? 0 : ((tp_chamber % 6 > 2) ? 1 : 2);
866 
867  if (!(emtf::MIN_ENDCAP <= tp_endcap && tp_endcap <= emtf::MAX_ENDCAP)) {
868  edm::LogWarning("L1T") << "EMTF GEM format error: tp_endcap = " << tp_endcap;
869  return selected;
870  }
871  if (!(emtf::MIN_TRIGSECTOR <= tp_sector && tp_sector <= emtf::MAX_TRIGSECTOR)) {
872  edm::LogWarning("L1T") << "EMTF GEM format error: tp_sector = " << tp_sector;
873  return selected;
874  }
875  if (!(1 <= tp_station && tp_station <= 2)) {
876  edm::LogWarning("L1T") << "EMTF GEM format error: tp_station = " << tp_station;
877  return selected;
878  }
879  if (!(1 <= tp_ring && tp_ring <= 1)) {
880  edm::LogWarning("L1T") << "EMTF GEM format error: tp_ring = " << tp_ring;
881  return selected;
882  }
883  if (!(1 <= tp_csc_ID && tp_csc_ID <= 9)) {
884  edm::LogWarning("L1T") << "EMTF GEM format error: tp_csc_ID = " << tp_csc_ID;
885  return selected;
886  }
887  if (!(tp_station == 1 && 1 <= tp_roll && tp_roll <= 8) || (tp_station != 1)) {
888  edm::LogWarning("L1T") << "EMTF GEM format error: tp_station = " << tp_station << ", tp_roll = " << tp_roll;
889  return selected;
890  }
891  if (!(tp_station == 2 && 1 <= tp_roll && tp_roll <= 12) || (tp_station != 2)) {
892  edm::LogWarning("L1T") << "EMTF GEM format error: tp_station = " << tp_station << ", tp_roll = " << tp_roll;
893  return selected;
894  }
895  if (!(1 <= tp_layer && tp_layer <= 2)) {
896  edm::LogWarning("L1T") << "EMTF GEM format error: tp_layer = " << tp_layer;
897  return selected;
898  }
899  if (!((tp_station == 1 && 1 <= tp_pad && tp_pad <= 192) || (tp_station != 1))) {
900  edm::LogWarning("L1T") << "EMTF GEM format error: tp_station = " << tp_station << ", tp_pad = " << tp_pad;
901  return selected;
902  }
903  if (!((tp_station == 2 && 1 <= tp_pad && tp_pad <= 192) || (tp_station != 2))) {
904  edm::LogWarning("L1T") << "EMTF GEM format error: tp_station = " << tp_station << ", tp_pad = " << tp_pad;
905  return selected;
906  }
907 
908  // Selection
909  if (is_in_bx_gem(tp_bx)) {
910  if (is_in_sector_gem(tp_endcap, tp_sector)) {
911  selected = get_index_gem(tp_subsector, tp_station, tp_csc_ID, false);
912  } else if (is_in_neighbor_sector_gem(tp_endcap, tp_sector, tp_subsector, tp_station, tp_csc_ID)) {
913  selected = get_index_gem(tp_subsector, tp_station, tp_csc_ID, true);
914  }
915  }
916  }
917  return selected;
918 }
919 
920 bool PrimitiveSelection::is_in_sector_gem(int tp_endcap, int tp_sector) const {
921  // Identical to the corresponding CSC function
922  return is_in_sector_csc(tp_endcap, tp_sector);
923 }
924 
926  int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const {
927  // Identical to the corresponding CSC function
928  return is_in_neighbor_sector_csc(tp_endcap, tp_sector, tp_subsector, tp_station, tp_csc_ID);
929 }
930 
931 bool PrimitiveSelection::is_in_bx_gem(int tp_bx) const {
932  tp_bx += bxShiftGEM_;
933  return (bx_ == tp_bx);
934 }
935 
936 int PrimitiveSelection::get_index_gem(int tp_subsector, int tp_station, int tp_csc_ID, bool is_neighbor) const {
937  // Identical to the corresponding CSC function
938  return get_index_csc(tp_subsector, tp_station, tp_csc_ID, is_neighbor);
939 }
size
Write out results.
int chamber() const
Definition: CSCDetId.h:62
int MAX_TRIGSECTOR
Definition: Common.h:63
const subsystem_type subsystem() const
bool is_in_sector_csc(int tp_endcap, int tp_sector) const
const GEMData getGEMData() const
#define NUM_GEM_CHAMBERS
int MIN_ENDCAP
Definition: Common.h:58
int get_index_gem(int tp_subsector, int tp_station, int tp_csc_ID, bool is_neighbor) const
#define NUM_RPC_CHAMBERS
const CSCData getCSCData() const
int select_gem(const TriggerPrimitive &muon_primitive) const
bool is_in_sector_gem(int tp_endcap, int tp_sector) const
void merge_no_truncate(const std::map< int, TriggerPrimitiveCollection > &selected_csc_map, const std::map< int, TriggerPrimitiveCollection > &selected_rpc_map, const std::map< int, TriggerPrimitiveCollection > &selected_gem_map, std::map< int, TriggerPrimitiveCollection > &selected_prim_map) const
const RPCData getRPCData() const
void configure(int verbose, int endcap, int sector, int bx, int bxShiftCSC, int bxShiftRPC, int bxShiftGEM, bool includeNeighbor, bool duplicateTheta, bool bugME11Dupes)
bool is_in_sector_rpc(int tp_endcap, int tp_station, int tp_ring, int tp_sector, int tp_subsector) const
int endcap() const
Definition: CSCDetId.h:85
int layer() const
Definition: EMTFGEMDetId.cc:42
bool is_in_bx_gem(int tp_bx) const
int roll() const
Definition: RPCDetId.h:92
static int verbose
int roll() const
Definition: EMTFGEMDetId.cc:56
int MIN_TRIGSECTOR
Definition: Common.h:62
int region() const
The identifiers.
Definition: EMTFGEMDetId.cc:19
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
int ring() const
Definition: RPCDetId.h:59
int select_rpc(const TriggerPrimitive &muon_primitive) const
int select_csc(const TriggerPrimitive &muon_primitive) const
void process(T tag, const TriggerPrimitiveCollection &muon_primitives, std::map< int, TriggerPrimitiveCollection > &selected_prim_map) const
#define end
Definition: vmac.h:39
bool is_in_neighbor_sector_csc(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const
int chamber() const
Definition: EMTFGEMDetId.cc:49
bool is_in_bx_csc(int tp_bx) const
int get_index_csc(int tp_subsector, int tp_station, int tp_csc_ID, bool is_neighbor) const
JetCorrectorParameters corr
Definition: classes.h:5
ii
Definition: cuy.py:590
int ring() const
Definition: CSCDetId.h:68
void merge(const std::map< int, TriggerPrimitiveCollection > &selected_csc_map, const std::map< int, TriggerPrimitiveCollection > &selected_rpc_map, const std::map< int, TriggerPrimitiveCollection > &selected_gem_map, std::map< int, TriggerPrimitiveCollection > &selected_prim_map) const
int station() const
Definition: EMTFGEMDetId.cc:34
bool is_in_bx_rpc(int tp_bx) const
int triggerSector() const
Definition: CSCDetId.cc:3
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:81
int MAX_ENDCAP
Definition: Common.h:59
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
Definition: RPCDetId.h:88
int station() const
Definition: CSCDetId.h:79
int get_index_rpc(int tp_station, int tp_ring, int tp_subsector, bool is_neighbor) const
EMTFGEMDetId construct_EMTFGEMDetId(const L1TMuon::TriggerPrimitive &tp)
#define NUM_CSC_CHAMBERS
Int_t triggerSector(Int_t station, Int_t ring, Int_t chamber) const
L1TMuon::TriggerPrimitiveCollection TriggerPrimitiveCollection
Definition: Common.h:34
bool is_in_neighbor_sector_rpc(int tp_endcap, int tp_station, int tp_ring, int tp_sector, int tp_subsector) const
int ring() const
Definition: EMTFGEMDetId.cc:26
bool is_in_neighbor_sector_gem(int tp_endcap, int tp_sector, int tp_subsector, int tp_station, int tp_csc_ID) const
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
int station() const
Definition: RPCDetId.h:78