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 }
L1MuRegionalCand::setPhiPacked
void setPhiPacked(unsigned phi)
Set Phi: 0..143.
Definition: L1MuRegionalCand.h:120
L1MuRegionalCand::setEtaPacked
void setEtaPacked(unsigned eta)
Set Eta: 6-bit code.
Definition: L1MuRegionalCand.h:135
L1MuDTTrackCand::sector
int sector
Definition: L1MuDTTrackCand.h:73
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
L1MuDTTrackCand::TrkTag
int TrkTag() const
Definition: L1MuDTTrackCand.cc:115
L1MuDTTrackCand::TrkAdd
int TrkAdd[4]
Definition: L1MuDTTrackCand.h:76
L1MuDTTrackCand::scNum
int scNum() const
Definition: L1MuDTTrackCand.cc:109
L1MuDTTrackCand::TrkTagCode
int TrkTagCode
Definition: L1MuDTTrackCand.h:74
L1MuRegionalCand::setType
void setType(unsigned type)
Set Type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC.
Definition: L1MuRegionalCand.h:114
quality
const uint32_t *__restrict__ Quality * quality
Definition: CAHitNtupletGeneratorKernelsImpl.h:122
L1MuRegionalCand::quality_packed
unsigned int quality_packed() const
return quality packed as in hardware
Definition: L1MuRegionalCand.h:92
L1MuDTTrackCand.h
PVValHelper::eta
Definition: PVValidationHelpers.h:70
L1MuDTTrackCand::setAdd
void setAdd(int ust)
Definition: L1MuDTTrackCand.cc:164
L1MuRegionalCand
Definition: L1MuRegionalCand.h:26
L1MuRegionalCand::setChargeValidPacked
void setChargeValidPacked(unsigned valid)
Set Charge Valid.
Definition: L1MuRegionalCand.h:132
L1MuDTTrackCand::~L1MuDTTrackCand
~L1MuDTTrackCand() override
Definition: L1MuDTTrackCand.cc:102
L1MuDTTrackCand::L1MuDTTrackCand
L1MuDTTrackCand()
Definition: L1MuDTTrackCand.cc:33
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
PVValHelper::phi
Definition: PVValidationHelpers.h:69
L1MuRegionalCand::setPtPacked
void setPtPacked(unsigned pt)
Set Pt: 0..31.
Definition: L1MuRegionalCand.h:123
L1MuDTTrackCand::wheel
int wheel
Definition: L1MuDTTrackCand.h:72
L1MuDTTrackCand::setTC
void setTC()
Definition: L1MuDTTrackCand.cc:117
L1MuDTTrackCand::stNum
int stNum(int ust) const
Definition: L1MuDTTrackCand.cc:111
DDAxes::phi
L1MuDTTrackCand::whNum
int whNum() const
Definition: L1MuDTTrackCand.cc:107
L1MuDTTrackCand::TCNum
int TCNum() const
Definition: L1MuDTTrackCand.cc:113
L1MuDTTrackCand::TClassCode
int TClassCode
Definition: L1MuDTTrackCand.h:75
L1MuRegionalCand::setChargePacked
void setChargePacked(unsigned ch)
Set Charge (0=pos, 1=neg)
Definition: L1MuRegionalCand.h:129
L1MuRegionalCand::type_idx
unsigned type_idx() const
return type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC
Definition: L1MuRegionalCand.h:76
L1MuRegionalCand::setQualityPacked
void setQualityPacked(unsigned qual)
Set Quality: 0..7.
Definition: L1MuRegionalCand.h:126
L1MuRegionalCand::quality
unsigned int quality() const
return quality
Definition: L1MuRegionalCand.h:73
L1MuRegionalCand::setFineHaloPacked
void setFineHaloPacked(unsigned fh)
Set Fine / Halo.
Definition: L1MuRegionalCand.h:138