CMS 3D CMS Logo

HGCalTowerMapImpl_SA.cc
Go to the documentation of this file.
2 
3 using namespace l1thgcfirmware;
4 
5 void HGCalTowerMapImplSA::runAlgorithm(const std::vector<HGCalTowerMap>& inputTowerMaps_SA,
6  std::vector<HGCalTower>& outputTowers_SA) const {
7  // Need better way to initialise the output tower map
8  if (inputTowerMaps_SA.empty())
9  return;
10  std::vector<HGCalTowerCoord> tower_ids;
11  for (const auto& tower : inputTowerMaps_SA.front().towers()) {
12  tower_ids.emplace_back(tower.first, tower.second.eta(), tower.second.phi());
13  }
14  HGCalTowerMap towerMap(tower_ids);
15 
16  for (const auto& map : inputTowerMaps_SA) {
17  towerMap += map;
18  }
19 
20  for (const auto& tower : towerMap.towers()) {
21  if (tower.second.etEm() > 0 || tower.second.etHad() > 0) {
22  outputTowers_SA.push_back(tower.second);
23  }
24  }
25 }
void runAlgorithm(const std::vector< l1thgcfirmware::HGCalTowerMap > &inputTowerMaps_SA, std::vector< l1thgcfirmware::HGCalTower > &outputTowers_SA) const
const std::unordered_map< unsigned short, l1thgcfirmware::HGCalTower > & towers() const