44 const int CSCTFPtLUT::dPhiNLBMap_5bit[32] = {0, 1, 2, 4, 5, 7, 9, 11, 13, 15, 18, 21, 24, 28, 32, 37,
45 41, 47, 53, 60, 67, 75, 84, 94, 105, 117, 131, 145, 162, 180, 200, 222};
50 0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 14, 15, 16, 17, 19, 20, 21, 23, 24, 26,
51 27, 29, 30, 32, 33, 35, 37, 38, 40, 42, 44, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65,
52 67, 70, 72, 74, 77, 79, 81, 84, 86, 89, 92, 94, 97, 100, 103, 105, 108, 111, 114, 117, 121, 124,
53 127, 130, 134, 137, 141, 144, 148, 151, 155, 159, 163, 167, 171, 175, 179, 183, 188, 192, 197, 201, 206, 210,
54 215, 220, 225, 230, 235, 241, 246, 251, 257, 263, 268, 274, 280, 286, 292, 299, 305, 312, 318, 325, 332, 339,
55 346, 353, 361, 368, 376, 383, 391, 399, 408, 416, 425, 433, 442, 451, 460, 469, 479, 489};
60 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22,
61 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 46, 48,
62 49, 50, 51, 53, 54, 55, 56, 58, 59, 60, 61, 63, 64, 65, 67, 68, 69, 70, 72, 73, 74, 76,
63 77, 79, 80, 81, 83, 84, 85, 87, 88, 90, 91, 92, 94, 95, 97, 98, 100, 101, 103, 104, 105, 107,
64 108, 110, 111, 113, 115, 116, 118, 119, 121, 122, 124, 125, 127, 129, 130, 132, 133, 135, 137, 138, 140, 141,
65 143, 145, 146, 148, 150, 151, 153, 155, 157, 158, 160, 162, 163, 165, 167, 169, 171, 172, 174, 176, 178, 180,
66 181, 183, 185, 187, 189, 191, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222,
67 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 249, 251, 253, 255, 257, 259, 261, 264, 266, 268,
68 270, 273, 275, 277, 279, 282, 284, 286, 289, 291, 293, 296, 298, 300, 303, 305, 307, 310, 312, 315, 317, 320,
69 322, 324, 327, 329, 332, 334, 337, 340, 342, 345, 347, 350, 352, 355, 358, 360, 363, 366, 368, 371, 374, 376,
70 379, 382, 385, 387, 390, 393, 396, 398, 401, 404, 407, 410, 413, 416, 419, 421, 424, 427, 430, 433, 436, 439,
71 442, 445, 448, 451, 454, 457, 461, 464, 467, 470, 473, 476, 479, 483};
78 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};
79 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};
80 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};
81 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};
82 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};
83 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));
164 pt_method =
pset.getUntrackedParameter<
unsigned>(
"PtMethod", 32);
194 const unsigned& delta_phi_23,
195 const unsigned& track_eta,
196 const unsigned& track_mode,
197 const unsigned& track_fr,
198 const unsigned& delta_phi_sign)
const {
200 address.delta_phi_12 = delta_phi_12;
201 address.delta_phi_23 = delta_phi_23;
202 address.track_eta = track_eta;
203 address.track_mode = track_mode;
204 address.track_fr = track_fr;
205 address.delta_phi_sign = delta_phi_sign;
211 const unsigned& track_eta,
212 const unsigned& track_mode,
213 const unsigned& track_fr,
214 const unsigned& delta_phi_sign)
const {
216 address.delta_phi_12 = ((1 << 8) - 1) & delta_phi_12;
217 address.delta_phi_23 = ((1 << 4) - 1) & (delta_phi_12 >> 8);
218 address.track_eta = track_eta;
219 address.track_mode = track_mode;
220 address.track_fr = track_fr;
221 address.delta_phi_sign = delta_phi_sign;
229 double Pi = acos(-1.);
230 float etaR = 0, ptR_front = 0, ptR_rear = 0, dphi12R = 0, dphi23R = 0;
231 int charge12, charge23;
234 mode = address.track_mode;
236 int usedetaCUT =
true;
240 int EtaCutLevel_1 = 2;
243 for (
int i = 0;
i < 24;
i++) {
245 if (EtaCutLevel_1 == 1)
247 else if (EtaCutLevel_1 == 2)
249 else if (EtaCutLevel_1 == 3)
251 else if (EtaCutLevel_1 == 4)
253 else if (EtaCutLevel_1 == 5)
255 else if (EtaCutLevel_1 == 6)
259 int EtaCutLevel_2 = 2;
262 for (
int i = 0;
i < 24;
i++) {
264 if (EtaCutLevel_2 == 1)
266 else if (EtaCutLevel_2 == 2)
268 else if (EtaCutLevel_2 == 3)
270 else if (EtaCutLevel_2 == 4)
272 else if (EtaCutLevel_2 == 5)
274 else if (EtaCutLevel_2 == 6)
279 dEtaCut_2[
i] = scalef * dEtaCut_2[
i];
282 eta = address.track_eta;
284 fr = address.track_fr;
285 charge = address.delta_phi_sign;
287 unsigned front_pt, rear_pt;
290 unsigned front_quality, rear_quality;
294 front_quality = rear_quality =
quality;
296 unsigned int remerged;
302 float bestLH_front = -999.0;
303 float bestLH_rear = -999.0;
328 remerged = (address.delta_phi_12 | (address.delta_phi_23 << 8));
331 absPhi12 = ((1 << 7) - 1) & remerged;
332 absPhi23 = ((1 << 5) - 1) & (remerged >> 7);
345 if (charge12 * charge23 < 0)
349 bestLH_front = bestLH;
351 bestLH_rear = bestLH;
356 float dphi12Rmin = dphi12R -
Pi * 10 / 180 / 3;
357 float dphi12Rmax = dphi12R +
Pi * 10 / 180 / 3;
358 float dphi23Rmin = dphi23R;
359 float dphi23Rmax = dphi23R;
362 float ptR_front_min =
364 float bestLH_front_min = bestLH;
367 float bestLH_rear_min = bestLH;
368 float ptR_front_max =
370 float bestLH_front_max = bestLH;
373 float bestLH_rear_max = bestLH;
376 float best_pt_front = ptR_front;
377 float best_LH_front = bestLH_front;
378 if (bestLH_front_min > best_LH_front) {
379 best_pt_front = ptR_front_min;
380 best_LH_front = bestLH_front_min;
382 if (bestLH_front_max > best_LH_front) {
383 best_pt_front = ptR_front_max;
385 ptR_front = best_pt_front;
387 float best_pt_rear = ptR_rear;
388 float best_LH_rear = bestLH_rear;
389 if (bestLH_rear_min > best_LH_rear) {
390 best_pt_rear = ptR_rear_min;
391 best_LH_rear = bestLH_rear_min;
393 if (bestLH_rear_max > best_LH_rear) {
394 best_pt_rear = ptR_rear_max;
396 ptR_rear = best_pt_rear;
399 ptR_front =
std::max(ptR_front, ptR_front_min);
400 ptR_front =
std::max(ptR_front, ptR_front_max);
401 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
402 ptR_rear =
std::max(ptR_rear, ptR_rear_max);
411 remerged = (address.delta_phi_12 | (address.delta_phi_23 << 8));
413 absPhi12 = ((1 << 8) - 1) & remerged;
415 dEta = ((1 << 3) - 1) & (remerged >> 8);
417 CLCT_pattern = 0x1 & (remerged >> 11);
420 if (iME11 == 1 && etaR > 1.6)
422 if (iME11 == 0 && etaR < 1.6)
426 absPhi12 = ((1 << 8) - 1) & address.delta_phi_12;
437 bestLH_front = bestLH;
439 bestLH_rear = bestLH;
443 float dphi12Rmin = fabs(fabs(dphi12R) -
Pi * 10 / 180 / 3);
445 float bestLH_front_min = bestLH;
447 float bestLH_rear_min = bestLH;
450 ptR_front = bestLH_front > bestLH_front_min ? ptR_front : ptR_front_min;
451 ptR_rear = bestLH_rear > bestLH_rear_min ? ptR_rear : ptR_rear_min;
454 ptR_front =
std::max(ptR_front, ptR_front_min);
455 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
459 if ((!CLCT_pattern) && (ptR_front > 5.))
461 if ((!CLCT_pattern) && (ptR_rear > 5.))
474 if (fabs(etaR) > 1.2 && fabs(etaR) <= 1.5)
481 if (fabs(etaR) > 1.5 && fabs(etaR) <= 1.65)
489 if (fabs(etaR) > 1.65 && fabs(etaR) <= 2.1)
496 if (fabs(etaR) > 2.1)
512 remerged = (address.delta_phi_12 | (address.delta_phi_23 << 8));
514 absPhi12 = ((1 << 9) - 1) & remerged;
516 dEta = ((1 << 3) - 1) & (remerged >> 9);
533 if (fabs(etaR) > 1.2 && fabs(etaR) <= 1.5)
540 if (fabs(etaR) > 1.5 && fabs(etaR) <= 1.65)
548 if (fabs(etaR) > 1.65 && fabs(etaR) <= 2.1)
555 if (fabs(etaR) > 2.1)
577 absPhi12 = address.delta_phi_12;
578 absPhi23 = address.delta_phi_23;
586 dphi23R =
float(absPhi23);
587 if (charge12 * charge23 < 0)
592 if (fr == 1 && mode1 == 11)
628 absPhi12 = address.delta_phi_12;
629 absPhi23 = address.delta_phi_23;
638 if (charge12 * charge23 < 0)
647 float dphi12Rmin = dphi12R -
Pi * 10 / 180 / 3;
648 float dphi12Rmax = dphi12R +
Pi * 10 / 180 / 3;
649 float dphi23Rmin = dphi23R;
650 float dphi23Rmax = dphi23R;
658 ptR_front =
std::max(ptR_front, ptR_front_min);
659 ptR_front =
std::max(ptR_front, ptR_front_max);
660 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
661 ptR_rear =
std::max(ptR_rear, ptR_rear_max);
669 if (iME11 == 1 && etaR > 1.6)
671 if (iME11 == 0 && etaR < 1.6)
673 absPhi12 = address.delta_phi_12;
676 CLCT_pattern =
int(address.delta_phi_23);
684 float dphi12Rmin = fabs(fabs(dphi12R) -
Pi * 10 / 180 / 3);
688 ptR_front =
std::max(ptR_front, ptR_front_min);
689 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
691 if (((CLCT_pattern < 8) || (CLCT_pattern > 10)) && (ptR_front > 5.))
693 if (((CLCT_pattern < 8) || (CLCT_pattern > 10)) && (ptR_rear > 5.))
702 absPhi12 = address.delta_phi();
704 int temp_phi = address.delta_phi();
705 absPhi12 =
static_cast<unsigned>(-temp_phi) & 0xfff;
725 absPhi12 = address.delta_phi_12;
726 absPhi23 = address.delta_phi_23;
734 dphi23R =
float(absPhi23);
735 if (charge12 * charge23 < 0)
740 if (fr == 1 && mode1 == 11)
776 absPhi12 = address.delta_phi_12;
777 absPhi23 = address.delta_phi_23;
786 if (charge12 * charge23 < 0)
794 float dphi12Rmin = dphi12R -
Pi * 10 / 180 / 3;
795 float dphi12Rmax = dphi12R +
Pi * 10 / 180 / 3;
796 float dphi23Rmin = dphi23R;
797 float dphi23Rmax = dphi23R;
805 ptR_front =
std::max(ptR_front, ptR_front_min);
806 ptR_front =
std::max(ptR_front, ptR_front_max);
807 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
808 ptR_rear =
std::max(ptR_rear, ptR_rear_max);
816 absPhi12 = address.delta_phi_12;
819 CLCT_pattern =
int(address.delta_phi_23);
828 float dphi12Rmin = fabs(fabs(dphi12R) -
Pi * 10 / 180 / 3);
832 ptR_front =
std::max(ptR_front, ptR_front_min);
833 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
835 if (((CLCT_pattern < 8) || (CLCT_pattern > 10)) && (ptR_front > 5.))
837 if (((CLCT_pattern < 8) || (CLCT_pattern > 10)) && (ptR_rear > 5.))
845 absPhi12 = address.delta_phi();
847 int temp_phi = address.delta_phi();
848 absPhi12 =
static_cast<unsigned>(-temp_phi) & 0xfff;
867 absPhi12 = address.delta_phi_12;
868 absPhi23 = address.delta_phi_23;
876 dphi23R =
float(absPhi23);
877 if (charge12 * charge23 < 0)
882 if (fr == 1 && mode1 == 11)
918 absPhi12 = address.delta_phi_12;
919 absPhi23 = address.delta_phi_23;
928 if (charge12 * charge23 < 0)
936 float dphi12Rmin = dphi12R -
Pi * 10 / 180 / 3;
937 float dphi12Rmax = dphi12R +
Pi * 10 / 180 / 3;
938 float dphi23Rmin = dphi23R;
939 float dphi23Rmax = dphi23R;
940 if (dphi12Rmin * dphi12R < 0)
941 dphi23Rmin = -dphi23R;
942 if (dphi12Rmax * dphi12R < 0)
943 dphi23Rmax = -dphi23R;
949 ptR_front =
std::max(ptR_front, ptR_front_min);
950 ptR_front =
std::max(ptR_front, ptR_front_max);
951 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
952 ptR_rear =
std::max(ptR_rear, ptR_rear_max);
963 absPhi12 = address.delta_phi();
965 int temp_phi = address.delta_phi();
966 absPhi12 =
static_cast<unsigned>(-temp_phi) & 0xfff;
976 float dphi12Rmin = fabs(fabs(dphi12R) -
Pi * 10 / 180 / 3);
980 ptR_front =
std::max(ptR_front, ptR_front_min);
981 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
991 absPhi12 = address.delta_phi();
993 int temp_phi = address.delta_phi();
994 absPhi12 =
static_cast<unsigned>(-temp_phi) & 0xfff;
1002 absPhi12 = address.delta_phi_12;
1003 absPhi23 = address.delta_phi_23;
1012 if (charge12 * charge23 < 0)
1019 float dphi12Rmin = dphi12R -
Pi * 10 / 180 / 3;
1020 float dphi12Rmax = dphi12R +
Pi * 10 / 180 / 3;
1021 float dphi23Rmin = dphi23R;
1022 float dphi23Rmax = dphi23R;
1023 if (dphi12Rmin * dphi12R < 0)
1024 dphi23Rmin = -dphi23R;
1025 if (dphi12Rmax * dphi12R < 0)
1026 dphi23Rmax = -dphi23R;
1030 ptR_front =
std::max(ptR_front, ptR_front_min);
1031 ptR_front =
std::max(ptR_front, ptR_front_max);
1070 absPhi12 = address.delta_phi_12;
1071 absPhi23 = address.delta_phi_23;
1084 if (charge12 * charge23 < 0)
1092 float dphi12Rmin = dphi12R -
Pi * 10 / 180 / 3;
1093 float dphi12Rmax = dphi12R +
Pi * 10 / 180 / 3;
1094 float dphi23Rmin = dphi23R;
1095 float dphi23Rmax = dphi23R;
1096 if (dphi12Rmin * dphi12R < 0)
1097 dphi23Rmin = -dphi23R;
1098 if (dphi12Rmax * dphi12R < 0)
1099 dphi23Rmax = -dphi23R;
1105 ptR_front =
std::max(ptR_front, ptR_front_min);
1106 ptR_front =
std::max(ptR_front, ptR_front_max);
1107 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
1108 ptR_rear =
std::max(ptR_rear, ptR_rear_max);
1114 if (charge12 * charge23 < 0)
1124 type + 3, etaR, absPhi12 << 1, ((
charge == 0) ? -(absPhi23 << 4) : (absPhi23 << 4)), 1);
1126 type + 3, etaR, absPhi12 << 1, ((
charge == 0) ? -(absPhi23 << 4) : (absPhi23 << 4)), 0);
1136 type + 3, etaR, absPhi12 << 1, ((
charge == 0) ? -(absPhi23 << 4) : (absPhi23 << 4)), 1);
1138 type + 3, etaR, absPhi12 << 1, ((
charge == 0) ? -(absPhi23 << 4) : (absPhi23 << 4)), 0);
1153 absPhi12 = address.delta_phi();
1155 int temp_phi = address.delta_phi();
1156 absPhi12 =
static_cast<unsigned>(-temp_phi) & 0xfff;
1159 if (absPhi12 < (1 << 9)) {
1186 float dphi12Rmin = fabs(fabs(dphi12R) -
Pi * 10 / 180 / 3);
1190 ptR_front =
std::max(ptR_front, ptR_front_min);
1191 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
1201 absPhi12 = address.delta_phi();
1203 int temp_phi = address.delta_phi();
1204 absPhi12 =
static_cast<unsigned>(-temp_phi) & 0xfff;
1206 if (absPhi12 < (1 << 9)) {
1221 if (fabs(dphi12R) < 0.01 && (ptR_rear < 10 || ptR_front < 10))
1222 std::cout <<
"dphi12R = " << dphi12R <<
" ptR_rear = " << ptR_rear <<
" ptR_front = " << ptR_front
1223 <<
" etaR = " << etaR <<
" mode = " <<
mode << std::endl;
1230 absPhi12 = address.delta_phi();
1232 int temp_phi = address.delta_phi();
1233 absPhi12 =
static_cast<unsigned>(-temp_phi) & 0xfff;
1235 if (absPhi12 < (1 << 9)) {
1252 float dphi12Rmin = fabs(fabs(dphi12R) -
Pi * 10 / 180 / 3);
1256 ptR_front =
std::max(ptR_front, ptR_front_min);
1257 ptR_rear =
std::max(ptR_rear, ptR_rear_min);
1321 result.front_rank = front_pt | front_quality << 5;
1322 result.rear_rank = rear_pt | rear_quality << 5;
1324 result.charge_valid_front = 1;
1325 result.charge_valid_rear = 1;
1343 edm::LogError(
"CSCTFPtLUT::trackQuality()") <<
"Eta or Mode out of range in AU quality assignment";
1459 std::ifstream PtLUT;
1464 int length = PtLUT.tellg();
1467 PtLUT.seekg(0, std::ios::beg);
1468 PtLUT.read(reinterpret_cast<char*>(
pt_lut), length);
1476 unsigned short temp = 0;
float Pt3Stn2010(int type, float eta, float dphi1, float dphi2, int fr=-1, int method=11) const
edm::ESGetToken< L1MuTriggerScales, L1MuTriggerScalesRcd > scales
edm::ESGetToken< L1MuTriggerPtScale, L1MuTriggerPtScaleRcd > ptScale
const L1MuTriggerScales * trigger_scale
edm::ESGetToken< L1MuCSCPtLut, L1MuCSCPtLutRcd > ptLUT
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
float Pt3Stn2012_DT(int type, float eta, float dphi1, float dphi2, int PtbyMLH, float &theLH, int fr=-1, int method=11) const
std::string fullPath() const
float Pt3Stn2012(int type, float eta, float dphi1, float dphi2, int PtbyMLH, float &theLH, int fr=-1, int method=11) const
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed
float Pt2Stn(int type, float eta, float dphi, int fr=-1) const
static const int getPtbyMLH
Log< level::Error, false > LogError
const L1MuScale * getPtScale() const
get the Pt scale
float Pt3StnChiSq(int type, float eta, int dphi1, int dphi2, int fr) const
static const int dEtaCut_High_C[24]
static Tokens consumes(edm::ConsumesCollector iC)
static const int dPhiNLBMap_8bit[256]
static const int dEtaCut_Mid[24]
static const int dEtaCut_Low[24]
unsigned trackQuality(const unsigned &eta, const unsigned &mode, const unsigned &fr) const
const L1MuScale * getRegionalEtaScale(int isys) const
get the regioanl muon trigger eta scale, isys = 0(DT), 1(bRPC), 2(CSC), 3(fwdRPC) ...
float Pt2StnHybrid(int type, float eta, int dphi, int fr) const
float Pt3Stn(int type, float eta, float dphi1, float dphi2, int fr=-1) const
float Pt2Stn2010(int type, float eta, float dphi, int fr=-1, int method=11) const
float Pt2Stn2011(int type, float eta, float dphi, int fr=-1, int method=11, int phiSign=2) const
edm::FileInPath pt_lut_file
float Pt3StnHybrid(int type, float eta, int dphi1, int dphi2, int fr) const
Log< level::Info, false > LogInfo
static const int dEtaCut_High_A[24]
float Pt2Stn2012(int type, float eta, float dphi, int PtbyMLH, float &theLH, int fr=-1, int method=11) const
float Pt2StnChiSq(int type, float eta, int dphi, int fr) const
const std::vector< double > ptScale
static const int dEtaCut_Open[24]
ptdat calcPt(const ptadd &) const
float Pt3Stn2011(int type, float eta, float dphi1, float dphi2, int fr=-1, int method=11) const
virtual unsigned getPacked(float value) const =0
pack a value
static const int dPhiNLBMap_7bit[128]
static const double SECTOR_RAD
ptdat Pt(const ptadd &) const
const unsigned short * lut(void) const
const L1MuTriggerPtScale * trigger_ptscale
static const int dEtaCut_High_B[24]
CSCTFPtLUT(const edm::EventSetup &c, const Tokens &tokens)
KK.
static const int dPhiNLBMap_5bit[32]
KK.