CMS 3D CMS Logo

List of all members | Public Member Functions
PtAssignmentEngine2016 Class Reference

#include <PtAssignmentEngine2016.h>

Inheritance diagram for PtAssignmentEngine2016:
PtAssignmentEngine

Public Member Functions

const PtAssignmentEngineAux2016aux () const
 
address_t calculate_address (const EMTFTrack &track) const override
 
float calculate_pt_xml (const address_t &address) const override
 
float calculate_pt_xml (const EMTFTrack &track) const override
 
 PtAssignmentEngine2016 ()
 
float scale_pt (const float pt, const int mode=15) const override
 
float unscale_pt (const float pt, const int mode=15) const override
 
 ~PtAssignmentEngine2016 () override
 
- Public Member Functions inherited from PtAssignmentEngine
const PtAssignmentEngineAuxaux () const
 
virtual float calculate_pt (const address_t &address) const
 
virtual float calculate_pt (const EMTFTrack &track) const
 
virtual float calculate_pt_lut (const address_t &address) const
 
void configure (int verbose, bool readPtLUTFile, bool fixMode15HighPt, bool bug9BitDPhi, bool bugMode7CLCT, bool bugNegPt)
 
void configure_details ()
 
int get_pt_lut_version () const
 
const std::vector< int > & getAllowedModes (void) const
 
const std::array< emtf::Forest, 16 > & getForests (void) const
 
void load (int pt_lut_version, const L1TMuonEndCapForest *payload)
 
 PtAssignmentEngine ()
 
void read (int pt_lut_version, const std::string &xml_dir)
 
virtual ~PtAssignmentEngine ()
 

Additional Inherited Members

- Public Types inherited from PtAssignmentEngine
typedef uint64_t address_t
 
- Protected Attributes inherited from PtAssignmentEngine
std::vector< int > allowedModes_
 
bool bug9BitDPhi_
 
bool bugMode7CLCT_
 
bool bugNegPt_
 
bool fixMode15HighPt_
 
std::array< emtf::Forest, 16 > forests_
 
PtLUTReader ptlut_reader_
 
int ptLUTVersion_
 
bool readPtLUTFile_
 
int verbose_
 

Detailed Description

Definition at line 7 of file PtAssignmentEngine2016.h.

Constructor & Destructor Documentation

◆ PtAssignmentEngine2016()

PtAssignmentEngine2016::PtAssignmentEngine2016 ( )
inlineexplicit

Definition at line 9 of file PtAssignmentEngine2016.h.

◆ ~PtAssignmentEngine2016()

PtAssignmentEngine2016::~PtAssignmentEngine2016 ( )
inlineoverride

Definition at line 10 of file PtAssignmentEngine2016.h.

10 {}

Member Function Documentation

◆ aux()

const PtAssignmentEngineAux2016 & PtAssignmentEngine2016::aux ( ) const

Definition at line 7 of file PtAssignmentEngine2016.cc.

7  {
9  return instance;
10 }

References instance.

Referenced by calculate_address(), and calculate_pt_xml().

◆ calculate_address()

PtAssignmentEngine::address_t PtAssignmentEngine2016::calculate_address ( const EMTFTrack track) const
overridevirtual

Reimplemented from PtAssignmentEngine.

Definition at line 24 of file PtAssignmentEngine2016.cc.

