Skip to content

Commit

Permalink
Merge pull request #38320 from eyigitba/EMTF_cclut_bugfix_Jun22
Browse files Browse the repository at this point in the history
[12_4_X] Fix EMTF Run 3 CSC pattern calculation
  • Loading branch information
cmsbuild committed Jun 14, 2022
2 parents f5c780f + 10921df commit 9729e7b
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions L1Trigger/L1TMuonEndCap/src/PrimitiveConversion.cc
Expand Up @@ -129,29 +129,6 @@ void PrimitiveConversion::convert_csc(int pc_sector,
}
}

// Calculate Pattern
unsigned pattern = tp_data.pattern;
const auto& detid(conv_hit.CreateCSCDetId());
const bool isOTMB(detid.isME11() or detid.isME21() or detid.isME31() or detid.isME41());
const bool isTMB((detid.isME12() or detid.isME22() or detid.isME32() or detid.isME42()) or (detid.isME13()));

// check if CCLUT is on for this CSC TP
const bool useRun3CCLUT((useRun3CCLUT_OTMB_ and isOTMB) or (useRun3CCLUT_TMB_ and isTMB));
if (useRun3CCLUT) {
// convert slope to Run-2 pattern for CSC TPs coming from MEX/1 chambers
// where the CCLUT algorithm is enabled
const unsigned slopeList[32] = {10, 10, 10, 8, 8, 8, 6, 6, 6, 4, 4, 4, 2, 2, 2, 2,
10, 10, 10, 9, 9, 9, 7, 7, 7, 5, 5, 5, 3, 3, 3, 3};

// this LUT follows the same convention as in CSCPatternBank.cc
unsigned slope_and_sign(tp_data.slope);
if (tp_data.bend == 0) {
slope_and_sign += 16;
}
unsigned run2_converted_PID = slopeList[slope_and_sign];
pattern = run2_converted_PID;
}

// Set properties
conv_hit.SetCSCDetId(tp_detId);

Expand Down Expand Up @@ -182,6 +159,30 @@ void PrimitiveConversion::convert_csc(int pc_sector,
//conv_hit.set_strip_hi ( tp_data.strip_hi );
conv_hit.set_wire(tp_data.keywire);
conv_hit.set_quality(tp_data.quality);

// Calculate Pattern
unsigned pattern = tp_data.pattern;
const auto& detid(conv_hit.CreateCSCDetId());
const bool isOTMB(detid.isME11() or detid.isME21() or detid.isME31() or detid.isME41());
const bool isTMB((detid.isME12() or detid.isME22() or detid.isME32() or detid.isME42()) or (detid.isME13()));

// check if CCLUT is on for this CSC TP
const bool useRun3CCLUT((useRun3CCLUT_OTMB_ and isOTMB) or (useRun3CCLUT_TMB_ and isTMB));
if (useRun3CCLUT) {
// convert slope to Run-2 pattern for CSC TPs coming from MEX/1 chambers
// where the CCLUT algorithm is enabled
const unsigned slopeList[32] = {10, 10, 10, 8, 8, 8, 6, 6, 6, 4, 4, 4, 2, 2, 2, 2,
10, 10, 10, 9, 9, 9, 7, 7, 7, 5, 5, 5, 3, 3, 3, 3};

// this LUT follows the same convention as in CSCPatternBank.cc
unsigned slope_and_sign(tp_data.slope);
if (tp_data.bend == 0) {
slope_and_sign += 16;
}
unsigned run2_converted_PID = slopeList[slope_and_sign];
pattern = run2_converted_PID;
}

conv_hit.set_pattern(pattern);
conv_hit.set_bend(tp_data.bend);
conv_hit.set_time(0.); // No fine resolution timing
Expand Down

0 comments on commit 9729e7b

Please sign in to comment.