24 float pt_unscale = 1. / 1.4;
45 int dTheta12 = ptlut_data.
delta_th[0];
46 int dTheta13 = ptlut_data.
delta_th[1];
47 int dTheta14 = ptlut_data.
delta_th[2];
48 int dTheta23 = ptlut_data.
delta_th[3];
49 int dTheta24 = ptlut_data.
delta_th[4];
50 int dTheta34 = ptlut_data.
delta_th[5];
51 int FR1 = ptlut_data.
fr [0];
52 int FR2 = ptlut_data.
fr [1];
53 int FR3 = ptlut_data.
fr [2];
54 int FR4 = ptlut_data.
fr [3];
56 int sign12 = ptlut_data.
sign_ph [0];
57 int sign13 = ptlut_data.
sign_ph [1];
58 int sign14 = ptlut_data.
sign_ph [2];
59 int sign23 = ptlut_data.
sign_ph [3];
60 int sign24 = ptlut_data.
sign_ph [4];
61 int sign34 = ptlut_data.
sign_ph [5];
62 int dTheta12Sign = ptlut_data.
sign_th [0];
63 int dTheta13Sign = ptlut_data.
sign_th [1];
64 int dTheta14Sign = ptlut_data.
sign_th [2];
65 int dTheta23Sign = ptlut_data.
sign_th [3];
66 int dTheta24Sign = ptlut_data.
sign_th [4];
67 int dTheta34Sign = ptlut_data.
sign_th [5];
78 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];
79 int CSCID2 = ptlut_data.
bt_ci[2];
80 int CSCID3 = ptlut_data.
bt_ci[3];
81 int CSCID4 = ptlut_data.
bt_ci[4];
83 auto get_signed_int = [](
int var,
int sign) {
84 return (sign == 1) ? (var * 1) : (var * -1);
87 dTheta12 =
aux().
getdTheta(get_signed_int(dTheta12, dTheta12Sign));
88 dTheta13 =
aux().
getdTheta(get_signed_int(dTheta13, dTheta13Sign));
89 dTheta14 =
aux().
getdTheta(get_signed_int(dTheta14, dTheta14Sign));
90 dTheta23 =
aux().
getdTheta(get_signed_int(dTheta23, dTheta23Sign));
91 dTheta24 =
aux().
getdTheta(get_signed_int(dTheta24, dTheta24Sign));
92 dTheta34 =
aux().
getdTheta(get_signed_int(dTheta34, dTheta34Sign));
94 bool use_FRLUT =
true;
109 address |= (dPhi12 & ((1<<9)-1)) << (0);
110 address |= (sign12 & ((1<<1)-1)) << (0+9);
111 address |= (dTheta12 & ((1<<3)-1)) << (0+9+1);
112 address |= (CLCT1 & ((1<<2)-1)) << (0+9+1+3);
113 address |= (CLCT1Sign & ((1<<1)-1)) << (0+9+1+3+2);
114 address |= (CLCT2 & ((1<<2)-1)) << (0+9+1+3+2+1);
115 address |= (CLCT2Sign & ((1<<1)-1)) << (0+9+1+3+2+1+2);
116 address |= (FR1 & ((1<<1)-1)) << (0+9+1+3+2+1+2+1);
117 address |= (FR2 & ((1<<1)-1)) << (0+9+1+3+2+1+2+1+1);
118 address |= (theta & ((1<<5)-1)) << (0+9+1+3+2+1+2+1+1+1);
119 address |= (mode_inv & ((1<<4)-1)) << (0+9+1+3+2+1+2+1+1+1+5);
125 address |= (dPhi13 & ((1<<9)-1)) << (0);
126 address |= (sign13 & ((1<<1)-1)) << (0+9);
127 address |= (dTheta13 & ((1<<3)-1)) << (0+9+1);
128 address |= (CLCT1 & ((1<<2)-1)) << (0+9+1+3);
129 address |= (CLCT1Sign & ((1<<1)-1)) << (0+9+1+3+2);
130 address |= (CLCT3 & ((1<<2)-1)) << (0+9+1+3+2+1);
131 address |= (CLCT3Sign & ((1<<1)-1)) << (0+9+1+3+2+1+2);
132 address |= (FR1 & ((1<<1)-1)) << (0+9+1+3+2+1+2+1);
133 address |= (FR3 & ((1<<1)-1)) << (0+9+1+3+2+1+2+1+1);
134 address |= (theta & ((1<<5)-1)) << (0+9+1+3+2+1+2+1+1+1);
135 address |= (mode_inv & ((1<<4)-1)) << (0+9+1+3+2+1+2+1+1+1+5);
141 address |= (dPhi14 & ((1<<9)-1)) << (0);
142 address |= (sign14 & ((1<<1)-1)) << (0+9);
143 address |= (dTheta14 & ((1<<3)-1)) << (0+9+1);
144 address |= (CLCT1 & ((1<<2)-1)) << (0+9+1+3);
145 address |= (CLCT1Sign & ((1<<1)-1)) << (0+9+1+3+2);
146 address |= (CLCT4 & ((1<<2)-1)) << (0+9+1+3+2+1);
147 address |= (CLCT4Sign & ((1<<1)-1)) << (0+9+1+3+2+1+2);
148 address |= (FR1 & ((1<<1)-1)) << (0+9+1+3+2+1+2+1);
149 address |= (FR4 & ((1<<1)-1)) << (0+9+1+3+2+1+2+1+1);
150 address |= (theta & ((1<<5)-1)) << (0+9+1+3+2+1+2+1+1+1);
151 address |= (mode_inv & ((1<<4)-1)) << (0+9+1+3+2+1+2+1+1+1+5);
157 address |= (dPhi23 & ((1<<9)-1)) << (0);
158 address |= (sign23 & ((1<<1)-1)) << (0+9);
159 address |= (dTheta23 & ((1<<3)-1)) << (0+9+1);
160 address |= (CLCT2 & ((1<<2)-1)) << (0+9+1+3);
161 address |= (CLCT2Sign & ((1<<1)-1)) << (0+9+1+3+2);
162 address |= (CLCT3 & ((1<<2)-1)) << (0+9+1+3+2+1);
163 address |= (CLCT3Sign & ((1<<1)-1)) << (0+9+1+3+2+1+2);
164 address |= (FR2 & ((1<<1)-1)) << (0+9+1+3+2+1+2+1);
165 address |= (FR3 & ((1<<1)-1)) << (0+9+1+3+2+1+2+1+1);
166 address |= (theta & ((1<<5)-1)) << (0+9+1+3+2+1+2+1+1+1);
167 address |= (mode_inv & ((1<<4)-1)) << (0+9+1+3+2+1+2+1+1+1+5);
173 address |= (dPhi24 & ((1<<9)-1)) << (0);
174 address |= (sign24 & ((1<<1)-1)) << (0+9);
175 address |= (dTheta24 & ((1<<3)-1)) << (0+9+1);
176 address |= (CLCT2 & ((1<<2)-1)) << (0+9+1+3);
177 address |= (CLCT2Sign & ((1<<1)-1)) << (0+9+1+3+2);
178 address |= (CLCT4 & ((1<<2)-1)) << (0+9+1+3+2+1);
179 address |= (CLCT4Sign & ((1<<1)-1)) << (0+9+1+3+2+1+2);
180 address |= (FR2 & ((1<<1)-1)) << (0+9+1+3+2+1+2+1);
181 address |= (FR4 & ((1<<1)-1)) << (0+9+1+3+2+1+2+1+1);
182 address |= (theta & ((1<<5)-1)) << (0+9+1+3+2+1+2+1+1+1);
183 address |= (mode_inv & ((1<<4)-1)) << (0+9+1+3+2+1+2+1+1+1+5);
189 address |= (dPhi34 & ((1<<9)-1)) << (0);
190 address |= (sign34 & ((1<<1)-1)) << (0+9);
191 address |= (dTheta34 & ((1<<3)-1)) << (0+9+1);
192 address |= (CLCT3 & ((1<<2)-1)) << (0+9+1+3);
193 address |= (CLCT3Sign & ((1<<1)-1)) << (0+9+1+3+2);
194 address |= (CLCT4 & ((1<<2)-1)) << (0+9+1+3+2+1);
195 address |= (CLCT4Sign & ((1<<1)-1)) << (0+9+1+3+2+1+2);
196 address |= (FR3 & ((1<<1)-1)) << (0+9+1+3+2+1+2+1);
197 address |= (FR4 & ((1<<1)-1)) << (0+9+1+3+2+1+2+1+1);
198 address |= (theta & ((1<<5)-1)) << (0+9+1+3+2+1+2+1+1+1);
199 address |= (mode_inv & ((1<<4)-1)) << (0+9+1+3+2+1+2+1+1+1+5);
206 address |= (dPhi12 & ((1<<7)-1)) << (0);
207 address |= (dPhi23 & ((1<<5)-1)) << (0+7);
208 address |= (sign12 & ((1<<1)-1)) << (0+7+5);
209 address |= (sign23 & ((1<<1)-1)) << (0+7+5+1);
210 address |= (dTheta13 & ((1<<3)-1)) << (0+7+5+1+1);
211 address |= (CLCT1 & ((1<<2)-1)) << (0+7+5+1+1+3);
212 address |= (CLCT1Sign & ((1<<1)-1)) << (0+7+5+1+1+3+2);
213 address |= (FR1 & ((1<<1)-1)) << (0+7+5+1+1+3+2+1);
214 address |= (theta & ((1<<5)-1)) << (0+7+5+1+1+3+2+1+1);
215 address |= (mode_inv & ((1<<4)-1)) << (0+7+5+1+1+3+2+1+1+5);
222 address |= (dPhi12 & ((1<<7)-1)) << (0);
223 address |= (dPhi24 & ((1<<5)-1)) << (0+7);
224 address |= (sign12 & ((1<<1)-1)) << (0+7+5);
225 address |= (sign24 & ((1<<1)-1)) << (0+7+5+1);
226 address |= (dTheta14 & ((1<<3)-1)) << (0+7+5+1+1);
227 address |= (CLCT1 & ((1<<2)-1)) << (0+7+5+1+1+3);
228 address |= (CLCT1Sign & ((1<<1)-1)) << (0+7+5+1+1+3+2);
229 address |= (FR1 & ((1<<1)-1)) << (0+7+5+1+1+3+2+1);
230 address |= (theta & ((1<<5)-1)) << (0+7+5+1+1+3+2+1+1);
231 address |= (mode_inv & ((1<<4)-1)) << (0+7+5+1+1+3+2+1+1+5);
238 address |= (dPhi13 & ((1<<7)-1)) << (0);
239 address |= (dPhi34 & ((1<<5)-1)) << (0+7);
240 address |= (sign13 & ((1<<1)-1)) << (0+7+5);
241 address |= (sign34 & ((1<<1)-1)) << (0+7+5+1);
242 address |= (dTheta14 & ((1<<3)-1)) << (0+7+5+1+1);
243 address |= (CLCT1 & ((1<<2)-1)) << (0+7+5+1+1+3);
244 address |= (CLCT1Sign & ((1<<1)-1)) << (0+7+5+1+1+3+2);
245 address |= (FR1 & ((1<<1)-1)) << (0+7+5+1+1+3+2+1);
246 address |= (theta & ((1<<5)-1)) << (0+7+5+1+1+3+2+1+1);
247 address |= (mode_inv & ((1<<4)-1)) << (0+7+5+1+1+3+2+1+1+5);
254 address |= (dPhi23 & ((1<<7)-1)) << (0);
255 address |= (dPhi34 & ((1<<6)-1)) << (0+7);
256 address |= (sign23 & ((1<<1)-1)) << (0+7+6);
257 address |= (sign34 & ((1<<1)-1)) << (0+7+6+1);
258 address |= (dTheta24 & ((1<<3)-1)) << (0+7+6+1+1);
259 address |= (CLCT2 & ((1<<2)-1)) << (0+7+6+1+1+3);
260 address |= (CLCT2Sign & ((1<<1)-1)) << (0+7+6+1+1+3+2);
261 address |= (theta & ((1<<5)-1)) << (0+7+6+1+1+3+2+1);
262 address |= (mode_inv & ((1<<4)-1)) << (0+7+6+1+1+3+2+1+5);
277 address |= (dPhi12 & ((1<<7)-1)) << (0);
278 address |= (dPhi23 & ((1<<5)-1)) << (0+7);
279 address |= (dPhi34 & ((1<<6)-1)) << (0+7+5);
280 address |= (sign23 & ((1<<1)-1)) << (0+7+5+6);
281 address |= (sign34 & ((1<<1)-1)) << (0+7+5+6+1);
282 address |= (FR1 & ((1<<1)-1)) << (0+7+5+6+1+1);
283 address |= (theta & ((1<<5)-1)) << (0+7+5+6+1+1+1);
284 address |= (mode_inv & ((1<<4)-1)) << (0+7+5+6+1+1+1+5);
300 int mode_inv = (address >> (30-4)) & ((1<<4)-1);
302 auto contain = [](
const std::vector<int>& vec,
int elem) {
303 return (
std::find(vec.begin(), vec.end(),
elem) != vec.end());
352 dPhi12 = (address >> (0)) & ((1<<9)-1);
353 sign12 = (address >> (0+9)) & ((1<<1)-1);
354 dTheta12 = (address >> (0+9+1)) & ((1<<3)-1);
355 CLCT1 = (address >> (0+9+1+3)) & ((1<<2)-1);
356 CLCT1Sign = (address >> (0+9+1+3+2)) & ((1<<1)-1);
357 CLCT2 = (address >> (0+9+1+3+2+1)) & ((1<<2)-1);
358 CLCT2Sign = (address >> (0+9+1+3+2+1+2)) & ((1<<1)-1);
359 FR1 = (address >> (0+9+1+3+2+1+2+1)) & ((1<<1)-1);
360 FR2 = (address >> (0+9+1+3+2+1+2+1+1)) & ((1<<1)-1);
361 theta = (address >> (0+9+1+3+2+1+2+1+1+1)) & ((1<<5)-1);
365 dPhi13 = (address >> (0)) & ((1<<9)-1);
366 sign13 = (address >> (0+9)) & ((1<<1)-1);
367 dTheta13 = (address >> (0+9+1)) & ((1<<3)-1);
368 CLCT1 = (address >> (0+9+1+3)) & ((1<<2)-1);
369 CLCT1Sign = (address >> (0+9+1+3+2)) & ((1<<1)-1);
370 CLCT3 = (address >> (0+9+1+3+2+1)) & ((1<<2)-1);
371 CLCT3Sign = (address >> (0+9+1+3+2+1+2)) & ((1<<1)-1);
372 FR1 = (address >> (0+9+1+3+2+1+2+1)) & ((1<<1)-1);
373 FR3 = (address >> (0+9+1+3+2+1+2+1+1)) & ((1<<1)-1);
374 theta = (address >> (0+9+1+3+2+1+2+1+1+1)) & ((1<<5)-1);
378 dPhi14 = (address >> (0)) & ((1<<9)-1);
379 sign14 = (address >> (0+9)) & ((1<<1)-1);
380 dTheta14 = (address >> (0+9+1)) & ((1<<3)-1);
381 CLCT1 = (address >> (0+9+1+3)) & ((1<<2)-1);
382 CLCT1Sign = (address >> (0+9+1+3+2)) & ((1<<1)-1);
383 CLCT4 = (address >> (0+9+1+3+2+1)) & ((1<<2)-1);
384 CLCT4Sign = (address >> (0+9+1+3+2+1+2)) & ((1<<1)-1);
385 FR1 = (address >> (0+9+1+3+2+1+2+1)) & ((1<<1)-1);
386 FR4 = (address >> (0+9+1+3+2+1+2+1+1)) & ((1<<1)-1);
387 theta = (address >> (0+9+1+3+2+1+2+1+1+1)) & ((1<<5)-1);
391 dPhi23 = (address >> (0)) & ((1<<9)-1);
392 sign23 = (address >> (0+9)) & ((1<<1)-1);
393 dTheta23 = (address >> (0+9+1)) & ((1<<3)-1);
394 CLCT2 = (address >> (0+9+1+3)) & ((1<<2)-1);
395 CLCT2Sign = (address >> (0+9+1+3+2)) & ((1<<1)-1);
396 CLCT3 = (address >> (0+9+1+3+2+1)) & ((1<<2)-1);
397 CLCT3Sign = (address >> (0+9+1+3+2+1+2)) & ((1<<1)-1);
398 FR2 = (address >> (0+9+1+3+2+1+2+1)) & ((1<<1)-1);
399 FR3 = (address >> (0+9+1+3+2+1+2+1+1)) & ((1<<1)-1);
400 theta = (address >> (0+9+1+3+2+1+2+1+1+1)) & ((1<<5)-1);
404 dPhi24 = (address >> (0)) & ((1<<9)-1);
405 sign24 = (address >> (0+9)) & ((1<<1)-1);
406 dTheta24 = (address >> (0+9+1)) & ((1<<3)-1);
407 CLCT2 = (address >> (0+9+1+3)) & ((1<<2)-1);
408 CLCT2Sign = (address >> (0+9+1+3+2)) & ((1<<1)-1);
409 CLCT4 = (address >> (0+9+1+3+2+1)) & ((1<<2)-1);
410 CLCT4Sign = (address >> (0+9+1+3+2+1+2)) & ((1<<1)-1);
411 FR2 = (address >> (0+9+1+3+2+1+2+1)) & ((1<<1)-1);
412 FR4 = (address >> (0+9+1+3+2+1+2+1+1)) & ((1<<1)-1);
413 theta = (address >> (0+9+1+3+2+1+2+1+1+1)) & ((1<<5)-1);
417 dPhi34 = (address >> (0)) & ((1<<9)-1);
418 sign34 = (address >> (0+9)) & ((1<<1)-1);
419 dTheta34 = (address >> (0+9+1)) & ((1<<3)-1);
420 CLCT3 = (address >> (0+9+1+3)) & ((1<<2)-1);
421 CLCT3Sign = (address >> (0+9+1+3+2)) & ((1<<1)-1);
422 CLCT4 = (address >> (0+9+1+3+2+1)) & ((1<<2)-1);
423 CLCT4Sign = (address >> (0+9+1+3+2+1+2)) & ((1<<1)-1);
424 FR3 = (address >> (0+9+1+3+2+1+2+1)) & ((1<<1)-1);
425 FR4 = (address >> (0+9+1+3+2+1+2+1+1)) & ((1<<1)-1);
426 theta = (address >> (0+9+1+3+2+1+2+1+1+1)) & ((1<<5)-1);
430 dPhi12 = (address >> (0)) & ((1<<7)-1);
431 dPhi23 = (address >> (0+7)) & ((1<<5)-1);
432 sign12 = (address >> (0+7+5)) & ((1<<1)-1);
433 sign23 = (address >> (0+7+5+1)) & ((1<<1)-1);
434 dTheta13 = (address >> (0+7+5+1+1)) & ((1<<3)-1);
435 CLCT1 = (address >> (0+7+5+1+1+3)) & ((1<<2)-1);
436 CLCT1Sign = (address >> (0+7+5+1+1+3+2)) & ((1<<1)-1);
437 FR1 = (address >> (0+7+5+1+1+3+2+1)) & ((1<<1)-1);
438 theta = (address >> (0+7+5+1+1+3+2+1+1)) & ((1<<5)-1);
445 dPhi12 = (address >> (0)) & ((1<<7)-1);
446 dPhi24 = (address >> (0+7)) & ((1<<5)-1);
447 sign12 = (address >> (0+7+5)) & ((1<<1)-1);
448 sign24 = (address >> (0+7+5+1)) & ((1<<1)-1);
449 dTheta14 = (address >> (0+7+5+1+1)) & ((1<<3)-1);
450 CLCT1 = (address >> (0+7+5+1+1+3)) & ((1<<2)-1);
451 CLCT1Sign = (address >> (0+7+5+1+1+3+2)) & ((1<<1)-1);
452 FR1 = (address >> (0+7+5+1+1+3+2+1)) & ((1<<1)-1);
453 theta = (address >> (0+7+5+1+1+3+2+1+1)) & ((1<<5)-1);
460 dPhi13 = (address >> (0)) & ((1<<7)-1);
461 dPhi34 = (address >> (0+7)) & ((1<<5)-1);
462 sign13 = (address >> (0+7+5)) & ((1<<1)-1);
463 sign34 = (address >> (0+7+5+1)) & ((1<<1)-1);
464 dTheta14 = (address >> (0+7+5+1+1)) & ((1<<3)-1);
465 CLCT1 = (address >> (0+7+5+1+1+3)) & ((1<<2)-1);
466 CLCT1Sign = (address >> (0+7+5+1+1+3+2)) & ((1<<1)-1);
467 FR1 = (address >> (0+7+5+1+1+3+2+1)) & ((1<<1)-1);
468 theta = (address >> (0+7+5+1+1+3+2+1+1)) & ((1<<5)-1);
475 dPhi23 = (address >> (0)) & ((1<<7)-1);
476 dPhi34 = (address >> (0+7)) & ((1<<6)-1);
477 sign23 = (address >> (0+7+6)) & ((1<<1)-1);
478 sign34 = (address >> (0+7+6+1)) & ((1<<1)-1);
479 dTheta24 = (address >> (0+7+6+1+1)) & ((1<<3)-1);
480 CLCT2 = (address >> (0+7+6+1+1+3)) & ((1<<2)-1);
481 CLCT2Sign = (address >> (0+7+6+1+1+3+2)) & ((1<<1)-1);
482 theta = (address >> (0+7+6+1+1+3+2+1)) & ((1<<5)-1);
489 dPhi12 = (address >> (0)) & ((1<<7)-1);
490 dPhi23 = (address >> (0+7)) & ((1<<5)-1);
491 dPhi34 = (address >> (0+7+5)) & ((1<<6)-1);
492 sign23 = (address >> (0+7+5+6)) & ((1<<1)-1);
493 sign34 = (address >> (0+7+5+6+1)) & ((1<<1)-1);
494 FR1 = (address >> (0+7+5+6+1+1)) & ((1<<1)-1);
495 theta = (address >> (0+7+5+6+1+1+1)) & ((1<<5)-1);
507 auto get_signed_int = [](
int var,
int sign) {
508 return (
sign == 1) ? (var * 1) : (var * -1);
511 dPhi12 = get_signed_int(dPhi12, sign12);
512 dPhi13 = get_signed_int(dPhi13, sign13);
513 dPhi14 = get_signed_int(dPhi14, sign14);
514 dPhi23 = get_signed_int(dPhi23, sign23);
515 dPhi24 = get_signed_int(dPhi24, sign24);
516 dPhi34 = get_signed_int(dPhi34, sign34);
518 CLCT1 = get_signed_int(CLCT1, CLCT1Sign);
519 CLCT2 = get_signed_int(CLCT2, CLCT2Sign);
520 CLCT3 = get_signed_int(CLCT3, CLCT3Sign);
521 CLCT4 = get_signed_int(CLCT4, CLCT4Sign);
526 bool use_lossy_eta =
true;
529 etaInt &= ((1<<5)-1);
538 if (mode_inv == 15) {
539 bool st2_off =
false;
540 bool st3_off =
false;
541 bool st4_off =
false;
543 dPhi13 = dPhi12 + dPhi23;
544 dPhi14 = dPhi13 + dPhi34;
545 dPhi24 = dPhi23 + dPhi34;
547 int sum_st1 =
abs( dPhi12 + dPhi13 + dPhi14);
548 int sum_st2 =
abs(-dPhi12 + dPhi23 + dPhi24);
549 int sum_st3 =
abs(-dPhi13 - dPhi23 + dPhi34);
550 int sum_st4 =
abs(-dPhi14 - dPhi24 - dPhi34);
553 if (sum_st2 > sum_st1 && sum_st2 > sum_st3 && sum_st2 > sum_st4) st2_off =
true;
554 if (sum_st3 > sum_st1 && sum_st3 > sum_st2 && sum_st3 > sum_st4) st3_off =
true;
555 if (sum_st4 > sum_st1 && sum_st4 > sum_st2 && sum_st4 > sum_st3) st4_off =
true;
560 (
abs(dPhi12) > 9 ||
abs(dPhi23) > 9 ||
abs(dPhi24) > 9) &&
561 (
abs(dPhi13) < 10 &&
abs(dPhi14) < 10 &&
abs(dPhi34) < 10)
569 (
abs(dPhi13) > 9 ||
abs(dPhi23) > 9 ||
abs(dPhi34) > 9) &&
570 (
abs(dPhi12) < 10 &&
abs(dPhi14) < 10 &&
abs(dPhi24) < 10)
578 (
abs(dPhi14) > 9 ||
abs(dPhi24) > 9 ||
abs(dPhi34) > 9 ) &&
579 (
abs(dPhi12) < 10 &&
abs(dPhi13) < 10 &&
abs(dPhi23) < 10)
581 if (
abs(dPhi13) <
abs(dPhi23))
600 sign23 = (dPhi23 > 0) ? 1 : 0;
601 sign34 = (dPhi34 > 0) ? 1 : 0;
603 sign23 = (dPhi23 < 0) ? 1 : 0;
604 sign34 = (dPhi34 < 0) ? 1 : 0;
607 dPhi12 = get_signed_int(
abs(dPhi12), sign12);
608 dPhi23 = get_signed_int(
abs(dPhi23), sign23);
609 dPhi34 = get_signed_int(
abs(dPhi34), sign34);
616 if (mode_inv == 14) {
623 bugged_CLCT2 = (address >> (0+7+5+1+1+3)) & ((1<<2)-1);
624 bugged_address = address & ~(((1<<2)-1) << (0+7+6+1+1+3));
625 bugged_address |= (bugged_CLCT2 & ((1<<2)-1)) << (0+7+6+1+1+3);
626 bugged_CLCT2 = (bugged_address >> (0+7+5+1+1+3)) & ((1<<2)-1);
628 CLCT2 = bugged_CLCT2;
629 CLCT2 = get_signed_int(CLCT2, CLCT2Sign);
639 dPhi12, dPhi13, dPhi14, dPhi23, dPhi24, dPhi34, dTheta12, dTheta13, dTheta14, dTheta23, dTheta24, dTheta34,
640 CLCT1, CLCT2, CLCT3, CLCT4, CSCID1, CSCID2, CSCID3, CSCID4, FR1, FR2, FR3, FR4
643 std::vector<double> tree_data;
644 tree_data.push_back(1.0);
645 tree_data.push_back(eta);
647 for (
int i=0;
i<6;
i++) {
648 int mv = mode_variables[mode_inv-3][
i];
650 int v = variables.at(mv);
651 if (!(mode_inv == 13 &&
i == 3)) {
655 tree_data.push_back(v);
660 std::cout <<
"mode_inv: " << mode_inv <<
" variables: ";
661 for (
const auto&
v: tree_data)
666 auto tree_event = std::make_unique<emtf::Event>();
667 tree_event->predictedValue = 0;
668 tree_event->data = tree_data;
674 float tmp_pt = tree_event->predictedValue;
677 std::cout <<
"mode_inv: " << mode_inv <<
" 1/pT: " << tmp_pt << std::endl;
678 std::cout <<
"dPhi12: " << dPhi12 <<
" dPhi13: " << dPhi13 <<
" dPhi14: " << dPhi14
679 <<
" dPhi23: " << dPhi23 <<
" dPhi24: " << dPhi24 <<
" dPhi34: " << dPhi34 << std::endl;
680 std::cout <<
"dTheta12: " << dTheta12 <<
" dTheta13: " << dTheta13 <<
" dTheta14: " << dTheta14
681 <<
" dTheta23: " << dTheta23 <<
" dTheta24: " << dTheta24 <<
" dTheta34: " << dTheta34 << std::endl;
682 std::cout <<
"CLCT1: " << CLCT1 <<
" CLCT2: " << CLCT2 <<
" CLCT3: " << CLCT3 <<
" CLCT4: " << CLCT4 << std::endl;
683 std::cout <<
"CSCID1: " << CSCID1 <<
" CSCID2: " << CSCID2 <<
" CSCID3: " << CSCID3 <<
" CSCID4: " << CSCID4 << std::endl;
684 std::cout <<
"FR1: " << FR1 <<
" FR2: " << FR2 <<
" FR3: " << FR3 <<
" FR4: " << FR4 << std::endl;
688 pt = (tmp_pt == 0) ? tmp_pt : 1.0/tmp_pt;
689 if (pt<0.0) pt = 1.0;
690 if (pt>200.0) pt = 200.0;
693 if (tmp_pt < 0.0) tmp_pt = 1.0/7000;
694 pt = (tmp_pt == 0) ? tmp_pt : 1.0/tmp_pt;
float scale_pt(const float pt, const int mode=15) const override
void predictEvent(Event *e, unsigned int trees)
address_t calculate_address(const EMTFTrack &track) const override
int getdPhiFromBin(int dPhiBin, int bits, int max=512) const
static PFTauRenderPlugin instance
Geom::Theta< T > theta() const
int getNLBdPhiBin(int dPhi, int bits, int max=512) const
int getEtaInt(float eta, int bits=5) const
float getEtaFromEtaInt(int etaInt, int bits=5) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const PtAssignmentEngineAux2016 & aux() const
int getCLCT(int clct) const
Abs< T >::type abs(const T &t)
const int(* getModeVariables() const)[6]
def elem(elemtype, innerHTML='', html_class='', kwargs)
std::array< emtf::Forest, 16 > forests_
float getEtaFromThetaInt(int thetaInt, int bits=5) const
float calculate_pt_xml(const address_t &address) const override
int getdTheta(int dTheta) const
float unscale_pt(const float pt, const int mode=15) const override
int getFRLUT(int sector, int station, int chamber) const
std::vector< int > allowedModes_