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 //---------------
24 // C++ Headers --
25 //---------------
26 
27 //-------------------
28 // Initializations --
29 //-------------------
30 
31 
32 //----------------
33 // Constructors --
34 //----------------
36 
37  wheel = 0;
38  sector = 0;
39  TrkTagCode = -1;
40  TrkAdd[0] = 3;
41  TrkAdd[1] = 15;
42  TrkAdd[2] = 15;
43  TrkAdd[3] = 15;
44  TClassCode = 11;
45 }
46 
47 L1MuDTTrackCand::L1MuDTTrackCand( unsigned dataword, int bx, int uwh, int usc,
48  int utag, int adr1, int adr2, int adr3, int adr4, int utc ) :
49  L1MuRegionalCand(dataword, bx) {
50 
51  wheel = uwh;
52  sector = usc;
53  TrkTagCode = utag;
54  TrkAdd[0] = adr1&0x03;
55  TrkAdd[1] = adr2;
56  TrkAdd[2] = adr3;
57  TrkAdd[3] = adr4;
58  TClassCode = utc;
59 
60  setAdd(1);
61  setAdd(2);
62  setAdd(3);
63  setAdd(4);
64 }
65 
66 L1MuDTTrackCand::L1MuDTTrackCand( unsigned type_idx, unsigned phi, unsigned eta,
67  unsigned pt, unsigned charge, unsigned ch_valid, unsigned finehalo,
68  unsigned quality, int bx, int uwh, int usc, int utag,
69  int adr1, int adr2, int adr3, int adr4 ) :
70  L1MuRegionalCand(0, bx) {
71 
72  setType(type_idx);
73  setPhiPacked(phi);
74  setEtaPacked(eta);
75  setPtPacked(pt);
76  setChargePacked(charge);
77  setChargeValidPacked(ch_valid);
78  setFineHaloPacked(finehalo);
79  setQualityPacked(quality);
80 
81  wheel = uwh;
82  sector = usc;
83  TrkTagCode = utag;
84  TrkAdd[0] = adr1;
85  TrkAdd[1] = adr2;
86  TrkAdd[2] = adr3;
87  TrkAdd[3] = adr4;
88 
89  setTC();
90 }
91 
92 //--------------
93 // Destructor --
94 //--------------
96 }
97 
98 //--------------
99 // Operations --
100 //--------------
102  return wheel;
103 }
104 
106  return sector;
107 }
108 
109 int L1MuDTTrackCand::stNum(int ust) const {
110  return TrkAdd[ust-1];
111 }
112 
114  return TClassCode;
115 }
116 
118  return TrkTagCode;
119 }
120 
122  unsigned int uqua = quality_packed();
123 
124  switch (uqua) {
125  case 7: { TClassCode = 0; break; }
126  case 6: { TClassCode = 1;
127  if ( TrkAdd[3] != 15 ) TClassCode = 2;
128  break; }
129  case 5: { TClassCode = 3; break; }
130  case 4: { TClassCode = 4; break; }
131  case 3: { TClassCode = 5;
132  if ( TrkAdd[3] != 15 ) TClassCode = 6;
133  if ( TrkAdd[2] != 15 ) TClassCode = 7;
134  break; }
135  case 2: { TClassCode = 8;
136  if ( TrkAdd[2] != 15 ) TClassCode = 9;
137  break; }
138  case 1: { TClassCode = 10; break; }
139  default: { TClassCode = 11; break; }
140  }
141 }
142 
143 void L1MuDTTrackCand::setAdd(int ust) {
144  unsigned int uadd = stNum(ust);
145 
146  switch (uadd) {
147  case 0: { TrkAdd[ust-1] = 8; break; }
148  case 1: { TrkAdd[ust-1] = 9; break; }
149  case 2: { TrkAdd[ust-1] = 0; break; }
150  case 3: { TrkAdd[ust-1] = 1; break; }
151  case 4: { TrkAdd[ust-1] = 10; break; }
152  case 5: { TrkAdd[ust-1] = 11; break; }
153  case 6: { TrkAdd[ust-1] = 2; break; }
154  case 7: { TrkAdd[ust-1] = 3; break; }
155  case 8: { TrkAdd[ust-1] = 12; break; }
156  case 9: { TrkAdd[ust-1] = 13; break; }
157  case 10: { TrkAdd[ust-1] = 4; break; }
158  case 11: { TrkAdd[ust-1] = 5; break; }
159  case 15: { TrkAdd[ust-1] = 15; break; }
160  default: { TrkAdd[ust-1] = 15; break; }
161  }
162 
163  if (ust!=1) return;
164 
165  switch (uadd) {
166  case 0: { TrkAdd[0] = 2; break; }
167  case 1: { TrkAdd[0] = 1; break; }
168  case 15: { TrkAdd[0] = 3; break; }
169  default: { TrkAdd[0] = 3; break; }
170  }
171 }
void setAdd(int ust)
int whNum() const
void setChargeValidPacked(unsigned valid)
Set Charge Valid.
~L1MuDTTrackCand() override
void setType(unsigned type)
Set Type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC.
void setChargePacked(unsigned ch)
Set Charge (0=pos, 1=neg)
int TrkTag() const
void setPtPacked(unsigned pt)
Set Pt: 0..31.
int scNum() const
unsigned int quality() const
return quality
void setPhiPacked(unsigned phi)
Set Phi: 0..143.
unsigned int quality_packed() const
return quality packed as in hardware
int bx() const
return bunch crossing identifier
void setQualityPacked(unsigned qual)
Set Quality: 0..7.
void setEtaPacked(unsigned eta)
Set Eta: 6-bit code.
int TCNum() const
void setFineHaloPacked(unsigned fh)
Set Fine / Halo.
int stNum(int ust) const
unsigned type_idx() const
return type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC