CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EMTFHit.cc
Go to the documentation of this file.
3 
4 namespace l1t {
5 
7  return CSCDetId((endcap == 1) ? 1 : 2, station, (ring == 4) ? 1 : ring, chamber, 0);
8  // Layer always filled as 0 (indicates "whole chamber")
9  // See http://cmslxr.fnal.gov/source/L1Trigger/CSCTriggerPrimitives/src/CSCTriggerPrimitivesBuilder.cc#0198
10  }
11 
13  int roll_ = roll;
14  int theta_ = theta_fp / 4;
15  if (roll < 1 || roll > 3) {
16  switch (station * 2 + ring) { // Infer roll from integer theta value, by station / ring
17  case 4:
18  roll_ = (theta_ < 17 ? 3 : (theta_ > 18 ? 1 : 2));
19  break; // RE1/2
20  case 6:
21  roll_ = (theta_ < 16 ? 3 : (theta_ > 17 ? 1 : 2));
22  break; // RE2/2
23  case 8:
24  roll_ = (theta_ < 12 ? 3 : (theta_ > 13 ? 1 : 2));
25  break; // RE3/2
26  case 9:
27  roll_ = (theta_ < 20 ? 3 : (theta_ > 21 ? 1 : 2));
28  break; // RE3/3
29  case 10:
30  roll_ = (theta_ < 11 ? 3 : (theta_ > 11 ? 1 : 2));
31  break; // RE4/2
32  case 11:
33  roll_ = (theta_ < 18 ? 3 : (theta_ > 19 ? 1 : 2));
34  break; // RE4/3
35  default:
36  roll_ = 2; // Default to 2 if no valid value found
37  }
38  }
39 
40  return RPCDetId(endcap, ring, station, sector_RPC, 1, subsector_RPC, roll_);
41  // Layer always filled as 1, as layer 2 is only used in the barrel
42  }
43 
45  return GEMDetId((endcap == 1) ? 1 : -1, ring, station, layer, chamber, roll);
46  }
47 
48  ME0DetId EMTFHit::CreateME0DetId() const { return ME0DetId((endcap == 1) ? 1 : -1, layer, chamber, roll); }
49 
51  if (!Is_RPC())
52  return CPPFDigi();
53 
54  int board_ = 1 + ((chamber % 36) / 9); // RPC chamber to CPPF board mapping
55  int channel_ = (chamber % 9); // RPC chamber to CPPF output link mapping
56  int sector_ = (sector_idx + 1) - 6 * (endcap == -1);
57  int link_ = (neighbor ? 0 : 1 + (((chamber + 33) % 36) % 6)); // RPC chamber to EMTF input link mapping
58  int nStrips_ = (strip_low < 0 ? -99 : 1 + strip_hi - strip_low); // Cluster size in number of strips
59 
60  return CPPFDigi(RPC_DetId(),
61  bx,
62  phi_fp / 4,
63  theta_fp / 4,
64  valid,
65  board_,
66  channel_,
67  sector_,
68  link_,
69  strip_low,
70  nStrips_,
71  phi_glob,
72  theta);
73  }
74 
76  return CSCCorrelatedLCTDigi(1,
77  valid,
78  quality,
79  wire,
80  strip,
81  pattern,
82  (bend == 1) ? 1 : 0,
84  0,
85  0,
86  sync_err,
87  csc_ID);
88  // Filling "trknmb" with 1 and "bx0" with 0 (as in MC).
89  // May consider filling "trknmb" with 2 for 2nd LCT in the same chamber. - AWB 24.05.17
90  // trknmb and bx0 are unused in the EMTF emulator code. mpclink = 0 (after bx) indicates unsorted.
91  }
92 
93  // // Not yet implemented - AWB 15.03.17
94  // RPCDigi EMTFHit::CreateRPCDigi() const {
95  // return RPCDigi( (strip_hi + strip_lo) / 2, bx + CSCConstants::LCT_CENTRAL_BX );
96  // }
97 
99  std::vector<uint16_t> pads;
100  for (int i = Pad_low(); i < Pad_hi(); ++i)
101  pads.emplace_back(static_cast<uint16_t>(i));
102  return GEMPadDigiCluster(pads, bx);
103  }
104 
105 } // End namespace l1t
RPCDetId RPC_DetId() const
Definition: EMTFHit.h:129
int Pad_hi() const
Repurpose &quot;strip&quot; as GEM pad for GEM sourced hits.
Definition: EMTFHit.h:250
int station
1 - 4.
Definition: EMTFHit.h:303
int ring
1 - 4. ME1/1a is denoted as &quot;Ring 4&quot;. Should check dependence on input CSCDetId convention. - AWB 02.03.17
Definition: EMTFHit.h:304
GEMDetId CreateGEMDetId() const
Definition: EMTFHit.cc:44
int neighbor
0 or 1. Filled in EMTFBlock(ME|GEM|RPC).cc
Definition: EMTFHit.h:314
int sector_idx
0 - 11. 0 - 5 for ME+, 6 - 11 for ME-. For neighbor hits, set by EMTF sector that received it...
Definition: EMTFHit.h:307
GEMPadDigiCluster CreateGEMPadDigiCluster() const
Definition: EMTFHit.cc:98
int sync_err
0 or 1. For CSCs only.
Definition: EMTFHit.h:335
int subsector_RPC
0 - 6. RPC sector convention (in CMSSW): subsector 3 is the first chamber in the EMTF sector...
Definition: EMTFHit.h:309
int sector_RPC
1 - 6. RPC sector convention (in CMSSW): sector 1 starts at -5 degrees
Definition: EMTFHit.h:306
float theta
0 - 90.
Definition: EMTFHit.h:352
ME0DetId CreateME0DetId() const
Definition: EMTFHit.cc:48
bool Is_RPC() const
Definition: EMTFHit.h:287
int roll
1 - 3. For RPCs only, sub-division of ring. (Range? - AWB 02.03.17)
Definition: EMTFHit.h:313
RPCDetId CreateRPCDetId() const
Definition: EMTFHit.cc:12
int bend
0 or 1. For CSCs only.
Definition: EMTFHit.h:332
CPPFDigi CreateCPPFDigi() const
Definition: EMTFHit.cc:50
int bx
-3 - +3.
Definition: EMTFHit.h:340
CSCDetId CreateCSCDetId() const
Definition: EMTFHit.cc:6
CSCCorrelatedLCTDigi CreateCSCCorrelatedLCTDigi() const
Definition: EMTFHit.cc:75
int pattern
0 - 10. For CSCs only.
Definition: EMTFHit.h:330
int endcap
+/-1. For ME+ and ME-.
Definition: EMTFHit.h:302
int strip
0 - 158 For CSCs only.
Definition: EMTFHit.h:321
int strip_low
? - ?. For RPCs only, lowest strip in a cluster. (Range? - AWB 02.03.17)
Definition: EMTFHit.h:323
int layer
0 - 1. For GEMs only, superchamber detector layer (1 or 2).
Definition: EMTFHit.h:337
int wire
0 - 111 For CSCs only.
Definition: EMTFHit.h:320
int quality
0 - 15. For CSCs only.
Definition: EMTFHit.h:329
int phi_fp
0 - 4920
Definition: EMTFHit.h:342
int theta_fp
0 - 127
Definition: EMTFHit.h:343
int strip_hi
? - ?. For RPCs only, highest strip in a cluster. (Range? - AWB 02.03.17)
Definition: EMTFHit.h:322
int valid
0 or 1. For CSCs only (for now; could use to flag failing clusters? - AWB 02.03.17) ...
Definition: EMTFHit.h:334
int Pad_low() const
Repurpose &quot;strip&quot; as GEM pad for GEM sourced hits.
Definition: EMTFHit.h:252
float phi_glob
+/-180.
Definition: EMTFHit.h:351
int chamber
1 - 36. Chamber 1 starts at -5 degrees.
Definition: EMTFHit.h:310
int csc_ID
1 - 9. For CSCs only.
Definition: EMTFHit.h:311