Skip to content

Commit

Permalink
fixing HB and HE to rely on unpacked TDC values in fine grain bit set…
Browse files Browse the repository at this point in the history
…ting. Update tdc_HE to tdc_boundary name
  • Loading branch information
gk199 committed Mar 22, 2022
1 parent 4145e52 commit c4a5bf4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
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

0 comments on commit c4a5bf4

Please sign in to comment.