Skip to content

Commit

Permalink
Address code style issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Hiltbrand committed May 4, 2020
1 parent 15ad3ab commit b2cfec7
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions SimCalorimetry/HcalTrigPrimAlgos/src/HcalTriggerPrimitiveAlgo.cc
Expand Up @@ -789,17 +789,15 @@ bool HcalTriggerPrimitiveAlgo::needLegacyFG(const HcalTrigTowerDetId& id) const
}

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;
// 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) {
Expand All @@ -808,16 +806,15 @@ void HcalTriggerPrimitiveAlgo::addUpgradeFG(const HcalTrigTowerDetId& 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)).first;
}
// 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)).first;
}
}

return;
Expand Down

0 comments on commit b2cfec7

Please sign in to comment.