24  {
25  address_t address = 0;
26 
27  const EMTFPtLUT& ptlut_data = track.PtLUT();
28 
29  int mode_inv = track.Mode_inv();
30  int theta = track.Theta_fp();
31  theta >>= 2; // truncate from 7-bit to 5-bit
32 
33  int dPhi12 = ptlut_data.delta_ph[0];
34  int dPhi13 = ptlut_data.delta_ph[1];
35  int dPhi14 = ptlut_data.delta_ph[2];
36  int dPhi23 = ptlut_data.delta_ph[3];
37  int dPhi24 = ptlut_data.delta_ph[4];
38  int dPhi34 = ptlut_data.delta_ph[5];
39  int dTheta12 = ptlut_data.delta_th[0];
40  int dTheta13 = ptlut_data.delta_th[1];
41  int dTheta14 = ptlut_data.delta_th[2];
42  int dTheta23 = ptlut_data.delta_th[3];
43  int dTheta24 = ptlut_data.delta_th[4];
44  int dTheta34 = ptlut_data.delta_th[5];
45  int FR1 = ptlut_data.fr[0];
46  int FR2 = ptlut_data.fr[1];
47  int FR3 = ptlut_data.fr[2];
48  int FR4 = ptlut_data.fr[3];
49 
50  int sign12 = ptlut_data.sign_ph[0];
51  int sign13 = ptlut_data.sign_ph[1];
52  int sign14 = ptlut_data.sign_ph[2];
53  int sign23 = ptlut_data.sign_ph[3];
54  int sign24 = ptlut_data.sign_ph[4];
55  int sign34 = ptlut_data.sign_ph[5];
56  int dTheta12Sign = ptlut_data.sign_th[0];
57  int dTheta13Sign = ptlut_data.sign_th[1];
58  int dTheta14Sign = ptlut_data.sign_th[2];
59  int dTheta23Sign = ptlut_data.sign_th[3];
60  int dTheta24Sign = ptlut_data.sign_th[4];
61  int dTheta34Sign = ptlut_data.sign_th[5];
62 
63  int CLCT1 = std::abs(aux().getCLCT(ptlut_data.cpattern[0]));
64  int CLCT2 = std::abs(aux().getCLCT(ptlut_data.cpattern[1]));
65  int CLCT3 = std::abs(aux().getCLCT(ptlut_data.cpattern[2]));
66  int CLCT4 = std::abs(aux().getCLCT(ptlut_data.cpattern[3]));
67  int CLCT1Sign = (aux().getCLCT(ptlut_data.cpattern[0]) > 0);
68  int CLCT2Sign = (aux().getCLCT(ptlut_data.cpattern[1]) > 0);
69  int CLCT3Sign = (aux().getCLCT(ptlut_data.cpattern[2]) > 0);
70  int CLCT4Sign = (aux().getCLCT(ptlut_data.cpattern[3]) > 0);
71 
72  int CSCID1 = (ptlut_data.bt_vi[0] == 0 && ptlut_data.bt_vi[1] != 0) ? ptlut_data.bt_ci[1] + 16 : ptlut_data.bt_ci[0];
73  int CSCID2 = ptlut_data.bt_ci[2];
74  int CSCID3 = ptlut_data.bt_ci[3];
75  int CSCID4 = ptlut_data.bt_ci[4];
76 
77  auto get_signed_int = [](int var, int sign) { return (sign == 1) ? (var * 1) : (var * -1); };
78 
79  dTheta12 = aux().getdTheta(get_signed_int(dTheta12, dTheta12Sign));
80  dTheta13 = aux().getdTheta(get_signed_int(dTheta13, dTheta13Sign));
81  dTheta14 = aux().getdTheta(get_signed_int(dTheta14, dTheta14Sign));
82  dTheta23 = aux().getdTheta(get_signed_int(dTheta23, dTheta23Sign));
83  dTheta24 = aux().getdTheta(get_signed_int(dTheta24, dTheta24Sign));
84  dTheta34 = aux().getdTheta(get_signed_int(dTheta34, dTheta34Sign));
85 
86  bool use_FRLUT = true;
87  if (use_FRLUT) {
88  if (CSCID1 >= 16)
89  FR1 = aux().getFRLUT(track.Sector(), 1, CSCID1 - 16);
90  else
91  FR1 = aux().getFRLUT(track.Sector(), 0, CSCID1);
92  FR2 = aux().getFRLUT(track.Sector(), 2, CSCID2);
93  FR3 = aux().getFRLUT(track.Sector(), 3, CSCID3);
94  FR4 = aux().getFRLUT(track.Sector(), 4, CSCID4);
95  }
96 
97  switch (mode_inv) {
98  case 3: // 1-2
99  if (!bug9BitDPhi_)
100  dPhi12 = std::min(511, dPhi12);
101 
102  address |= (dPhi12 & ((1 << 9) - 1)) << (0);
103  address |= (sign12 & ((1 << 1) - 1)) << (0 + 9);
104  address |= (dTheta12 & ((1 << 3) - 1)) << (0 + 9 + 1);
105  address |= (CLCT1 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3);
106  address |= (CLCT1Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2);
107  address |= (CLCT2 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3 + 2 + 1);
108  address |= (CLCT2Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2);
109  address |= (FR1 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1);
110  address |= (FR2 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1);
111  address |= (theta & ((1 << 5) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1);
112  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1 + 5);
113  break;
114 
115  case 5: // 1-3
116  if (!bug9BitDPhi_)
117  dPhi13 = std::min(511, dPhi13);
118 
119  address |= (dPhi13 & ((1 << 9) - 1)) << (0);
120  address |= (sign13 & ((1 << 1) - 1)) << (0 + 9);
121  address |= (dTheta13 & ((1 << 3) - 1)) << (0 + 9 + 1);
122  address |= (CLCT1 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3);
123  address |= (CLCT1Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2);
124  address |= (CLCT3 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3 + 2 + 1);
125  address |= (CLCT3Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2);
126  address |= (FR1 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1);
127  address |= (FR3 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1);
128  address |= (theta & ((1 << 5) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1);
129  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1 + 5);
130  break;
131 
132  case 9: // 1-4
133  if (!bug9BitDPhi_)
134  dPhi14 = std::min(511, dPhi14);
135 
136  address |= (dPhi14 & ((1 << 9) - 1)) << (0);
137  address |= (sign14 & ((1 << 1) - 1)) << (0 + 9);
138  address |= (dTheta14 & ((1 << 3) - 1)) << (0 + 9 + 1);
139  address |= (CLCT1 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3);
140  address |= (CLCT1Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2);
141  address |= (CLCT4 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3 + 2 + 1);
142  address |= (CLCT4Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2);
143  address |= (FR1 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1);
144  address |= (FR4 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1);
145  address |= (theta & ((1 << 5) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1);
146  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1 + 5);
147  break;
148 
149  case 6: // 2-3
150  if (!bug9BitDPhi_)
151  dPhi23 = std::min(511, dPhi23);
152 
153  address |= (dPhi23 & ((1 << 9) - 1)) << (0);
154  address |= (sign23 & ((1 << 1) - 1)) << (0 + 9);
155  address |= (dTheta23 & ((1 << 3) - 1)) << (0 + 9 + 1);
156  address |= (CLCT2 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3);
157  address |= (CLCT2Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2);
158  address |= (CLCT3 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3 + 2 + 1);
159  address |= (CLCT3Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2);
160  address |= (FR2 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1);
161  address |= (FR3 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1);
162  address |= (theta & ((1 << 5) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1);
163  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1 + 5);
164  break;
165 
166  case 10: // 2-4
167  if (!bug9BitDPhi_)
168  dPhi24 = std::min(511, dPhi24);
169 
170  address |= (dPhi24 & ((1 << 9) - 1)) << (0);
171  address |= (sign24 & ((1 << 1) - 1)) << (0 + 9);
172  address |= (dTheta24 & ((1 << 3) - 1)) << (0 + 9 + 1);
173  address |= (CLCT2 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3);
174  address |= (CLCT2Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2);
175  address |= (CLCT4 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3 + 2 + 1);
176  address |= (CLCT4Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2);
177  address |= (FR2 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1);
178  address |= (FR4 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1);
179  address |= (theta & ((1 << 5) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1);
180  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1 + 5);
181  break;
182 
183  case 12: // 3-4
184  if (!bug9BitDPhi_)
185  dPhi34 = std::min(511, dPhi34);
186 
187  address |= (dPhi34 & ((1 << 9) - 1)) << (0);
188  address |= (sign34 & ((1 << 1) - 1)) << (0 + 9);
189  address |= (dTheta34 & ((1 << 3) - 1)) << (0 + 9 + 1);
190  address |= (CLCT3 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3);
191  address |= (CLCT3Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2);
192  address |= (CLCT4 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3 + 2 + 1);
193  address |= (CLCT4Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2);
194  address |= (FR3 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1);
195  address |= (FR4 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1);
196  address |= (theta & ((1 << 5) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1);
197  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1 + 5);
198  break;
199 
200  case 7: // 1-2-3
201  dPhi12 = aux().getNLBdPhiBin(dPhi12, 7, 512);
202  dPhi23 = aux().getNLBdPhiBin(dPhi23, 5, 256);
203 
204  address |= (dPhi12 & ((1 << 7) - 1)) << (0);
205  address |= (dPhi23 & ((1 << 5) - 1)) << (0 + 7);
206  address |= (sign12 & ((1 << 1) - 1)) << (0 + 7 + 5);
207  address |= (sign23 & ((1 << 1) - 1)) << (0 + 7 + 5 + 1);
208  address |= (dTheta13 & ((1 << 3) - 1)) << (0 + 7 + 5 + 1 + 1);
209  address |= (CLCT1 & ((1 << 2) - 1)) << (0 + 7 + 5 + 1 + 1 + 3);
210  address |= (CLCT1Sign & ((1 << 1) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2);
211  address |= (FR1 & ((1 << 1) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1);
212  address |= (theta & ((1 << 5) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1 + 1);
213  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1 + 1 + 5);
214  break;
215 
216  case 11: // 1-2-4
217  dPhi12 = aux().getNLBdPhiBin(dPhi12, 7, 512);
218  dPhi24 = aux().getNLBdPhiBin(dPhi24, 5, 256);
219 
220  address |= (dPhi12 & ((1 << 7) - 1)) << (0);
221  address |= (dPhi24 & ((1 << 5) - 1)) << (0 + 7);
222  address |= (sign12 & ((1 << 1) - 1)) << (0 + 7 + 5);
223  address |= (sign24 & ((1 << 1) - 1)) << (0 + 7 + 5 + 1);
224  address |= (dTheta14 & ((1 << 3) - 1)) << (0 + 7 + 5 + 1 + 1);
225  address |= (CLCT1 & ((1 << 2) - 1)) << (0 + 7 + 5 + 1 + 1 + 3);
226  address |= (CLCT1Sign & ((1 << 1) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2);
227  address |= (FR1 & ((1 << 1) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1);
228  address |= (theta & ((1 << 5) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1 + 1);
229  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1 + 1 + 5);
230  break;
231 
232  case 13: // 1-3-4
233  dPhi13 = aux().getNLBdPhiBin(dPhi13, 7, 512);
234  dPhi34 = aux().getNLBdPhiBin(dPhi34, 5, 256);
235 
236  address |= (dPhi13 & ((1 << 7) - 1)) << (0);
237  address |= (dPhi34 & ((1 << 5) - 1)) << (0 + 7);
238  address |= (sign13 & ((1 << 1) - 1)) << (0 + 7 + 5);
239  address |= (sign34 & ((1 << 1) - 1)) << (0 + 7 + 5 + 1);
240  address |= (dTheta14 & ((1 << 3) - 1)) << (0 + 7 + 5 + 1 + 1);
241  address |= (CLCT1 & ((1 << 2) - 1)) << (0 + 7 + 5 + 1 + 1 + 3);
242  address |= (CLCT1Sign & ((1 << 1) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2);
243  address |= (FR1 & ((1 << 1) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1);
244  address |= (theta & ((1 << 5) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1 + 1);
245  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1 + 1 + 5);
246  break;
247 
248  case 14: // 2-3-4
249  dPhi23 = aux().getNLBdPhiBin(dPhi23, 7, 512);
250  dPhi34 = aux().getNLBdPhiBin(dPhi34, 6, 256);
251 
252  address |= (dPhi23 & ((1 << 7) - 1)) << (0);
253  address |= (dPhi34 & ((1 << 6) - 1)) << (0 + 7);
254  address |= (sign23 & ((1 << 1) - 1)) << (0 + 7 + 6);
255  address |= (sign34 & ((1 << 1) - 1)) << (0 + 7 + 6 + 1);
256  address |= (dTheta24 & ((1 << 3) - 1)) << (0 + 7 + 6 + 1 + 1);
257  address |= (CLCT2 & ((1 << 2) - 1)) << (0 + 7 + 6 + 1 + 1 + 3);
258  address |= (CLCT2Sign & ((1 << 1) - 1)) << (0 + 7 + 6 + 1 + 1 + 3 + 2);
259  address |= (theta & ((1 << 5) - 1)) << (0 + 7 + 6 + 1 + 1 + 3 + 2 + 1);
260  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 7 + 6 + 1 + 1 + 3 + 2 + 1 + 5);
261  break;
262 
263  case 15: // 1-2-3-4
264  // Set sign23 and sign34 relative to sign12
265  if (!sign12) {
266  sign12 = !sign12;
267  sign23 = !sign23;
268  sign34 = !sign34;
269  }
270 
271  dPhi12 = aux().getNLBdPhiBin(dPhi12, 7, 512);
272  dPhi23 = aux().getNLBdPhiBin(dPhi23, 5, 256);
273  dPhi34 = aux().getNLBdPhiBin(dPhi34, 6, 256);
274 
275  address |= (dPhi12 & ((1 << 7) - 1)) << (0);
276  address |= (dPhi23 & ((1 << 5) - 1)) << (0 + 7);
277  address |= (dPhi34 & ((1 << 6) - 1)) << (0 + 7 + 5);
278  address |= (sign23 & ((1 << 1) - 1)) << (0 + 7 + 5 + 6);
279  address |= (sign34 & ((1 << 1) - 1)) << (0 + 7 + 5 + 6 + 1);
280  address |= (FR1 & ((1 << 1) - 1)) << (0 + 7 + 5 + 6 + 1 + 1);
281  address |= (theta & ((1 << 5) - 1)) << (0 + 7 + 5 + 6 + 1 + 1 + 1);
282  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 7 + 5 + 6 + 1 + 1 + 1 + 5);
283  break;
284 
285  default:
286  break;
287  }
288 
289  return address;
290 }

References funct::abs(), aux(), l1t::EMTFPtLUT::bt_ci, l1t::EMTFPtLUT::bt_vi, PtAssignmentEngine::bug9BitDPhi_, l1t::EMTFPtLUT::cpattern, l1t::EMTFPtLUT::delta_ph, l1t::EMTFPtLUT::delta_th, l1t::EMTFPtLUT::fr, PtAssignmentEngineAux2016::getCLCT(), PtAssignmentEngineAux2016::getdTheta(), PtAssignmentEngineAux2016::getFRLUT(), PtAssignmentEngineAux2016::getNLBdPhiBin(), min(), Validation_hcalonly_cfi::sign, l1t::EMTFPtLUT::sign_ph, l1t::EMTFPtLUT::sign_th, theta(), HLT_FULL_cff::track, and trigObjTnPSource_cfi::var.

◆ calculate_pt_xml() [1/2]

float PtAssignmentEngine2016::calculate_pt_xml ( const address_t address) const
overridevirtual

Reimplemented from PtAssignmentEngine.

Definition at line 292 of file PtAssignmentEngine2016.cc.

292  {
293  float pt = 0.;
294 
295  if (address == 0) // invalid address
296  return -1; // return pt;
297 
298  int mode_inv = (address >> (30 - 4)) & ((1 << 4) - 1);
299 
300  auto contain = [](const std::vector<int>& vec, int elem) {
301  return (std::find(vec.begin(), vec.end(), elem) != vec.end());
302  };
303 
304  bool is_good_mode = contain(allowedModes_, mode_inv);
305 
306  if (!is_good_mode) // invalid mode
307  return -1; // return pt;
308 
309  int dPhi12 = -999;
310  int dPhi13 = -999;
311  int dPhi14 = -999;
312  int dPhi23 = -999;
313  int dPhi24 = -999;
314  int dPhi34 = -999;
315  int dTheta12 = -999;
316  int dTheta13 = -999;
317  int dTheta14 = -999;
318  int dTheta23 = -999;
319  int dTheta24 = -999;
320  int dTheta34 = -999;
321  int CLCT1 = -999;
322  int CLCT2 = -999;
323  int CLCT3 = -999;
324  int CLCT4 = -999;
325  int CSCID1 = -999;
326  int CSCID2 = -999;
327  int CSCID3 = -999;
328  int CSCID4 = -999;
329  int FR1 = -999;
330  int FR2 = -999;
331  int FR3 = -999;
332  int FR4 = -999;
333 
334  int sign12 = 1;
335  int sign13 = 1;
336  int sign14 = 1;
337  int sign23 = 1;
338  int sign24 = 1;
339  int sign34 = 1;
340 
341  int CLCT1Sign = 1;
342  int CLCT2Sign = 1;
343  int CLCT3Sign = 1;
344  int CLCT4Sign = 1;
345 
346  int theta = 0;
347 
348  switch (mode_inv) {
349  case 3: // 1-2
350  dPhi12 = (address >> (0)) & ((1 << 9) - 1);
351  sign12 = (address >> (0 + 9)) & ((1 << 1) - 1);
352  dTheta12 = (address >> (0 + 9 + 1)) & ((1 << 3) - 1);
353  CLCT1 = (address >> (0 + 9 + 1 + 3)) & ((1 << 2) - 1);
354  CLCT1Sign = (address >> (0 + 9 + 1 + 3 + 2)) & ((1 << 1) - 1);
355  CLCT2 = (address >> (0 + 9 + 1 + 3 + 2 + 1)) & ((1 << 2) - 1);
356  CLCT2Sign = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2)) & ((1 << 1) - 1);
357  FR1 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1)) & ((1 << 1) - 1);
358  FR2 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1)) & ((1 << 1) - 1);
359  theta = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1)) & ((1 << 5) - 1);
360  break;
361 
362  case 5: // 1-3
363  dPhi13 = (address >> (0)) & ((1 << 9) - 1);
364  sign13 = (address >> (0 + 9)) & ((1 << 1) - 1);
365  dTheta13 = (address >> (0 + 9 + 1)) & ((1 << 3) - 1);
366  CLCT1 = (address >> (0 + 9 + 1 + 3)) & ((1 << 2) - 1);
367  CLCT1Sign = (address >> (0 + 9 + 1 + 3 + 2)) & ((1 << 1) - 1);
368  CLCT3 = (address >> (0 + 9 + 1 + 3 + 2 + 1)) & ((1 << 2) - 1);
369  CLCT3Sign = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2)) & ((1 << 1) - 1);
370  FR1 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1)) & ((1 << 1) - 1);
371  FR3 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1)) & ((1 << 1) - 1);
372  theta = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1)) & ((1 << 5) - 1);
373  break;
374 
375  case 9: // 1-4
376  dPhi14 = (address >> (0)) & ((1 << 9) - 1);
377  sign14 = (address >> (0 + 9)) & ((1 << 1) - 1);
378  dTheta14 = (address >> (0 + 9 + 1)) & ((1 << 3) - 1);
379  CLCT1 = (address >> (0 + 9 + 1 + 3)) & ((1 << 2) - 1);
380  CLCT1Sign = (address >> (0 + 9 + 1 + 3 + 2)) & ((1 << 1) - 1);
381  CLCT4 = (address >> (0 + 9 + 1 + 3 + 2 + 1)) & ((1 << 2) - 1);
382  CLCT4Sign = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2)) & ((1 << 1) - 1);
383  FR1 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1)) & ((1 << 1) - 1);
384  FR4 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1)) & ((1 << 1) - 1);
385  theta = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1)) & ((1 << 5) - 1);
386  break;
387 
388  case 6: // 2-3
389  dPhi23 = (address >> (0)) & ((1 << 9) - 1);
390  sign23 = (address >> (0 + 9)) & ((1 << 1) - 1);
391  dTheta23 = (address >> (0 + 9 + 1)) & ((1 << 3) - 1);
392  CLCT2 = (address >> (0 + 9 + 1 + 3)) & ((1 << 2) - 1);
393  CLCT2Sign = (address >> (0 + 9 + 1 + 3 + 2)) & ((1 << 1) - 1);
394  CLCT3 = (address >> (0 + 9 + 1 + 3 + 2 + 1)) & ((1 << 2) - 1);
395  CLCT3Sign = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2)) & ((1 << 1) - 1);
396  FR2 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1)) & ((1 << 1) - 1);
397  FR3 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1)) & ((1 << 1) - 1);
398  theta = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1)) & ((1 << 5) - 1);
399  break;
400 
401  case 10: // 2-4
402  dPhi24 = (address >> (0)) & ((1 << 9) - 1);
403  sign24 = (address >> (0 + 9)) & ((1 << 1) - 1);
404  dTheta24 = (address >> (0 + 9 + 1)) & ((1 << 3) - 1);
405  CLCT2 = (address >> (0 + 9 + 1 + 3)) & ((1 << 2) - 1);
406  CLCT2Sign = (address >> (0 + 9 + 1 + 3 + 2)) & ((1 << 1) - 1);
407  CLCT4 = (address >> (0 + 9 + 1 + 3 + 2 + 1)) & ((1 << 2) - 1);
408  CLCT4Sign = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2)) & ((1 << 1) - 1);
409  FR2 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1)) & ((1 << 1) - 1);
410  FR4 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1)) & ((1 << 1) - 1);
411  theta = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1)) & ((1 << 5) - 1);
412  break;
413 
414  case 12: // 3-4
415  dPhi34 = (address >> (0)) & ((1 << 9) - 1);
416  sign34 = (address >> (0 + 9)) & ((1 << 1) - 1);
417  dTheta34 = (address >> (0 + 9 + 1)) & ((1 << 3) - 1);
418  CLCT3 = (address >> (0 + 9 + 1 + 3)) & ((1 << 2) - 1);
419  CLCT3Sign = (address >> (0 + 9 + 1 + 3 + 2)) & ((1 << 1) - 1);
420  CLCT4 = (address >> (0 + 9 + 1 + 3 + 2 + 1)) & ((1 << 2) - 1);
421  CLCT4Sign = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2)) & ((1 << 1) - 1);
422  FR3 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1)) & ((1 << 1) - 1);
423  FR4 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1)) & ((1 << 1) - 1);
424  theta = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1)) & ((1 << 5) - 1);
425  break;
426 
427  case 7: // 1-2-3
428  dPhi12 = (address >> (0)) & ((1 << 7) - 1);
429  dPhi23 = (address >> (0 + 7)) & ((1 << 5) - 1);
430  sign12 = (address >> (0 + 7 + 5)) & ((1 << 1) - 1);
431  sign23 = (address >> (0 + 7 + 5 + 1)) & ((1 << 1) - 1);
432  dTheta13 = (address >> (0 + 7 + 5 + 1 + 1)) & ((1 << 3) - 1);
433  CLCT1 = (address >> (0 + 7 + 5 + 1 + 1 + 3)) & ((1 << 2) - 1);
434  CLCT1Sign = (address >> (0 + 7 + 5 + 1 + 1 + 3 + 2)) & ((1 << 1) - 1);
435  FR1 = (address >> (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1)) & ((1 << 1) - 1);
436  theta = (address >> (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1 + 1)) & ((1 << 5) - 1);
437 
438  dPhi12 = aux().getdPhiFromBin(dPhi12, 7, 512);
439  dPhi23 = aux().getdPhiFromBin(dPhi23, 5, 256);
440  break;
441 
442  case 11: // 1-2-4
443  dPhi12 = (address >> (0)) & ((1 << 7) - 1);
444  dPhi24 = (address >> (0 + 7)) & ((1 << 5) - 1);
445  sign12 = (address >> (0 + 7 + 5)) & ((1 << 1) - 1);
446  sign24 = (address >> (0 + 7 + 5 + 1)) & ((1 << 1) - 1);
447  dTheta14 = (address >> (0 + 7 + 5 + 1 + 1)) & ((1 << 3) - 1);
448  CLCT1 = (address >> (0 + 7 + 5 + 1 + 1 + 3)) & ((1 << 2) - 1);
449  CLCT1Sign = (address >> (0 + 7 + 5 + 1 + 1 + 3 + 2)) & ((1 << 1) - 1);
450  FR1 = (address >> (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1)) & ((1 << 1) - 1);
451  theta = (address >> (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1 + 1)) & ((1 << 5) - 1);
452 
453  dPhi12 = aux().getdPhiFromBin(dPhi12, 7, 512);
454  dPhi24 = aux().getdPhiFromBin(dPhi24, 5, 256);
455  break;
456 
457  case 13: // 1-3-4
458  dPhi13 = (address >> (0)) & ((1 << 7) - 1);
459  dPhi34 = (address >> (0 + 7)) & ((1 << 5) - 1);
460  sign13 = (address >> (0 + 7 + 5)) & ((1 << 1) - 1);
461  sign34 = (address >> (0 + 7 + 5 + 1)) & ((1 << 1) - 1);
462  dTheta14 = (address >> (0 + 7 + 5 + 1 + 1)) & ((1 << 3) - 1);
463  CLCT1 = (address >> (0 + 7 + 5 + 1 + 1 + 3)) & ((1 << 2) - 1);
464  CLCT1Sign = (address >> (0 + 7 + 5 + 1 + 1 + 3 + 2)) & ((1 << 1) - 1);
465  FR1 = (address >> (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1)) & ((1 << 1) - 1);
466  theta = (address >> (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1 + 1)) & ((1 << 5) - 1);
467 
468  dPhi13 = aux().getdPhiFromBin(dPhi13, 7, 512);
469  dPhi34 = aux().getdPhiFromBin(dPhi34, 5, 256);
470  break;
471 
472  case 14: // 2-3-4
473  dPhi23 = (address >> (0)) & ((1 << 7) - 1);
474  dPhi34 = (address >> (0 + 7)) & ((1 << 6) - 1);
475  sign23 = (address >> (0 + 7 + 6)) & ((1 << 1) - 1);
476  sign34 = (address >> (0 + 7 + 6 + 1)) & ((1 << 1) - 1);
477  dTheta24 = (address >> (0 + 7 + 6 + 1 + 1)) & ((1 << 3) - 1);
478  CLCT2 = (address >> (0 + 7 + 6 + 1 + 1 + 3)) & ((1 << 2) - 1);
479  CLCT2Sign = (address >> (0 + 7 + 6 + 1 + 1 + 3 + 2)) & ((1 << 1) - 1);
480  theta = (address >> (0 + 7 + 6 + 1 + 1 + 3 + 2 + 1)) & ((1 << 5) - 1);
481 
482  dPhi23 = aux().getdPhiFromBin(dPhi23, 7, 512);
483  dPhi34 = aux().getdPhiFromBin(dPhi34, 6, 256);
484  break;
485 
486  case 15: // 1-2-3-4
487  dPhi12 = (address >> (0)) & ((1 << 7) - 1);
488  dPhi23 = (address >> (0 + 7)) & ((1 << 5) - 1);
489  dPhi34 = (address >> (0 + 7 + 5)) & ((1 << 6) - 1);
490  sign23 = (address >> (0 + 7 + 5 + 6)) & ((1 << 1) - 1);
491  sign34 = (address >> (0 + 7 + 5 + 6 + 1)) & ((1 << 1) - 1);
492  FR1 = (address >> (0 + 7 + 5 + 6 + 1 + 1)) & ((1 << 1) - 1);
493  theta = (address >> (0 + 7 + 5 + 6 + 1 + 1 + 1)) & ((1 << 5) - 1);
494 
495  dPhi12 = aux().getdPhiFromBin(dPhi12, 7, 512);
496  dPhi23 = aux().getdPhiFromBin(dPhi23, 5, 256);
497  dPhi34 = aux().getdPhiFromBin(dPhi34, 6, 256);
498  break;
499 
500  default:
501  break;
502  }
503 
504  auto get_signed_int = [](int var, int sign) { return (sign == 1) ? (var * 1) : (var * -1); };
505 
506  dPhi12 = get_signed_int(dPhi12, sign12);
507  dPhi13 = get_signed_int(dPhi13, sign13);
508  dPhi14 = get_signed_int(dPhi14, sign14);
509  dPhi23 = get_signed_int(dPhi23, sign23);
510  dPhi24 = get_signed_int(dPhi24, sign24);
511  dPhi34 = get_signed_int(dPhi34, sign34);
512 
513  CLCT1 = get_signed_int(CLCT1, CLCT1Sign);
514  CLCT2 = get_signed_int(CLCT2, CLCT2Sign);
515  CLCT3 = get_signed_int(CLCT3, CLCT3Sign);
516  CLCT4 = get_signed_int(CLCT4, CLCT4Sign);
517 
518  theta <<= 2;
519  float eta = aux().getEtaFromThetaInt(theta, 5);
520 
521  bool use_lossy_eta = true;
522  if (use_lossy_eta) {
523  int etaInt = aux().getEtaInt(eta, 5);
524  etaInt &= ((1 << 5) - 1);
525  eta = aux().getEtaFromEtaInt(etaInt, 5);
526  }
527 
528  // First fix to recover high pT muons with 3 hits in a line and one displaced hit
529  // Done by re-writing a few addresses in the original LUT, according to the following logic
530  // Implemented in FW 26.07.16, as of run 2774278 / fill 5119
531  if (fixMode15HighPt_) {
532  if (mode_inv == 15) { // 1-2-3-4
533  bool st2_off = false;
534  bool st3_off = false;
535  bool st4_off = false;
536 
537  dPhi13 = dPhi12 + dPhi23;
538  dPhi14 = dPhi13 + dPhi34;
539  dPhi24 = dPhi23 + dPhi34;
540 
541  int sum_st1 = abs(dPhi12 + dPhi13 + dPhi14);
542  int sum_st2 = abs(-dPhi12 + dPhi23 + dPhi24);
543  int sum_st3 = abs(-dPhi13 - dPhi23 + dPhi34);
544  int sum_st4 = abs(-dPhi14 - dPhi24 - dPhi34);
545 
546  // Detect outliers
547  if (sum_st2 > sum_st1 && sum_st2 > sum_st3 && sum_st2 > sum_st4)
548  st2_off = true;
549  if (sum_st3 > sum_st1 && sum_st3 > sum_st2 && sum_st3 > sum_st4)
550  st3_off = true;
551  if (sum_st4 > sum_st1 && sum_st4 > sum_st2 && sum_st4 > sum_st3)
552  st4_off = true;
553 
554  // Recover outliers
555  if (st2_off) {
556  if ((abs(dPhi12) > 9 || abs(dPhi23) > 9 || abs(dPhi24) > 9) &&
557  (abs(dPhi13) < 10 && abs(dPhi14) < 10 && abs(dPhi34) < 10)) {
558  dPhi12 = dPhi13 / 2;
559  dPhi23 = dPhi13 / 2;
560  }
561  }
562  if (st3_off) {
563  if ((abs(dPhi13) > 9 || abs(dPhi23) > 9 || abs(dPhi34) > 9) &&
564  (abs(dPhi12) < 10 && abs(dPhi14) < 10 && abs(dPhi24) < 10)) {
565  dPhi23 = dPhi24 / 2;
566  dPhi34 = dPhi24 / 2;
567  }
568  }
569  if (st4_off) {
570  if ((abs(dPhi14) > 9 || abs(dPhi24) > 9 || abs(dPhi34) > 9) &&
571  (abs(dPhi12) < 10 && abs(dPhi13) < 10 && abs(dPhi23) < 10)) {
572  if (abs(dPhi13) < abs(dPhi23))
573  dPhi34 = dPhi13;
574  else
575  dPhi34 = dPhi23;
576  }
577  }
578 
579  // Set sign23 and sign34 relative to sign12
580  //sign12 = (dPhi12 >= 0);
581  //sign23 = (dPhi23 >= 0);
582  //sign34 = (dPhi34 >= 0);
583  //if (!sign12) {
584  // sign12 = !sign12;
585  // sign23 = !sign23;
586  // sign34 = !sign34;
587  //}
588 
589  sign12 = 1;
590  if (dPhi12 > 0) {
591  sign23 = (dPhi23 > 0) ? 1 : 0;
592  sign34 = (dPhi34 > 0) ? 1 : 0;
593  } else {
594  sign23 = (dPhi23 < 0) ? 1 : 0;
595  sign34 = (dPhi34 < 0) ? 1 : 0;
596  }
597 
598  dPhi12 = get_signed_int(abs(dPhi12), sign12);
599  dPhi23 = get_signed_int(abs(dPhi23), sign23);
600  dPhi34 = get_signed_int(abs(dPhi34), sign34);
601 
602  } // end if mode_inv == 15
603  }
604 
605  // Inherit some bugs
606  if (bugMode7CLCT_) {
607  if (mode_inv == 14) { // 2-3-4
608  int bugged_CLCT2;
609  address_t bugged_address;
610 
611  //CLCT2 = (address >> (0+7+6+1+1+3)) & ((1<<2)-1);
612  //address |= (CLCT2 & ((1<<2)-1)) << (0+7+6+1+1+3);
613 
614  bugged_CLCT2 = (address >> (0 + 7 + 5 + 1 + 1 + 3)) & ((1 << 2) - 1); // bad
615  bugged_address = address & ~(((1 << 2) - 1) << (0 + 7 + 6 + 1 + 1 + 3)); // clear bits
616  bugged_address |= (bugged_CLCT2 & ((1 << 2) - 1)) << (0 + 7 + 6 + 1 + 1 + 3);
617  bugged_CLCT2 = (bugged_address >> (0 + 7 + 5 + 1 + 1 + 3)) & ((1 << 2) - 1); // bad
618 
619  CLCT2 = bugged_CLCT2;
620  CLCT2 = get_signed_int(CLCT2, CLCT2Sign);
621 
622  } // end if mode_inv == 14
623  }
624 
625  // Get pT from XML (forest)
626  const int(*mode_variables)[6] = aux().getModeVariables();
627 
628  std::vector<int> variables = {dPhi12, dPhi13, dPhi14, dPhi23, dPhi24, dPhi34, dTheta12, dTheta13,
629  dTheta14, dTheta23, dTheta24, dTheta34, CLCT1, CLCT2, CLCT3, CLCT4,
630  CSCID1, CSCID2, CSCID3, CSCID4, FR1, FR2, FR3, FR4};
631 
632  std::vector<double> tree_data;
633  tree_data.push_back(1.0);
634  tree_data.push_back(eta);
635 
636  for (int i = 0; i < 6; i++) { // loop over 6 variables (or less)
637  int mv = mode_variables[mode_inv - 3][i];
638  if (mv != -999) {
639  int v = variables.at(mv);
640  if (!(mode_inv == 13 && i == 3)) { // somehow this uses CSCID1
641  emtf_assert(v != -999);
642  }
643  tree_data.push_back(v);
644  } else {
645  tree_data.push_back(0); // pad with zeroes, somehow BDT tries to access out of bounds
646  }
647  }
648 
649  if (verbose_ > 2) {
650  std::cout << "mode_inv: " << mode_inv << " variables: ";
651  for (const auto& v : tree_data)
652  std::cout << v << " ";
653  std::cout << std::endl;
654  }
655 
656  auto tree_event = std::make_unique<emtf::Event>();
657  tree_event->predictedValue = 0; // must explicitly initialize
658  tree_event->data = tree_data;
659 
660  // forests_.at(mode_inv).predictEvent(tree_event.get(), 64);
661  emtf::Forest& forest = const_cast<emtf::Forest&>(forests_.at(mode_inv));
662  forest.predictEvent(tree_event.get(), 64);
663 
664  float tmp_pt = tree_event->predictedValue; // is actually 1/pT
665 
666  if (verbose_ > 1) {
667  std::cout << "mode_inv: " << mode_inv << " 1/pT: " << tmp_pt << std::endl;
668  std::cout << "dPhi12: " << dPhi12 << " dPhi13: " << dPhi13 << " dPhi14: " << dPhi14 << " dPhi23: " << dPhi23
669  << " dPhi24: " << dPhi24 << " dPhi34: " << dPhi34 << std::endl;
670  std::cout << "dTheta12: " << dTheta12 << " dTheta13: " << dTheta13 << " dTheta14: " << dTheta14
671  << " dTheta23: " << dTheta23 << " dTheta24: " << dTheta24 << " dTheta34: " << dTheta34 << std::endl;
672  std::cout << "CLCT1: " << CLCT1 << " CLCT2: " << CLCT2 << " CLCT3: " << CLCT3 << " CLCT4: " << CLCT4 << std::endl;
673  std::cout << "CSCID1: " << CSCID1 << " CSCID2: " << CSCID2 << " CSCID3: " << CSCID3 << " CSCID4: " << CSCID4
674  << std::endl;
675  std::cout << "FR1: " << FR1 << " FR2: " << FR2 << " FR3: " << FR3 << " FR4: " << FR4 << std::endl;
676  }
677 
678  if (bugNegPt_) {
679  pt = (tmp_pt == 0) ? tmp_pt : 1.0 / tmp_pt;
680  if (pt < 0.0)
681  pt = 1.0;
682  if (pt > 200.0)
683  pt = 200.0;
684 
685  } else {
686  if (tmp_pt < 0.0)
687  tmp_pt = 1.0 / 7000;
688  pt = (tmp_pt == 0) ? tmp_pt : 1.0 / tmp_pt;
689  }
690 
691  emtf_assert(pt > 0);
692  return pt;
693 }

