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