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 
35  class EMTFTrack {
36  public:
37 
39  _PtLUT(), endcap(-99), sector(-99), sector_idx(-99),
40  mode(-99), mode_CSC(0), mode_RPC(0), mode_neighbor(0), mode_inv(-99),
41  rank(-99), winner(-99), charge(-99), bx(-99), first_bx(-99), second_bx(-99),
42  pt(-99), pt_XML(-99), zone(-99), ph_num(-99), ph_q(-99),
43  theta_fp(-99), theta(-99), eta(-99), phi_fp(-99), phi_loc(-99), phi_glob(-999),
44  gmt_pt(-99), gmt_phi(-999), gmt_eta(-999), gmt_quality(-99), gmt_charge(-99), gmt_charge_valid(-99),
45  track_num(-99), numHits(-99)
46  {};
47 
48  virtual ~EMTFTrack() {};
49 
50  void ImportSP( const emtf::SP _SP, int _sector );
51  // void ImportPtLUT( int _mode, unsigned long _address );
52 
53 
54  void clear_Hits() {
55  _Hits.clear();
56  numHits = 0;
57  mode_CSC = 0;
58  mode_RPC = 0;
59  mode_neighbor = 0;
60  }
61 
62  void push_Hit(const EMTFHit& hit) {
63  _Hits.push_back( hit );
64  numHits = _Hits.size();
65  if (hit.Is_CSC()) mode_CSC |= (1 << (4 - hit.Station()));
66  if (hit.Is_RPC()) mode_RPC |= (1 << (4 - hit.Station()));
67  if (hit.Neighbor()) mode_neighbor |= (1 << (4 - hit.Station()));
68  }
69 
71  clear_Hits();
72  for (const auto& hit : hits)
73  push_Hit( hit );
74  }
75 
76  void clear_HitIdx() { _HitIdx.clear(); }
77  void push_HitIdx(unsigned int bits) { _HitIdx.push_back(bits); }
78  void set_HitIdx(const std::vector<unsigned int>& bits) { _HitIdx = bits; }
79 
80  int NumHits () const { return numHits; }
81  EMTFHitCollection Hits () const { return _Hits; }
82  std::vector<unsigned int> HitIdx () const { return _HitIdx; }
83 
84  void set_Road(const EMTFRoad& bits) { _Road = bits; }
85  void set_RoadIdx(unsigned int bits) { _RoadIdx = bits; }
86  EMTFRoad Road () const { return _Road; }
87  unsigned int RoadIdx () const { return _RoadIdx; }
88 
89  void set_PtLUT(EMTFPtLUT bits) { _PtLUT = bits; }
90  EMTFPtLUT PtLUT () const { return _PtLUT; }
91 
92  void set_endcap (int bits) { endcap = bits; }
93  void set_sector (int bits) { sector = bits; }
94  void set_sector_idx (int bits) { sector_idx = bits; }
95  void set_mode (int bits) { mode = bits; }
96  void set_mode_inv (int bits) { mode_inv = bits; }
97  void set_rank (int bits) { rank = bits; }
98  void set_winner (int bits) { winner = bits; }
99  void set_charge (int bits) { charge = bits; }
100  void set_bx (int bits) { bx = bits; }
101  void set_first_bx (int bits) { first_bx = bits; }
102  void set_second_bx (int bits) { second_bx = bits; }
103  void set_pt (float val) { pt = val; }
104  void set_pt_XML (float val) { pt_XML = val; }
105  void set_zone (int bits) { zone = bits; }
106  void set_ph_num (int bits) { ph_num = bits; }
107  void set_ph_q (int bits) { ph_q = bits; }
108  void set_theta_fp (int bits) { theta_fp = bits; }
109  void set_theta (float val) { theta = val; }
110  void set_eta (float val) { eta = val; }
111  void set_phi_fp (int bits) { phi_fp = bits; }
112  void set_phi_loc (float val) { phi_loc = val; }
113  void set_phi_glob (float val) { phi_glob = val; }
114  void set_gmt_pt (int bits) { gmt_pt = bits; }
115  void set_gmt_phi (int bits) { gmt_phi = bits; }
116  void set_gmt_eta (int bits) { gmt_eta = bits; }
117  void set_gmt_quality (int bits) { gmt_quality = bits; }
118  void set_gmt_charge (int bits) { gmt_charge = bits; }
119  void set_gmt_charge_valid (int bits) { gmt_charge_valid = bits; }
120  void set_track_num (int bits) { track_num = bits; }
121 
122 
123  int Endcap () const { return endcap ; }
124  int Sector () const { return sector ; }
125  int Sector_idx () const { return sector_idx ; }
126  int Mode () const { return mode ; }
127  int Mode_CSC () const { return mode_CSC ; }
128  int Mode_RPC () const { return mode_RPC ; }
129  int Mode_neighbor() const { return mode_neighbor; }
130  int Mode_inv () const { return mode_inv ; }
131  int Rank () const { return rank ; }
132  int Winner () const { return winner ; }
133  int Charge () const { return charge ; }
134  int BX () const { return bx ; }
135  int First_BX () const { return first_bx ; }
136  int Second_BX () const { return second_bx ; }
137  float Pt () const { return pt ; }
138  float Pt_XML () const { return pt_XML ; }
139  int Zone () const { return zone ; }
140  int Ph_num () const { return ph_num ; }
141  int Ph_q () const { return ph_q ; }
142  int Theta_fp () const { return theta_fp ; }
143  float Theta () const { return theta ; }
144  float Eta () const { return eta ; }
145  int Phi_fp () const { return phi_fp ; }
146  float Phi_loc () const { return phi_loc ; }
147  float Phi_glob () const { return phi_glob ; }
148  int GMT_pt () const { return gmt_pt ; }
149  int GMT_phi () const { return gmt_phi ; }
150  int GMT_eta () const { return gmt_eta ; }
151  int GMT_quality () const { return gmt_quality ; }
152  int GMT_charge () const { return gmt_charge ; }
153  int GMT_charge_valid () const { return gmt_charge_valid; }
154  int Track_num () const { return track_num ; }
155 
156 
157  private:
158 
160  std::vector<unsigned int> _HitIdx;
161 
163  unsigned int _RoadIdx;
164 
166 
167  int endcap ; // +/-1. For ME+ and ME-.
168  int sector ; // 1 - 6.
169  int sector_idx ; // 0 - 11. 0 - 5 for ME+, 6 - 11 for ME-.
170  int mode ; // 0 - 15.
171  int mode_CSC ; // 0 - 15, CSC-only
172  int mode_RPC ; // 0 - 15, RPC-only
173  int mode_neighbor; // 0 - 15, only neighbor hits
174  int mode_inv ; // 15 - 0.
175  int rank ; // 0 - 127 (Range? - AWB 03.03.17)
176  int winner ; // 0 - 2. (Range? - AWB 03.03.17)
177  int charge ; // +/-1. For physical charge (reversed from GMT convention)
178  int bx ; // -3 - +3.
179  int first_bx ; // -3 - +3.
180  int second_bx ; // -3 - +3.
181  float pt ; // 0 - 255
182  float pt_XML ; // 0 - 999
183  int zone ; // 0 - 3.
184  int ph_num ;
185  int ph_q ;
186  int theta_fp ; // 0 - 127
187  float theta ; // 0 - 90.
188  float eta ; // +/-2.5.
189  int phi_fp ; // 0 - 4920
190  float phi_loc ; // -22 - 60 (Range? - AWB 03.03.17)
191  float phi_glob ; // +/-180.
192  int gmt_pt ;
193  int gmt_phi ;
194  int gmt_eta ;
198  int track_num ; // 0 - ??. (Range? - AWB 03.03.17)
199  int numHits ; // 1 - 4.
200 
201  }; // End of class EMTFTrack
202 
203  // Define a vector of EMTFTrack
204  typedef std::vector<EMTFTrack> EMTFTrackCollection;
205 
206 } // End of namespace l1t
207 
208 #endif /* define DataFormats_L1TMuon_EMTFTrack_h */
void set_mode(int bits)
Definition: EMTFTrack.h:95
void clear_Hits()
Definition: EMTFTrack.h:54
int Theta_fp() const
Definition: EMTFTrack.h:142
void set_bx(int bits)
Definition: EMTFTrack.h:100
int Zone() const
Definition: EMTFTrack.h:139
float Theta() const
Definition: EMTFTrack.h:143
int GMT_eta() const
Definition: EMTFTrack.h:150
void set_second_bx(int bits)
Definition: EMTFTrack.h:102
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:116
uint16_t sign_ph[6]
Definition: EMTFTrack.h:24
void set_sector(int bits)
Definition: EMTFTrack.h:93
EMTFPtLUT _PtLUT
Definition: EMTFTrack.h:165
int Endcap() const
Definition: EMTFTrack.h:123
void set_phi_fp(int bits)
Definition: EMTFTrack.h:111
float Pt() const
Definition: EMTFTrack.h:137
std::vector< unsigned int > HitIdx() const
Definition: EMTFTrack.h:82
int NumHits() const
Definition: EMTFTrack.h:80
int Phi_fp() const
Definition: EMTFTrack.h:145
void set_first_bx(int bits)
Definition: EMTFTrack.h:101
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:99
int Sector() const
Definition: EMTFTrack.h:124
int Ph_q() const
Definition: EMTFTrack.h:141
uint16_t bt_vi[5]
Definition: EMTFTrack.h:28
int Winner() const
Definition: EMTFTrack.h:132
uint16_t mode
Definition: EMTFTrack.h:18
void set_ph_num(int bits)
Definition: EMTFTrack.h:106
EMTFRoad Road() const
Definition: EMTFTrack.h:86
int Charge() const
Definition: EMTFTrack.h:133
int GMT_charge() const
Definition: EMTFTrack.h:152
int gmt_charge_valid
Definition: EMTFTrack.h:197
int GMT_quality() const
Definition: EMTFTrack.h:151
delete x;
Definition: CaloConfig.h:22
uint16_t eta
Definition: EMTFTrack.h:21
float Pt_XML() const
Definition: EMTFTrack.h:138
uint16_t delta_ph[6]
Definition: EMTFTrack.h:22
unsigned int _RoadIdx
Definition: EMTFTrack.h:163
void set_PtLUT(EMTFPtLUT bits)
Definition: EMTFTrack.h:89
EMTFRoad _Road
Definition: EMTFTrack.h:162
float phi_glob
Definition: EMTFTrack.h:191
void set_sector_idx(int bits)
Definition: EMTFTrack.h:94
int Sector_idx() const
Definition: EMTFTrack.h:125
int Mode_RPC() const
Definition: EMTFTrack.h:128
void set_gmt_phi(int bits)
Definition: EMTFTrack.h:115
void set_pt(float val)
Definition: EMTFTrack.h:103
uint16_t delta_th[6]
Definition: EMTFTrack.h:23
int Mode_inv() const
Definition: EMTFTrack.h:130
unsigned int RoadIdx() const
Definition: EMTFTrack.h:87
int Is_CSC() const
Definition: EMTFHit.h:197
void set_zone(int bits)
Definition: EMTFTrack.h:105
uint16_t theta
Definition: EMTFTrack.h:19
void set_gmt_quality(int bits)
Definition: EMTFTrack.h:117
std::vector< EMTFHit > EMTFHitCollection
Definition: EMTFHit.h:276
float Eta() const
Definition: EMTFTrack.h:144
int Mode_CSC() const
Definition: EMTFTrack.h:127
uint16_t cpattern[4]
Definition: EMTFTrack.h:26
void set_track_num(int bits)
Definition: EMTFTrack.h:120
int Second_BX() const
Definition: EMTFTrack.h:136
uint16_t fr[4]
Definition: EMTFTrack.h:27
float Phi_glob() const
Definition: EMTFTrack.h:147
void set_rank(int bits)
Definition: EMTFTrack.h:97
void set_theta_fp(int bits)
Definition: EMTFTrack.h:108
int Mode_neighbor() const
Definition: EMTFTrack.h:129
int Track_num() const
Definition: EMTFTrack.h:154
void clear_HitIdx()
Definition: EMTFTrack.h:76
int GMT_phi() const
Definition: EMTFTrack.h:149
std::vector< unsigned int > _HitIdx
Definition: EMTFTrack.h:160
void set_eta(float val)
Definition: EMTFTrack.h:110
void set_winner(int bits)
Definition: EMTFTrack.h:98
void set_gmt_charge(int bits)
Definition: EMTFTrack.h:118
EMTFHitCollection Hits() const
Definition: EMTFTrack.h:81
float Phi_loc() const
Definition: EMTFTrack.h:146
void set_theta(float val)
Definition: EMTFTrack.h:109
uint16_t sign_th[6]
Definition: EMTFTrack.h:25
int Station() const
Definition: EMTFHit.h:145
unsigned long long uint64_t
Definition: Time.h:15
void push_HitIdx(unsigned int bits)
Definition: EMTFTrack.h:77
uint16_t st1_ring2
Definition: EMTFTrack.h:20
EMTFHitCollection _Hits
Definition: EMTFTrack.h:159
void set_endcap(int bits)
Definition: EMTFTrack.h:92
uint64_t address
Definition: EMTFTrack.h:17
void set_ph_q(int bits)
Definition: EMTFTrack.h:107
void set_RoadIdx(unsigned int bits)
Definition: EMTFTrack.h:85
void set_pt_XML(float val)
Definition: EMTFTrack.h:104
int BX() const
Definition: EMTFTrack.h:134
void set_HitIdx(const std::vector< unsigned int > &bits)
Definition: EMTFTrack.h:78
void set_Road(const EMTFRoad &bits)
Definition: EMTFTrack.h:84
void ImportSP(EMTFTrack &_track, const l1t::emtf::SP _SP, const int _endcap, const int _evt_sector)
int GMT_pt() const
Definition: EMTFTrack.h:148
int First_BX() const
Definition: EMTFTrack.h:135
void push_Hit(const EMTFHit &hit)
Definition: EMTFTrack.h:62
void set_Hits(const EMTFHitCollection &hits)
Definition: EMTFTrack.h:70
void set_phi_loc(float val)
Definition: EMTFTrack.h:112
int Mode() const
Definition: EMTFTrack.h:126
virtual ~EMTFTrack()
Definition: EMTFTrack.h:48
int GMT_charge_valid() const
Definition: EMTFTrack.h:153
void set_gmt_charge_valid(int bits)
Definition: EMTFTrack.h:119
std::vector< EMTFTrack > EMTFTrackCollection
Definition: EMTFTrack.h:204
void set_phi_glob(float val)
Definition: EMTFTrack.h:113
uint16_t bt_hi[5]
Definition: EMTFTrack.h:29
void set_mode_inv(int bits)
Definition: EMTFTrack.h:96
EMTFPtLUT PtLUT() const
Definition: EMTFTrack.h:90
void set_gmt_pt(int bits)
Definition: EMTFTrack.h:114
int Neighbor() const
Definition: EMTFHit.h:156
int Rank() const
Definition: EMTFTrack.h:131
int Ph_num() const
Definition: EMTFTrack.h:140
int Is_RPC() const
Definition: EMTFHit.h:198