Skip to content

Commit

Permalink
Merge pull request #29634 from JHiltbrand/fix_HcalTrigPrimAlgo_Depth7…
Browse files Browse the repository at this point in the history
…onlySignal

Handle Depth 7-only Signal in HcalTriggerPrimitiveAlgo
  • Loading branch information
cmsbuild committed May 17, 2020
2 parents 195c600 + 3a7bcfe commit da11692
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Expand Up @@ -95,6 +95,7 @@ class HcalTriggerPrimitiveAlgo {
bool validUpgradeFG(const HcalTrigTowerDetId& id, int depth) const;
bool validChannel(const QIE10DataFrame& digi, int ts) const;
bool needLegacyFG(const HcalTrigTowerDetId& id) const;
bool needUpgradeID(const HcalTrigTowerDetId& id, int depth) const;

/// adds the actual digis
void analyze(IntegerCaloSamples& samples, HcalTriggerPrimitiveDigi& result);
Expand Down Expand Up @@ -205,6 +206,7 @@ class HcalTriggerPrimitiveAlgo {

// HE constants
static const int HBHE_OVERLAP_TOWER = 16;
static const int FIRST_DEPTH7_TOWER = 26;
static const int LAST_FINEGRAIN_DEPTH = 6;
static const int LAST_FINEGRAIN_TOWER = 28;

Expand Down
21 changes: 21 additions & 0 deletions SimCalorimetry/HcalTrigPrimAlgos/src/HcalTriggerPrimitiveAlgo.cc
Expand Up @@ -788,14 +788,35 @@ bool HcalTriggerPrimitiveAlgo::needLegacyFG(const HcalTrigTowerDetId& id) const
return false;
}

bool HcalTriggerPrimitiveAlgo::needUpgradeID(const HcalTrigTowerDetId& id, int depth) const {
// Depth 7 for TT 26, 27, and 28 is not considered a fine grain depth.
// However, the trigger tower for these ieta should still be added to the fgUpgradeMap_
// Otherwise, depth 7-only signal will not be analyzed.
unsigned int aieta = id.ietaAbs();
if (aieta >= FIRST_DEPTH7_TOWER and aieta <= LAST_FINEGRAIN_TOWER and depth > LAST_FINEGRAIN_DEPTH)
return true;
return false;
}

void HcalTriggerPrimitiveAlgo::addUpgradeFG(const HcalTrigTowerDetId& id,
int depth,
const std::vector<std::bitset<2>>& bits) {
if (not validUpgradeFG(id, depth)) {
if (needLegacyFG(id)) {
std::vector<bool> pseudo(bits.size(), false);
addFG(id, pseudo);
} else if (needUpgradeID(id, depth)) {
// If the tower id is not in the map yet
// then for safety's sake add it, otherwise, no need
// Likewise, we're here with non-fg depth 7 so the bits are not to be added
auto it = fgUpgradeMap_.find(id);
if (it == fgUpgradeMap_.end()) {
FGUpgradeContainer element;
element.resize(bits.size());
fgUpgradeMap_.insert(std::make_pair(id, element));
}
}

return;
}

Expand Down

0 comments on commit da11692

Please sign in to comment.