References funct::abs(), PtAssignmentEngine::allowedModes_, aux(), PtAssignmentEngine::bugMode7CLCT_, PtAssignmentEngine::bugNegPt_, gather_cfg::cout, emtf_assert, PVValHelper::eta, spr::find(), PtAssignmentEngine::fixMode15HighPt_, PtAssignmentEngine::forests_, PtAssignmentEngineAux2016::getdPhiFromBin(), PtAssignmentEngineAux2016::getEtaFromEtaInt(), PtAssignmentEngineAux2016::getEtaFromThetaInt(), PtAssignmentEngineAux2016::getEtaInt(), PtAssignmentEngineAux2016::getModeVariables(), mps_fire::i, createfilelist::int, emtf::Forest::predictEvent(), DiDispStaMuonMonitor_cfi::pt, Validation_hcalonly_cfi::sign, theta(), findQualityFiles::v, trigObjTnPSource_cfi::var, L1TEGammaDiff_cfi::variables, and PtAssignmentEngine::verbose_.

◆ calculate_pt_xml() [2/2]

float PtAssignmentEngine2016::calculate_pt_xml ( const EMTFTrack track) const
overridevirtual

Reimplemented from PtAssignmentEngine.

Definition at line 696 of file PtAssignmentEngine2016.cc.

