CMS 3D CMS Logo

EMTFTrack.h
Go to the documentation of this file.
1 // Class for muon tracks in EMTF - AWB 04.01.16
2 // Mostly copied from L1Trigger/L1TMuonEndCap/interface/MuonInternalTrack.h
3 
4 #ifndef DataFormats_L1TMuon_EMTFTrack_h
5 #define DataFormats_L1TMuon_EMTFTrack_h
6 
7 #include <cstdint>
8 #include <vector>
9 
13 
14 namespace l1t {
15 
16  struct EMTFPtLUT {
18  uint16_t mode;
19  uint16_t theta;
20  uint16_t st1_ring2;
21  uint16_t eta;
22  uint16_t delta_ph[6]; // index: 0=12, 1=13, 2=14, 3=23, 4=24, 5=34
23  uint16_t delta_th[6]; // ^
24  uint16_t sign_ph[6]; // ^
25  uint16_t sign_th[6]; // ^
26  uint16_t cpattern[4]; // index: 0=ME1, 1=ME2, 2=ME3, 3=ME4
27  uint16_t fr[4]; // ^
28  uint16_t bt_vi[5]; // index: 0=ME1sub1, 1=ME1sub2, 2=ME2, 3=ME3, 4=ME4
29  uint16_t bt_hi[5]; // ^
30  uint16_t bt_ci[5]; // ^
31  uint16_t bt_si[5]; // ^
32  };
33 
34  class EMTFTrack {
35  public:
37  : _PtLUT(),
38  endcap(-99),
39  sector(-99),
40  sector_idx(-99),
41  mode(-99),
42  mode_CSC(0),
43  mode_RPC(0),
44  mode_neighbor(0),
45  mode_inv(-99),
46  rank(-99),
47  winner(-99),
48  charge(-99),
49  bx(-99),
50  first_bx(-99),
51  second_bx(-99),
52  pt(-99),
53  pt_XML(-99),
54  zone(-99),
55  ph_num(-99),
56  ph_q(-99),
57  theta_fp(-99),
58  theta(-99),
59  eta(-99),
60  phi_fp(-99),
61  phi_loc(-99),
62  phi_glob(-999),
63  gmt_pt(-99),
64  gmt_phi(-999),
65  gmt_eta(-999),
66  gmt_quality(-99),
67  gmt_charge(-99),
68  gmt_charge_valid(-99),
69  track_num(-99),
70  numHits(-99){};
71 
72  virtual ~EMTFTrack(){};
73 
74  void ImportSP(const emtf::SP _SP, int _sector);
75  // void ImportPtLUT( int _mode, unsigned long _address );
76 
77  void clear_Hits() {
78  _Hits.clear();
79  numHits = 0;
80  mode_CSC = 0;
81  mode_RPC = 0;
82  mode_neighbor = 0;
83  }
84 
85  void push_Hit(const EMTFHit& hit) {
86  _Hits.push_back(hit);
87  numHits = _Hits.size();
88  if (hit.Is_CSC())
89  mode_CSC |= (1 << (4 - hit.Station()));
90  if (hit.Is_RPC())
91  mode_RPC |= (1 << (4 - hit.Station()));
92  if (hit.Neighbor())
93  mode_neighbor |= (1 << (4 - hit.Station()));
94  }
95 
97  clear_Hits();
98  for (const auto& hit : hits)
99  push_Hit(hit);
100  }
101 
102  void clear_HitIdx() { _HitIdx.clear(); }
103  void push_HitIdx(unsigned int bits) { _HitIdx.push_back(bits); }
104  void set_HitIdx(const std::vector<unsigned int>& bits) { _HitIdx = bits; }
105 
106  int NumHits() const { return numHits; }
107  EMTFHitCollection Hits() const { return _Hits; }
108  std::vector<unsigned int> HitIdx() const { return _HitIdx; }
109 
110  void set_Road(const EMTFRoad& bits) { _Road = bits; }
111  void set_RoadIdx(unsigned int bits) { _RoadIdx = bits; }
112  EMTFRoad Road() const { return _Road; }
113  unsigned int RoadIdx() const { return _RoadIdx; }
114 
115  void set_PtLUT(EMTFPtLUT bits) { _PtLUT = bits; }
116  EMTFPtLUT PtLUT() const { return _PtLUT; }
117 
118  void set_endcap(int bits) { endcap = bits; }
119  void set_sector(int bits) { sector = bits; }
120  void set_sector_idx(int bits) { sector_idx = bits; }
121  void set_mode(int bits) { mode = bits; }
122  void set_mode_inv(int bits) { mode_inv = bits; }
123  void set_rank(int bits) { rank = bits; }
124  void set_winner(int bits) { winner = bits; }
125  void set_charge(int bits) { charge = bits; }
126  void set_bx(int bits) { bx = bits; }
127  void set_first_bx(int bits) { first_bx = bits; }
128  void set_second_bx(int bits) { second_bx = bits; }
129  void set_pt(float val) { pt = val; }
130  void set_pt_XML(float val) { pt_XML = val; }
131  void set_zone(int bits) { zone = bits; }
132  void set_ph_num(int bits) { ph_num = bits; }
133  void set_ph_q(int bits) { ph_q = bits; }
134  void set_theta_fp(int bits) { theta_fp = bits; }
135  void set_theta(float val) { theta = val; }
136  void set_eta(float val) { eta = val; }
137  void set_phi_fp(int bits) { phi_fp = bits; }
138  void set_phi_loc(float val) { phi_loc = val; }
139  void set_phi_glob(float val) { phi_glob = val; }
140  void set_gmt_pt(int bits) { gmt_pt = bits; }
141  void set_gmt_phi(int bits) { gmt_phi = bits; }
142  void set_gmt_eta(int bits) { gmt_eta = bits; }
143  void set_gmt_quality(int bits) { gmt_quality = bits; }
144  void set_gmt_charge(int bits) { gmt_charge = bits; }
145  void set_gmt_charge_valid(int bits) { gmt_charge_valid = bits; }
146  void set_track_num(int bits) { track_num = bits; }
147 
148  int Endcap() const { return endcap; }
149  int Sector() const { return sector; }
150  int Sector_idx() const { return sector_idx; }
151  int Mode() const { return mode; }
152  int Mode_CSC() const { return mode_CSC; }
153  int Mode_RPC() const { return mode_RPC; }
154  int Mode_neighbor() const { return mode_neighbor; }
155  int Mode_inv() const { return mode_inv; }
156  int Rank() const { return rank; }
157  int Winner() const { return winner; }
158  int Charge() const { return charge; }
159  int BX() const { return bx; }
160  int First_BX() const { return first_bx; }
161  int Second_BX() const { return second_bx; }
162  float Pt() const { return pt; }
163  float Pt_XML() const { return pt_XML; }
164  int Zone() const { return zone; }
165  int Ph_num() const { return ph_num; }
166  int Ph_q() const { return ph_q; }
167  int Theta_fp() const { return theta_fp; }
168  float Theta() const { return theta; }
169  float Eta() const { return eta; }
170  int Phi_fp() const { return phi_fp; }
171  float Phi_loc() const { return phi_loc; }
172  float Phi_glob() const { return phi_glob; }
173  int GMT_pt() const { return gmt_pt; }
174  int GMT_phi() const { return gmt_phi; }
175  int GMT_eta() const { return gmt_eta; }
176  int GMT_quality() const { return gmt_quality; }
177  int GMT_charge() const { return gmt_charge; }
178  int GMT_charge_valid() const { return gmt_charge_valid; }
179  int Track_num() const { return track_num; }
180 
181  private:
183  std::vector<unsigned int> _HitIdx;
184 
186  unsigned int _RoadIdx;
187 
189 
190  int endcap; // +/-1. For ME+ and ME-.
191  int sector; // 1 - 6.
192  int sector_idx; // 0 - 11. 0 - 5 for ME+, 6 - 11 for ME-.
193  int mode; // 0 - 15.
194  int mode_CSC; // 0 - 15, CSC-only
195  int mode_RPC; // 0 - 15, RPC-only
196  int mode_neighbor; // 0 - 15, only neighbor hits
197  int mode_inv; // 15 - 0.
198  int rank; // 0 - 127 (Range? - AWB 03.03.17)
199  int winner; // 0 - 2. (Range? - AWB 03.03.17)
200  int charge; // +/-1. For physical charge (reversed from GMT convention)
201  int bx; // -3 - +3.
202  int first_bx; // -3 - +3.
203  int second_bx; // -3 - +3.
204  float pt; // 0 - 255
205  float pt_XML; // 0 - 999
206  int zone; // 0 - 3.
207  int ph_num;
208  int ph_q;
209  int theta_fp; // 0 - 127
210  float theta; // 0 - 90.
211  float eta; // +/-2.5.
212  int phi_fp; // 0 - 4920
213  float phi_loc; // -22 - 60 (Range? - AWB 03.03.17)
214  float phi_glob; // +/-180.
215  int gmt_pt;
216  int gmt_phi;
217  int gmt_eta;
221  int track_num; // 0 - ??. (Range? - AWB 03.03.17)
222  int numHits; // 1 - 4.
223 
224  }; // End of class EMTFTrack
225 
226  // Define a vector of EMTFTrack
227  typedef std::vector<EMTFTrack> EMTFTrackCollection;
228 
229 } // End of namespace l1t
230 
231 #endif /* define DataFormats_L1TMuon_EMTFTrack_h */
void set_mode(int bits)
Definition: EMTFTrack.h:121
void clear_Hits()
Definition: EMTFTrack.h:77
int Theta_fp() const
Definition: EMTFTrack.h:167
void set_bx(int bits)
Definition: EMTFTrack.h:126
int Zone() const
Definition: EMTFTrack.h:164
float Theta() const
Definition: EMTFTrack.h:168
int GMT_eta() const
Definition: EMTFTrack.h:175
void set_second_bx(int bits)
Definition: EMTFTrack.h:128
uint16_t bt_si[5]
Definition: EMTFTrack.h:31
uint16_t bt_ci[5]
Definition: EMTFTrack.h:30
void set_gmt_eta(int bits)
Definition: EMTFTrack.h:142
uint16_t sign_ph[6]
Definition: EMTFTrack.h:24
void set_sector(int bits)
Definition: EMTFTrack.h:119
EMTFPtLUT _PtLUT
Definition: EMTFTrack.h:188
int Endcap() const
Definition: EMTFTrack.h:148
void set_phi_fp(int bits)
Definition: EMTFTrack.h:137
float Pt() const
Definition: EMTFTrack.h:162
std::vector< unsigned int > HitIdx() const
Definition: EMTFTrack.h:108
int NumHits() const
Definition: EMTFTrack.h:106
int Phi_fp() const
Definition: EMTFTrack.h:170
void set_first_bx(int bits)
Definition: EMTFTrack.h:127
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
void set_charge(int bits)
Definition: EMTFTrack.h:125
int Sector() const
Definition: EMTFTrack.h:149
int Ph_q() const
Definition: EMTFTrack.h:166
uint16_t bt_vi[5]
Definition: EMTFTrack.h:28
int Winner() const
Definition: EMTFTrack.h:157
uint16_t mode
Definition: EMTFTrack.h:18
void set_ph_num(int bits)
Definition: EMTFTrack.h:132
EMTFRoad Road() const
Definition: EMTFTrack.h:112
int Charge() const
Definition: EMTFTrack.h:158
int GMT_charge() const
Definition: EMTFTrack.h:177
int gmt_charge_valid
Definition: EMTFTrack.h:220
int GMT_quality() const
Definition: EMTFTrack.h:176
delete x;
Definition: CaloConfig.h:22
uint16_t eta
Definition: EMTFTrack.h:21
float Pt_XML() const
Definition: EMTFTrack.h:163
uint16_t delta_ph[6]
Definition: EMTFTrack.h:22
unsigned int _RoadIdx
Definition: EMTFTrack.h:186
void set_PtLUT(EMTFPtLUT bits)
Definition: EMTFTrack.h:115
EMTFRoad _Road
Definition: EMTFTrack.h:185
float phi_glob
Definition: EMTFTrack.h:214
void set_sector_idx(int bits)
Definition: EMTFTrack.h:120
int Sector_idx() const
Definition: EMTFTrack.h:150
int Mode_RPC() const
Definition: EMTFTrack.h:153
void set_gmt_phi(int bits)
Definition: EMTFTrack.h:141
void set_pt(float val)
Definition: EMTFTrack.h:129
uint16_t delta_th[6]
Definition: EMTFTrack.h:23
int Mode_inv() const
Definition: EMTFTrack.h:155
unsigned int RoadIdx() const
Definition: EMTFTrack.h:113
int Is_CSC() const
Definition: EMTFHit.h:241
void set_zone(int bits)
Definition: EMTFTrack.h:131
uint16_t theta
Definition: EMTFTrack.h:19
void set_gmt_quality(int bits)
Definition: EMTFTrack.h:143
std::vector< EMTFHit > EMTFHitCollection
Definition: EMTFHit.h:318
float Eta() const
Definition: EMTFTrack.h:169
int Mode_CSC() const
Definition: EMTFTrack.h:152
uint16_t cpattern[4]
Definition: EMTFTrack.h:26
void set_track_num(int bits)
Definition: EMTFTrack.h:146
int Second_BX() const
Definition: EMTFTrack.h:161
uint16_t fr[4]
Definition: EMTFTrack.h:27
float Phi_glob() const
Definition: EMTFTrack.h:172
void set_rank(int bits)
Definition: EMTFTrack.h:123
void set_theta_fp(int bits)
Definition: EMTFTrack.h:134
int Mode_neighbor() const
Definition: EMTFTrack.h:154
int Track_num() const
Definition: EMTFTrack.h:179
void clear_HitIdx()
Definition: EMTFTrack.h:102
int GMT_phi() const
Definition: EMTFTrack.h:174
std::vector< unsigned int > _HitIdx
Definition: EMTFTrack.h:183
void set_eta(float val)
Definition: EMTFTrack.h:136
void set_winner(int bits)
Definition: EMTFTrack.h:124
void set_gmt_charge(int bits)
Definition: EMTFTrack.h:144
EMTFHitCollection Hits() const
Definition: EMTFTrack.h:107
float Phi_loc() const
Definition: EMTFTrack.h:171
void set_theta(float val)
Definition: EMTFTrack.h:135
uint16_t sign_th[6]
Definition: EMTFTrack.h:25
int Station() const
Definition: EMTFHit.h:189
unsigned long long uint64_t
Definition: Time.h:13
void push_HitIdx(unsigned int bits)
Definition: EMTFTrack.h:103
uint16_t st1_ring2
Definition: EMTFTrack.h:20
EMTFHitCollection _Hits
Definition: EMTFTrack.h:182
void set_endcap(int bits)
Definition: EMTFTrack.h:118
uint64_t address
Definition: EMTFTrack.h:17
void set_ph_q(int bits)
Definition: EMTFTrack.h:133
void set_RoadIdx(unsigned int bits)
Definition: EMTFTrack.h:111
void set_pt_XML(float val)
Definition: EMTFTrack.h:130
int BX() const
Definition: EMTFTrack.h:159
void set_HitIdx(const std::vector< unsigned int > &bits)
Definition: EMTFTrack.h:104
void set_Road(const EMTFRoad &bits)
Definition: EMTFTrack.h:110
void ImportSP(EMTFTrack &_track, const l1t::emtf::SP _SP, const int _endcap, const int _evt_sector)
int GMT_pt() const
Definition: EMTFTrack.h:173
int First_BX() const
Definition: EMTFTrack.h:160
void push_Hit(const EMTFHit &hit)
Definition: EMTFTrack.h:85
void set_Hits(const EMTFHitCollection &hits)
Definition: EMTFTrack.h:96
void set_phi_loc(float val)
Definition: EMTFTrack.h:138
int Mode() const
Definition: EMTFTrack.h:151
virtual ~EMTFTrack()
Definition: EMTFTrack.h:72
int GMT_charge_valid() const
Definition: EMTFTrack.h:178
void set_gmt_charge_valid(int bits)
Definition: EMTFTrack.h:145
std::vector< EMTFTrack > EMTFTrackCollection
Definition: EMTFTrack.h:227
void set_phi_glob(float val)
Definition: EMTFTrack.h:139
uint16_t bt_hi[5]
Definition: EMTFTrack.h:29
void set_mode_inv(int bits)
Definition: EMTFTrack.h:122
EMTFPtLUT PtLUT() const
Definition: EMTFTrack.h:116
void set_gmt_pt(int bits)
Definition: EMTFTrack.h:140
int Neighbor() const
Definition: EMTFHit.h:200
int Rank() const
Definition: EMTFTrack.h:156
int Ph_num() const
Definition: EMTFTrack.h:165
int Is_RPC() const
Definition: EMTFHit.h:242