52 const int CSCTFPtLUT::dPhiNLBMap_5bit[32] = {0, 1, 2, 4, 5, 7, 9, 11, 13, 15, 18, 21, 24, 28, 32, 37,
53 41, 47, 53, 60, 67, 75, 84, 94, 105, 117, 131, 145, 162, 180, 200, 222};
58 0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 14, 15, 16, 17, 19, 20, 21, 23, 24, 26,
59 27, 29, 30, 32, 33, 35, 37, 38, 40, 42, 44, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65,
60 67, 70, 72, 74, 77, 79, 81, 84, 86, 89, 92, 94, 97, 100, 103, 105, 108, 111, 114, 117, 121, 124,
61 127, 130, 134, 137, 141, 144, 148, 151, 155, 159, 163, 167, 171, 175, 179, 183, 188, 192, 197, 201, 206, 210,
62 215, 220, 225, 230, 235, 241, 246, 251, 257, 263, 268, 274, 280, 286, 292, 299, 305, 312, 318, 325, 332, 339,
63 346, 353, 361, 368, 376, 383, 391, 399, 408, 416, 425, 433, 442, 451, 460, 469, 479, 489};
68 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22,
69 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 46, 48,
70 49, 50, 51, 53, 54, 55, 56, 58, 59, 60, 61, 63, 64, 65, 67, 68, 69, 70, 72, 73, 74, 76,
71 77, 79, 80, 81, 83, 84, 85, 87, 88, 90, 91, 92, 94, 95, 97, 98, 100, 101, 103, 104, 105, 107,
72 108, 110, 111, 113, 115, 116, 118, 119, 121, 122, 124, 125, 127, 129, 130, 132, 133, 135, 137, 138, 140, 141,
73 143, 145, 146, 148, 150, 151, 153, 155, 157, 158, 160, 162, 163, 165, 167, 169, 171, 172, 174, 176, 178, 180,
74 181, 183, 185, 187, 189, 191, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222,
75 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 249, 251, 253, 255, 257, 259, 261, 264, 266, 268,
76 270, 273, 275, 277, 279, 282, 284, 286, 289, 291, 293, 296, 298, 300, 303, 305, 307, 310, 312, 315, 317, 320,
77 322, 324, 327, 329, 332, 334, 337, 340, 342, 345, 347, 350, 352, 355, 358, 360, 363, 366, 368, 371, 374, 376,
78 379, 382, 385, 387, 390, 393, 396, 398, 401, 404, 407, 410, 413, 416, 419, 421, 424, 427, 430, 433, 436, 439,
79 442, 445, 448, 451, 454, 457, 461, 464, 467, 470, 473, 476, 479, 483};
86 const int CSCTFPtLUT::dEtaCut_Low[24] = {2, 2, 2, 7, 2, 1, 2, 7, 3, 3, 3, 7, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1};
87 const int CSCTFPtLUT::dEtaCut_Mid[24] = {2, 2, 3, 7, 2, 2, 3, 7, 4, 4, 4, 7, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2};
88 const int CSCTFPtLUT::dEtaCut_High_A[24] = {3, 3, 4, 7, 3, 2, 4, 7, 5, 5, 5, 7, 2, 2, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2};
89 const int CSCTFPtLUT::dEtaCut_High_B[24] = {3, 3, 4, 7, 3, 3, 5, 7, 6, 6, 6, 7, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2};
90 const int CSCTFPtLUT::dEtaCut_High_C[24] = {4, 4, 5, 7, 4, 3, 6, 7, 7, 7, 7, 7, 3, 3, 3, 3, 4, 4, 4, 4, 3, 3, 3, 3};
91 const int CSCTFPtLUT::dEtaCut_Open[24] = {7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7};
107 memcpy((
void*)
pt_lut, (
void*)myConfigPt_->
lut(), (1 << 21) *
sizeof(
ptdat));
169 pt_method =
pset.getUntrackedParameter<
unsigned>(
"PtMethod", 32);
199 const unsigned& delta_phi_23,
200 const unsigned& track_eta,
201 const unsigned& track_mode,
202 const unsigned& track_fr,
203 const unsigned& delta_phi_sign)
const {
205 address.delta_phi_12 = delta_phi_12;
206 address.delta_phi_23 = delta_phi_23;
207 address.track_eta = track_eta;
208 address.track_mode = track_mode;
209 address.track_fr = track_fr;
210 address.delta_phi_sign = delta_phi_sign;
216 const unsigned& track_eta,
217 const unsigned& track_mode,
218 const unsigned& track_fr,
219 const unsigned& delta_phi_sign)
const {
221 address.delta_phi_12 = ((1 << 8) - 1) & delta_phi_12;
222 address.delta_phi_23 = ((1 << 4) - 1) & (delta_phi_12 >> 8);
223 address.track_eta = track_eta;
224 address.track_mode = track_mode;
225 address.track_fr = track_fr;
226 address.delta_phi_sign = delta_phi_sign;
234 double Pi = acos(-1.);
235 float etaR = 0, ptR_front = 0, ptR_rear = 0, dphi12R = 0, dphi23R = 0;
236 int charge12, charge23;
239 mode = address.track_mode;
241 int usedetaCUT =
true;
245 int EtaCutLevel_1 = 2;
248 for (
int i = 0;
i < 24;
i++) {
250 if (EtaCutLevel_1 == 1)
252 else if (EtaCutLevel_1 == 2)
254 else if (EtaCutLevel_1 == 3)
256 else if (EtaCutLevel_1 == 4)
258 else if (EtaCutLevel_1 == 5)
260 else if (EtaCutLevel_1 == 6)
264 int EtaCutLevel_2 = 2;
267 for (
int i = 0;
i < 24;
i++) {
269 if (EtaCutLevel_2 == 1)
271 else if (EtaCutLevel_2 == 2)
273 else if (EtaCutLevel_2 == 3)
275 else if (EtaCutLevel_2 == 4)
277 else if (EtaCutLevel_2 == 5)
279 else if (EtaCutLevel_2 == 6)
284 dEtaCut_2[
i] = scalef * dEtaCut_2[
i];
287 eta = address.track_eta;
289 fr = address.track_fr;
290 charge = address.delta_phi_sign;
292 unsigned front_pt, rear_pt;
295 unsigned front_quality, rear_quality;
299 front_quality = rear_quality =
quality;
301 unsigned int remerged;
307 float bestLH_front = -999.0;
308 float bestLH_rear = -999.0;
333 remerged = (address.delta_phi_12 | (address.delta_phi_23 << 8));
336 absPhi12 = ((1 << 7) - 1) & remerged;
337 absPhi23 = ((1 << 5) - 1) & (remerged >> 7);
350 if (charge12 * charge23 < 0)
354 bestLH_front = bestLH;
356 bestLH_rear = bestLH;
361 float dphi12Rmin = dphi12R -
Pi * 10 / 180 / 3;
362 float dphi12Rmax = dphi12R +
Pi * 10 / 180 / 3;
363 float dphi23Rmin = dphi23R;
364 float dphi23Rmax = dphi23R;
367 float ptR_front_min =
369 float bestLH_front_min = bestLH;
372 float bestLH_rear_min = bestLH;
373 float ptR_front_max =
375 float bestLH_front_max = bestLH;
378 float bestLH_rear_max = bestLH;
381 float best_pt_front = ptR_front;
382 float best_LH_front = bestLH_front;
383 if (bestLH_front_min > best_LH_front) {
384 best_pt_front = ptR_front_min;
385 best_LH_front = bestLH_front_min;
387 if (bestLH_front_max > best_LH_front) {
388 best_pt_front = ptR_front_max;
389 best_LH_front = bestLH_front_max;
391 ptR_front = best_pt_front;
393 float best_pt_rear = ptR_rear;
394 float best_LH_rear = bestLH_rear;
395 if (bestLH_rear_min > best_LH_rear) {
396 best_pt_rear = ptR_rear_min;
397 best_LH_rear = bestLH_rear_min;
399 if (bestLH_rear_max > best_LH_rear) {
400 best_pt_rear = ptR_rear_max;
401 best_LH_rear = bestLH_rear_max;
403 ptR_rear = best_pt_rear;
406 ptR_front =
std::max(ptR_front, ptR_front_min);
407 ptR_front =
std::max(ptR_front, ptR_front_max);
408 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
409 ptR_rear =
std::max(ptR_rear, ptR_rear_max);
418 remerged = (address.delta_phi_12 | (address.delta_phi_23 << 8));
420 absPhi12 = ((1 << 8) - 1) & remerged;
422 dEta = ((1 << 3) - 1) & (remerged >> 8);
424 CLCT_pattern = 0x1 & (remerged >> 11);
427 if (iME11 == 1 && etaR > 1.6)
429 if (iME11 == 0 && etaR < 1.6)
433 absPhi12 = ((1 << 8) - 1) & address.delta_phi_12;
444 bestLH_front = bestLH;
446 bestLH_rear = bestLH;
450 float dphi12Rmin = fabs(fabs(dphi12R) -
Pi * 10 / 180 / 3);
452 float bestLH_front_min = bestLH;
454 float bestLH_rear_min = bestLH;
457 ptR_front = bestLH_front > bestLH_front_min ? ptR_front : ptR_front_min;
458 ptR_rear = bestLH_rear > bestLH_rear_min ? ptR_rear : ptR_rear_min;
461 ptR_front =
std::max(ptR_front, ptR_front_min);
462 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
466 if ((!CLCT_pattern) && (ptR_front > 5.))
468 if ((!CLCT_pattern) && (ptR_rear > 5.))
481 if (fabs(etaR) > 1.2 && fabs(etaR) <= 1.5)
488 if (fabs(etaR) > 1.5 && fabs(etaR) <= 1.65)
496 if (fabs(etaR) > 1.65 && fabs(etaR) <= 2.1)
503 if (fabs(etaR) > 2.1)
519 remerged = (address.delta_phi_12 | (address.delta_phi_23 << 8));
521 absPhi12 = ((1 << 9) - 1) & remerged;
523 dEta = ((1 << 3) - 1) & (remerged >> 9);
540 if (fabs(etaR) > 1.2 && fabs(etaR) <= 1.5)
547 if (fabs(etaR) > 1.5 && fabs(etaR) <= 1.65)
555 if (fabs(etaR) > 1.65 && fabs(etaR) <= 2.1)
562 if (fabs(etaR) > 2.1)
584 absPhi12 = address.delta_phi_12;
585 absPhi23 = address.delta_phi_23;
593 dphi23R =
float(absPhi23);
594 if (charge12 * charge23 < 0)
599 if (fr == 1 && mode1 == 11)
635 absPhi12 = address.delta_phi_12;
636 absPhi23 = address.delta_phi_23;
645 if (charge12 * charge23 < 0)
654 float dphi12Rmin = dphi12R -
Pi * 10 / 180 / 3;
655 float dphi12Rmax = dphi12R +
Pi * 10 / 180 / 3;
656 float dphi23Rmin = dphi23R;
657 float dphi23Rmax = dphi23R;
665 ptR_front =
std::max(ptR_front, ptR_front_min);
666 ptR_front =
std::max(ptR_front, ptR_front_max);
667 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
668 ptR_rear =
std::max(ptR_rear, ptR_rear_max);
676 if (iME11 == 1 && etaR > 1.6)
678 if (iME11 == 0 && etaR < 1.6)
680 absPhi12 = address.delta_phi_12;
683 CLCT_pattern =
int(address.delta_phi_23);
691 float dphi12Rmin = fabs(fabs(dphi12R) -
Pi * 10 / 180 / 3);
695 ptR_front =
std::max(ptR_front, ptR_front_min);
696 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
698 if (((CLCT_pattern < 8) || (CLCT_pattern > 10)) && (ptR_front > 5.))
700 if (((CLCT_pattern < 8) || (CLCT_pattern > 10)) && (ptR_rear > 5.))
709 absPhi12 = address.delta_phi();
711 int temp_phi = address.delta_phi();
712 absPhi12 = static_cast<unsigned>(-temp_phi) & 0xfff;
732 absPhi12 = address.delta_phi_12;
733 absPhi23 = address.delta_phi_23;
741 dphi23R =
float(absPhi23);
742 if (charge12 * charge23 < 0)
747 if (fr == 1 && mode1 == 11)
783 absPhi12 = address.delta_phi_12;
784 absPhi23 = address.delta_phi_23;
793 if (charge12 * charge23 < 0)
801 float dphi12Rmin = dphi12R -
Pi * 10 / 180 / 3;
802 float dphi12Rmax = dphi12R +
Pi * 10 / 180 / 3;
803 float dphi23Rmin = dphi23R;
804 float dphi23Rmax = dphi23R;
812 ptR_front =
std::max(ptR_front, ptR_front_min);
813 ptR_front =
std::max(ptR_front, ptR_front_max);
814 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
815 ptR_rear =
std::max(ptR_rear, ptR_rear_max);
823 absPhi12 = address.delta_phi_12;
826 CLCT_pattern =
int(address.delta_phi_23);
835 float dphi12Rmin = fabs(fabs(dphi12R) -
Pi * 10 / 180 / 3);
839 ptR_front =
std::max(ptR_front, ptR_front_min);
840 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
842 if (((CLCT_pattern < 8) || (CLCT_pattern > 10)) && (ptR_front > 5.))
844 if (((CLCT_pattern < 8) || (CLCT_pattern > 10)) && (ptR_rear > 5.))
852 absPhi12 = address.delta_phi();
854 int temp_phi = address.delta_phi();
855 absPhi12 = static_cast<unsigned>(-temp_phi) & 0xfff;
874 absPhi12 = address.delta_phi_12;
875 absPhi23 = address.delta_phi_23;
883 dphi23R =
float(absPhi23);
884 if (charge12 * charge23 < 0)
889 if (fr == 1 && mode1 == 11)
925 absPhi12 = address.delta_phi_12;
926 absPhi23 = address.delta_phi_23;
935 if (charge12 * charge23 < 0)
943 float dphi12Rmin = dphi12R -
Pi * 10 / 180 / 3;
944 float dphi12Rmax = dphi12R +
Pi * 10 / 180 / 3;
945 float dphi23Rmin = dphi23R;
946 float dphi23Rmax = dphi23R;
947 if (dphi12Rmin * dphi12R < 0)
948 dphi23Rmin = -dphi23R;
949 if (dphi12Rmax * dphi12R < 0)
950 dphi23Rmax = -dphi23R;
956 ptR_front =
std::max(ptR_front, ptR_front_min);
957 ptR_front =
std::max(ptR_front, ptR_front_max);
958 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
959 ptR_rear =
std::max(ptR_rear, ptR_rear_max);
971 absPhi12 = address.delta_phi();
973 int temp_phi = address.delta_phi();
974 absPhi12 = static_cast<unsigned>(-temp_phi) & 0xfff;
984 float dphi12Rmin = fabs(fabs(dphi12R) -
Pi * 10 / 180 / 3);
988 ptR_front =
std::max(ptR_front, ptR_front_min);
989 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
999 absPhi12 = address.delta_phi();
1001 int temp_phi = address.delta_phi();
1002 absPhi12 = static_cast<unsigned>(-temp_phi) & 0xfff;
1010 absPhi12 = address.delta_phi_12;
1011 absPhi23 = address.delta_phi_23;
1020 if (charge12 * charge23 < 0)
1027 float dphi12Rmin = dphi12R -
Pi * 10 / 180 / 3;
1028 float dphi12Rmax = dphi12R +
Pi * 10 / 180 / 3;
1029 float dphi23Rmin = dphi23R;
1030 float dphi23Rmax = dphi23R;
1031 if (dphi12Rmin * dphi12R < 0)
1032 dphi23Rmin = -dphi23R;
1033 if (dphi12Rmax * dphi12R < 0)
1034 dphi23Rmax = -dphi23R;
1038 ptR_front =
std::max(ptR_front, ptR_front_min);
1039 ptR_front =
std::max(ptR_front, ptR_front_max);
1077 absPhi12 = address.delta_phi_12;
1078 absPhi23 = address.delta_phi_23;
1091 if (charge12 * charge23 < 0)
1099 float dphi12Rmin = dphi12R -
Pi * 10 / 180 / 3;
1100 float dphi12Rmax = dphi12R +
Pi * 10 / 180 / 3;
1101 float dphi23Rmin = dphi23R;
1102 float dphi23Rmax = dphi23R;
1103 if (dphi12Rmin * dphi12R < 0)
1104 dphi23Rmin = -dphi23R;
1105 if (dphi12Rmax * dphi12R < 0)
1106 dphi23Rmax = -dphi23R;
1112 ptR_front =
std::max(ptR_front, ptR_front_min);
1113 ptR_front =
std::max(ptR_front, ptR_front_max);
1114 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
1115 ptR_rear =
std::max(ptR_rear, ptR_rear_max);
1121 if (charge12 * charge23 < 0)
1131 type + 3, etaR, absPhi12 << 1, ((
charge == 0) ? -(absPhi23 << 4) : (absPhi23 << 4)), 1);
1133 type + 3, etaR, absPhi12 << 1, ((
charge == 0) ? -(absPhi23 << 4) : (absPhi23 << 4)), 0);
1143 type + 3, etaR, absPhi12 << 1, ((
charge == 0) ? -(absPhi23 << 4) : (absPhi23 << 4)), 1);
1145 type + 3, etaR, absPhi12 << 1, ((
charge == 0) ? -(absPhi23 << 4) : (absPhi23 << 4)), 0);
1160 absPhi12 = address.delta_phi();
1162 int temp_phi = address.delta_phi();
1163 absPhi12 = static_cast<unsigned>(-temp_phi) & 0xfff;
1166 if (absPhi12 < (1 << 9)) {
1193 float dphi12Rmin = fabs(fabs(dphi12R) -
Pi * 10 / 180 / 3);
1197 ptR_front =
std::max(ptR_front, ptR_front_min);
1198 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
1208 absPhi12 = address.delta_phi();
1210 int temp_phi = address.delta_phi();
1211 absPhi12 = static_cast<unsigned>(-temp_phi) & 0xfff;
1213 if (absPhi12 < (1 << 9)) {
1228 if (fabs(dphi12R) < 0.01 && (ptR_rear < 10 || ptR_front < 10))
1229 std::cout <<
"dphi12R = " << dphi12R <<
" ptR_rear = " << ptR_rear <<
" ptR_front = " << ptR_front
1230 <<
" etaR = " << etaR <<
" mode = " <<
mode << std::endl;
1237 absPhi12 = address.delta_phi();
1239 int temp_phi = address.delta_phi();
1240 absPhi12 = static_cast<unsigned>(-temp_phi) & 0xfff;
1242 if (absPhi12 < (1 << 9)) {
1259 float dphi12Rmin = fabs(fabs(dphi12R) -
Pi * 10 / 180 / 3);
1263 ptR_front =
std::max(ptR_front, ptR_front_min);
1264 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
1328 result.front_rank = front_pt | front_quality << 5;
1329 result.rear_rank = rear_pt | rear_quality << 5;
1331 result.charge_valid_front = 1;
1332 result.charge_valid_rear = 1;
1350 edm::LogError(
"CSCTFPtLUT::trackQuality()") <<
"Eta or Mode out of range in AU quality assignment";
1466 std::ifstream PtLUT;
1471 int length = PtLUT.tellg();
1474 PtLUT.seekg(0, std::ios::beg);
1475 PtLUT.read(reinterpret_cast<char*>(
pt_lut), length);
1483 unsigned short temp = 0;