696  {
697  float pt = 0.;
698 
699  return pt;
700 }

References DiDispStaMuonMonitor_cfi::pt.

◆ scale_pt()

float PtAssignmentEngine2016::scale_pt ( const float  pt,
const int  mode = 15 
) const
overridevirtual

Implements PtAssignmentEngine.

Definition at line 12 of file PtAssignmentEngine2016.cc.

12  {
13  // Scaling to achieve 90% efficency at any given L1 pT threshold
14  // For 2016, was a flat scaling factor of 1.4
15  float pt_scale = 1.4;
16  return pt_scale;
17 }

◆ unscale_pt()

float PtAssignmentEngine2016::unscale_pt ( const float  pt,
const int  mode = 15 
) const
overridevirtual

Implements PtAssignmentEngine.

Definition at line 19 of file PtAssignmentEngine2016.cc.

19  {
20  float pt_unscale = 1. / 1.4;
21  return pt_unscale;
22 }
PtAssignmentEngineAux2016::getFRLUT
int getFRLUT(int sector, int station, int chamber) const
Definition: PtAssignmentEngineAux2016.cc:395
PtAssignmentEngine::fixMode15HighPt_
bool fixMode15HighPt_
Definition: PtAssignmentEngine.h:57
mps_fire.i
i
Definition: mps_fire.py:428
PtAssignmentEngineAux2016::getdPhiFromBin
int getdPhiFromBin(int dPhiBin, int bits, int max=512) const
Definition: PtAssignmentEngineAux2016.cc:224
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
PtAssignmentEngine2016::aux
const PtAssignmentEngineAux2016 & aux() const
Definition: PtAssignmentEngine2016.cc:7
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
L1TEGammaDiff_cfi.variables
variables
Definition: L1TEGammaDiff_cfi.py:5
min
T min(T a, T b)
Definition: MathUtil.h:58
l1t::EMTFPtLUT
Definition: EMTFTrack.h:24
PtAssignmentEngine::bug9BitDPhi_
bool bug9BitDPhi_
Definition: PtAssignmentEngine.h:58
l1t::EMTFPtLUT::delta_ph
uint16_t delta_ph[6]
Definition: EMTFTrack.h:30
PtAssignmentEngineAux2016::getNLBdPhiBin
int getNLBdPhiBin(int dPhi, int bits, int max=512) const
Definition: PtAssignmentEngineAux2016.cc:168
gather_cfg.cout
cout
Definition: gather_cfg.py:144
emtf::Forest::predictEvent
void predictEvent(Event *e, unsigned int trees)
Definition: Forest.cc:440
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
findQualityFiles.v
v
Definition: findQualityFiles.py:179
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
PtAssignmentEngineAux2016::getModeVariables
const int(* getModeVariables() const)[6]
Definition: PtAssignmentEngineAux2016.cc:103
l1t::EMTFPtLUT::sign_ph
uint16_t sign_ph[6]
Definition: EMTFTrack.h:32
PtAssignmentEngineAux2016::getEtaFromEtaInt
float getEtaFromEtaInt(int etaInt, int bits=5) const
Definition: PtAssignmentEngineAux2016.cc:373
trigObjTnPSource_cfi.var
var
Definition: trigObjTnPSource_cfi.py:21
l1t::EMTFPtLUT::bt_vi
uint16_t bt_vi[5]
Definition: EMTFTrack.h:36
PVValHelper::eta
Definition: PVValidationHelpers.h:70
l1t::EMTFPtLUT::fr
uint16_t fr[4]
Definition: EMTFTrack.h:35
PtAssignmentEngine::bugMode7CLCT_
bool bugMode7CLCT_
Definition: PtAssignmentEngine.h:58
PtAssignmentEngine::address_t
uint64_t address_t
Definition: PtAssignmentEngine.h:21
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
PtAssignmentEngine::forests_
std::array< emtf::Forest, 16 > forests_
Definition: PtAssignmentEngine.h:51
l1t::EMTFPtLUT::delta_th
uint16_t delta_th[6]
Definition: EMTFTrack.h:31
createfilelist.int
int
Definition: createfilelist.py:10
PtAssignmentEngineAux2016::getCLCT
int getCLCT(int clct) const
Definition: PtAssignmentEngineAux2016.cc:249
PtAssignmentEngineAux2016
Definition: PtAssignmentEngineAux2016.h:6
PtAssignmentEngineAux2016::getdTheta
int getdTheta(int dTheta) const
Definition: PtAssignmentEngineAux2016.cc:306
l1t::EMTFPtLUT::cpattern
uint16_t cpattern[4]
Definition: EMTFTrack.h:34
instance
static PFTauRenderPlugin instance
Definition: PFTauRenderPlugin.cc:70
emtf::Forest
Definition: Forest.h:12
PtAssignmentEngine::allowedModes_
std::vector< int > allowedModes_
Definition: PtAssignmentEngine.h:50
PtAssignmentEngine::bugNegPt_
bool bugNegPt_
Definition: PtAssignmentEngine.h:58
PtAssignmentEngine::PtAssignmentEngine
PtAssignmentEngine()
Definition: PtAssignmentEngine.cc:6
PtAssignmentEngineAux2016::getEtaInt
int getEtaInt(float eta, int bits=5) const
Definition: PtAssignmentEngineAux2016.cc:350
l1t::EMTFPtLUT::sign_th
uint16_t sign_th[6]
Definition: EMTFTrack.h:33
PtAssignmentEngine::verbose_
int verbose_
Definition: PtAssignmentEngine.h:54
emtf_assert
#define emtf_assert(expr)
Definition: DebugTools.h:18
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
l1t::EMTFPtLUT::bt_ci
uint16_t bt_ci[5]
Definition: EMTFTrack.h:38
PtAssignmentEngineAux2016::getEtaFromThetaInt
float getEtaFromThetaInt(int thetaInt, int bits=5) const
Definition: PtAssignmentEngineAux2016.cc:362