Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HCAL: fixing fine grain bits to be set based on unpacked TDC [12_3_X backport] #37307

Merged
merged 1 commit into from Mar 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -26,7 +26,7 @@ class HcalFinegrainBit {
int version_;

// define prompt-delayed TDC range. Note this is offset from depth and ieta by 1
const int tdc_HE[29][7] = {
const int tdc_boundary[29][7] = {
{8, 14, 15, 17, 0, 0, 0}, {8, 14, 15, 17, 0, 0, 0}, {8, 14, 14, 17, 0, 0, 0}, {8, 14, 14, 17, 0, 0, 0},
{8, 13, 14, 16, 0, 0, 0}, {8, 13, 14, 16, 0, 0, 0}, {8, 12, 14, 15, 0, 0, 0}, {8, 12, 14, 15, 0, 0, 0},
{7, 12, 13, 15, 0, 0, 0}, {7, 12, 13, 15, 0, 0, 0}, {7, 12, 13, 15, 0, 0, 0}, {7, 12, 13, 15, 0, 0, 0},
Expand Down
20 changes: 6 additions & 14 deletions SimCalorimetry/HcalTrigPrimAlgos/src/HcalFinegrainBit.cc
Expand Up @@ -63,22 +63,14 @@ std::bitset<6> HcalFinegrainBit::compute(const HcalFinegrainBit::TowerTDC& tower

// timing bits
if (TDC < 50) { // exclude error code for TDC in HE (unpacked)
if (abs(tp_ieta) <=
16) { // in HB, TDC values are compressed. 01 = first delayed range, 10 = second delayed range
if (TDC == 1 && bit15 == 1)
if ((abs(tp_ieta) <= 16) || (i >= 1)) {
// count delayed / prompt hits either in HB, or in HE (excluding depth 1 due to backgrounds in HE)
// TDC values are uncompressed (0-49) at the trigger primitive level. Packing (compressing HB TDC 6:2) happens in packer.
if (TDC > tdc_boundary[abs(tp_ieta) - 1][i] && TDC <= tdc_boundary[abs(tp_ieta) - 1][i] + 2 && bit15 == 1)
Ndelayed += 1;
if (TDC == 2 && bit15 == 1)
if (TDC > tdc_boundary[abs(tp_ieta) - 1][i] + 2 && bit15 == 1)
NveryDelayed += 1;
if (TDC == 0 && bit14 == 1)
Nprompt += 1;
}
if (abs(tp_ieta) > 16 &&
i >= 1) { // in HE, TDC values are uncompressed (0-49). Exclude depth 1 in HE due to backgrounds
if (TDC > tdc_HE[abs(tp_ieta) - 1][i] && TDC <= tdc_HE[abs(tp_ieta) - 1][i] + 2 && bit15 == 1)
Ndelayed += 1;
if (TDC > tdc_HE[abs(tp_ieta) - 1][i] + 2 && bit15 == 1)
NveryDelayed += 1;
if (TDC <= tdc_HE[abs(tp_ieta) - 1][i] && TDC >= 0 && bit14 == 1)
if (TDC <= tdc_boundary[abs(tp_ieta) - 1][i] && TDC >= 0 && bit14 == 1)
Nprompt += 1;
}
}
Expand Down