CMS 3D CMS Logo

L1MuDTTrackCand.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class L1MuDTTrackCand
4 //
5 // Description: ouput data for DTTF trigger
6 //
7 //
8 // Author List: Jorge Troconiz UAM Madrid
9 //
10 //
11 //--------------------------------------------------
12 
13 //-----------------------
14 // This Class's Header --
15 //-----------------------
17 
18 //-------------------------------
19 // Collaborating Class Headers --
20 //-------------------------------
21 
22 //---------------
23 // C++ Headers --
24 //---------------
25 
26 //-------------------
27 // Initializations --
28 //-------------------
29 
30 //----------------
31 // Constructors --
32 //----------------
34  wheel = 0;
35  sector = 0;
36  TrkTagCode = -1;
37  TrkAdd[0] = 3;
38  TrkAdd[1] = 15;
39  TrkAdd[2] = 15;
40  TrkAdd[3] = 15;
41  TClassCode = 11;
42 }
43 
45  unsigned dataword, int bx, int uwh, int usc, int utag, int adr1, int adr2, int adr3, int adr4, int utc)
46  : L1MuRegionalCand(dataword, bx) {
47  wheel = uwh;
48  sector = usc;
49  TrkTagCode = utag;
50  TrkAdd[0] = adr1 & 0x03;
51  TrkAdd[1] = adr2;
52  TrkAdd[2] = adr3;
53  TrkAdd[3] = adr4;
54  TClassCode = utc;
55 
56  setAdd(1);
57  setAdd(2);
58  setAdd(3);
59  setAdd(4);
60 }
61 
63  unsigned phi,
64  unsigned eta,
65  unsigned pt,
66  unsigned charge,
67  unsigned ch_valid,
68  unsigned finehalo,
69  unsigned quality,
70  int bx,
71  int uwh,
72  int usc,
73  int utag,
74  int adr1,
75  int adr2,
76  int adr3,
77  int adr4)
78  : L1MuRegionalCand(0, bx) {
82  setPtPacked(pt);
84  setChargeValidPacked(ch_valid);
85  setFineHaloPacked(finehalo);
87 
88  wheel = uwh;
89  sector = usc;
90  TrkTagCode = utag;
91  TrkAdd[0] = adr1;
92  TrkAdd[1] = adr2;
93  TrkAdd[2] = adr3;
94  TrkAdd[3] = adr4;
95 
96  setTC();
97 }
98 
99 //--------------
100 // Destructor --
101 //--------------
103 
104 //--------------
105 // Operations --
106 //--------------
107 int L1MuDTTrackCand::whNum() const { return wheel; }
108 
109 int L1MuDTTrackCand::scNum() const { return sector; }
110 
111 int L1MuDTTrackCand::stNum(int ust) const { return TrkAdd[ust - 1]; }
112 
113 int L1MuDTTrackCand::TCNum() const { return TClassCode; }
114 
115 int L1MuDTTrackCand::TrkTag() const { return TrkTagCode; }
116 
118  unsigned int uqua = quality_packed();
119 
120  switch (uqua) {
121  case 7: {
122  TClassCode = 0;
123  break;
124  }
125  case 6: {
126  TClassCode = 1;
127  if (TrkAdd[3] != 15)
128  TClassCode = 2;
129  break;
130  }
131  case 5: {
132  TClassCode = 3;
133  break;
134  }
135  case 4: {
136  TClassCode = 4;
137  break;
138  }
139  case 3: {
140  TClassCode = 5;
141  if (TrkAdd[3] != 15)
142  TClassCode = 6;
143  if (TrkAdd[2] != 15)
144  TClassCode = 7;
145  break;
146  }
147  case 2: {
148  TClassCode = 8;
149  if (TrkAdd[2] != 15)
150  TClassCode = 9;
151  break;
152  }
153  case 1: {
154  TClassCode = 10;
155  break;
156  }
157  default: {
158  TClassCode = 11;
159  break;
160  }
161  }
162 }
163 
164 void L1MuDTTrackCand::setAdd(int ust) {
165  unsigned int uadd = stNum(ust);
166 
167  switch (uadd) {
168  case 0: {
169  TrkAdd[ust - 1] = 8;
170  break;
171  }
172  case 1: {
173  TrkAdd[ust - 1] = 9;
174  break;
175  }
176  case 2: {
177  TrkAdd[ust - 1] = 0;
178  break;
179  }
180  case 3: {
181  TrkAdd[ust - 1] = 1;
182  break;
183  }
184  case 4: {
185  TrkAdd[ust - 1] = 10;
186  break;
187  }
188  case 5: {
189  TrkAdd[ust - 1] = 11;
190  break;
191  }
192  case 6: {
193  TrkAdd[ust - 1] = 2;
194  break;
195  }
196  case 7: {
197  TrkAdd[ust - 1] = 3;
198  break;
199  }
200  case 8: {
201  TrkAdd[ust - 1] = 12;
202  break;
203  }
204  case 9: {
205  TrkAdd[ust - 1] = 13;
206  break;
207  }
208  case 10: {
209  TrkAdd[ust - 1] = 4;
210  break;
211  }
212  case 11: {
213  TrkAdd[ust - 1] = 5;
214  break;
215  }
216  case 15: {
217  TrkAdd[ust - 1] = 15;
218  break;
219  }
220  default: {
221  TrkAdd[ust - 1] = 15;
222  break;
223  }
224  }
225 
226  if (ust != 1)
227  return;
228 
229  switch (uadd) {
230  case 0: {
231  TrkAdd[0] = 2;
232  break;
233  }
234  case 1: {
235  TrkAdd[0] = 1;
236  break;
237  }
238  case 15: {
239  TrkAdd[0] = 3;
240  break;
241  }
242  default: {
243  TrkAdd[0] = 3;
244  break;
245  }
246  }
247 }
unsigned int quality_packed() const
return quality packed as in hardware
unsigned int quality() const
return quality
void setAdd(int ust)
void setChargeValidPacked(unsigned valid)
Set Charge Valid.
~L1MuDTTrackCand() override
string quality
void setType(unsigned type)
Set Type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC.
int stNum(int ust) const
int TrkTag() const
void setChargePacked(unsigned ch)
Set Charge (0=pos, 1=neg)
void setPtPacked(unsigned pt)
Set Pt: 0..31.
void setPhiPacked(unsigned phi)
Set Phi: 0..143.
void setQualityPacked(unsigned qual)
Set Quality: 0..7.
void setEtaPacked(unsigned eta)
Set Eta: 6-bit code.
void setFineHaloPacked(unsigned fh)
Set Fine / Halo.
unsigned type_idx() const
return type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC